OgreNewt low level collision functions

Entropai

28-03-2008 11:07:37

I'm trying to figure out how to use low level collision functions in OgreNewt to achieve low level collision detection without physics as Walaber suggested in one post. However i'm having trouble with calling CollisionCollide function, this function should return collision between two collision objects? I'm getting following mismatch error:



ArgumentError: Python argument types in
ogre.physics.OgreNewt._ogrenewt_.CollisionCollide(World, int, Box, Quaternion, Vector3, Box, Quaternion, Vector3, Vector3, Vector3, float)

did not match C++ signature:

CollisionCollide(class OgreNewt::World const * world, int maxSize, class OgreNewt::Collision const * colA, class Ogre::Quaternion colOrientA, class Ogre::Vector3 colPosA, class OgreNewt::Collision const * colB, class Ogre::Quaternion colOrientB, class Ogre::Vector3 colPosB, class Ogre::Vector3 * retContactPts, class Ogre::Vector3 * retNormals, float * retPenetrations)


Using same earlier created parameters and calling for example CollisionPointDistance call works just fine. Has anyone tested and used this function or can see some obvius fault that i've missed. I've tried reading that signature many times but i cant figure out what is not correct. I've created two collision box objects.

bharling

28-03-2008 12:10:12

From looking at it, I think the return parameters are arrays, so you could try passing in empty lists for the last few parameters, where currently you have

OgreNewt.CollisionCollide(World, int, Box, Quaternion, Vector3, Box, Quaternion, Vector3, Vector3, Vector3, float)

try:

returnContacts = []
returnNormals = []
returnPenetrations = []

OgreNewt.CollisionCollide(World, int, Box, Quaternion, Vector3, Box, Quaternion, Vector3, returnContacts, returnNormals, returnPenetrations)


If I'm right, then those lists should be filled with the results after calling this function.

Entropai

28-03-2008 13:06:04


If I'm right, then those lists should be filled with the results after calling this function.


Thanks for the quick reply.
Yes, you're right it might be so and the param names do suggest multiple ones. I tried it but same failure occured, there could be something else wrong in similar lines. However i've come to conclusion that i'll let Onewt handle the collisions in its way and try another approach to see if its more viable.