Interface ConstCharacterVirtual
- All Superinterfaces:
Comparable<JoltPhysicsObject>
,ConstCharacterBase
,ConstJoltPhysicsObject
- All Known Implementing Classes:
CharacterVirtual
,CharacterVirtualRef
,CharacterVirtualRefC
Read-only access to a
CharacterVirtual
. (native type: const
CharacterVirtual)-
Method Summary
Modifier and TypeMethodDescriptioncancelVelocityTowardsSteepSlopes
(Vec3Arg desiredVelocity) Convert the specified velocity to one that won't climb steep slopes.boolean
canWalkStairs
(Vec3Arg desiredVelocity) Test whether the character has moved onto a steep slope.Copy the list of active contacts.Calculate the location of the character's center of mass.Calculate the local-to-system transform of the character's center of mass.float
Return the thickness of the character's padding.boolean
Test whether enhanced internal edge removal is enabled.float
Return the maximum angle for merging during hit reduction.int
getId()
Return the character's ID.int
Return the ID of the inner body.Copy the linear velocity of the character.float
getMass()
Return the character's mass.boolean
Test whether the last collision check discarded one or more hits.int
Return the maximum number of hits to be collected.float
Return the maximum force applied to other bodies.float
Return how quickly penetration is resolved.Copy the location of the character.void
getPositionAndRotation
(RVec3 storeLocation, Quat storeOrientation) Copy the position of the character.Copy the orientation of the character.Copy the local offset applied to the shape.Return a TransformedShape that represents the volume occupied by the character.long
Return the character's user data: can be used for anything.Calculate the character's local-to-system coordinate transform.boolean
hasCollidedWith
(int bodyId) Test whether the character is in contact with or collided with the specified body during the previous time step.boolean
Test whether the character is in contact with or has collided with the specified character during the previous time step.toRefC()
Create a counted reference to the nativeCharacterVirtual
.Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface com.github.stephengold.joltjni.readonly.ConstCharacterBase
getCosMaxSlopeAngle, getGroundBodyId, getGroundMaterial, getGroundNormal, getGroundPosition, getGroundState, getGroundSubShapeId, getGroundUserData, getGroundVelocity, getShape, getUp, isSlopeTooSteep, isSupported, saveState
Methods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa
-
Method Details
-
cancelVelocityTowardsSteepSlopes
Convert the specified velocity to one that won't climb steep slopes. The character is unaffected.- Parameters:
desiredVelocity
- velocity vector (in system coordinates, not null, unaffected)- Returns:
- a new velocity vector (in system coordinates)
-
canWalkStairs
Test whether the character has moved onto a steep slope. The character is unaffected.- Parameters:
desiredVelocity
- velocity vector (in system coordinates, not null, unaffected)- Returns:
true
if too step to walk, otherwisefalse
-
getActiveContacts
ConstContact[] getActiveContacts()Copy the list of active contacts. The character is unaffected.- Returns:
- a new array of new objects
-
getCenterOfMassPosition
RVec3 getCenterOfMassPosition()Calculate the location of the character's center of mass. The character is unaffected.- Returns:
- a new location vector (in system coordinates)
-
getCenterOfMassTransform
RMat44 getCenterOfMassTransform()Calculate the local-to-system transform of the character's center of mass. The character is unaffected.- Returns:
- a new coordinate transform matrix
-
getCharacterPadding
float getCharacterPadding()Return the thickness of the character's padding. The character is unaffected.- Returns:
- the thickness (in meters)
-
getEnhancedInternalEdgeRemoval
boolean getEnhancedInternalEdgeRemoval()Test whether enhanced internal edge removal is enabled. The character is unaffected.- Returns:
true
if enabled, otherwisefalse
-
getHitReductionCosMaxAngle
float getHitReductionCosMaxAngle()Return the maximum angle for merging during hit reduction. The character is unaffected.- Returns:
- the cosine of the maximum angle, or -1 if hit reduction is disabled
-
getId
int getId()Return the character's ID. The character is unaffected.- Returns:
- a
CharacterId
value
-
getInnerBodyId
int getInnerBodyId()Return the ID of the inner body. The character is unaffected.- Returns:
- the
BodyID
value
-
getLinearVelocity
Vec3 getLinearVelocity()Copy the linear velocity of the character. The character is unaffected.- Returns:
- a new velocity vector (meters per second in system coordinates)
-
getMass
float getMass()Return the character's mass. The character is unaffected.- Returns:
- the mass (in kilograms)
-
getMaxHitsExceeded
boolean getMaxHitsExceeded()Test whether the last collision check discarded one or more hits. The character is unaffected.- Returns:
true
if discarded hits, otherwisefalse
-
getMaxNumHits
int getMaxNumHits()Return the maximum number of hits to be collected. The character is unaffected.- Returns:
- the limit (≥0)
-
getMaxStrength
float getMaxStrength()Return the maximum force applied to other bodies. The character is unaffected.- Returns:
- the force (in Newtons)
-
getPenetrationRecoverySpeed
float getPenetrationRecoverySpeed()Return how quickly penetration is resolved. The character is unaffected.- Returns:
- the resolution fraction (0=never resolved, 1=all in one update)
-
getPosition
RVec3 getPosition()Copy the location of the character. The character is unaffected.- Returns:
- a new location vector (in system coordinates)
-
getPositionAndRotation
Copy the position of the character. The character is unaffected.- Parameters:
storeLocation
- storage for the location (in system coordinates, not null, modified)storeOrientation
- storage for the orientation (in system coordinates, not null, modified)
-
getRotation
Quat getRotation()Copy the orientation of the character. The character is unaffected.- Returns:
- a new rotation quaternion (in system coordinates)
-
getShapeOffset
Vec3 getShapeOffset()Copy the local offset applied to the shape. The character is unaffected.- Returns:
- a new offset vector (in local coordinates)
-
getTransformedShape
TransformedShape getTransformedShape()Return a TransformedShape that represents the volume occupied by the character. The character is unaffected.- Returns:
- a new object
-
getUserData
long getUserData()Return the character's user data: can be used for anything. The character is unaffected.- Returns:
- the value
-
getWorldTransform
RMat44 getWorldTransform()Calculate the character's local-to-system coordinate transform. The character is unaffected.- Returns:
- a new transform matrix
-
hasCollidedWith
boolean hasCollidedWith(int bodyId) Test whether the character is in contact with or collided with the specified body during the previous time step. The character is unaffected.- Parameters:
bodyId
- the ID of the body to test against- Returns:
true
if contact or collision, otherwisefalse
-
hasCollidedWith
Test whether the character is in contact with or has collided with the specified character during the previous time step. The current character is unaffected.- Parameters:
other
- the character to test against (not null, unaffected)- Returns:
true
if contact or collision, otherwisefalse
-
toRefC
CharacterVirtualRefC toRefC()Create a counted reference to the nativeCharacterVirtual
.- Returns:
- a new JVM object with a new native object assigned
-