Contact report, trigger report

themadme

13-03-2008 10:08:37

Hi. Im creating a racing game and i have a few problems.

Those problems are:
.Knowing which point exactly if the car collides with another object

.Knowing if it has passed the finish line correctly ( so that the player can not reverse and go foward over the line and win the game )

Would i have to create a Call class for contact report, to know if when and where the objects colliede? is there another way?

For the finish line i was thinking some sort of plane or box, where if the player goes through one side, i would increment a variable (e.g. Lap++ ) but if it went through the other side, i would not increment, because the player is going backwards perhaps.

Would i need to use the trigger report or is there another way, like creating a plane or box that can not effect the racer or the track it self. Therefore i would look to see if where the plane normal is, which would tell me which direction the car should be going through

If i have to create a contact class or trigger class, could some one perhaps show link to another topic, where it shows how to make one with NxOgre.

Oh all the objects are actors

Help would be very much be appreciated

themadme

13-03-2008 11:52:18

i have looked for other topics on how to make use of trigger, but majority of them are not very useful. I would really like some help please

themadme

13-03-2008 13:21:37

i have been looking up the physX documentation about trigger reports and contact reports. Is there a difference in NxOgre? How would one implement one

betajaen

13-03-2008 13:26:04

Triggers:

Two posts against many.

http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=6723
http://www.ogre3d.org/phpBB2addons/view ... 7236#27236

Contact Reports:

http://www.ogre3d.org/phpBB2addons/view ... 7130#27130

themadme

13-03-2008 14:21:07

ok thanks.

In NxOgre is there way to get access to NxSceneDesc.userContactReport

the NxOgre::SceneParams, dont seem to allow you gain access to it.

Is there any special way of getting it???

betajaen

13-03-2008 14:25:19

As I pasted in those links there. It is strongly implied that don't do stuff like that. You use what NxOgre gives you.

themadme

13-03-2008 14:33:28

ok, thank you kindly for the warning.

So i just say


NxOgre::ActorGroup ObjGroup = mScene->createActorGroup("Object");

NxOgre::Actor ObjActor = mScene->createBody("cube.1m.mesh", new CubeShape(1,1,1),Vector3(0,0.5f,0),"Mass: 100, Group: Object");

ObjGroup.setCallback( /*my own contact class */ );



then what do i say to get the points of contact of two objects?

is there a function i have to call with in the NxOgre::Actor or NxOgre::Body or is it something completely different