collisionID/shapeID/contactID & NewtonTreeCollisionEnd BUG

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

collisionID/shapeID/contactID & NewtonTreeCollisionEnd BUG

Postby JernejL » Fri Oct 12, 2018 2:25 am

I'd like something a bit confused cleared up and document as i had some struggle understanding this, but now i think i understand majority of it.

Most of time, shapeID is defined as a int, and on 32 bit system this will be a 32 bit int.

In NewtonWorldRayFilterCallback it is called shapeHit, and is a 64 bit int (even in 32 bit lib).

From what i understand, this is standard "shapeID", but with different name (i tested this thoroughly): In NewtonTreeCollisionAddFace it is however named faceAttribute, but it's still the same piece of data (and 32 bit).

There is additionally a bug here - newton will optimize faces in NewtonTreeCollisionEndBuild and merge those with different shapeID/faceAttribute together, and destroy the shapeID data of specific part of the mesh when merging its polygons. I suggest that this is changed, so that it only merges faces with identical shapeID/faceAttribute.

The same data is is also named that way (but 64 bit) in NewtonCollisionCollide and NewtonCollisionCollideContinue

In NewtonWorldConvexCastReturnInfo struct it is named m_contactID (and 64 bit) - i think this is once again the ShapeID?

Could we just rename these parameters so they'd be all named same - i suggest we name them "ShapeUserID", and change it to all same type - i suggest it set to a 64 bit int, but not a pointer type, because the shapeid gets serialized and would be invalid after serialization if people put pointers into that field.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 10 guests

cron