Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
SoftBodyContactListener Class Reference

#include <SoftBodyContactListener.h>

Public Member Functions

virtual ~SoftBodyContactListener ()=default
 Ensure virtual destructor.
 
virtual SoftBodyValidateResult OnSoftBodyContactValidate (const Body &inSoftBody, const Body &inOtherBody, SoftBodyContactSettings &ioSettings)
 
virtual void OnSoftBodyContactAdded (const Body &inSoftBody, const SoftBodyManifold &inManifold)
 

Detailed Description

A listener class that receives collision contact events for soft bodies against rigid bodies. It can be registered with the PhysicsSystem.

Constructor & Destructor Documentation

◆ ~SoftBodyContactListener()

virtual SoftBodyContactListener::~SoftBodyContactListener ( )
virtualdefault

Ensure virtual destructor.

Member Function Documentation

◆ OnSoftBodyContactAdded()

virtual void SoftBodyContactListener::OnSoftBodyContactAdded ( const Body inSoftBody,
const SoftBodyManifold inManifold 
)
inlinevirtual

Called after all contact points for a soft body have been handled. You only receive one callback per body pair per simulation step and can use inManifold to iterate through all contacts. Note that this callback is called when all bodies are locked, so don't use any locking functions! You will receive a single callback for a soft body per simulation step for performance reasons, this callback will apply to all vertices in the soft body.

Parameters
inSoftBodyThe soft body that collided. It is safe to access this as the soft body is only updated on the current thread.
inManifoldThe manifold that describes the contact surface between the two bodies. Other bodies may be modified by other threads during this callback.

◆ OnSoftBodyContactValidate()

virtual SoftBodyValidateResult SoftBodyContactListener::OnSoftBodyContactValidate ( const Body inSoftBody,
const Body inOtherBody,
SoftBodyContactSettings ioSettings 
)
inlinevirtual

Called whenever the soft body's aabox overlaps with another body's aabox (so receiving this callback doesn't tell if any of the vertices will collide). This callback can be used to change the behavior of the collision response for all vertices in the soft body or to completely reject the contact. Note that this callback is called when all bodies are locked, so don't use any locking functions!

Parameters
inSoftBodyThe soft body that collided. It is safe to access this as the soft body is only updated on the current thread.
inOtherBodyThe other body that collided. Note that accessing the position/orientation/velocity of inOtherBody may result in a race condition as other threads may be modifying the body at the same time.
ioSettingsThe settings for all contact points that are generated by this collision.
Returns
Whether the contact should be processed or not.

The documentation for this class was generated from the following file: