Interface ConstCharacterVirtual
- All Superinterfaces:
Comparable<ConstJoltPhysicsObject>,ConstCharacterBase,ConstJoltPhysicsObject
- All Known Implementing Classes:
CharacterVirtual,CharacterVirtualRef
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.booleancanWalkStairs(Vec3Arg desiredVelocity) Test whether the character has moved onto a steep slope.Access the list of contacts.Calculate the location of the character's center of mass.Calculate the local-to-system transform of the character's center of mass.floatReturn the thickness of the character's padding.booleanTest whether enhanced internal edge removal is enabled.floatReturn the maximum angle for merging during hit reduction.Return the ID of the inner body.Return the linear velocity of the character.floatgetMass()Return the character's mass.booleanTest whether the last collision check discarded one or more hits.intReturn the maximum number of hits to be collected.floatReturn the maximum force applied to other bodies.floatReturn how quickly penetration is resolved.Copy the location of the character.Copy the orientation of the character.Copy the local offset applied to the shape.longReturn the character's user data: can be used for anything.Calculate the character's local-to-system coordinate transform.booleanhasCollidedWith(ConstBodyId bodyId) Test whether the character is in contact with or collided with the specified body during the previous time step.booleanTest whether the character is in contact with or has collided with the specified character during the previous time step.Methods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstCharacterBase
getCosMaxSlopeAngle, getGroundBodyId, getGroundMaterial, getGroundNormal, getGroundPosition, getGroundState, getGroundSubShapeId, getGroundUserData, getGroundVelocity, getShape, getUp, isSlopeTooSteep, isSupported, saveStateMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, va
-
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, otherwise false
-
getActiveContacts
ContactList getActiveContacts()Access the list of contacts. The character is unaffected.- Returns:
- a new JVM object with the pre-existing native object assigned
-
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, otherwise false
-
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
-
getInnerBodyId
BodyId getInnerBodyId()Return the ID of the inner body. The character is unaffected.- Returns:
- the ID, or
nullif none
-
getLinearVelocity
Vec3 getLinearVelocity()Return 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, otherwise false
-
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)
-
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)
-
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
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 (not null, unaffected)- Returns:
- true if contact or collision, otherwise false
-
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, otherwise false
-