48 const Shape * GetShape()
const;
49 void SetShape(
const Shape *inShape) { mShapePtr = inShape; mShape =
nullptr; }
58 void SaveBinaryState(
StreamOut &inStream)
const;
61 void RestoreBinaryState(
StreamIn &inStream);
95 bool mAllowDynamicOrKinematic =
false;
96 bool mIsSensor =
false;
97 bool mSensorDetectsStatic =
false;
98 bool mUseManifoldReduction =
true;
100 bool mAllowSleeping =
true;
101 float mFriction = 0.2f;
102 float mRestitution = 0.0f;
103 float mLinearDamping = 0.05f;
104 float mAngularDamping = 0.05f;
105 float mMaxLinearVelocity = 500.0f;
106 float mMaxAngularVelocity = 0.25f * JPH_PI * 60.0f;
107 float mGravityFactor = 1.0f;
111 float mInertiaMultiplier = 1.0f;
EAllowedDOFs
Enum used in BodyCreationSettings and MotionProperties to indicate which degrees of freedom a body ha...
Definition AllowedDOFs.h:11
@ All
All degrees of freedom are allowed.
EOverrideMassProperties
Enum used in BodyCreationSettings to indicate how mass and inertia should be calculated.
Definition BodyCreationSettings.h:23
@ CalculateInertia
Tells the system to take the mass from mMassPropertiesOverride and to calculate the inertia based on ...
@ MassAndInertiaProvided
Tells the system to take the mass and inertia from mMassPropertiesOverride.
@ CalculateMassAndInertia
Tells the system to calculate the mass and inertia based on density.
std::uint8_t uint8
Definition Core.h:427
#define JPH_EXPORT
Definition Core.h:214
std::uint64_t uint64
Definition Core.h:430
#define JPH_NAMESPACE_END
Definition Core.h:354
#define JPH_NAMESPACE_BEGIN
Definition Core.h:348
EMotionQuality
Motion quality, or how well it detects collisions when it has a high velocity.
Definition MotionQuality.h:11
EMotionType
Motion type of a physics body.
Definition MotionType.h:11
@ Dynamic
Responds to forces as a normal physics object.
uint16 ObjectLayer
Definition ObjectLayer.h:16
#define JPH_DECLARE_SERIALIZABLE_NON_VIRTUAL(linkage, class_name)
Definition SerializableObject.h:71
Settings for constructing a rigid body.
Definition BodyCreationSettings.h:31
StreamUtils::IDToObjectMap< GroupFilter > IDToGroupFilterMap
Definition BodyCreationSettings.h:64
void SetShape(const Shape *inShape)
Definition BodyCreationSettings.h:49
StreamUtils::ObjectToIDMap< GroupFilter > GroupFilterToIDMap
Definition BodyCreationSettings.h:63
StreamUtils::ObjectToIDMap< PhysicsMaterial > MaterialToIDMap
Definition BodyCreationSettings.h:67
const ShapeSettings * GetShapeSettings() const
Access to the shape settings object. This contains serializable (non-runtime optimized) information a...
Definition BodyCreationSettings.h:41
Shape::IDToShapeMap IDToShapeMap
Definition BodyCreationSettings.h:66
BodyCreationSettings(const Shape *inShape, RVec3Arg inPosition, QuatArg inRotation, EMotionType inMotionType, ObjectLayer inObjectLayer)
Definition BodyCreationSettings.h:38
bool HasMassProperties() const
Check if the mass properties of this body will be calculated (only relevant for kinematic or dynamic ...
Definition BodyCreationSettings.h:52
StreamUtils::IDToObjectMap< PhysicsMaterial > IDToMaterialMap
Definition BodyCreationSettings.h:68
CollisionGroup mCollisionGroup
The collision group this body belongs to (determines if two objects can collide)
Definition BodyCreationSettings.h:90
Shape::ShapeToIDMap ShapeToIDMap
Definition BodyCreationSettings.h:65
MassProperties mMassPropertiesOverride
Contains replacement mass settings which override the automatically calculated values.
Definition BodyCreationSettings.h:112
void SetShapeSettings(const ShapeSettings *inShape)
Definition BodyCreationSettings.h:42
Definition CollisionGroup.h:20
Describes the mass and inertia properties of a body. Used during body construction only.
Definition MassProperties.h:16
static JPH_INLINE Quat sIdentity()
Definition Quat.h:103
Definition Reference.h:151
Base class for all shapes (collision volume of a body). Defines a virtual interface for collision det...
Definition Shape.h:174
StreamUtils::IDToObjectMap< Shape > IDToShapeMap
Definition Shape.h:378
StreamUtils::ObjectToIDMap< Shape > ShapeToIDMap
Definition Shape.h:377
Simple binary input stream.
Definition StreamIn.h:13
Simple binary output stream.
Definition StreamOut.h:13
static JPH_INLINE Vec3 sZero()
Vector with all zeros.
Definition Vec3.inl:107
UnorderedMap< const Type *, uint32 > ObjectToIDMap
Definition StreamUtils.h:18
Array< Ref< Type > > IDToObjectMap
Definition StreamUtils.h:21