java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.CharacterRefC
- All Implemented Interfaces:
ConstCharacter,ConstCharacterBase,ConstJoltPhysicsObject,AutoCloseable,Comparable<JoltPhysicsObject>
A counted reference to a
ConstCharacter. (native type:
RefConst<Character>)-
Method Summary
Modifier and TypeMethodDescriptionintReturn the ID of the body associated with the character.Copy the location of the rigid body's center of mass using the locking body interface.getCenterOfMassPosition(boolean lockBodies) Copy the location of the rigid body's center of mass.Generate settings to reconstruct the character, using the locking body interface.getCharacterSettings(boolean lockBodies) Generate settings to reconstruct the character.floatReturn the maximum slope the character can walk on.intReturn the body ID of the supporting surface.Access the material of the supporting surface.Copy the normal direction at the point of contact with the supporting surface.Copy the location of the point of contact with the supporting surface.Return the relationship between the character and its supporting surface.intIdentify the face on the supporting surface where contact is occurring.longReturn the user data of the supporting surface.Copy the world-space velocity of the supporting surface.intgetLayer()Return the character's object layer, using the locking body interface.intgetLayer(boolean lockBodies) Return the character's object layer.Copy the linear velocity of the character using the locking body interface.getLinearVelocity(boolean lockBodies) Copy the linear velocity of the character.Copy the location of the character using the locking body interface.getPosition(boolean lockBodies) Copy the location of the character.voidgetPositionAndRotation(RVec3 storeLocation, Quat storeOrientation) Copy the position of the associated body using the locking body interface.voidgetPositionAndRotation(RVec3 storeLocation, Quat storeOrientation, boolean lockBodies) Copy the position of the associated body.getPtr()Temporarily access the referencedConstCharacter.intCount the active references to the nativeCharacter.Copy the orientation of the character using the locking body interface.getRotation(boolean lockBodies) Copy the orientation of the character.getShape()Access the character's shape.voidUpdate the specified counted reference to refer to the character's shape.Generate a TransformedShape that represents the volume occupied by the character, using the locking body interface.getTransformedShape(boolean lockBodies) Return a TransformedShape that represents the volume occupied by the character.getUp()Copy the character's "up" direction.Calculate the character's local-to-system coordinate transform using the locking body interface.getWorldTransform(boolean lockBodies) Calculate the character's local-to-system coordinate transform.booleanisSlopeTooSteep(Vec3Arg normal) Test whether the specified normal direction is too steep.booleanTest whether the character is supported.voidsaveState(StateRecorder recorder) Save the character's state to the specified recorder.longtargetVa()Return the address of the nativeCharacter.toRefC()Create another counted reference to the nativeCharacter.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
-
Method Details
-
getPtr
Temporarily access the referencedConstCharacter.- Returns:
- a new JVM object with the pre-existing native object assigned
-
getBodyId
public int getBodyId()Return the ID of the body associated with the character. The character is unaffected. (native function: GetBodyID)- Specified by:
getBodyIdin interfaceConstCharacter- Returns:
- the
BodyIDvalue
-
getCenterOfMassPosition
Copy the location of the rigid body's center of mass using the locking body interface. The character is unaffected.- Specified by:
getCenterOfMassPositionin interfaceConstCharacter- Returns:
- a new location vector (in system coordinates)
-
getCenterOfMassPosition
Copy the location of the rigid body's center of mass. The character is unaffected.- Specified by:
getCenterOfMassPositionin interfaceConstCharacter- Parameters:
lockBodies-true→ use the locking body interface,false→ use the non-locking body interface (default=true)- Returns:
- a new location vector (in system coordinates)
-
getCharacterSettings
Generate settings to reconstruct the character, using the locking body interface. The character is unaffected.- Specified by:
getCharacterSettingsin interfaceConstCharacter- Returns:
- a new object
-
getCharacterSettings
Generate settings to reconstruct the character. The character is unaffected.- Specified by:
getCharacterSettingsin interfaceConstCharacter- Parameters:
lockBodies-true→ use the locking body interface,- Returns:
- a new object
-
getCosMaxSlopeAngle
public float getCosMaxSlopeAngle()Return the maximum slope the character can walk on. The character is unaffected.- Specified by:
getCosMaxSlopeAnglein interfaceConstCharacterBase- Returns:
- the cosine of the slope angle
-
getGroundBodyId
public int getGroundBodyId()Return the body ID of the supporting surface. The character is unaffected.- Specified by:
getGroundBodyIdin interfaceConstCharacterBase- Returns:
- the
BodyIDvalue
-
getGroundMaterial
Access the material of the supporting surface. The character is unaffected.- Specified by:
getGroundMaterialin interfaceConstCharacterBase- Returns:
- a new JVM object with the pre-existing native object assigned, or
else
null
-
getGroundNormal
Copy the normal direction at the point of contact with the supporting surface. The character is unaffected.- Specified by:
getGroundNormalin interfaceConstCharacterBase- Returns:
- a new direction vector (in system coordinates)
-
getGroundPosition
Copy the location of the point of contact with the supporting surface. The character is unaffected.- Specified by:
getGroundPositionin interfaceConstCharacterBase- Returns:
- a new location vector (in system coordinates)
-
getGroundState
Return the relationship between the character and its supporting surface. The character is unaffected.- Specified by:
getGroundStatein interfaceConstCharacterBase- Returns:
- an enum value (not
null)
-
getGroundSubShapeId
public int getGroundSubShapeId()Identify the face on the supporting surface where contact is occurring. The character is unaffected.- Specified by:
getGroundSubShapeIdin interfaceConstCharacterBase- Returns:
- a
SubShapeIDvalue
-
getGroundUserData
public long getGroundUserData()Return the user data of the supporting surface. The character is unaffected.- Specified by:
getGroundUserDatain interfaceConstCharacterBase- Returns:
- the 64-bit value
-
getGroundVelocity
Copy the world-space velocity of the supporting surface. The character is unaffected.- Specified by:
getGroundVelocityin interfaceConstCharacterBase- Returns:
- a new velocity vector (meters per second in system coordinates)
-
getLayer
public int getLayer()Return the character's object layer, using the locking body interface. The character is unaffected.- Specified by:
getLayerin interfaceConstCharacter- Returns:
- a layer index (≥0)
-
getLayer
public int getLayer(boolean lockBodies) Return the character's object layer. The character is unaffected.- Specified by:
getLayerin interfaceConstCharacter- Parameters:
lockBodies-true→ use the locking body interface,false→ use the non-locking body interface (default=true)- Returns:
- a layer index (≥0)
-
getLinearVelocity
Copy the linear velocity of the character using the locking body interface. The character is unaffected.- Specified by:
getLinearVelocityin interfaceConstCharacter- Returns:
- a new velocity vector (meters per second in system coordinates)
-
getLinearVelocity
Copy the linear velocity of the character. The character is unaffected.- Specified by:
getLinearVelocityin interfaceConstCharacter- Parameters:
lockBodies-true→ use the locking body interface,false→ use the non-locking body interface (default=true)- Returns:
- a new velocity vector (meters per second in system coordinates)
-
getPosition
Copy the location of the character using the locking body interface. The character is unaffected.- Specified by:
getPositionin interfaceConstCharacter- Returns:
- a new location vector (in system coordinates)
-
getPosition
Copy the location of the character. The character is unaffected.- Specified by:
getPositionin interfaceConstCharacter- Parameters:
lockBodies-true→ use the locking body interface,false→ use the non-locking body interface (default=true)- Returns:
- a new location vector (in system coordinates)
-
getPositionAndRotation
Copy the position of the associated body using the locking body interface. The character is unaffected.- Specified by:
getPositionAndRotationin interfaceConstCharacter- Parameters:
storeLocation- storage for the location (in system coordinates, notnull, modified)storeOrientation- storage for the orientation (in system coordinates, notnull, modified)
-
getPositionAndRotation
Copy the position of the associated body. The character is unaffected.- Specified by:
getPositionAndRotationin interfaceConstCharacter- Parameters:
storeLocation- storage for the location (in system coordinates, notnull, modified)storeOrientation- storage for the orientation (in system coordinates, notnull, modified)lockBodies-true→ use the locking body interface,false→ use the non-locking body interface (default=true)
-
getRefCount
public int getRefCount()Count the active references to the nativeCharacter. The settings are unaffected.- Specified by:
getRefCountin interfaceConstCharacterBase- Returns:
- the count (≥0)
-
getRotation
Copy the orientation of the character using the locking body interface. The character is unaffected.- Specified by:
getRotationin interfaceConstCharacter- Returns:
- a new rotation quaternion (in system coordinates)
-
getRotation
Copy the orientation of the character. The character is unaffected.- Specified by:
getRotationin interfaceConstCharacter- Parameters:
lockBodies-true→ use the locking body interface,false→ use the non-locking body interface (default=true)- Returns:
- a new rotation quaternion (in system coordinates)
-
getShape
Access the character's shape. The character is unaffected.- Specified by:
getShapein interfaceConstCharacterBase- Returns:
- a new immutable JVM object with the pre-existing native object
assigned, or
nullif none
-
getShape
Update the specified counted reference to refer to the character's shape. The character is unaffected.- Specified by:
getShapein interfaceConstCharacterBase- Parameters:
storeRef- storage for the reference (notnull, modified)
-
getTransformedShape
Generate a TransformedShape that represents the volume occupied by the character, using the locking body interface. The character is unaffected.- Specified by:
getTransformedShapein interfaceConstCharacter- Returns:
- a new object
-
getTransformedShape
Return a TransformedShape that represents the volume occupied by the character. The character is unaffected.- Specified by:
getTransformedShapein interfaceConstCharacter- Parameters:
lockBodies-true→ use the locking body interface,false→ use the non-locking body interface (default=true)- Returns:
- a new object
-
getUp
Copy the character's "up" direction. The character is unaffected.- Specified by:
getUpin interfaceConstCharacterBase- Returns:
- a new direction vector
-
getWorldTransform
Calculate the character's local-to-system coordinate transform using the locking body interface. The character is unaffected.- Specified by:
getWorldTransformin interfaceConstCharacter- Returns:
- a new coordinate transform matrix
-
getWorldTransform
Calculate the character's local-to-system coordinate transform. The character is unaffected.- Specified by:
getWorldTransformin interfaceConstCharacter- Parameters:
lockBodies-true→ use the locking body interface,false→ use the non-locking body interface (default=true)- Returns:
- a new transform matrix
-
isSlopeTooSteep
Test whether the specified normal direction is too steep. The character is unaffected.- Specified by:
isSlopeTooSteepin interfaceConstCharacterBase- Parameters:
normal- the surface normal to test (notnull, unaffected)- Returns:
trueif too steep, otherwisefalse
-
isSupported
public boolean isSupported()Test whether the character is supported. The character is unaffected.- Specified by:
isSupportedin interfaceConstCharacterBase- Returns:
trueif supported, otherwisefalse
-
saveState
Save the character's state to the specified recorder. The character is unaffected.- Specified by:
saveStatein interfaceConstCharacterBase- Parameters:
recorder- the recorder to save to (notnull)
-
targetVa
public long targetVa()Return the address of the nativeCharacter. No objects are affected.- Specified by:
targetVain interfaceConstJoltPhysicsObject- Overrides:
targetVain classJoltPhysicsObject- Returns:
- a virtual address (not zero)
-
toRefC
Create another counted reference to the nativeCharacter.- Specified by:
toRefCin interfaceConstCharacter- Returns:
- a new JVM object with a new native object assigned
-