I try to use the new feature allowing to change sub collision transform after the creation of the compound collision, but my sub collision is not moving at all
The NewtonCompoundCollisionRemoveSubCollisionByIndex function is working nice, so I'm sure that this is the right node I'm calling the function on.
This is what I do, nothing extraordinary:
- Code: Select all
void CompoundCollision::setSubCollisionTransform(int collisionIndex
,const Ogre::Vector3 & position
,const Ogre::Quaternion & orientation)
{
void* node = NewtonCompoundCollisionGetNodeByIndex(m_col,collisionIndex);
Ogre::Real matrix[16];
OgreNewt::Converters::QuatPosToMatrix(orientation, position, &matrix[0]);
NewtonCompoundCollisionSetSubCollisionMatrix(m_col,node,matrix);
}
In the sdk samples this is only used between calls of begin/end add subcollision, is it necessary?