TriangleMeshShape not colliding

nord

09-07-2008 22:41:35

Hi all. So far I have been using primitive collision (CubeShape(1,1,1)) boxes in my game. Now I wanted to use a custom collision box for my car. But my car falls from my terrain to infinity when I use a custom made mesh.
I did put a floor, so my car falls under the terrain until the floor. I can drive the car on the floor. that's fine.
interestingly,
I CAN HIT OTHER NORMAL OBJECTS ON THE FLOOR (like CubeShape(1,1,1) ). But I cannot hit another custom collision boxed object (like TriangleMeshShape("ConvexBody.mesh")). Here is my old working fine code and new problematic code:


mBody = mScene->createBody("bora; body.mesh;", new CubeShape(1.8,1.3,4.5),Pos, "mass: 1800");

mBody = mScene->createBody("bora; body.mesh;", new TriangleMeshShape("ConvexBody.mesh"),Pos, "mass: 1800");


And here is a screenshot



betajaen

09-07-2008 22:48:11

Oh, my god. Does nobody read the PhysX Documentation?

You cannot use TriangleMeshes in any form except for a Static Actor.


Find "PhysXDocumentation.chm"

The Ageia PhysX SDk -> Guide -> Collision Detection.

nord

09-07-2008 23:20:03

But when I use

mBody = mScene->createBody("bora; body.mesh;", new ConvexShape("ConvexBody.mesh),Pos, "mass: 1800");

it says this and app doesnt start.

Convex 'ConvexBody.mesh' failed to cook
Vertices = 1

sorry for these "low level" (!) questions..

betajaen

09-07-2008 23:26:06

Well according to the error; Your ConvexBody has 1 vertex. Why are you using 0.9, when 1.0 is clearly better?

nord

09-07-2008 23:36:55

if I use my convex mesh for just the visualisation, I don't see any problems with it. There seems to be many vertices and shape is convex. (as also you can see on the screenshots)
BTW I have copied it from another game and in that game it is used for collision detection - no problems.

I need to do certain things in my project until the end of july so I did not want to lose time by porting my game into NxOgre 1.0. But if you strongly suggest that I should do that immediately (not after 20 days), I will take the time and try to port it.

Thanks a lot ...

PS: I will try modelling a NEW convex model (in maya) for my collision box.

betajaen

10-07-2008 09:55:51

I would move over to 1.0, and make use of flour.