Package com.github.stephengold.joltjni
Class CharacterVirtualSettingsRef
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.template.Ref
com.github.stephengold.joltjni.CharacterVirtualSettingsRef
- All Implemented Interfaces:
ConstCharacterBaseSettings,ConstCharacterVirtualSettings,ConstJoltPhysicsObject,AutoCloseable,Comparable<JoltPhysicsObject>
A counted reference to a
CharacterVirtualSettings object. (native
type: Ref<CharacterVirtualSettings>)-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDetermine whether the character will move through back-facing triangles.floatReturn how far the character tries to stay away from the geometry.floatReturn the collision tolerance.booleanTest whether to make an extra effort to remove contacts with internal edges.floatReturn the maximum angle for merging during hit reduction.intReturn the object layer that the inner rigid body will be added to.Return the shape of the inner rigid body.floatgetMass()Return the character's mass.intReturn the maximum number of collision iterations.intReturn how often to try stepping in the constraint solver.intReturn the maximum number of hits to be collected.floatReturn the maximum slope that the character can walk on.floatReturn the maximum force applied to other bodies.floatReturn the early-out threshold.floatReturn how quickly penetration is resolved.floatReturn the maximum range of predictive contacts.getPtr()Temporarily access the referencedCharacterVirtualSettings.intCount the active references to the nativeCharacterVirtualSettings.getShape()Access theShape.Copy the local offset applied to the shape.Copy the supporting volume.getUp()Copy the character's "up" direction.voidsetBackFaceMode(EBackFaceMode mode) Alter whether the character will move through back facing triangles.voidsetCharacterPadding(float padding) Alter how far the character tries to stay away from the geometry.voidsetCollisionTolerance(float tolerance) Alter the collision tolerance.voidsetEnhancedInternalEdgeRemoval(boolean remove) Alter whether to make an extra effort to remove contacts with internal edges.voidsetHitReductionCosMaxAngle(int cosine) Alter the maximum angle for merging during hit reduction.voidsetInnerBodyLayer(int objectLayer) Alter the object layer that the inner rigid body will be added to.voidsetInnerBodyShape(ConstShape shape) Replace the shape of the inner rigid body.voidsetMass(float mass) Alter the character's mass.voidsetMaxCollisionIterations(int numIterations) Alter the maximum number of collision iterations.voidsetMaxConstraintIterations(int numIterations) Alter how often to try stepping in the constraint solver.voidsetMaxNumHits(int numHits) Alter the maximum number of hits to collect.voidsetMaxSlopeAngle(float angle) Alter the maximum slope that the character can walk on.voidsetMaxStrength(float force) Alter the maximum force applied to other bodies.voidsetMinTimeRemaining(float interval) Alter the early-out threshold.voidsetPenetrationRecoverySpeed(float fraction) Alter how quickly penetration is resolved.voidsetPredictiveContactDistance(float distance) Alter the maximum range of predictive contacts.voidsetShape(ConstShape shape) Replace the shape.voidsetShapeOffset(Vec3Arg offset) Alter the local offset applied to the shape.voidsetSupportingVolume(ConstPlane plane) Alter the supporting volume.voidAlter the character's "up" direction.longtargetVa()Return the address of the nativeCharacterVirtualSettings.toRef()Create another counted reference to the nativeCharacterVirtualSettings.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
-
CharacterVirtualSettingsRef
public CharacterVirtualSettingsRef()Instantiate an empty reference.
-
-
Method Details
-
setBackFaceMode
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-trueto 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
Replace the shape of the inner rigid body. (native attribute: mInnerBodyShape)- Parameters:
shape- the desired shape, ornullfor 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
Replace the shape. (native attribute: mShape)- Parameters:
shape- the desired shape (not null, unaffected, default=null)
-
setShapeOffset
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
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))
-
getBackFaceMode
Determine whether the character will move through back-facing triangles. The settings are unaffected. (native attribute: mBackFaceMode)- Specified by:
getBackFaceModein interfaceConstCharacterVirtualSettings- 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:
getCharacterPaddingin interfaceConstCharacterVirtualSettings- Returns:
- the desired distance (in meters)
-
getCollisionTolerance
public float getCollisionTolerance()Return the collision tolerance. The settings are unaffected. (native attribute: mCollisionTolerance)- Specified by:
getCollisionTolerancein interfaceConstCharacterVirtualSettings- 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:
getEnhancedInternalEdgeRemovalin interfaceConstCharacterBaseSettings- Returns:
trueto remove ghost contacts, otherwisefalse
-
getHitReductionCosMaxAngle
public float getHitReductionCosMaxAngle()Return the maximum angle for merging during hit reduction. The settings are unaffected. (native attribute: mHitReductionCosMaxAngle)- Specified by:
getHitReductionCosMaxAnglein interfaceConstCharacterVirtualSettings- 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:
getInnerBodyLayerin interfaceConstCharacterVirtualSettings- Returns:
- the index of the object layer
-
getInnerBodyShape
Return the shape of the inner rigid body. The settings are unaffected. (native attribute: mInnerBodyShape)- Specified by:
getInnerBodyShapein interfaceConstCharacterVirtualSettings- Returns:
- the shape, or
nullfor no inner body
-
getMass
public float getMass()Return the character's mass. The settings are unaffected. (native attribute: mMass)- Specified by:
getMassin interfaceConstCharacterVirtualSettings- 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:
getMaxCollisionIterationsin interfaceConstCharacterVirtualSettings- 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:
getMaxConstraintIterationsin interfaceConstCharacterVirtualSettings- 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:
getMaxNumHitsin interfaceConstCharacterVirtualSettings- 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:
getMaxSlopeAnglein interfaceConstCharacterBaseSettings- 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:
getMaxStrengthin interfaceConstCharacterVirtualSettings- Returns:
- the force (in Newtons)
-
getMinTimeRemaining
public float getMinTimeRemaining()Return the early-out threshold. The settings are unaffected. (native attribute: mMinTimeRemaining)- Specified by:
getMinTimeRemainingin interfaceConstCharacterVirtualSettings- 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:
getPenetrationRecoverySpeedin interfaceConstCharacterVirtualSettings- 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:
getPredictiveContactDistancein interfaceConstCharacterVirtualSettings- Returns:
- the distance (in meters)
-
getRefCount
public int getRefCount()Count the active references to the nativeCharacterVirtualSettings. 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
-
getShapeOffset
Copy the local offset applied to the shape. The settings are unaffected. (native attribute: mShapeOffset)- Specified by:
getShapeOffsetin interfaceConstCharacterVirtualSettings- Returns:
- a new offset vector (in local coordinates)
-
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 referencedCharacterVirtualSettings. -
targetVa
public long targetVa()Return the address of the nativeCharacterVirtualSettings. No objects are affected.- Specified by:
targetVain interfaceConstJoltPhysicsObject- Overrides:
targetVain classJoltPhysicsObject- Returns:
- a virtual address (not zero)
-
toRef
Create another counted reference to the nativeCharacterVirtualSettings.
-