Package com.github.stephengold.joltjni
Class CharacterSettingsRef
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.template.Ref
com.github.stephengold.joltjni.CharacterSettingsRef
- All Implemented Interfaces:
ConstCharacterBaseSettings,ConstCharacterSettings,ConstJoltPhysicsObject,AutoCloseable,Comparable<JoltPhysicsObject>
A counted reference to a
CharacterSettings object. (native type:
Ref<CharacterSettings>)-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanTest whether to make an extra effort to remove contacts with internal edges.floatReturn the friction ratio.floatReturn the gravity factor.intgetLayer()Return the index of the object layer.floatgetMass()Return the character's mass.floatReturn the maximum slope that the character can walk on.getPtr()Temporarily access the referencedCharacterSettings.intCount the active references to the nativeCharacterSettings.getShape()Access theShape.Copy the supporting volume.getUp()Copy the character's "up" direction.voidsetEnhancedInternalEdgeRemoval(boolean remove) Alter whether to make an extra effort to remove contacts with internal edges.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.voidsetMaxSlopeAngle(float angle) Alter the maximum slope that the character can walk on.voidsetShape(ConstShape shape) Replace the shape.voidsetSupportingVolume(ConstPlane plane) Alter the supporting volume.voidAlter the character's "up" direction.longtargetVa()Return the address of the nativeCharacterSettings.toRef()Create another counted reference to the nativeCharacterSettings.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, 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.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject
-
Constructor Details
-
CharacterSettingsRef
public CharacterSettingsRef()Instantiate an empty reference.
-
-
Method Details
-
setEnhancedInternalEdgeRemoval
public void setEnhancedInternalEdgeRemoval(boolean remove) Alter whether to make an extra effort to remove contacts with internal edges. (native attribute: mEnhancedInternalEdgeRemoval)- Parameters:
remove-trueto remove ghost contacts (default=false)
-
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)
-
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)
-
setShape
Replace the shape. (native attribute: mShape)- Parameters:
shape- the desired shape (not null, unaffected, default=null)
-
setSupportingVolume
Alter the supporting volume. (native attribute: mSupportingVolume)- Parameters:
plane- the desired plane of support (not null, unaffected, default={(0,1,0),-1e10})
-
setUp
Alter the character's "up" direction. (native attribute: mUp)- Parameters:
direction- the desired direction (not null, unaffected, default=(0,1,0))
-
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:
getEnhancedInternalEdgeRemovalin interfaceConstCharacterBaseSettings- Returns:
trueto remove ghost contacts, otherwisefalse
-
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)
-
getMaxSlopeAngle
public float getMaxSlopeAngle()Return the maximum slope that the character can walk on. The settings are unaffected. (native attribute: mMaxSlopeAngle)- Specified by:
getMaxSlopeAnglein interfaceConstCharacterBaseSettings- Returns:
- the angle (in radians)
-
getRefCount
public int getRefCount()Count the active references to the nativeCharacterSettings. The settings are unaffected.- Specified by:
getRefCountin interfaceConstCharacterBaseSettings- Returns:
- the count (≥0)
-
getShape
Access theShape. (native attribute: mShape)- Specified by:
getShapein interfaceConstCharacterBaseSettings- Returns:
- a new JVM object with the pre-existing native object assigned, or
null
-
getSupportingVolume
Copy the supporting volume. The settings are unaffected. (native attribute: mSupportingVolume)- Specified by:
getSupportingVolumein interfaceConstCharacterBaseSettings- Returns:
- a new object
-
getUp
Copy the character's "up" direction. The settings are unaffected. (native attribute: mUp)- Specified by:
getUpin interfaceConstCharacterBaseSettings- Returns:
- a new direction vector (in system coordinates)
-
getPtr
Temporarily access the referencedCharacterSettings. -
targetVa
public long targetVa()Return the address of the nativeCharacterSettings. No objects are affected.- Specified by:
targetVain interfaceConstJoltPhysicsObject- Overrides:
targetVain classJoltPhysicsObject- Returns:
- a virtual address (not zero)
-
toRef
Create another counted reference to the nativeCharacterSettings.
-