Interface ConstBodyCreationSettings
- All Superinterfaces:
Comparable<JoltPhysicsObject>
,ConstJoltPhysicsObject
- All Known Implementing Classes:
BodyCreationSettings
,Part
Read-only access to a
BodyCreationSettings
object. (native type:
const BodyCreationSettings)-
Method Summary
Modifier and TypeMethodDescriptionboolean
Test whether a static body can be converted to kinematic or dynamic.int
Return the body's degrees of freedom.boolean
Test whether the created body will be allowed to fall asleep.float
Return the angular damping constant.Copy the (initial) angular velocity.boolean
Test whether the gyroscopic force will be applied.boolean
Test whether a kinematic body will collide with kinematic/static bodies.Access the collision group to which the body will belong.boolean
Test whether extra effort should be made to remove ghost contacts.float
Return the friction ratio.float
Return the gravity factor.float
Return the multiplier for inertia calculations.boolean
Test whether the body will be a sensor.float
Return the linear damping constant.Copy the (initial) linear velocity.Calculate the body's mass and inertia.Access the mass-properties override.float
Return the maximum angular speed.float
Return the maximum linear speed.Return the motion quality.Return the motion type.int
Return the override for the number position iterations in the solver.int
Return the override for the number velocity iterations in the solver.int
Return the index of the object layer.Return how the mass-properties override will be used.Copy the (initial) location.float
Return the restitution ratio.Copy the (initial) orientation of the body's axes.getShape()
Acquire read-only access to the shape.Acquire read-only access to theShapeSettings
.boolean
Test whether manifold reduction will be enabled.long
Return the body's user data: can be used for anything.boolean
Test whether mass properties are required.void
saveBinaryState
(StreamOut stream) Write the state of this object to the specified stream, excluding the shape, materials, and group filter.void
saveWithChildren
(StreamOut stream, ShapeToIdMap shapeMap, MaterialToIdMap materialMap, GroupFilterToIdMap filterMap) Write the state of this object to the specified stream.Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa
-
Method Details
-
getAllowDynamicOrKinematic
boolean getAllowDynamicOrKinematic()Test whether a static body can be converted to kinematic or dynamic. The settings are unaffected.- Returns:
true
if convertible, otherwisefalse
-
getAllowedDofs
int getAllowedDofs()Return the body's degrees of freedom. The settings are unaffected.- Returns:
- a bitmask (see
EAllowedDofs
for semantics)
-
getAllowSleeping
boolean getAllowSleeping()Test whether the created body will be allowed to fall asleep. The settings are unaffected.- Returns:
true
if allowed, otherwisefalse
-
getAngularDamping
float getAngularDamping()Return the angular damping constant. The settings are unaffected.- Returns:
- the constant (in units of per second, ≥0, ≤1)
-
getAngularVelocity
Vec3 getAngularVelocity()Copy the (initial) angular velocity. The settings are unaffected.- Returns:
- a new velocity vector (radians per second in system coordinates)
-
getApplyGyroscopicForce
boolean getApplyGyroscopicForce()Test whether the gyroscopic force will be applied. The settings are unaffected.- Returns:
true
if enabled, otherwisefalse
-
getCollideKinematicVsNonDynamic
boolean getCollideKinematicVsNonDynamic()Test whether a kinematic body will collide with kinematic/static bodies.- Returns:
true
if it will collide, otherwisefalse
-
getCollisionGroup
ConstCollisionGroup getCollisionGroup()Access the collision group to which the body will belong.- Returns:
- a new JVM object with the pre-existing native object assigned
-
getEnhancedInternalEdgeRemoval
boolean getEnhancedInternalEdgeRemoval()Test whether extra effort should be made to remove ghost contacts. The settings are unaffected.- Returns:
true
for extra effort, otherwisefalse
-
getFriction
float getFriction()Return the friction ratio. The settings are unaffected.- Returns:
- the ratio (typically ≥0 and ≤1)
-
getGravityFactor
float getGravityFactor()Return the gravity factor. The settings are unaffected.- Returns:
- the factor
-
getInertiaMultiplier
float getInertiaMultiplier()Return the multiplier for inertia calculations.- Returns:
- the factor
-
getIsSensor
boolean getIsSensor()Test whether the body will be a sensor. The settings are unaffected.- Returns:
true
for a sensor, otherwisefalse
-
getLinearDamping
float getLinearDamping()Return the linear damping constant. The settings are unaffected.- Returns:
- the constant (in units of per second, ≥0, ≤1)
-
getLinearVelocity
Vec3 getLinearVelocity()Copy the (initial) linear velocity. The settings are unaffected.- Returns:
- a new velocity vector (meters per second in system coordinates)
-
getMassProperties
MassProperties getMassProperties()Calculate the body's mass and inertia. As a side effect, this method may "cook" the settings.- Returns:
- a new JVM object with a new native object assigned, or
null
if a shape is required but not available
-
getMassPropertiesOverride
ConstMassProperties getMassPropertiesOverride()Access the mass-properties override.- Returns:
- a new JVM object with the pre-existing native object assigned
-
getMaxAngularVelocity
float getMaxAngularVelocity()Return the maximum angular speed. The settings are unaffected.- Returns:
- the maximum speed (in radians per second)
-
getMaxLinearVelocity
float getMaxLinearVelocity()Return the maximum linear speed. The settings are unaffected.- Returns:
- the maximum speed (in meters per second)
-
getMotionQuality
EMotionQuality getMotionQuality()Return the motion quality. The settings are unaffected.- Returns:
- an enum value (not null)
-
getMotionType
EMotionType getMotionType()Return the motion type. The settings are unaffected.- Returns:
- an enum value (not null)
-
getNumPositionStepsOverride
int getNumPositionStepsOverride()Return the override for the number position iterations in the solver. Applicable only to a dynamic colliding body. The settings are unaffected.- Returns:
- the number (0 → use default in
PhysicsSettings
)
-
getNumVelocityStepsOverride
int getNumVelocityStepsOverride()Return the override for the number velocity iterations in the solver. Applicable only to a dynamic colliding body. The settings are unaffected.- Returns:
- the number (0 → use default in
PhysicsSettings
)
-
getObjectLayer
int getObjectLayer()Return the index of the object layer. The settings are unaffected.- Returns:
- the layer index (≥0, <numObjectLayers)
-
getOverrideMassProperties
EOverrideMassProperties getOverrideMassProperties()Return how the mass-properties override will be used. The settings are unaffected.- Returns:
- an enum value (not null)
-
getPosition
RVec3 getPosition()Copy the (initial) location. The settings are unaffected.- Returns:
- a new location vector (in system coordinates, all components finite)
-
getRestitution
float getRestitution()Return the restitution ratio. The settings are unaffected.- Returns:
- the ratio (typically ≥0 and ≤1)
-
getRotation
Quat getRotation()Copy the (initial) orientation of the body's axes. The settings are unaffected.- Returns:
- a new rotation quaternion (relative to the system axes)
-
getShape
ConstShape getShape()Acquire read-only access to the shape. As a side effect, if the body-creation settings aren't already cooked, this method cooks them.- Returns:
- a new JVM object, or
null
if the shape settings arenull
and the body-creation settings aren't cooked
-
getShapeSettings
ConstShapeSettings getShapeSettings()Acquire read-only access to theShapeSettings
. The body-creation settings are unaffected.- Returns:
- a new JVM object with the pre-existing native object assigned, or
null
-
getUseManifoldReduction
boolean getUseManifoldReduction()Test whether manifold reduction will be enabled. The settings are unaffected. (member data: mUseManifoldReduction)- Returns:
true
if enabled, otherwisefalse
-
getUserData
long getUserData()Return the body's user data: can be used for anything. The settings are unaffected. (member data: mUserData)- Returns:
- the value
-
hasMassProperties
boolean hasMassProperties()Test whether mass properties are required. The settings are unaffected.- Returns:
true
if required, otherwisefalse
-
saveBinaryState
Write the state of this object to the specified stream, excluding the shape, materials, and group filter. The settings are unaffected.- Parameters:
stream
- where to write objects (not null)
-
saveWithChildren
void saveWithChildren(StreamOut stream, ShapeToIdMap shapeMap, MaterialToIdMap materialMap, GroupFilterToIdMap filterMap) Write the state of this object to the specified stream. The settings are unaffected.- Parameters:
stream
- where to write objects (not null)shapeMap
- track multiple uses of shapes (may be null)materialMap
- track multiple uses of physics materials (may be null)filterMap
- track multiple uses of group filters (may be null)
-