25#ifdef JPH_DEBUG_RENDERER
76 void SetPressure(
float inPressure) { mPressure = inPressure; }
94 float GetVolume()
const {
return GetVolumeTimesSix() / 6.0f; }
99#ifdef JPH_DEBUG_RENDERER
123 void SkinVertices(
RMat44Arg inCenterOfMassTransform,
const Mat44 *inJointMatrices,
uint inNumJoints,
bool inHardSkinAll,
TempAllocator &ioTempAllocator);
169 LeafShape() =
default;
170 LeafShape(
Mat44Arg inTransform,
Vec3Arg inScale,
const Shape *inShape) : mTransform(inTransform), mScale(inScale), mShape(inShape) { }
178 struct CollidingShape
181 Vec3 GetPointVelocity(
Vec3Arg inPointRelativeToCOM)
const
183 return mLinearVelocity + mAngularVelocity.
Cross(inPointRelativeToCOM);
186 Mat44 mCenterOfMassTransform;
193 float mSoftBodyInvMassScale;
194 bool mUpdateVelocities;
196 Vec3 mLinearVelocity;
197 Vec3 mAngularVelocity;
198 Vec3 mOriginalLinearVelocity;
199 Vec3 mOriginalAngularVelocity;
203 struct CollidingSensor
205 Mat44 mCenterOfMassTransform;
220 void DetermineCollisionPlanes(
uint inVertexStart,
uint inNumVertices);
223 void DetermineSensorCollisions(CollidingSensor &ioSensor);
244 void ApplyLRAConstraints(
uint inStartIndex,
uint inEndIndex);
271 float GetVolumeTimesSix()
const;
273#ifdef JPH_DEBUG_RENDERER
275 template <
typename GetEndIndex,
typename DrawConstra
int>
276 inline void DrawConstraints(
ESoftBodyConstraintColor inConstraintColor,
const GetEndIndex &inGetEndIndex,
const DrawConstraint &inDrawConstraint,
ColorArg inBaseColor)
const;
287 AABox mLocalPredictedBounds;
290 float mSkinnedMaxDistanceMultiplier = 1.0f;
291 bool mUpdatePosition;
292 bool mNeedContactCallback =
false;
293 bool mEnableSkinConstraints =
true;
294 bool mSkinStatePreviousPositionValid =
false;
@ CalculateMassAndInertia
Tells the system to calculate the mass and inertia based on density.
ESoftBodyConstraintColor
Defines how to color soft body constraints.
Definition BodyManager.h:28
#define JPH_EXPORT
Definition Core.h:271
unsigned int uint
Definition Core.h:481
#define JPH_NAMESPACE_END
Definition Core.h:414
std::uint32_t uint32
Definition Core.h:484
#define JPH_NAMESPACE_BEGIN
Definition Core.h:408
EMotionType
Motion type of a physics body.
Definition MotionType.h:11
Axis aligned box.
Definition AABox.h:16
ID of a body. This is a way of reasoning about bodies in a multithreaded simulation while avoiding ra...
Definition BodyID.h:13
Definition BodyInterface.h:35
Base class interface for locking a body. Usually you will use BodyLockRead / BodyLockWrite / BodyLock...
Definition BodyLockInterface.h:17
Class that holds an RGBA color with 8-bits per component.
Definition Color.h:16
Definition DebugRenderer.h:47
Holds a 4x4 matrix of floats, but supports also operations on the 3x3 upper left part of the matrix.
Definition Mat44.h:13
static JPH_INLINE Mat44 sIdentity()
Identity matrix.
Definition Mat44.inl:35
The Body class only keeps track of state for static bodies, the MotionProperties class keeps the addi...
Definition MotionProperties.h:29
void RestoreState(StateRecorder &inStream)
Restoring state for replay.
Definition MotionProperties.cpp:78
void SaveState(StateRecorder &inStream) const
Saving state for replay.
Definition MotionProperties.cpp:63
Definition PhysicsSystem.h:30
Definition Reference.h:163
Base class for all shapes (collision volume of a body). Defines a virtual interface for collision det...
Definition Shape.h:186
Definition SoftBodyCreationSettings.h:18
An interface to query which vertices of a soft body are colliding with other bodies.
Definition SoftBodyManifold.h:13
This class contains the runtime information of a soft body.
Definition SoftBodyMotionProperties.h:35
bool GetEnableSkinConstraints() const
Global setting to turn on/off skin constraints.
Definition SoftBodyMotionProperties.h:83
Vertex & GetVertex(uint inIndex)
Definition SoftBodyMotionProperties.h:59
EStatus
Return code for ParallelUpdate.
Definition SoftBodyMotionProperties.h:150
Array< Vertex > & GetVertices()
Definition SoftBodyMotionProperties.h:55
void SetSkinnedMaxDistanceMultiplier(float inSkinnedMaxDistanceMultiplier)
Definition SoftBodyMotionProperties.h:88
const PhysicsMaterialList & GetMaterials() const
Get the materials of the soft body.
Definition SoftBodyMotionProperties.h:62
const Array< Vertex > & GetVertices() const
Get the vertices of the soft body.
Definition SoftBodyMotionProperties.h:54
void SetUpdatePosition(bool inUpdatePosition)
Definition SoftBodyMotionProperties.h:80
float GetSkinnedMaxDistanceMultiplier() const
Multiplier applied to Skinned::mMaxDistance to allow tightening or loosening of the skin constraints....
Definition SoftBodyMotionProperties.h:87
void SetPressure(float inPressure)
Definition SoftBodyMotionProperties.h:76
const Array< Face > & GetFaces() const
Get the faces of the soft body.
Definition SoftBodyMotionProperties.h:65
const AABox & GetLocalBounds() const
Get local bounding box.
Definition SoftBodyMotionProperties.h:91
const Vertex & GetVertex(uint inIndex) const
Access an individual vertex.
Definition SoftBodyMotionProperties.h:58
void SetNumIterations(uint32 inNumIterations)
Definition SoftBodyMotionProperties.h:72
bool GetUpdatePosition() const
Update the position of the body while simulating (set to false for something that is attached to the ...
Definition SoftBodyMotionProperties.h:79
float GetVolume() const
Get the volume of the soft body. Note can become negative if the shape is inside out!
Definition SoftBodyMotionProperties.h:94
uint32 GetNumIterations() const
Get the number of solver iterations.
Definition SoftBodyMotionProperties.h:71
float GetPressure() const
Get the pressure of the soft body.
Definition SoftBodyMotionProperties.h:75
void SetEnableSkinConstraints(bool inEnableSkinConstraints)
Definition SoftBodyMotionProperties.h:84
const SoftBodySharedSettings * GetSettings() const
Get the shared settings of the soft body.
Definition SoftBodyMotionProperties.h:51
const Face & GetFace(uint inIndex) const
Access to an individual face.
Definition SoftBodyMotionProperties.h:68
An inverse bind matrix take a skinned vertex from its bind pose into joint local space.
Definition SoftBodySharedSettings.h:220
Definition SoftBodySharedSettings.h:284
A joint and its skin weight.
Definition SoftBodySharedSettings.h:234
A constraint that skins a vertex to joints and limits the distance that the simulated vertex can trav...
Definition SoftBodySharedSettings.h:248
Definition SoftBodySharedSettings.h:16
Temporary data used by the update of a soft body.
Definition SoftBodyUpdateContext.h:19
Definition SoftBodyVertex.h:16
Definition StateRecorder.h:110
Definition TempAllocator.h:16
JPH_INLINE Vec3 Cross(Vec3Arg inV2) const
Cross product.
Definition Vec3.inl:590
static JPH_INLINE Vec3 sZero()
Vector with all zeros.
Definition Vec3.inl:103
static JPH_INLINE Vec3 sNaN()
Vector with all NaN's.
Definition Vec3.inl:125
Definition PhysicsSettings.h:28
Definition SoftBodySharedSettings.h:186
An edge keeps two vertices at a constant distance using a spring: |x1 - x2| = rest length.
Definition SoftBodySharedSettings.h:152
A face defines the surface of the body.
Definition SoftBodySharedSettings.h:136
Volume constraint, keeps the volume of a tetrahedron constant.
Definition SoftBodySharedSettings.h:203