Class CharacterSettings

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

public class CharacterSettings extends CharacterBaseSettings implements ConstCharacterSettings, RefTarget
Settings used to create a Character.
  • Constructor Details

    • CharacterSettings

      public CharacterSettings()
      Instantiate default settings.
  • Method Details

    • setFriction

      public void setFriction(float friction)
      Alter the friction ratio. (native attribute: mFriction)
      Parameters:
      friction - the desired ratio (typically ≥0 and ≤1, default=0.2)
    • setGravityFactor

      public void setGravityFactor(float factor)
      Alter the gravity multiplier. (native attribute: mGravityFactor)
      Parameters:
      factor - the desired multiplier (default=1)
    • setLayer

      public void setLayer(int objLayer)
      Alter the object layer to which the character will be added. (native attribute: mLayer)
      Parameters:
      objLayer - the ID of the desired object layer (≥0, <numObjectLayers, default=0)
    • setMass

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

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

      public float getGravityFactor()
      Return the gravity factor. The settings are unaffected. (native attribute: mGravityFactor)
      Specified by:
      getGravityFactor in interface ConstCharacterSettings
      Returns:
      the factor
    • getLayer

      public int getLayer()
      Return the index of the object layer. The settings are unaffected. (native attribute: mLayer)
      Specified by:
      getLayer in interface ConstCharacterSettings
      Returns:
      the layer index (≥0, <numObjectLayers)
    • getMass

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

      public int getRefCount()
      Count the active references to the native CharacterSettings. The settings are unaffected.
      Specified by:
      getRefCount in interface RefTarget
      Returns:
      the count (≥0)
    • setEmbedded

      public void setEmbedded()
      Mark the native CharacterSettings as embedded.
      Specified by:
      setEmbedded in interface RefTarget
    • toRef

      public CharacterSettingsRef toRef()
      Create a counted reference to the native CharacterSettings.
      Specified by:
      toRef in interface RefTarget
      Returns:
      a new JVM object with a new native object assigned