Okay, I guess it doesn't matter that the shape is a box then?
EdgeShapes (aka Thin Line Segments)
FlashI feel like a total idiot....
I simply added this and the chain is blocking as both ceiling and floor.
I thought it was supposed to act as one or the other?
Quote:
var chainDef:b2StaticEdgeChainDef = new b2StaticEdgeChainDef();
chainDef.vertexCount = 3;
chainDef.vertices.push(new b2Vec2(0,15));
chainDef.vertices.push(new b2Vec2(5,15));
chainDef.vertices.push(new b2Vec2(10,15));
chainDef.isALoop = true; // connect the first and last vertices
m_world.CreateGroundShape(chainDef);
chainDef.vertexCount = 3;
chainDef.vertices.push(new b2Vec2(0,15));
chainDef.vertices.push(new b2Vec2(5,15));
chainDef.vertices.push(new b2Vec2(10,15));
chainDef.isALoop = true; // connect the first and last vertices
m_world.CreateGroundShape(chainDef);
I simply added this and the chain is blocking as both ceiling and floor.
I thought it was supposed to act as one or the other?
You've made it a loop, connecting the last vertex back to the first, which is acting as a ceiling.
Very nice, Thanks!
I tried to use thin lines for platforms, so that a player can jump onto them from below and it works.
However I am experiencing some wierdness as the player is "forced" in an upwards thrust.
Is this intended and can I fix it?
I tried to use thin lines for platforms, so that a player can jump onto them from below and it works.
However I am experiencing some wierdness as the player is "forced" in an upwards thrust.
Is this intended and can I fix it?
Ygryggil wrote:
Very nice, Thanks!
I tried to use thin lines for platforms, so that a player can jump onto them from below and it works.
However I am experiencing some wierdness as the player is "forced" in an upwards thrust.
Is this intended and can I fix it?
I tried to use thin lines for platforms, so that a player can jump onto them from below and it works.
However I am experiencing some wierdness as the player is "forced" in an upwards thrust.
Is this intended and can I fix it?
I was about to say that, the line segments have a 'good' and a 'bad' side, but objects are not supposed to collide with the bad side at all. These thin line segments are not meant to function as 'one-way-doors'. The behavior is unpredictable, and as you have experienced: the velocity will be influenced. I think the sensor-bar approach is more reliable for what you are trying to achieve.
Have you uh officially added the bodies support yet?
You said the API is the same so i assume you haven't?
You said the API is the same so i assume you haven't?
Can we change the name to line meshes, or meshes for short? "thin line segment" is getting awkward, and is in fact a pretty misleading term. I can't see any real difference between the meshes on the todolist and the segments provided.
Oh is that what erin meant by 'meshes' on the TODO? If that is what this is, then it's meshes from now on 😀.
I thought meshes were something different, more like a 2D surface.. Like what you'd use to simulate cloth in 3D.
I thought meshes were something different, more like a 2D surface.. Like what you'd use to simulate cloth in 3D.
YagerX: No, not in the ActionScript version. Sorry. Maybe I'll get to that tonight?
Alright it's not that big of a deal, it's working fine as it is, the api is just a bit weird thats all...
Btw your SVG Parser is AWESOME!!! It makes making levels sooo much easier, one thing, how did you handle scaling the mini level(the one you import into box2d) and the one with all the backgrounds and stuff?
did you just scale the drawing by your physcale? i've tried that and it's not aligned properly?
Btw your SVG Parser is AWESOME!!! It makes making levels sooo much easier, one thing, how did you handle scaling the mini level(the one you import into box2d) and the one with all the backgrounds and stuff?
did you just scale the drawing by your physcale? i've tried that and it's not aligned properly?
Original thread: https://box2d.org/forum/viewtopic.php?t=1437