Defined in:Called when a new contact is made with a geometry node.
virtual RigidBodyStatus HandleNewGeometryContact(const GeometryContact *contact);
||The new contact.|
HandleNewGeometryContactfunction is called by the Physics Manager when a rigid body makes a new contact with a geometry node. This function can be overridden in a subclass of
RigidBodyControllerin order to carry out a specialized response to a collision.
contactparameter specifies the newly created
GeometryContactobject, which is an edge in the contact graph maintained by the Physics Manager. The rigid body for which the
HandleNewGeometryContactfunction is called is always the start element of this edge, and a special null body is the finish element.
HandleNewGeometryContactfunction should return one of the following constants.
||No change was made to the rigid body or its contacts.|
||One or more contacts with the rigid body were broken or may have been broken.|
||The rigid body was destroyed.|
HandleNewGeometryContactfunction is allowed to destroy the contact specified by the
contactparameter using the
deleteoperator. In this case, the function must return
If the implementation of the
HandleNewGeometryContactfunction destroys the geometry node referenced by the contact (retrieved with the
GeometryContact::GetContactGeometryfunction), then the
PhysicsController::PurgeGeometryContactsshould be called for the same geometry node, and the
HandleNewGeometryContactfunction should return
kRigidBodyContactsBroken. This is demonstrated by the following code:
Geometry *geometry = contact->GetContactGeometry();The default implementation of the
HandleNewGeometryContactfunction calls the