Package com.github.stephengold.joltjni
Class BodyCreationSettings
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.BodyCreationSettings
- All Implemented Interfaces:
ConstBodyCreationSettings,ConstJoltPhysicsObject,AutoCloseable,Comparable<JoltPhysicsObject>
- Direct Known Subclasses:
Part
Settings used to create a rigid body. Such settings are described as "cooked"
if an actual shape has been assigned, or "uncooked" if there's no actual
shape yet.
-
Constructor Summary
ConstructorsConstructorDescriptionInstantiate default settings (uncooked).Instantiate a copy of the specified settings.BodyCreationSettings(ConstShape shape, RVec3Arg loc, QuatArg orient, EMotionType motionType, int objLayer) Instantiate cooked settings for the specified shape.BodyCreationSettings(ConstShapeSettings shapeSettings, RVec3Arg loc, QuatArg orient, EMotionType motionType, int objLayer) Instantiate uncooked settings for the specified shape settings.BodyCreationSettings(ShapeRef shapeRef, RVec3Arg loc, QuatArg orient, EMotionType motionType, int objLayer) Instantiate settings for the specified shape reference. -
Method Summary
Modifier and TypeMethodDescriptionPrepare for simulation by attempting to cook theShapeSettingsmember into a shape.booleanTest whether a static body can be converted to kinematic or dynamic.intReturn the body's degrees of freedom.booleanTest whether the created body will be allowed to fall asleep.floatReturn the angular damping constant.Copy the (initial) angular velocity.booleanTest whether the gyroscopic force will be applied.booleanTest whether a kinematic body will collide with kinematic/static bodies.Access the collision group to which the body will belong.booleanTest whether extra effort should be made to remove ghost contacts.floatReturn the friction ratio.floatReturn the gravity factor.floatReturn the multiplier for inertia calculations.booleanTest whether the body will be a sensor.floatReturn the linear damping constant.Copy the (initial) linear velocity.Calculate the body's mass and inertia.Access the mass-properties override.floatReturn the maximum angular speed.floatReturn the maximum linear speed.Return the motion quality.Return the motion type.intReturn the override for the number position iterations in the solver.getNumPositionStepsOverride(int numSteps) Deprecated.intReturn the override for the number velocity iterations in the solver.getNumVelocityStepsOverride(int numSteps) Deprecated.intReturn the index of the object layer.Return how the mass-properties override will be used.Copy the (initial) location.floatReturn 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.booleanTest whether manifold reduction will be enabled.longReturn the body's user data: can be used for anything.booleanTest whether mass properties are required.voidrestoreBinaryState(StreamIn stream) Read the state of this object from the specified stream, excluding the shape and group filter.voidsaveBinaryState(StreamOut stream) Write the state of this object to the specified stream, excluding the shape, materials, and group filter.voidsaveWithChildren(StreamOut stream, ShapeToIdMap shapeMap, MaterialToIdMap materialMap, GroupFilterToIdMap filterMap) Write the state of this object to the specified stream.setAllowDynamicOrKinematic(boolean setting) Alter whether a static body can be converted to kinematic or dynamic.setAllowedDofs(int bitmask) Alter the body's degrees of freedom.setAllowSleeping(boolean allow) Alter whether the created body will be allowed to fall asleep.setAngularDamping(float damping) Alter the angular damping constant.setAngularVelocity(float wx, float wy, float wz) Alter the (initial) angular velocity.setAngularVelocity(Vec3Arg omega) Alter the (initial) angular velocity.setApplyGyroscopicForce(boolean setting) Alter whether gyroscopic force will be applied.setCollideKinematicVsNonDynamic(boolean setting) Alter whether a kinematic body will collide with kinematic/static bodies.Alter the collision group to which the body will belong.setEnhancedInternalEdgeRemoval(boolean enhance) Alter whether extra effort should be made to remove ghost contacts.setFriction(float friction) Alter the friction ratio.setGravityFactor(float factor) Alter the gravity multiplier.setInertiaMultiplier(float factor) Alter the inertia multiplier.setIsSensor(boolean setting) Alter whether the body will be a sensor.setLinearDamping(float damping) Alter the linear damping constant.setLinearVelocity(float vx, float vy, float vz) Alter the (initial) linear velocity.setLinearVelocity(Vec3Arg velocity) Alter the (initial) linear velocity.setMassPropertiesOverride(ConstMassProperties properties) Alter the mass-properties override.setMaxAngularVelocity(float maxSpeed) Alter the maximum angular speed.setMaxLinearVelocity(float maxSpeed) Alter the maximum linear speed.setMotionQuality(EMotionQuality motionQuality) Alter the motion quality.setMotionType(EMotionType motionType) Alter the motion type.setNumPositionStepsOverride(int numSteps) Override the number position iterations in the solver.setNumVelocityStepsOverride(int numSteps) Override the number velocity iterations in the solver.setObjectLayer(int objLayer) Alter the object layer.Alter how the mass-properties override will be used.setPosition(double xx, double yy, double zz) Alter the (initial) location of the body's origin (which might not coincide with its center of mass).setPosition(RVec3Arg location) Alter the (initial) location of the body's origin (which might not coincide with its center of mass).setRestitution(float restitution) Alter the restitution ratio for collisions.setRotation(QuatArg quat) Alter the (initial) orientation of the body's axes.setShape(ConstShape shape) Replace the shape and null out the shape settings.setShapeSettings(ConstShapeSettings shapeSettings) Replace the shape settings and null out the shape.setUseManifoldReduction(boolean setting) Alter whether manifold reduction will be enabled.setUserData(long value) Alter the body's user data.static BcsResultsRestoreWithChildren(StreamIn stream, IdToShapeMap shapeMap, IdToMaterialMap materialMap, IdToGroupFilterMap filterMap) Read a settings object from the specified binary stream.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, vaMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa
-
Constructor Details
-
BodyCreationSettings
public BodyCreationSettings()Instantiate default settings (uncooked). -
BodyCreationSettings
Instantiate a copy of the specified settings.- Parameters:
original- the settings to copy (notnull, unaffected)
-
BodyCreationSettings
public BodyCreationSettings(ConstShape shape, RVec3Arg loc, QuatArg orient, EMotionType motionType, int objLayer) Instantiate cooked settings for the specified shape.- Parameters:
shape- the desired shape (not null)loc- the desired location (not null, unaffected)orient- the desired orientation (not null, unaffected)motionType- the desired motion type (not null)objLayer- the ID of the desired object layer (≥0)
-
BodyCreationSettings
public BodyCreationSettings(ConstShapeSettings shapeSettings, RVec3Arg loc, QuatArg orient, EMotionType motionType, int objLayer) Instantiate uncooked settings for the specified shape settings.- Parameters:
shapeSettings- the desired shape settings (not null)loc- the desired location (not null, unaffected)orient- the desired orientation (not null, unaffected)motionType- the desired motion type (not null)objLayer- the ID of the desired object layer
-
BodyCreationSettings
public BodyCreationSettings(ShapeRef shapeRef, RVec3Arg loc, QuatArg orient, EMotionType motionType, int objLayer) Instantiate settings for the specified shape reference.- Parameters:
shapeRef- a reference to the desired shape (not null)loc- the desired location (not null, unaffected)orient- the desired orientation (not null, unaffected)motionType- the desired motion type (not null)objLayer- the ID of the desired object layer
-
-
Method Details
-
convertShapeSettings
Prepare for simulation by attempting to cook theShapeSettingsmember into a shape. After invoking this method,ObjectStreamserialization is inhibited.- Returns:
- a new object (Remember to test it for errors!)
-
getNumPositionStepsOverride
Deprecated.Override the number position iterations in the solver. Applicable only to a dynamic colliding body. (native member: mNumPositionStepsOverride)- Parameters:
numSteps- the desired number, or 0 to use the default inPhysicsSettings)- Returns:
- the modified settings, for chaining
-
getNumVelocityStepsOverride
Deprecated.Override the number velocity iterations in the solver. Applicable only to a dynamic colliding body. (native member: mNumVelocityStepsOverride)- Parameters:
numSteps- the desired number, or 0 to use the default inPhysicsSettings)- Returns:
- the modified settings, for chaining
-
restoreBinaryState
Read the state of this object from the specified stream, excluding the shape and group filter.- Parameters:
stream- where to read objects from (not null)
-
setAllowDynamicOrKinematic
Alter whether a static body can be converted to kinematic or dynamic. (native member: mAllowDynamicOrKinematic)- Parameters:
setting-trueto allow orfalseto inhibit (default=false)- Returns:
- the modified settings, for chaining
-
setAllowedDofs
Alter the body's degrees of freedom. (native member: mAllowedDOFs)- Parameters:
bitmask- the desired bitmask (seeEAllowedDofsfor semantics, default=All)- Returns:
- the modified settings, for chaining
-
setAllowSleeping
Alter whether the created body will be allowed to fall asleep. (native member: mAllowSleeping)- Parameters:
allow-trueto allow,falseto inhibit (default=true)- Returns:
- the modified settings, for chaining
-
setAngularDamping
Alter the angular damping constant. (native member: mAngularDamping)- Parameters:
damping- the desired value (in units of per second, ≥0, ≤1, default=0.05)- Returns:
- the modified settings, for chaining
-
setAngularVelocity
Alter the (initial) angular velocity. (native member: mAngularVelocity)- Parameters:
wx- the X component of the desired angular velocity (radians per second in system coordinates, default=0)wy- the Y component of the desired angular velocity (radians per second in system coordinates, default=0)wz- the Z component of the desired angular velocity (radians per second in system coordinates, default=0)- Returns:
- the modified settings, for chaining
-
setAngularVelocity
Alter the (initial) angular velocity. (native member: mAngularVelocity)- Parameters:
omega- the desired angular velocity (radians per second in system coordinates, not null, unaffected, default=(0,0,0))- Returns:
- the modified settings, for chaining
-
setApplyGyroscopicForce
Alter whether gyroscopic force will be applied. (native member: mApplyGyroscopicForce)- Parameters:
setting-trueto enable the force, orfalseto disable it (default=false)- Returns:
- the modified settings, for chaining
-
setCollideKinematicVsNonDynamic
Alter whether a kinematic body will collide with kinematic/static bodies. (native member: mCollideKinematicVsNonDynamic)- Parameters:
setting-trueto collide, orfalseto disable collisions (default=false)- Returns:
- the modified settings, for chaining
-
setCollisionGroup
Alter the collision group to which the body will belong. (native member: mCollisionGroup)- Parameters:
group- the desired group (not null, unaffected)- Returns:
- the modified settings, for chaining
-
setEnhancedInternalEdgeRemoval
Alter whether extra effort should be made to remove ghost contacts. (native member: mEnhancedInternalEdgeRemoval)- Parameters:
enhance-truefor extra effort,falsefor ordinary effort (default=false)- Returns:
- the modified settings, for chaining
-
setFriction
Alter the friction ratio. (native member: mFriction)- Parameters:
friction- the desired ratio (typically ≥0 and ≤1, default=0.2)- Returns:
- the modified settings, for chaining
-
setGravityFactor
Alter the gravity multiplier. (native member: mGravityFactor)- Parameters:
factor- the desired multiplier (default=1)- Returns:
- the modified settings, for chaining
-
setInertiaMultiplier
Alter the inertia multiplier. (native member: mInertiaMultiplier)- Parameters:
factor- the desired multiplier (default=1)- Returns:
- the modified settings, for chaining
-
setIsSensor
Alter whether the body will be a sensor. (native member: mIsSensor)- Parameters:
setting-truefor a sensor, otherwisefalse(default=false)- Returns:
- the modified settings, for chaining
-
setLinearDamping
Alter the linear damping constant. (native member: mLinearDamping)- Parameters:
damping- the desired value (in units of per second, ≥0, ≤1, default=0.05)- Returns:
- the modified settings, for chaining
-
setLinearVelocity
Alter the (initial) linear velocity. (native member: mLinearVelocity)- Parameters:
vx- the X component of the desired velocity (meters per second in system coordinates, default=0)vy- the Y component of the desired velocity (meters per second in system coordinates, default=0)vz- the Z component of the desired velocity (meters per second in system coordinates, default=0)- Returns:
- the modified settings, for chaining
-
setLinearVelocity
Alter the (initial) linear velocity. (native member: mLinearVelocity)- Parameters:
velocity- the desired velocity (meters per second in system coordinates, not null, unaffected, default=(0,0,0))- Returns:
- the modified settings, for chaining
-
setMassPropertiesOverride
Alter the mass-properties override. (native member: mMassPropertiesOverride)- Parameters:
properties- the desired properties (not null, unaffected)- Returns:
- the modified settings, for chaining
-
setMaxAngularVelocity
Alter the maximum angular speed. (native member: mMaxAngularVelocity)- Parameters:
maxSpeed- the desired maximum speed (in radians per second, ≥0, default=15*pi)- Returns:
- the modified settings, for chaining
-
setMaxLinearVelocity
Alter the maximum linear speed. (native member: mMaxLinearVelocity)- Parameters:
maxSpeed- the desired maximum speed (in meters per second, ≥0, default=500)- Returns:
- the modified settings, for chaining
-
setMotionQuality
Alter the motion quality. (native member: mMotionQuality)- Parameters:
motionQuality- the desired quality (not null, default=Discrete)- Returns:
- the modified settings, for chaining
-
setMotionType
Alter the motion type. (native member: mMotionType)- Parameters:
motionType- the desired type (not null, default=Dynamic)- Returns:
- the modified settings, for chaining
-
setNumPositionStepsOverride
Override the number position iterations in the solver. Applicable only to a dynamic colliding body. (native member: mNumPositionStepsOverride)- Parameters:
numSteps- the desired number, or 0 to use the default inPhysicsSettings)- Returns:
- the modified settings, for chaining
-
setNumVelocityStepsOverride
Override the number velocity iterations in the solver. Applicable only to a dynamic colliding body. (native member: mNumVelocityStepsOverride)- Parameters:
numSteps- the desired number, or 0 to use the default inPhysicsSettings)- Returns:
- the modified settings, for chaining
-
setObjectLayer
Alter the object layer. (native member: mObjectLayer)- Parameters:
objLayer- the index of the desired object layer (≥0, <numObjectLayers, <65536, default=0)- Returns:
- the modified settings, for chaining
-
setOverrideMassProperties
Alter how the mass-properties override will be used. (native member: mOverrideMassProperties)- Parameters:
setting- an enum value (not null, default=CalculateMassAndInertia)- Returns:
- the modified settings, for chaining
-
setPosition
Alter the (initial) location of the body's origin (which might not coincide with its center of mass). (native member: mPosition)- Parameters:
xx- the desired X coordinate (in system coordinates, default=0)yy- the desired Y coordinate (in system coordinates, default=0)zz- the desired Z coordinate (in system coordinates, default=0)- Returns:
- the modified settings, for chaining
-
setPosition
Alter the (initial) location of the body's origin (which might not coincide with its center of mass). (native member: mPosition)- Parameters:
location- the desired location (in system coordinates, not null, unaffected, default=(0,0,0))- Returns:
- the modified settings, for chaining
-
setRestitution
Alter the restitution ratio for collisions. (native member: mRestitution)- Parameters:
restitution- the desired ratio (typically ≥0 and ≤1, default=0)- Returns:
- the modified settings, for chaining
-
setRotation
Alter the (initial) orientation of the body's axes. (native member: mRotation)- Parameters:
quat- the desired rotation (relative to the system axes, not null, normalized, unaffected, default=(0,0,0,1))- Returns:
- the modified settings, for chaining
-
setShape
Replace the shape and null out the shape settings.- Parameters:
shape- the desired shape (unaffected except that its reference count gets incremented) ornull- Returns:
- the modified settings, for chaining
-
setShapeSettings
Replace the shape settings and null out the shape. After invoking this method, the body-creation settings will be in an "uncooked" state.- Parameters:
shapeSettings- the desired shape settings (not null)- Returns:
- the modified settings, for chaining
-
setUseManifoldReduction
Alter whether manifold reduction will be enabled. (member data: mUseManifoldReduction)- Parameters:
setting-trueto enable, orfalseto disable- Returns:
- the modified settings, for chaining
-
setUserData
Alter the body's user data.- Parameters:
value- the desired value (default=0)- Returns:
- the modified settings, for chaining
-
sRestoreWithChildren
public static BcsResult sRestoreWithChildren(StreamIn stream, IdToShapeMap shapeMap, IdToMaterialMap materialMap, IdToGroupFilterMap filterMap) Read a settings object from the specified binary stream.- Parameters:
stream- where to read objects (not null)shapeMap- track multiple uses of shapes (not null)materialMap- track multiple uses of physics materials (not null)filterMap- track multiple uses of group filters (not null)- Returns:
- a new object
-
getAllowDynamicOrKinematic
public boolean getAllowDynamicOrKinematic()Test whether a static body can be converted to kinematic or dynamic. The settings are unaffected. (native member: mAllowDynamicOrKinematic)- Specified by:
getAllowDynamicOrKinematicin interfaceConstBodyCreationSettings- Returns:
trueif convertible, otherwisefalse
-
getAllowedDofs
public int getAllowedDofs()Return the body's degrees of freedom. The settings are unaffected. (native member: mAllowedDOFs)- Specified by:
getAllowedDofsin interfaceConstBodyCreationSettings- Returns:
- a bitmask (see
EAllowedDofsfor semantics)
-
getAllowSleeping
public boolean getAllowSleeping()Test whether the created body will be allowed to fall asleep. The settings are unaffected. (native member: mAllowSleeping)- Specified by:
getAllowSleepingin interfaceConstBodyCreationSettings- Returns:
trueif allowed, otherwisefalse
-
getAngularDamping
public float getAngularDamping()Return the angular damping constant. The settings are unaffected. (native member: mAngularDamping)- Specified by:
getAngularDampingin interfaceConstBodyCreationSettings- Returns:
- the constant (in units of per second, ≥0, ≤1)
-
getAngularVelocity
Copy the (initial) angular velocity. The settings are unaffected. (native member: mAngularVelocity)- Specified by:
getAngularVelocityin interfaceConstBodyCreationSettings- Returns:
- a new velocity vector (radians per second in system coordinates)
-
getApplyGyroscopicForce
public boolean getApplyGyroscopicForce()Test whether the gyroscopic force will be applied. The settings are unaffected. (native member: mApplyGyroscopicForce)- Specified by:
getApplyGyroscopicForcein interfaceConstBodyCreationSettings- Returns:
trueif enabled, otherwisefalse
-
getCollideKinematicVsNonDynamic
public boolean getCollideKinematicVsNonDynamic()Test whether a kinematic body will collide with kinematic/static bodies. (native member: mCollideKinematicVsNonDynamic)- Specified by:
getCollideKinematicVsNonDynamicin interfaceConstBodyCreationSettings- Returns:
trueif it will collide, otherwisefalse
-
getCollisionGroup
Access the collision group to which the body will belong. (native member: mCollisionGroup)- Specified by:
getCollisionGroupin interfaceConstBodyCreationSettings- Returns:
- a new JVM object with the pre-existing native object assigned
-
getEnhancedInternalEdgeRemoval
public boolean getEnhancedInternalEdgeRemoval()Test whether extra effort should be made to remove ghost contacts. The settings are unaffected. (native member: mEnhancedInternalEdgeRemoval)- Specified by:
getEnhancedInternalEdgeRemovalin interfaceConstBodyCreationSettings- Returns:
truefor extra effort, otherwisefalse
-
getFriction
public float getFriction()Return the friction ratio. The settings are unaffected. (native member: mFriction)- Specified by:
getFrictionin interfaceConstBodyCreationSettings- Returns:
- the ratio (typically ≥0 and ≤1)
-
getGravityFactor
public float getGravityFactor()Return the gravity factor. The settings are unaffected. (native member: mGravityFactor)- Specified by:
getGravityFactorin interfaceConstBodyCreationSettings- Returns:
- the factor
-
getInertiaMultiplier
public float getInertiaMultiplier()Return the multiplier for inertia calculations. (native member: mInertiaMultiplier)- Specified by:
getInertiaMultiplierin interfaceConstBodyCreationSettings- Returns:
- the factor
-
getIsSensor
public boolean getIsSensor()Test whether the body will be a sensor. The settings are unaffected. (native member: mIsSensor)- Specified by:
getIsSensorin interfaceConstBodyCreationSettings- Returns:
truefor a sensor, otherwisefalse
-
getLinearDamping
public float getLinearDamping()Return the linear damping constant. The settings are unaffected. (native member: mLinearDamping)- Specified by:
getLinearDampingin interfaceConstBodyCreationSettings- Returns:
- the constant (in units of per second, ≥0, ≤1)
-
getLinearVelocity
Copy the (initial) linear velocity. The settings are unaffected. (native member: mLinearVelocity)- Specified by:
getLinearVelocityin interfaceConstBodyCreationSettings- Returns:
- a new velocity vector (meters per second in system coordinates)
-
getMassProperties
Calculate the body's mass and inertia. As a side effect, this method may "cook" the settings.- Specified by:
getMassPropertiesin interfaceConstBodyCreationSettings- Returns:
- a new JVM object with a new native object assigned, or
nullif a shape is required but not available
-
getMassPropertiesOverride
Access the mass-properties override. (native member: mMassPropertiesOverride)- Specified by:
getMassPropertiesOverridein interfaceConstBodyCreationSettings- Returns:
- a new JVM object with the pre-existing native object assigned
-
getMaxAngularVelocity
public float getMaxAngularVelocity()Return the maximum angular speed. The settings are unaffected. (native member: mMaxAngularVelocity)- Specified by:
getMaxAngularVelocityin interfaceConstBodyCreationSettings- Returns:
- the maximum speed (in radians per second)
-
getMaxLinearVelocity
public float getMaxLinearVelocity()Return the maximum linear speed. The settings are unaffected. (native member: mMaxLinearVelocity)- Specified by:
getMaxLinearVelocityin interfaceConstBodyCreationSettings- Returns:
- the maximum speed (in meters per second)
-
getMotionQuality
Return the motion quality. The settings are unaffected. (native member: mMotionQuality)- Specified by:
getMotionQualityin interfaceConstBodyCreationSettings- Returns:
- an enum value (not null)
-
getMotionType
Return the motion type. The settings are unaffected. (native member: mMotionType)- Specified by:
getMotionTypein interfaceConstBodyCreationSettings- Returns:
- an enum value (not null)
-
getNumPositionStepsOverride
public int getNumPositionStepsOverride()Return the override for the number position iterations in the solver. Applicable only to a dynamic colliding body. The settings are unaffected. (native member: mNumPositionStepsOverride)- Specified by:
getNumPositionStepsOverridein interfaceConstBodyCreationSettings- Returns:
- the number (0 → use default in
PhysicsSettings)
-
getNumVelocityStepsOverride
public int getNumVelocityStepsOverride()Return the override for the number velocity iterations in the solver. Applicable only to a dynamic colliding body. The settings are unaffected. (native member: mNumVelocityStepsOverride)- Specified by:
getNumVelocityStepsOverridein interfaceConstBodyCreationSettings- Returns:
- the number (0 → use default in
PhysicsSettings)
-
getObjectLayer
public int getObjectLayer()Return the index of the object layer. The settings are unaffected. (native member: mObjectLayer)- Specified by:
getObjectLayerin interfaceConstBodyCreationSettings- Returns:
- the layer index (≥0, <numObjectLayers)
-
getOverrideMassProperties
Return how the mass-properties override will be used. The settings are unaffected. (native member: mOverrideMassProperties)- Specified by:
getOverrideMassPropertiesin interfaceConstBodyCreationSettings- Returns:
- an enum value (not null)
-
getPosition
Copy the (initial) location. The settings are unaffected. (native member: mPosition)- Specified by:
getPositionin interfaceConstBodyCreationSettings- Returns:
- a new location vector (in system coordinates, all components finite)
-
getRestitution
public float getRestitution()Return the restitution ratio. The settings are unaffected. (native member: mRestitution)- Specified by:
getRestitutionin interfaceConstBodyCreationSettings- Returns:
- the ratio (typically ≥0 and ≤1)
-
getRotation
Copy the (initial) orientation of the body's axes. The settings are unaffected. (native member: mRotation)- Specified by:
getRotationin interfaceConstBodyCreationSettings- Returns:
- a new rotation quaternion (relative to the system axes)
-
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.- Specified by:
getShapein interfaceConstBodyCreationSettings- Returns:
- a new JVM object, or
nullif the shape settings arenulland the body-creation settings aren't cooked
-
getShapeSettings
Acquire read-only access to theShapeSettings. The body-creation settings are unaffected.- Specified by:
getShapeSettingsin interfaceConstBodyCreationSettings- Returns:
- a new JVM object with the pre-existing native object assigned, or
null
-
getUseManifoldReduction
public boolean getUseManifoldReduction()Test whether manifold reduction will be enabled. The settings are unaffected. (member data: mUseManifoldReduction)- Specified by:
getUseManifoldReductionin interfaceConstBodyCreationSettings- Returns:
trueif enabled, otherwisefalse
-
getUserData
public long getUserData()Return the body's user data: can be used for anything. The settings are unaffected. (member data: mUserData)- Specified by:
getUserDatain interfaceConstBodyCreationSettings- Returns:
- the value
-
hasMassProperties
public boolean hasMassProperties()Test whether mass properties are required. The settings are unaffected.- Specified by:
hasMassPropertiesin interfaceConstBodyCreationSettings- Returns:
trueif required, otherwisefalse
-
saveBinaryState
Write the state of this object to the specified stream, excluding the shape, materials, and group filter. The settings are unaffected.- Specified by:
saveBinaryStatein interfaceConstBodyCreationSettings- Parameters:
stream- where to write objects (not null)
-
saveWithChildren
public void saveWithChildren(StreamOut stream, ShapeToIdMap shapeMap, MaterialToIdMap materialMap, GroupFilterToIdMap filterMap) Write the state of this object to the specified stream. The settings are unaffected.- Specified by:
saveWithChildrenin interfaceConstBodyCreationSettings- 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)
-
setNumPositionStepsOverride(int)