Face of a collision
by Aidan Sliney · in Torque Game Engine · 03/22/2009 (12:34 pm) · 5 replies
Hey all,
I've just created a new collision convex for my renderable model. I've add all the faces (96) using the getPolyList() function. No problem there ( Thanks Scott). I just want to know what face the player collides with? I've been told that it lies in upDatePos() in player.cc but I'm having no luck. I see in the ExtrudedPolylist class there is a variable U32 face but whenever I print it out its way bigger than 96. I print out the CollionList.collison[0].face. Not sure if thats right.
I'd appreciate any and all help
Thanks in advance
I've just created a new collision convex for my renderable model. I've add all the faces (96) using the getPolyList() function. No problem there ( Thanks Scott). I just want to know what face the player collides with? I've been told that it lies in upDatePos() in player.cc but I'm having no luck. I see in the ExtrudedPolylist class there is a variable U32 face but whenever I print it out its way bigger than 96. I print out the CollionList.collison[0].face. Not sure if thats right.
I'd appreciate any and all help
Thanks in advance
#2
03/23/2009 (9:20 am)
Thanks but it didnt work. All I got was a number between 0 and 5 when I collide with the object. Not sure what that signifies. I also have Matts Collidable cube loaded if that makes any difference
#3
Try using Your_Convex.getCollisionInfo(...)
And in that list printf the face.
03/23/2009 (10:33 am)
That should be player's box faces.Try using Your_Convex.getCollisionInfo(...)
And in that list printf the face.
#4
CollisionList myface;
bool face = myConvexName.getCollisionInfo(collisionMatrix,scale,myface,.1);
I get 'myConvexName not declared in this scope' error. myConvexName is the name of the convex class. Is that right? Bit of nupe error but am I referencing my convex right? I dont think its a matter of including the convex libraries in player.cc? Is it? There is also pConvex and mConvex in updatePos()? Did you mean them?
03/23/2009 (11:42 am)
How do you mean? I tried these lines with like thisCollisionList myface;
bool face = myConvexName.getCollisionInfo(collisionMatrix,scale,myface,.1);
I get 'myConvexName not declared in this scope' error. myConvexName is the name of the convex class. Is that right? Bit of nupe error but am I referencing my convex right? I dont think its a matter of including the convex libraries in player.cc? Is it? There is also pConvex and mConvex in updatePos()? Did you mean them?
#5
You can see an example of taking a collision information in rigidshape class.
03/25/2009 (1:49 pm)
Not in the player's code of course,put that code in your convex code.You can see an example of taking a collision information in rigidshape class.
Torque Owner Ivan Mandzhukov
Liman3D
collisionList.mCollision[0].face