Package com.github.stephengold.joltjni
Class CharacterSettings
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.CharacterBaseSettings
com.github.stephengold.joltjni.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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloat
Return the friction ratio.float
Return the gravity factor.int
getLayer()
Return the index of the object layer.float
getMass()
Return the character's mass.int
Count the active references to the nativeCharacterSettings
.void
Mark the nativeCharacterSettings
as embedded.void
setFriction
(float friction) Alter the friction ratio.void
setGravityFactor
(float factor) Alter the gravity multiplier.void
setLayer
(int objLayer) Alter the object layer to which the character will be added.void
setMass
(float mass) Alter the character's mass.toRef()
Create a counted reference to the nativeCharacterSettings
.Methods inherited from class com.github.stephengold.joltjni.CharacterBaseSettings
getEnhancedInternalEdgeRemoval, getMaxSlopeAngle, getShape, getSupportingVolume, getUp, setEnhancedInternalEdgeRemoval, setMaxSlopeAngle, setShape, setSupportingVolume, setUp
Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface com.github.stephengold.joltjni.readonly.ConstCharacterBaseSettings
getEnhancedInternalEdgeRemoval, getMaxSlopeAngle, getShape, getSupportingVolume, getUp
Methods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa
-
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 interfaceConstCharacterSettings
- 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 interfaceConstCharacterSettings
- 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 interfaceConstCharacterSettings
- 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 interfaceConstCharacterSettings
- Returns:
- the mass (in kilograms)
-
getRefCount
public int getRefCount()Count the active references to the nativeCharacterSettings
. The settings are unaffected.- Specified by:
getRefCount
in interfaceRefTarget
- Returns:
- the count (≥0)
-
setEmbedded
public void setEmbedded()Mark the nativeCharacterSettings
as embedded.- Specified by:
setEmbedded
in interfaceRefTarget
-
toRef
Create a counted reference to the nativeCharacterSettings
.
-