Custom Geometry - collision detection

Viper87

17-06-2010 17:26:38

Hi,

Our team was designed simulation program of lorry. Unfortunately we have a problem with collision detection. Because one picture can show more than thousand words, I attached a screenshot below:



As you can see, the box does not drop into track loader. I think that it's problem with collision model. We used BoxGeometry. I have two ideas to solution this problem, but I can't apply any of them:

1.) A first think is to use another Geometry type to customize a collision surface, but I don't know what kind of geometry should I use?
2.) A second think is to cut lorry model to smaller parts and then to connect they in one model again with FixedJoints. Unfortunately we have a problem with attaching parts of the lorry to the main body (paltform with engine and wheels) from prefab vehicle class (ogreode native class). Below code causes an error:


OgreOde::FixedJoint * joint = new OgreOde::FixedJoint(_world);
const OgreOde::Body const *test=_vehicle->getBody();
joint->attach(mBody[0], test); //causes a fatal error after compilation (during starting exe)


Thanks for any, even small tip.

cxxD

18-06-2010 21:29:38

i think a box geometry tells the collision detector that your truck is a box.... you need to use a mesh as collision object. But i dont know how to do so i'm very curious to find out how.

Viper87

19-06-2010 13:08:48

Thank you for your reply.

Yes. I think you all right, but the problem is how we can apply this solution? I looked for appropriate function in OgreOde, but I didn't find anything...

My question is still timely.

cxxD

20-06-2010 20:39:44

i once saw it in the demo code of the simplescene demo. Just browse through that one, you'll might find it. As far as i can remember it's something that was really stupid so maybe its not that easy. (If it was easy someone would have already answered this question:))

dermont

21-06-2010 11:44:52

You should look at TransformGeometry for example the apache helicopter code in SimpleScenes_Crash.h.