java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.Wheel
- All Implemented Interfaces:
ConstJoltPhysicsObject,ConstWheel,AutoCloseable,Comparable<JoltPhysicsObject>
A single wheel of a vehicle.
-
Method Summary
Modifier and TypeMethodDescriptionfloatReturn the wheel's angular velocity.intReturn the ID of the body that's supporting the wheel.Copy the wheel's lateral (sideways) direction.Copy the wheel's longitudinal direction.Copy the contact normal direction.Copy the velocity of the contact point.Copy the location of the contact point.intReturn ID of the sub-shape that's supporting the vehicle.floatReturn the lateral (sideways) component of the impulse applied to the wheel.floatReturn the forward component of the impulse applied to the wheel.floatReturn the wheel's rotation angle.Access the settings used to create this wheel.floatReturn the steering angle.floatReturn the total impulse applied to the suspension.floatReturn the length of the suspension.booleanTest whether the wheel is supported.booleanTest whether the suspension has hit its hard point.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, 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, targetVa
-
Method Details
-
getAngularVelocity
public float getAngularVelocity()Return the wheel's angular velocity.- Specified by:
getAngularVelocityin interfaceConstWheel- Returns:
- the angular velocity (in radians per second, positive when the vehicle is moving forward)
-
getContactBodyId
public int getContactBodyId()Return the ID of the body that's supporting the wheel. (native method: GetContactBodyID)- Specified by:
getContactBodyIdin interfaceConstWheel- Returns:
- the body ID
-
getContactLateral
Copy the wheel's lateral (sideways) direction.- Specified by:
getContactLateralin interfaceConstWheel- Returns:
- a new direction vector (in system coordinates)
-
getContactLongitudinal
Copy the wheel's longitudinal direction.- Specified by:
getContactLongitudinalin interfaceConstWheel- Returns:
- a new direction vector (in system coordinates)
-
getContactNormal
Copy the contact normal direction.- Specified by:
getContactNormalin interfaceConstWheel- Returns:
- a new direction vector (in system coordinates)
-
getContactPointVelocity
Copy the velocity of the contact point.- Specified by:
getContactPointVelocityin interfaceConstWheel- Returns:
- a new velocity vector (meters per second in system coordinates)
-
getContactPosition
Copy the location of the contact point.- Specified by:
getContactPositionin interfaceConstWheel- Returns:
- a new location vector (in system coordinates)
-
getContactSubShapeId
public int getContactSubShapeId()Return ID of the sub-shape that's supporting the vehicle. (native method: GetContactSubShapeID)- Specified by:
getContactSubShapeIdin interfaceConstWheel- Returns:
- a
SubShapeIDvalue
-
getLateralLambda
public float getLateralLambda()Return the lateral (sideways) component of the impulse applied to the wheel.- Specified by:
getLateralLambdain interfaceConstWheel- Returns:
- the impulse component (in Newton seconds)
-
getLongitudinalLambda
public float getLongitudinalLambda()Return the forward component of the impulse applied to the wheel.- Specified by:
getLongitudinalLambdain interfaceConstWheel- Returns:
- the impulse component (in Newton seconds)
-
getRotationAngle
public float getRotationAngle()Return the wheel's rotation angle.- Specified by:
getRotationAnglein interfaceConstWheel- Returns:
- the angle (in radians)
-
getSettings
Access the settings used to create this wheel.- Specified by:
getSettingsin interfaceConstWheel- Returns:
- a new JVM object with the pre-existing native object assigned
-
getSteerAngle
public float getSteerAngle()Return the steering angle.- Specified by:
getSteerAnglein interfaceConstWheel- Returns:
- the leftward angle (in radians, ≥-Pi, ≤Pi)
-
getSuspensionLambda
public float getSuspensionLambda()Return the total impulse applied to the suspension.- Specified by:
getSuspensionLambdain interfaceConstWheel- Returns:
- the magnitude of the impulse (in Newton seconds)
-
getSuspensionLength
public float getSuspensionLength()Return the length of the suspension.- Specified by:
getSuspensionLengthin interfaceConstWheel- Returns:
- the distance between the axle and the hard point (in meters)
-
hasContact
public boolean hasContact()Test whether the wheel is supported.- Specified by:
hasContactin interfaceConstWheel- Returns:
trueif supported, otherwisefalse
-
hasHitHardPoint
public boolean hasHitHardPoint()Test whether the suspension has hit its hard point.- Specified by:
hasHitHardPointin interfaceConstWheel- Returns:
trueif hit, otherwisefalse
-