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

public class BodyCreationSettings extends JoltPhysicsObject implements ConstBodyCreationSettings
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 Details

    • BodyCreationSettings

      public BodyCreationSettings()
      Instantiate default settings (uncooked).
    • BodyCreationSettings

      public BodyCreationSettings(ConstBodyCreationSettings original)
      Instantiate a copy of the specified settings.
      Parameters:
      original - the settings to copy (not null, unaffected)
    • BodyCreationSettings

      public BodyCreationSettings(ConstShape shape, double locX, double locY, double locZ, float orientX, float orientY, float orientZ, float orientW, EMotionType motionType, int objLayer)
      Instantiate cooked settings for the specified shape.
      Parameters:
      shape - the desired shape (not null)
      locX - the desired X coordinate of the location
      locY - the desired Y coordinate of the location
      locZ - the desired Z coordinate of the location
      orientX - the X component of the desired orientation
      orientY - the Y component of the desired orientation
      orientZ - the Z component of the desired orientation
      orientW - the W component of the desired orientation
      motionType - the desired motion type (not null)
      objLayer - the ID of the desired object layer (≥0)
    • 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, double locX, double locY, double locZ, float orientX, float orientY, float orientZ, float orientW, EMotionType motionType, int objLayer)
      Instantiate uncooked settings for the specified shape settings.
      Parameters:
      shapeSettings - the desired shape settings (not null)
      locX - the desired X coordinate of the location
      locY - the desired Y coordinate of the location
      locZ - the desired Z coordinate of the location
      orientX - the X component of the desired orientation
      orientY - the Y component of the desired orientation
      orientZ - the Z component of the desired orientation
      orientW - the W component of the desired orientation
      motionType - the desired motion type (not null)
      objLayer - the ID of the desired object layer
    • 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, double locX, double locY, double locZ, float orientX, float orientY, float orientZ, float orientW, EMotionType motionType, int objLayer)
      Instantiate settings for the specified shape reference.
      Parameters:
      shapeRef - a reference to the desired shape (not null)
      locX - the desired X coordinate of the location
      locY - the desired Y coordinate of the location
      locZ - the desired Z coordinate of the location
      orientX - the X component of the desired orientation
      orientY - the Y component of the desired orientation
      orientZ - the Z component of the desired orientation
      orientW - the W component of the desired orientation
      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

      public ShapeResult convertShapeSettings()
      Prepare for simulation by attempting to cook the ShapeSettings member into a shape. After invoking this method, ObjectStream serialization is inhibited.
      Returns:
      a new object (Remember to test it for errors!)
    • restoreBinaryState

      public void restoreBinaryState(StreamIn stream)
      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)
    • set

      public void set(ConstBodyCreationSettings source)
      Copy the argument to the current settings.
      Parameters:
      source - the settings to copy (not null, unaffected)
    • setAllowDynamicOrKinematic

      public BodyCreationSettings setAllowDynamicOrKinematic(boolean setting)
      Alter whether a static body can be converted to kinematic or dynamic. (native member: mAllowDynamicOrKinematic)
      Parameters:
      setting - true to allow or false to inhibit (default=false)
      Returns:
      the modified settings, for chaining
    • setAllowedDofs

      public BodyCreationSettings setAllowedDofs(int bitmask)
      Alter the body's degrees of freedom. (native member: mAllowedDOFs)
      Parameters:
      bitmask - the desired bitmask (see EAllowedDofs for semantics, default=All)
      Returns:
      the modified settings, for chaining
    • setAllowSleeping

      public BodyCreationSettings setAllowSleeping(boolean allow)
      Alter whether the created body will be allowed to fall asleep. (native member: mAllowSleeping)
      Parameters:
      allow - true to allow, false to inhibit (default=true)
      Returns:
      the modified settings, for chaining
    • setAngularDamping

      public BodyCreationSettings setAngularDamping(float damping)
      Alter the angular damping constant. (native member: mAngularDamping)
      Parameters:
      damping - the desired value (in units of per second, ≥0, default=0.05)
      Returns:
      the modified settings, for chaining
    • setAngularVelocity

      public BodyCreationSettings setAngularVelocity(float wx, float wy, float wz)
      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

      public BodyCreationSettings setAngularVelocity(Vec3Arg omega)
      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

      public BodyCreationSettings setApplyGyroscopicForce(boolean setting)
      Alter whether gyroscopic force will be applied. (native member: mApplyGyroscopicForce)
      Parameters:
      setting - true to enable the force, or false to disable it (default=false)
      Returns:
      the modified settings, for chaining
    • setCollideKinematicVsNonDynamic

      public BodyCreationSettings setCollideKinematicVsNonDynamic(boolean setting)
      Alter whether a kinematic body will collide with kinematic/static bodies. (native member: mCollideKinematicVsNonDynamic)
      Parameters:
      setting - true to collide, or false to disable collisions (default=false)
      Returns:
      the modified settings, for chaining
    • setCollisionGroup

      public BodyCreationSettings setCollisionGroup(ConstCollisionGroup group)
      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

      public BodyCreationSettings setEnhancedInternalEdgeRemoval(boolean enhance)
      Alter whether extra effort should be made to remove ghost contacts. (native member: mEnhancedInternalEdgeRemoval)
      Parameters:
      enhance - true for extra effort, false for ordinary effort (default=false)
      Returns:
      the modified settings, for chaining
    • setFriction

      public BodyCreationSettings setFriction(float friction)
      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

      public BodyCreationSettings setGravityFactor(float factor)
      Alter the gravity multiplier. (native member: mGravityFactor)
      Parameters:
      factor - the desired multiplier (default=1)
      Returns:
      the modified settings, for chaining
    • setInertiaMultiplier

      public BodyCreationSettings setInertiaMultiplier(float factor)
      Alter the inertia multiplier. (native member: mInertiaMultiplier)
      Parameters:
      factor - the desired multiplier (default=1)
      Returns:
      the modified settings, for chaining
    • setIsSensor

      public BodyCreationSettings setIsSensor(boolean setting)
      Alter whether the body will be a sensor. (native member: mIsSensor)
      Parameters:
      setting - true for a sensor, otherwise false (default=false)
      Returns:
      the modified settings, for chaining
    • setLinearDamping

      public BodyCreationSettings setLinearDamping(float damping)
      Alter the linear damping constant. (native member: mLinearDamping)
      Parameters:
      damping - the desired value (in units of per second, ≥0, default=0.05)
      Returns:
      the modified settings, for chaining
    • setLinearVelocity

      public BodyCreationSettings setLinearVelocity(float vx, float vy, float vz)
      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

      public BodyCreationSettings setLinearVelocity(Vec3Arg velocity)
      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

      public BodyCreationSettings setMassPropertiesOverride(ConstMassProperties properties)
      Alter the mass-properties override. (native member: mMassPropertiesOverride)
      Parameters:
      properties - the desired properties (not null, unaffected)
      Returns:
      the modified settings, for chaining
    • setMaxAngularVelocity

      public BodyCreationSettings setMaxAngularVelocity(float maxSpeed)
      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

      public BodyCreationSettings setMaxLinearVelocity(float maxSpeed)
      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

      public BodyCreationSettings setMotionQuality(EMotionQuality motionQuality)
      Alter the motion quality. (native member: mMotionQuality)
      Parameters:
      motionQuality - the desired quality (not null, default=Discrete)
      Returns:
      the modified settings, for chaining
    • setMotionType

      public BodyCreationSettings setMotionType(EMotionType motionType)
      Alter the motion type. (native member: mMotionType)
      Parameters:
      motionType - the desired type (not null, default=Dynamic)
      Returns:
      the modified settings, for chaining
    • setNumPositionStepsOverride

      public BodyCreationSettings setNumPositionStepsOverride(int numSteps)
      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 in PhysicsSettings)
      Returns:
      the modified settings, for chaining
    • setNumVelocityStepsOverride

      public BodyCreationSettings setNumVelocityStepsOverride(int numSteps)
      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 in PhysicsSettings)
      Returns:
      the modified settings, for chaining
    • setObjectLayer

      public BodyCreationSettings setObjectLayer(int objLayer)
      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

      public BodyCreationSettings setOverrideMassProperties(EOverrideMassProperties setting)
      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

      public BodyCreationSettings 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). (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

      public BodyCreationSettings setPosition(RVec3Arg location)
      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

      public BodyCreationSettings setRestitution(float restitution)
      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

      public BodyCreationSettings setRotation(float qx, float qy, float qz, float qw)
      Alter the (initial) orientation of the body's axes. (native member: mRotation)
      Parameters:
      qx - the X component of the desired rotation (relative to the system axes, default=0)
      qy - the Y component of the desired rotation (relative to the system axes, default=0)
      qz - the Z component of the desired rotation (relative to the system axes, default=0)
      qw - the W component of the desired rotation (relative to the system axes, default=1)
      Returns:
      the modified settings, for chaining
    • setRotation

      public BodyCreationSettings setRotation(QuatArg quat)
      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

      public BodyCreationSettings setShape(ConstShape shape)
      Replace the shape and null out the shape settings.
      Parameters:
      shape - the desired shape (unaffected except that its reference count gets incremented) or null
      Returns:
      the modified settings, for chaining
    • setShapeSettings

      public BodyCreationSettings setShapeSettings(ConstShapeSettings shapeSettings)
      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

      public BodyCreationSettings setUseManifoldReduction(boolean setting)
      Alter whether manifold reduction will be enabled. (member data: mUseManifoldReduction)
      Parameters:
      setting - true to enable, or false to disable
      Returns:
      the modified settings, for chaining
    • setUserData

      public BodyCreationSettings setUserData(long value)
      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:
      getAllowDynamicOrKinematic in interface ConstBodyCreationSettings
      Returns:
      true if convertible, otherwise false
    • getAllowedDofs

      public int getAllowedDofs()
      Return the body's degrees of freedom. The settings are unaffected. (native member: mAllowedDOFs)
      Specified by:
      getAllowedDofs in interface ConstBodyCreationSettings
      Returns:
      a bitmask (see EAllowedDofs for 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:
      getAllowSleeping in interface ConstBodyCreationSettings
      Returns:
      true if allowed, otherwise false
    • getAngularDamping

      public float getAngularDamping()
      Return the angular damping constant. The settings are unaffected. (native member: mAngularDamping)
      Specified by:
      getAngularDamping in interface ConstBodyCreationSettings
      Returns:
      the constant (in units of per second, ≥0)
    • getAngularVelocity

      public Vec3 getAngularVelocity()
      Copy the (initial) angular velocity. The settings are unaffected. (native member: mAngularVelocity)
      Specified by:
      getAngularVelocity in interface ConstBodyCreationSettings
      Returns:
      a new velocity vector (radians per second in system coordinates)
    • getAngularVelocity

      public void getAngularVelocity(Vec3 storeResult)
      Copy the (initial) angular velocity. The settings are unaffected. (native member: mAngularVelocity)
      Specified by:
      getAngularVelocity in interface ConstBodyCreationSettings
      Parameters:
      storeResult - storage for the velocity (radians per second in system coordinates, not null, modified)
    • getApplyGyroscopicForce

      public boolean getApplyGyroscopicForce()
      Test whether the gyroscopic force will be applied. The settings are unaffected. (native member: mApplyGyroscopicForce)
      Specified by:
      getApplyGyroscopicForce in interface ConstBodyCreationSettings
      Returns:
      true if enabled, otherwise false
    • getCollideKinematicVsNonDynamic

      public boolean getCollideKinematicVsNonDynamic()
      Test whether a kinematic body will collide with kinematic/static bodies. (native member: mCollideKinematicVsNonDynamic)
      Specified by:
      getCollideKinematicVsNonDynamic in interface ConstBodyCreationSettings
      Returns:
      true if it will collide, otherwise false
    • getCollisionGroup

      public CollisionGroup getCollisionGroup()
      Access the collision group to which the body will belong. (native member: mCollisionGroup)
      Specified by:
      getCollisionGroup in interface ConstBodyCreationSettings
      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:
      getEnhancedInternalEdgeRemoval in interface ConstBodyCreationSettings
      Returns:
      true for extra effort, otherwise false
    • getFriction

      public float getFriction()
      Return the friction ratio. The settings are unaffected. (native member: mFriction)
      Specified by:
      getFriction in interface ConstBodyCreationSettings
      Returns:
      the ratio (typically ≥0 and ≤1)
    • getGravityFactor

      public float getGravityFactor()
      Return the gravity factor. The settings are unaffected. (native member: mGravityFactor)
      Specified by:
      getGravityFactor in interface ConstBodyCreationSettings
      Returns:
      the factor
    • getInertiaMultiplier

      public float getInertiaMultiplier()
      Return the multiplier for inertia calculations. (native member: mInertiaMultiplier)
      Specified by:
      getInertiaMultiplier in interface ConstBodyCreationSettings
      Returns:
      the factor
    • getIsSensor

      public boolean getIsSensor()
      Test whether the body will be a sensor. The settings are unaffected. (native member: mIsSensor)
      Specified by:
      getIsSensor in interface ConstBodyCreationSettings
      Returns:
      true for a sensor, otherwise false
    • getLinearDamping

      public float getLinearDamping()
      Return the linear damping constant. The settings are unaffected. (native member: mLinearDamping)
      Specified by:
      getLinearDamping in interface ConstBodyCreationSettings
      Returns:
      the constant (in units of per second, ≥0)
    • getLinearVelocity

      public Vec3 getLinearVelocity()
      Copy the (initial) linear velocity. The settings are unaffected. (native member: mLinearVelocity)
      Specified by:
      getLinearVelocity in interface ConstBodyCreationSettings
      Returns:
      a new velocity vector (meters per second in system coordinates)
    • getLinearVelocity

      public void getLinearVelocity(Vec3 storeResult)
      Copy the (initial) linear velocity. The settings are unaffected. (native member: mLinearVelocity)
      Specified by:
      getLinearVelocity in interface ConstBodyCreationSettings
      Parameters:
      storeResult - storage for the velocity (meters per second in system coordinates, not null, modified)
    • getMassProperties

      public MassProperties getMassProperties()
      Calculate the body's mass and inertia. As a side effect, this method may "cook" the settings.
      Specified by:
      getMassProperties in interface ConstBodyCreationSettings
      Returns:
      a new JVM object with a new native object assigned, or null if a shape is required but not available
    • getMassPropertiesOverride

      public MassProperties getMassPropertiesOverride()
      Access the mass-properties override. (native member: mMassPropertiesOverride)
      Specified by:
      getMassPropertiesOverride in interface ConstBodyCreationSettings
      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:
      getMaxAngularVelocity in interface ConstBodyCreationSettings
      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:
      getMaxLinearVelocity in interface ConstBodyCreationSettings
      Returns:
      the maximum speed (in meters per second)
    • getMotionQuality

      public EMotionQuality getMotionQuality()
      Return the motion quality. The settings are unaffected. (native member: mMotionQuality)
      Specified by:
      getMotionQuality in interface ConstBodyCreationSettings
      Returns:
      an enum value (not null)
    • getMotionType

      public EMotionType getMotionType()
      Return the motion type. The settings are unaffected. (native member: mMotionType)
      Specified by:
      getMotionType in interface ConstBodyCreationSettings
      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:
      getNumPositionStepsOverride in interface ConstBodyCreationSettings
      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:
      getNumVelocityStepsOverride in interface ConstBodyCreationSettings
      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:
      getObjectLayer in interface ConstBodyCreationSettings
      Returns:
      the layer index (≥0, <numObjectLayers)
    • getOverrideMassProperties

      public EOverrideMassProperties getOverrideMassProperties()
      Return how the mass-properties override will be used. The settings are unaffected. (native member: mOverrideMassProperties)
      Specified by:
      getOverrideMassProperties in interface ConstBodyCreationSettings
      Returns:
      an enum value (not null)
    • getPosition

      public RVec3 getPosition()
      Copy the (initial) location. The settings are unaffected. (native member: mPosition)
      Specified by:
      getPosition in interface ConstBodyCreationSettings
      Returns:
      a new location vector (in system coordinates, all components finite)
    • getPosition

      public void getPosition(RVec3 storeResult)
      Copy the (initial) location. The settings are unaffected. (native member: mPosition)
      Specified by:
      getPosition in interface ConstBodyCreationSettings
      Parameters:
      storeResult - storage for the location (in system coordinates, not null, modified)
    • getRestitution

      public float getRestitution()
      Return the restitution ratio. The settings are unaffected. (native member: mRestitution)
      Specified by:
      getRestitution in interface ConstBodyCreationSettings
      Returns:
      the ratio (typically ≥0 and ≤1)
    • getRotation

      public Quat getRotation()
      Copy the (initial) orientation of the body's axes. The settings are unaffected. (native member: mRotation)
      Specified by:
      getRotation in interface ConstBodyCreationSettings
      Returns:
      a new rotation quaternion (relative to the system axes)
    • getRotation

      public void getRotation(Quat storeResult)
      Copy the (initial) orientation of the body's axes. The settings are unaffected. (native member: mRotation)
      Specified by:
      getRotation in interface ConstBodyCreationSettings
      Parameters:
      storeResult - storage for the rotation (relative to the system axes, not null, modified)
    • getShape

      public 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.
      Specified by:
      getShape in interface ConstBodyCreationSettings
      Returns:
      a new JVM object, or null if the shape settings are null and the body-creation settings aren't cooked
    • getShapeSettings

      public ConstShapeSettings getShapeSettings()
      Acquire read-only access to the ShapeSettings. The body-creation settings are unaffected.
      Specified by:
      getShapeSettings in interface ConstBodyCreationSettings
      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:
      getUseManifoldReduction in interface ConstBodyCreationSettings
      Returns:
      true if enabled, otherwise false
    • getUserData

      public long getUserData()
      Return the body's user data: can be used for anything. The settings are unaffected. (member data: mUserData)
      Specified by:
      getUserData in interface ConstBodyCreationSettings
      Returns:
      the value
    • hasMassProperties

      public boolean hasMassProperties()
      Test whether mass properties are required. The settings are unaffected.
      Specified by:
      hasMassProperties in interface ConstBodyCreationSettings
      Returns:
      true if required, otherwise false
    • isEqual

      public boolean isEqual(ConstBodyCreationSettings other)
      Test whether this object is equal to the argument. Both objects are unaffected. (native operator: binary ==)
      Specified by:
      isEqual in interface ConstBodyCreationSettings
      Parameters:
      other - the settings to compare with (not null, unaffected)
      Returns:
      true if equal, false if unequal
    • saveBinaryState

      public void saveBinaryState(StreamOut stream)
      Write the state of this object to the specified stream, excluding the shape, materials, and group filter. The settings are unaffected.
      Specified by:
      saveBinaryState in interface ConstBodyCreationSettings
      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:
      saveWithChildren in interface ConstBodyCreationSettings
      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)