48 const Shape * GetShape()
const;
49 void SetShape(
const Shape *inShape) { mShapePtr = inShape; mShape =
nullptr; }
52 bool HasMassProperties()
const {
return mAllowDynamicOrKinematic || mMotionType != EMotionType::Static; }
58 void SaveBinaryState(
StreamOut &inStream)
const;
61 void RestoreBinaryState(
StreamIn &inStream);
95 bool mAllowDynamicOrKinematic =
false;
96 bool mIsSensor =
false;
97 bool mCollideKinematicVsNonDynamic =
false;
98 bool mUseManifoldReduction =
true;
99 bool mApplyGyroscopicForce =
false;
101 bool mEnhancedInternalEdgeRemoval =
false;
102 bool mAllowSleeping =
true;
103 float mFriction = 0.2f;
104 float mRestitution = 0.0f;
105 float mLinearDamping = 0.05f;
106 float mAngularDamping = 0.05f;
107 float mMaxLinearVelocity = 500.0f;
108 float mMaxAngularVelocity = 0.25f * JPH_PI * 60.0f;
109 float mGravityFactor = 1.0f;
110 uint mNumVelocityStepsOverride = 0;
111 uint mNumPositionStepsOverride = 0;
115 float mInertiaMultiplier = 1.0f;
EAllowedDOFs
Enum used in BodyCreationSettings and MotionProperties to indicate which degrees of freedom a body ha...
Definition: AllowedDOFs.h:11
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:453
#define JPH_EXPORT
Definition: Core.h:236
std::uint64_t uint64
Definition: Core.h:456
unsigned int uint
Definition: Core.h:452
#define JPH_NAMESPACE_END
Definition: Core.h:378
#define JPH_NAMESPACE_BEGIN
Definition: Core.h:372
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
uint16 ObjectLayer
Definition: ObjectLayer.h:16
#define JPH_DECLARE_SERIALIZABLE_NON_VIRTUAL(linkage, class_name)
Definition: SerializableObject.h:80
Settings for constructing a rigid body.
Definition: BodyCreationSettings.h:31
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
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
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:116
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:178
StreamUtils::IDToObjectMap< Shape > IDToShapeMap
Definition: Shape.h:382
StreamUtils::ObjectToIDMap< Shape > ShapeToIDMap
Definition: Shape.h:381
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