typedef enum
{
NE_TERRAIN = 0,
NE_RIGID_BODY,
NE_ANIMATED_BODY,
} neBodyType;
This enum identifies the type of objects of bodyA and bodyB in the neCollisionInfo structure.
typedef struct neCollisionInfo neCollisionInfo;
struct neCollisionInfo
{
neByte * bodyA;
neByte * bodyB;
neBodyType typeA;
neBodyType typeB;
neGeometry * geometryA;
neGeometry * geometryB;
s32 materialIdA;
s32 materialIdB;
neV3 bodyContactPointA;
neV3 bodyContactPointB;
neV3 worldContactPointA;
neV3 worldContactPointB;
neV3 relativeVelocity;
neV3 collisionNormal;
};
This structure is passed to the application during neCollisionCallback. It contains various blocks of information about a collision which has occurred during the current simulation step.
bodyA, bodyB, typeA, typeB
bodyA and bodyB are pointers to the bodies which are colliding. Their type depends on the value of typeA and typeB. If the value of typeB is NE_TERRAIN, then bodyB is NULL.
geometryA, geometryB
These are pointers to neGeometry objects involved in the collision, one from each of the body. If typeB equal to NE_TERRAIN, then geometryB is NULL
materialA, materialB
The material indices of the geometries which are colliding.
bodyContactPointA, bodyContactPointB, worldContactPointA, worldContactPointB
The contact points in body coordinates and in world coordinates.
relativeVelocity
The relativeVelocity of the contact points.
collisionNormal
The direction of the collision normal.
typedef void (neLogOutputCallback)(char * logString);
typedef void (neCollisionCallback)(neCollisionInfo & collisionInfo);
typedef void (neTerrainTriangleQueryCallback)(const neV3 & minBound, const neV3 & maxBound, neTriangleMesh & triMesh);