Class CharacterVirtualSettingsRef

All Implemented Interfaces:
ConstCharacterBaseSettings, ConstCharacterVirtualSettings, ConstJoltPhysicsObject, AutoCloseable, Comparable<JoltPhysicsObject>

public final class CharacterVirtualSettingsRef extends Ref implements ConstCharacterVirtualSettings
A counted reference to a CharacterVirtualSettings object. (native type: Ref<CharacterVirtualSettings>)
  • Constructor Details

    • CharacterVirtualSettingsRef

      public CharacterVirtualSettingsRef()
      Instantiate an empty reference.
  • Method Details

    • setBackFaceMode

      public void setBackFaceMode(EBackFaceMode mode)
      Alter whether the character will move through back facing triangles. (native attribute: mBackFaceMode)
      Parameters:
      mode - the desired mode (not null, default=CollideWithBackFaces)
    • setCharacterPadding

      public void setCharacterPadding(float padding)
      Alter how far the character tries to stay away from the geometry. (native attribute: mCharacterPadding)
      Parameters:
      padding - the desired distance (in meters, default=0.02)
    • setCollisionTolerance

      public void setCollisionTolerance(float tolerance)
      Alter the collision tolerance. (native attribute: mCollisionTolerance)
      Parameters:
      tolerance - the desired penetration distance (in meters, default=0.001)
    • setEnhancedInternalEdgeRemoval

      public void setEnhancedInternalEdgeRemoval(boolean remove)
      Alter whether to make an extra effort to remove contacts with internal edges. (native attribute: mEnhancedInternalEdgeRemoval)
      Parameters:
      remove - true to remove ghost contacts (default=false)
    • setHitReductionCosMaxAngle

      public void setHitReductionCosMaxAngle(int cosine)
      Alter the maximum angle for merging during hit reduction. (native attribute: mHitReductionCosMaxAngle)
      Parameters:
      cosine - the cosine of the maximum angle, or -1 to disable hit reduction (default=0.999)
    • setInnerBodyLayer

      public void setInnerBodyLayer(int objectLayer)
      Alter the object layer that the inner rigid body will be added to. (native attribute: mInnerBodyLayer)
      Parameters:
      objectLayer - the index of the desired object layer (default=0)
    • setInnerBodyShape

      public void setInnerBodyShape(ConstShape shape)
      Replace the shape of the inner rigid body. (native attribute: mInnerBodyShape)
      Parameters:
      shape - the desired shape, or null for no inner body (default=null)
    • setMass

      public void setMass(float mass)
      Alter the character's mass. (native attribute: mMass)
      Parameters:
      mass - the desired mass (in kilograms, default=70)
    • setMaxCollisionIterations

      public void setMaxCollisionIterations(int numIterations)
      Alter the maximum number of collision iterations. (native attribute: mMaxCollisionIterations)
      Parameters:
      numIterations - the desired number of iterations (≥0, default=5)
    • setMaxConstraintIterations

      public void setMaxConstraintIterations(int numIterations)
      Alter how often to try stepping in the constraint solver. (native attribute: mMaxConstraintIterations)
      Parameters:
      numIterations - the desired number of iterations (≥0, default=15)
    • setMaxNumHits

      public void setMaxNumHits(int numHits)
      Alter the maximum number of hits to collect. (native attribute: mMaxNumHits)
      Parameters:
      numHits - the desired limit (≥0), default=256)
    • setMaxSlopeAngle

      public void setMaxSlopeAngle(float angle)
      Alter the maximum slope that the character can walk on. (native attribute: mMaxSlopeAngle)
      Parameters:
      angle - (in radians, default=5*Pi/18)
    • setMaxStrength

      public void setMaxStrength(float force)
      Alter the maximum force applied to other bodies. (native attribute: mMaxStrength)
      Parameters:
      force - the desired force (in Newtons)
    • setMinTimeRemaining

      public void setMinTimeRemaining(float interval)
      Alter the early out threshold. (native attribute: mMinTimeRemaining)
      Parameters:
      interval - the desired simulation time interval (in seconds, default=0.0001)
    • setPenetrationRecoverySpeed

      public void setPenetrationRecoverySpeed(float fraction)
      Alter how quickly penetration is resolved. (native attribute: mPenetrationRecoverySpeed)
      Parameters:
      fraction - the desired resolution fraction (0=never resolved, 1=all in one update, default=1)
    • setPredictiveContactDistance

      public void setPredictiveContactDistance(float distance)
      Alter the maximum range of predictive contacts. (native attribute: mPredictiveContactDistance)
      Parameters:
      distance - the desired distance (in meters, default=0.1)
    • setShape

      public void setShape(ConstShape shape)
      Replace the shape. (native attribute: mShape)
      Parameters:
      shape - the desired shape (not null, unaffected, default=null)
    • setShapeOffset

      public void setShapeOffset(Vec3Arg offset)
      Alter the local offset applied to the shape. (native attribute: mShapeOffset)
      Parameters:
      offset - the desired offset (in local coordinates, not null, unaffected, default=(0,0,0))
    • setSupportingVolume

      public void setSupportingVolume(ConstPlane plane)
      Alter the supporting volume. (native attribute: mSupportingVolume)
      Parameters:
      plane - the desired plane of support (not null, unaffected, default={(0,1,0),-1e10})
    • setUp

      public void setUp(Vec3Arg direction)
      Alter the character's "up" direction. (native attribute: mUp)
      Parameters:
      direction - the desired direction (not null, unaffected, default=(0,1,0))
    • getBackFaceMode

      public EBackFaceMode getBackFaceMode()
      Determine whether the character will move through back-facing triangles. The settings are unaffected. (native attribute: mBackFaceMode)
      Specified by:
      getBackFaceMode in interface ConstCharacterVirtualSettings
      Returns:
      an enum value (not null)
    • getCharacterPadding

      public float getCharacterPadding()
      Return how far the character tries to stay away from the geometry. The settings are unaffected. (native attribute: mCharacterPadding)
      Specified by:
      getCharacterPadding in interface ConstCharacterVirtualSettings
      Returns:
      the desired distance (in meters)
    • getCollisionTolerance

      public float getCollisionTolerance()
      Return the collision tolerance. The settings are unaffected. (native attribute: mCollisionTolerance)
      Specified by:
      getCollisionTolerance in interface ConstCharacterVirtualSettings
      Returns:
      the allowed penetration distance (in meters)
    • getEnhancedInternalEdgeRemoval

      public boolean getEnhancedInternalEdgeRemoval()
      Test whether to make an extra effort to remove contacts with internal edges. The settings are unaffected. (native attribute: mEnhancedInternalEdgeRemoval)
      Specified by:
      getEnhancedInternalEdgeRemoval in interface ConstCharacterBaseSettings
      Returns:
      true to remove ghost contacts, otherwise false
    • getHitReductionCosMaxAngle

      public float getHitReductionCosMaxAngle()
      Return the maximum angle for merging during hit reduction. The settings are unaffected. (native attribute: mHitReductionCosMaxAngle)
      Specified by:
      getHitReductionCosMaxAngle in interface ConstCharacterVirtualSettings
      Returns:
      the cosine of the maximum angle, or -1 if hit reduction is disabled
    • getInnerBodyLayer

      public int getInnerBodyLayer()
      Return the object layer that the inner rigid body will be added to. The settings are unaffected. (native attribute: mInnerBodyLayer)
      Specified by:
      getInnerBodyLayer in interface ConstCharacterVirtualSettings
      Returns:
      the index of the object layer
    • getInnerBodyShape

      public ConstShape getInnerBodyShape()
      Return the shape of the inner rigid body. The settings are unaffected. (native attribute: mInnerBodyShape)
      Specified by:
      getInnerBodyShape in interface ConstCharacterVirtualSettings
      Returns:
      the shape, or null for no inner body
    • getMass

      public float getMass()
      Return the character's mass. The settings are unaffected. (native attribute: mMass)
      Specified by:
      getMass in interface ConstCharacterVirtualSettings
      Returns:
      the mass (in kilograms)
    • getMaxCollisionIterations

      public int getMaxCollisionIterations()
      Return the maximum number of collision iterations. The settings are unaffected. (native attribute: mMaxCollisionIterations)
      Specified by:
      getMaxCollisionIterations in interface ConstCharacterVirtualSettings
      Returns:
      the number of iterations (≥0)
    • getMaxConstraintIterations

      public int getMaxConstraintIterations()
      Return how often to try stepping in the constraint solver. The settings are unaffected. (native attribute: mMaxConstraintIterations)
      Specified by:
      getMaxConstraintIterations in interface ConstCharacterVirtualSettings
      Returns:
      the number of iterations (≥0)
    • getMaxNumHits

      public int getMaxNumHits()
      Return the maximum number of hits to be collected. The settings are unaffected. (native attribute: mMaxNumHits)
      Specified by:
      getMaxNumHits in interface ConstCharacterVirtualSettings
      Returns:
      the limit (≥0)
    • getMaxSlopeAngle

      public float getMaxSlopeAngle()
      Return the maximum slope that the character can walk on. The settings are unaffected. (native attribute: mMaxSlopeAngle)
      Specified by:
      getMaxSlopeAngle in interface ConstCharacterBaseSettings
      Returns:
      the angle (in radians)
    • getMaxStrength

      public float getMaxStrength()
      Return the maximum force applied to other bodies. The settings are unaffected. (native attribute: mMaxStrength)
      Specified by:
      getMaxStrength in interface ConstCharacterVirtualSettings
      Returns:
      the force (in Newtons)
    • getMinTimeRemaining

      public float getMinTimeRemaining()
      Return the early out threshold. The settings are unaffected. (native attribute: mMinTimeRemaining)
      Specified by:
      getMinTimeRemaining in interface ConstCharacterVirtualSettings
      Returns:
      the simulation time interval (in seconds)
    • getPenetrationRecoverySpeed

      public float getPenetrationRecoverySpeed()
      Return how quickly penetration is resolved. The settings are unaffected. (native attribute: mPenetrationRecoverySpeed)
      Specified by:
      getPenetrationRecoverySpeed in interface ConstCharacterVirtualSettings
      Returns:
      the resolution fraction (0=never resolved, 1=all in one update)
    • getPredictiveContactDistance

      public float getPredictiveContactDistance()
      Return the maximum range of predictive contacts. The settings are unaffected. (native attribute: mPredictiveContactDistance)
      Specified by:
      getPredictiveContactDistance in interface ConstCharacterVirtualSettings
      Returns:
      the distance (in meters)
    • getShape

      public ConstShape getShape()
      Access the Shape. (native attribute: mShape)
      Specified by:
      getShape in interface ConstCharacterBaseSettings
      Returns:
      a new JVM object with the pre-existing native object assigned, or null
    • getShapeOffset

      public Vec3 getShapeOffset()
      Copy the local offset applied to the shape. The settings are unaffected. (native attribute: mShapeOffset)
      Specified by:
      getShapeOffset in interface ConstCharacterVirtualSettings
      Returns:
      a new offset vector (in local coordinates)
    • getSupportingVolume

      public Plane getSupportingVolume()
      Copy the supporting volume. The settings are unaffected. (native attribute: mSupportingVolume)
      Specified by:
      getSupportingVolume in interface ConstCharacterBaseSettings
      Returns:
      a new object
    • getUp

      public Vec3 getUp()
      Copy the character's "up" direction. The settings are unaffected. (native attribute: mUp)
      Specified by:
      getUp in interface ConstCharacterBaseSettings
      Returns:
      a new direction vector (in system coordinates)
    • getPtr

      public CharacterVirtualSettings getPtr()
      Temporarily access the referenced CharacterVirtualSettings.
      Specified by:
      getPtr in class Ref
      Returns:
      a new JVM object with the pre-existing native object assigned
    • targetVa

      public long targetVa()
      Return the address of the native CharacterVirtualSettings. No objects are affected.
      Specified by:
      targetVa in interface ConstJoltPhysicsObject
      Overrides:
      targetVa in class JoltPhysicsObject
      Returns:
      a virtual address (not zero)
    • toRef

      Create another counted reference to the native CharacterVirtualSettings.
      Specified by:
      toRef in class Ref
      Returns:
      a new JVM object with a new native object assigned