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
ConstructorsConstructorDescriptionInstantiate default settings.CharacterSettings(ConstCharacterSettings original) Instantiate a copy of the specified settings. -
Method Summary
Modifier and TypeMethodDescriptionfloatReturn the friction ratio.floatReturn the gravity factor.intgetLayer()Return the index of the object layer.floatgetMass()Return the character's mass.voidMark the nativeCharacterSettingsas embedded.voidsetFriction(float friction) Alter the friction ratio.voidsetGravityFactor(float factor) Alter the gravity multiplier.voidsetLayer(int objLayer) Alter the object layer to which the character will be added.voidsetMass(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, getRefCount, getShape, getSupportingVolume, getUp, setEnhancedInternalEdgeRemoval, setMaxSlopeAngle, setShape, setSupportingVolume, setUpMethods 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.ConstCharacterBaseSettings
getEnhancedInternalEdgeRemoval, getMaxSlopeAngle, getRefCount, getShape, getSupportingVolume, getUpMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVaMethods inherited from interface com.github.stephengold.joltjni.template.RefTarget
getRefCount
-
Constructor Details
-
CharacterSettings
public CharacterSettings()Instantiate default settings. -
CharacterSettings
Instantiate a copy of the specified settings.- Parameters:
original- the settings to copy (notnull, unaffected)
-
-
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:
getFrictionin 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:
getGravityFactorin interfaceConstCharacterSettings- Returns:
- the factor
-
getLayer
public int getLayer()Return the index of the object layer. The settings are unaffected. (native attribute: mLayer)- Specified by:
getLayerin 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:
getMassin interfaceConstCharacterSettings- Returns:
- the mass (in kilograms)
-
setEmbedded
public void setEmbedded()Mark the nativeCharacterSettingsas embedded.- Specified by:
setEmbeddedin interfaceRefTarget
-
toRef
Create a counted reference to the nativeCharacterSettings.
-