[SOLVED] TriangleMeshShape vs. ConvexShape

spacegaier

09-03-2008 19:57:20

I'm developing a simple game (a fun soccer game). Therefor I need a kind of stadion. But how to implement this in NxOgre?

Should I use one big mesh? If I should do so, what kind of shape would be appropriate? TriangleMeshShape or ConvexShape?
Or should I built up my stadion out of several smaller pieces? If yes, which shapes would be the best for the pieces?

Of course I want to implement collision between the stadion, the players (implemented as NxOgre::Charaters) and a sphere body?

betajaen

09-03-2008 20:11:55

No question - TriangleMeshShape.

However for some more accuracy, you can build up the goals using cube shapes.

spacegaier

09-03-2008 21:00:30

That is strange!!!

I've now implemented my stadion as a TriangleMeshShade and my Character as CT_Capsule typ.

Here a screenshot:


The strange thing is that if I'm running the app normally the character collides with the lower border of the stadion (the one that is nearer to you) so that the player is not moving any longer in this direction. If I'm moving towards the upper border, the character climbs over the border (not through). That is strage!

But as soon as the frame rate goes down (e.g. while capturing a video of it with FRAPS) this strage behaviour vanishes-> the player stops at both borders?!?!? Would this be a case for CCD (which unfortunalety is not implemented in NxOge 0.9)? Is there a way to solve this?

betajaen

09-03-2008 21:39:11

It's not to do with CCD. The CharacterSystem in 0.9 has a flaw which the movement is based upon the deltaTime, which causes strange results in low frame rates.

Try adjusting the step offset/angle or better still make a low poly of that mesh with a squarish border, so it has no chance of going over it (an invisible wall).