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 TypeMethodDescriptionfloat
Return the wheel's angular velocity.int
Return 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.int
Return ID of the sub-shape that's supporting the vehicle.float
Return the lateral (sideways) component of the impulse applied to the wheel.float
Return the forward component of the impulse applied to the wheel.float
Return the wheel's rotation angle.Access the settings used to create this wheel.float
Return the steering angle.float
Return the total impulse applied to the suspension.float
Return the length of the suspension.boolean
Test whether the wheel is supported.boolean
Test 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, va
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods 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:
getAngularVelocity
in 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:
getContactBodyId
in interfaceConstWheel
- Returns:
- the body ID
-
getContactLateral
Copy the wheel's lateral (sideways) direction.- Specified by:
getContactLateral
in interfaceConstWheel
- Returns:
- a new direction vector (in system coordinates)
-
getContactLongitudinal
Copy the wheel's longitudinal direction.- Specified by:
getContactLongitudinal
in interfaceConstWheel
- Returns:
- a new direction vector (in system coordinates)
-
getContactNormal
Copy the contact normal direction.- Specified by:
getContactNormal
in interfaceConstWheel
- Returns:
- a new direction vector (in system coordinates)
-
getContactPointVelocity
Copy the velocity of the contact point.- Specified by:
getContactPointVelocity
in interfaceConstWheel
- Returns:
- a new velocity vector (meters per second in system coordinates)
-
getContactPosition
Copy the location of the contact point.- Specified by:
getContactPosition
in 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:
getContactSubShapeId
in interfaceConstWheel
- Returns:
- the sub-shape ID
-
getLateralLambda
public float getLateralLambda()Return the lateral (sideways) component of the impulse applied to the wheel.- Specified by:
getLateralLambda
in 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:
getLongitudinalLambda
in interfaceConstWheel
- Returns:
- the impulse component (in Newton seconds)
-
getRotationAngle
public float getRotationAngle()Return the wheel's rotation angle.- Specified by:
getRotationAngle
in interfaceConstWheel
- Returns:
- the angle (in radians)
-
getSettings
Access the settings used to create this wheel.- Specified by:
getSettings
in interfaceConstWheel
- Returns:
- a new JVM object with the pre-existing native object assigned
-
getSteerAngle
public float getSteerAngle()Return the steering angle.- Specified by:
getSteerAngle
in interfaceConstWheel
- Returns:
- the leftward angle (in radians, ≥-Pi, ≤Pi)
-
getSuspensionLambda
public float getSuspensionLambda()Return the total impulse applied to the suspension.- Specified by:
getSuspensionLambda
in interfaceConstWheel
- Returns:
- the magnitude of the impulse (in Newton seconds)
-
getSuspensionLength
public float getSuspensionLength()Return the length of the suspension.- Specified by:
getSuspensionLength
in 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:
hasContact
in interfaceConstWheel
- Returns:
true
if supported, otherwisefalse
-
hasHitHardPoint
public boolean hasHitHardPoint()Test whether the suspension has hit its hard point.- Specified by:
hasHitHardPoint
in interfaceConstWheel
- Returns:
true
if hit, otherwisefalse
-