Interface ConstCharacterBase
- All Superinterfaces:
AutoCloseable,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 TypeMethodDescriptionfloatReturn 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.intCount the active references to the native character.getShape()Access the character's shape.voidUpdate the specified counted reference to refer to the character's shape.getUp()Copy the character's "up" direction.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.Methods inherited from interface java.lang.Comparable
compareToMethods 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
SubShapeIDvalue
-
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)
-
getRefCount
int getRefCount()Count the active references to the native character. The character is unaffected.- Returns:
- the count (≥0)
-
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
nullif none
-
getShape
Update the specified counted reference to refer to the character's shape. The character is unaffected.- Parameters:
storeRef- storage for the reference (notnull, modified)
-
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:
trueif too steep, otherwisefalse
-
isSupported
boolean isSupported()Test whether the character is supported. The character is unaffected.- Returns:
trueif 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)
-