Interface ConstCharacterBase
- All Superinterfaces:
Comparable<JoltPhysicsObject>
,ConstJoltPhysicsObject
- All Known Subinterfaces:
ConstCharacter
,ConstCharacterVirtual
- All Known Implementing Classes:
Character
,CharacterBase
,CharacterRef
,CharacterRefC
,CharacterVirtual
,CharacterVirtualRef
,CharacterVirtualRefC
Read-only access to a
CharacterBase
. (native type: const
CharacterBase)-
Method Summary
Modifier and TypeMethodDescriptionfloat
Return the maximum slope the character can walk on.int
Return 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.int
Identify the face on the supporting surface where contact is occurring.long
Return the user data of the supporting surface.Copy the world-space velocity of the supporting surface.getShape()
Access the character's shape.getUp()
Copy the character's "up" direction.boolean
isSlopeTooSteep
(Vec3Arg normal) Test whether the specified normal direction is too steep.boolean
Test whether the character is supported.void
saveState
(StateRecorder recorder) Save the character's state to the specified recorder.Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa
-
Method Details
-
getCosMaxSlopeAngle
float getCosMaxSlopeAngle()Return the maximum slope the character can walk on. The character is unaffected.- Returns:
- the cosine of the slope angle
-
getGroundBodyId
int getGroundBodyId()Return the body ID of the supporting surface. The character is unaffected.- Returns:
- an ID value
-
getGroundMaterial
ConstPhysicsMaterial getGroundMaterial()Access the material of the supporting surface. The character is unaffected.- Returns:
- a new JVM object with the pre-existing native object assigned, or
else
null
-
getGroundNormal
Vec3 getGroundNormal()Copy the normal direction at the point of contact with the supporting surface. The character is unaffected.- Returns:
- a new direction vector (in system coordinates)
-
getGroundPosition
RVec3 getGroundPosition()Copy the location of the point of contact with the supporting surface. The character is unaffected.- Returns:
- a new location vector (in system coordinates)
-
getGroundState
EGroundState getGroundState()Return the relationship between the character and its supporting surface. The character is unaffected.- Returns:
- an enum value (not null)
-
getGroundSubShapeId
int getGroundSubShapeId()Identify the face on the supporting surface where contact is occurring. The character is unaffected.- Returns:
- a
SubShapeID
value
-
getGroundUserData
long getGroundUserData()Return the user data of the supporting surface. The character is unaffected.- Returns:
- the 64-bit value
-
getGroundVelocity
Vec3 getGroundVelocity()Copy the world-space velocity of the supporting surface. The character is unaffected.- Returns:
- a new velocity vector (meters per second in system coordinates)
-
getShape
ConstShape getShape()Access the character's shape. The character is unaffected.- Returns:
- a new immutable JVM object with the pre-existing native object
assigned, or
null
if none
-
getUp
Vec3 getUp()Copy the character's "up" direction. The character is unaffected.- Returns:
- a new direction vector
-
isSlopeTooSteep
Test whether the specified normal direction is too steep. The character is unaffected.- Parameters:
normal
- the surface normal to test (not null, unaffected)- Returns:
true
if too steep, otherwisefalse
-
isSupported
boolean isSupported()Test whether the character is supported. The character is unaffected.- Returns:
true
if supported, otherwisefalse
-
saveState
Save the character's state to the specified recorder. The character is unaffected.- Parameters:
recorder
- the recorder to save to (not null)
-