void CustomTriggerController::Init (NewtonCollision* const convexShape, const dMatrix& matrix, void* const userData) { m_userData = userData; NewtonWorld* const world = ((CustomTriggerManager*)GetManager())->GetWorld(); // create a trigger body and place in the scene m_body = NewtonCreateKinematicBody(world, convexShape, &matrix[0][0]); // set this shape do not collide with other bodies NewtonCollision* const collision = NewtonBodyGetCollision (m_body); NewtonCollisionSetMode(collision, 0); }
void dNewtonCollision::SetAsTrigger(bool mode) { if (m_shape) { NewtonCollisionSetMode(m_shape, mode ? 0 : 1); } }