Objects falling through trianglemesh
Posted: Thu Jul 01, 2010 4:40 pm
I'm working on porting a game over from JigLibX to BEPU, and I've run into a problem with my player (a simple sphere object) falling through the level.
My level is constructed from several triangle meshes, which are extracted using the example in the Playground demo:
StaticTriangleGroup.getvertsandindices -> trianglemesh(verts, indices) -> statictrianglegroup(trianglemesh)
I'm using angular impulses to propel the player.
Timescale is set to 5f, mass of the ball is around 300
The problem I'm running in to, is most of the levels are composed of platforms that are roughly a fifth to a quarter of the diameter of the player's sphere in thickness. I haven't had any problem with the player falling through the platform, but I have a curved ramp, which launches the player through the air, and he hits a hollow cone with the bottom cut off, which effectively funnels him onto the next part of the level. The ball almost always punches straight through the funnel, or, in the event that I have my aim just right and "swish", he'll punch through the platform below the funnel. If he manages to collide with the funnel (and not fall through), then he's usually moving slow enough that he won't punch through the platform below.
I'm assuming a possible solution would be to thicken up the platforms and funnel, but I'm still doing feasibility testing on BEPU, and would rather my level designers and artists not have to change a bunch of content and then end up not using it.
My level is constructed from several triangle meshes, which are extracted using the example in the Playground demo:
StaticTriangleGroup.getvertsandindices -> trianglemesh(verts, indices) -> statictrianglegroup(trianglemesh)
I'm using angular impulses to propel the player.
Timescale is set to 5f, mass of the ball is around 300
The problem I'm running in to, is most of the levels are composed of platforms that are roughly a fifth to a quarter of the diameter of the player's sphere in thickness. I haven't had any problem with the player falling through the platform, but I have a curved ramp, which launches the player through the air, and he hits a hollow cone with the bottom cut off, which effectively funnels him onto the next part of the level. The ball almost always punches straight through the funnel, or, in the event that I have my aim just right and "swish", he'll punch through the platform below the funnel. If he manages to collide with the funnel (and not fall through), then he's usually moving slow enough that he won't punch through the platform below.
I'm assuming a possible solution would be to thicken up the platforms and funnel, but I'm still doing feasibility testing on BEPU, and would rather my level designers and artists not have to change a bunch of content and then end up not using it.