In the past, I just called:
- Code: Select all
contactPoint := NewtonContactJointGetFirstContact( contact );
...
contactMaterial := NewtonContactGetMaterial( contactPoint );
faceAttribute := NewtonMaterialGetContactFaceAttribute( contactMaterial );
And while creating the collisionTree, the "addFace" command would get numbers (pointers actually, thus big numbers). But now the "faceAttibute" is always 0.
I *think* it has to do with using NewtonSceneCollisionXXX functions. Before, I had a separate body
with its own CollisionTree for each part (say Room) of the world. Now there is just 1 body for the
entire world, and rooms are added as follow:
- Code: Select all
nCollisionScene := NewtonBodyGetCollision( nSceneBody );
NewtonSceneCollisionBeginAddRemove( nCollisionScene );
NewtonCollision tempRoomCollision := makeRoomCollision(); <--- produces tree, adds faces
nodePtr := NewtonSceneCollisionAddSubCollision( nCollisionScene, roomCollision );
NewtonDestroyCollision( tempRoomCollision );
The collisions and everything just works, but as said, I can't get the FaceAttribute. Nor the
userData I attached to that "tempRoomCollision" object with
tempRoomCollision := NewtonCreateTreeCollision( ..., myStuff ); or
NewtonCollisionSetUserData( tempRoomCollision, myStuff );
I don't really have to know the exact Face ID. Just a custom pointer per subnode is enough.