java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.SerializableObject
com.github.stephengold.joltjni.WheelSettings
- All Implemented Interfaces:
ConstJoltPhysicsObject,ConstSerializableObject,ConstWheelSettings,RefTarget,AutoCloseable,Comparable<JoltPhysicsObject>
- Direct Known Subclasses:
WheelSettingsTv,WheelSettingsWv
Settings used to construct a
Wheel.-
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermine where to apply tire forces.Copy the location of the attachment point.floatReturn the radius of the wheel.abstract intCount the active references to the nativeWheelSettings.Copy the steering axis (upward direction).Copy the downward direction of the suspension.Copy the location where tire forces will be applied if the force-point option is enabled.floatReturn the maximum displacement from the attachment point.floatReturn the minimum displacement from the attachment point.floatReturn the suspension preload length.Access the settings for the suspension spring.Copy the forward direction when steering is neutral.Copy the "up" direction when steering is neutral.floatgetWidth()Return the width of the wheel.voidrestoreBinaryState(StreamIn stream) Load settings from the specified binary stream.voidsaveBinaryState(StreamOut stream) Save the settings to the specified binary stream.abstract voidMark the nativeWheelSettingsas embedded.setEnableSuspensionForcePoint(boolean enable) Alter where to apply tire forces.setPosition(Vec3Arg position) Relocate the attachment point.setRadius(float radius) Alter the radius of the wheel.setSteeringAxis(Vec3Arg direction) Alter the steering axis (upward direction).setSuspensionDirection(Vec3Arg direction) Alter the downward direction of the suspension.setSuspensionForcePoint(Vec3Arg location) Alter the location where tire forces will be applied if the force-point option is enabled.setSuspensionMaxLength(float length) Alter the maximum displacement from the attachment point.setSuspensionMinLength(float length) Alter the minimum displacement from the attachment point.setSuspensionPreloadLength(float length) Alter the suspension preload length.setWheelForward(Vec3Arg direction) Alter the forward direction when steering is neutral.setWheelUp(Vec3Arg direction) Alter the "up" direction when steering is neutral.setWidth(float width) Alter the width of the wheel.abstract ReftoRef()Create a counted reference to the nativeWheelSettings.Methods inherited from class com.github.stephengold.joltjni.SerializableObject
getRttiMethods 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, targetVaMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstSerializableObject
getRtti
-
Method Details
-
restoreBinaryState
Load settings from the specified binary stream.- Parameters:
stream- the stream to read from (not null)
-
setEnableSuspensionForcePoint
Alter where to apply tire forces. (native attribute: mEnableSuspensionForcePoint)- Parameters:
enable-trueto apply at the configured suspension-force point,falseto apply at the wheel's point of contact (default=false)- Returns:
- the modified settings, for chaining
-
setPosition
Relocate the attachment point. (native attribute: mPosition)- Parameters:
position- the location of the attachment point (in the body's local coordinates, not null, unaffected, default=(0,0,0))- Returns:
- the modified settings, for chaining
-
setRadius
Alter the radius of the wheel. (native attribute: mRadius)- Parameters:
radius- the desired radius (in meters, default=0.3)- Returns:
- the modified settings, for chaining
-
setSteeringAxis
Alter the steering axis (upward direction). (native attribute: mSteeringAxis)- Parameters:
direction- the desired direction (not null, unaffected, default=(0,1,0))- Returns:
- the modified settings, for chaining
-
setSuspensionDirection
Alter the downward direction of the suspension. (native attribute: mSuspensionDirection)- Parameters:
direction- the desired direction (not null, unaffected, default=(0,-1,0))- Returns:
- the modified settings, for chaining
-
setSuspensionForcePoint
Alter the location where tire forces will be applied if the force-point option is enabled. (native attribute: mSuspensionForcePoint)- Parameters:
location- the desired location (in the body coordinates, not null, unaffected, default=(0,0,0))- Returns:
- the modified settings, for chaining
-
setSuspensionMaxLength
Alter the maximum displacement from the attachment point. (native attribute: mSuspensionMaxLength)- Parameters:
length- the desired limit (in meters, default=0.5)- Returns:
- the modified settings, for chaining
-
setSuspensionMinLength
Alter the minimum displacement from the attachment point. (native attribute: mSuspensionMinLength)- Parameters:
length- the desired limit (in meters, default=0.3)- Returns:
- the modified settings, for chaining
-
setSuspensionPreloadLength
Alter the suspension preload length. (native attribute: mSuspensionPreloadLength)- Parameters:
length- the desired offset (in meters, default=0)- Returns:
- the modified settings, for chaining
-
setWheelForward
Alter the forward direction when steering is neutral. (native attribute: mWheelForward)- Parameters:
direction- the desired direction (not null, unaffected, default=(0,0,1))- Returns:
- the modified settings, for chaining
-
setWheelUp
Alter the "up" direction when steering is neutral. (native attribute: mWheelUp)- Parameters:
direction- the desired direction (not null, unaffected, default=(0,1,0))- Returns:
- the modified settings, for chaining
-
setWidth
Alter the width of the wheel. (native attribute: mWidth)- Parameters:
width- the desired width (in meters, default=0.1)- Returns:
- the modified settings, for chaining
-
getEnableSuspensionForcePoint
public boolean getEnableSuspensionForcePoint()Determine where to apply tire forces. The settings are unaffected. (native attribute: mEnableSuspensionForcePoint)- Specified by:
getEnableSuspensionForcePointin interfaceConstWheelSettings- Returns:
trueif applied at the configured suspension-force point,falseif applied at the wheel's point of contact
-
getPosition
Copy the location of the attachment point. The settings are unaffected. (native attribute: mPosition)- Specified by:
getPositionin interfaceConstWheelSettings- Returns:
- a new location vector (in the body's local coordinates)
-
getRadius
public float getRadius()Return the radius of the wheel. The settings are unaffected. (native attribute: mRadius)- Specified by:
getRadiusin interfaceConstWheelSettings- Returns:
- the radius (in meters)
-
getSteeringAxis
Copy the steering axis (upward direction). The settings are unaffected. (native attribute: mSteeringAxis)- Specified by:
getSteeringAxisin interfaceConstWheelSettings- Returns:
- a new direction vector
-
getSuspensionDirection
Copy the downward direction of the suspension. The settings are unaffected. (native attribute: mSuspensionDirection)- Specified by:
getSuspensionDirectionin interfaceConstWheelSettings- Returns:
- a new direction vector
-
getSuspensionForcePoint
Copy the location where tire forces will be applied if the force-point option is enabled. The settings are unaffected. (native attribute: mSuspensionForcePoint)- Specified by:
getSuspensionForcePointin interfaceConstWheelSettings- Returns:
- a new location vector (in body coordinates)
-
getSuspensionMaxLength
public float getSuspensionMaxLength()Return the maximum displacement from the attachment point. The settings are unaffected. (native attribute: mSuspensionMaxLength)- Specified by:
getSuspensionMaxLengthin interfaceConstWheelSettings- Returns:
- the distance (in meters)
-
getSuspensionMinLength
public float getSuspensionMinLength()Return the minimum displacement from the attachment point. The settings are unaffected. (native attribute: mSuspensionMinLength)- Specified by:
getSuspensionMinLengthin interfaceConstWheelSettings- Returns:
- the distance (in meters)
-
getSuspensionPreloadLength
public float getSuspensionPreloadLength()Return the suspension preload length. The settings are unaffected. (native attribute: mSuspensionPreloadLength)- Specified by:
getSuspensionPreloadLengthin interfaceConstWheelSettings- Returns:
- the offset (in meters)
-
getSuspensionSpring
Access the settings for the suspension spring. (native attribute: mSuspensionSpring)- Specified by:
getSuspensionSpringin interfaceConstWheelSettings- Returns:
- a new JVM object with the pre-existing native object assigned
-
getWheelForward
Copy the forward direction when steering is neutral. The settings are unaffected. (native attribute: mWheelForward)- Specified by:
getWheelForwardin interfaceConstWheelSettings- Returns:
- a new direction vector
-
getWheelUp
Copy the "up" direction when steering is neutral. The settings are unaffected. (native attribute: mWheelUp)- Specified by:
getWheelUpin interfaceConstWheelSettings- Returns:
- a new direction vector
-
getWidth
public float getWidth()Return the width of the wheel. The settings are unaffected. (native attribute: mWidth)- Specified by:
getWidthin interfaceConstWheelSettings- Returns:
- the width (in meters)
-
saveBinaryState
Save the settings to the specified binary stream. The settings are unaffected.- Specified by:
saveBinaryStatein interfaceConstWheelSettings- Parameters:
stream- the stream to write to (not null)
-
getRefCount
public abstract int getRefCount()Count the active references to the nativeWheelSettings. The settings are unaffected.- Specified by:
getRefCountin interfaceRefTarget- Returns:
- the count (≥0)
-
setEmbedded
public abstract void setEmbedded()Mark the nativeWheelSettingsas embedded.- Specified by:
setEmbeddedin interfaceRefTarget
-
toRef
Create a counted reference to the nativeWheelSettings.
-