Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
SoftBodyContactListener.h
Go to the documentation of this file.
1// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
2// SPDX-FileCopyrightText: 2024 Jorrit Rouwe
3// SPDX-License-Identifier: MIT
4
5#pragma once
6
8
9class Body;
11
18
22{
23public:
24 float mInvMassScale1 = 1.0f;
25 float mInvMassScale2 = 1.0f;
26 float mInvInertiaScale2 = 1.0f;
27 bool mIsSensor;
28};
29
33{
34public:
36 virtual ~SoftBodyContactListener() = default;
37
45 virtual SoftBodyValidateResult OnSoftBodyContactValidate([[maybe_unused]] const Body &inSoftBody, [[maybe_unused]] const Body &inOtherBody, [[maybe_unused]] SoftBodyContactSettings &ioSettings) { return SoftBodyValidateResult::AcceptContact; }
46
52 virtual void OnSoftBodyContactAdded([[maybe_unused]] const Body &inSoftBody, const SoftBodyManifold &inManifold) { /* Do nothing */ }
53};
54
#define JPH_NAMESPACE_END
Definition Core.h:379
#define JPH_NAMESPACE_BEGIN
Definition Core.h:373
SoftBodyValidateResult
Return value for the OnSoftBodyContactValidate callback. Determines if the contact will be processed ...
Definition SoftBodyContactListener.h:14
@ RejectContact
Reject this contact.
@ AcceptContact
Accept this contact.
Definition Body.h:35
Definition SoftBodyContactListener.h:33
virtual void OnSoftBodyContactAdded(const Body &inSoftBody, const SoftBodyManifold &inManifold)
Definition SoftBodyContactListener.h:52
virtual SoftBodyValidateResult OnSoftBodyContactValidate(const Body &inSoftBody, const Body &inOtherBody, SoftBodyContactSettings &ioSettings)
Definition SoftBodyContactListener.h:45
virtual ~SoftBodyContactListener()=default
Ensure virtual destructor.
Definition SoftBodyContactListener.h:22
float mInvInertiaScale2
Scale factor for the inverse inertia of the other body (usually same as mInvMassScale2)
Definition SoftBodyContactListener.h:26
bool mIsSensor
If the contact should be treated as a sensor vs body contact (no collision response)
Definition SoftBodyContactListener.h:27
float mInvMassScale2
Scale factor for the inverse mass of the other body (0 = infinite mass, 1 = use original mass,...
Definition SoftBodyContactListener.h:25
float mInvMassScale1
Scale factor for the inverse mass of the soft body (0 = infinite mass, 1 = use original mass,...
Definition SoftBodyContactListener.h:24
An interface to query which vertices of a soft body are colliding with other bodies.
Definition SoftBodyManifold.h:13