SusanDing
13-06-2006 05:07:37
I have read the following code, and I find the code in red may be wrong!
I think it should be
Because the second param of NewtonCollisionPointDistance is
That should be the position of the origin point, not the position of the body.
Am I right? Or I confuse with it.
int CollisionPointDistance( const OgreNewt::World* world, const Ogre::Vector3& globalpt,
const OgreNewt::Collision* col, const Ogre::Quaternion& colorient, const Ogre::Vector3& colpos,
Ogre::Vector3& retpt, Ogre::Vector3& retnormal )
{
float matrix[16];
Converters::QuatPosToMatrix( colorient, colpos, matrix );
NewtonCollisionPointDistance( world->getNewtonWorld(), &colpos.x, col->getNewtonCollision(), matrix, &retpt.x, &retnormal.x ); }
I think it should be
return NewtonCollisionPointDistance( world->getNewtonWorld(), &globalpt.x, col->getNewtonCollision(), matrix, &retpt.x, &retnormal.x );
Because the second param of NewtonCollisionPointDistance is
- pointer to and array of a least 3 floats representing the origin.
That should be the position of the origin point, not the position of the body.
Am I right? Or I confuse with it.