Skip to main content

VehiclePhysics

Complete API reference for VehiclePhysics, including constructors, attributes, virtual attributes, and methods.

Package: JAVARuntime

Category: Physics

Component: yes


public class VehiclePhysics extends Component

Constructors

SignatureDescription
VehiclePhysics(VehiclePhysics)Executes VehiclePhysics and returns after the underlying engine call finishes.
VehiclePhysics(Engine)Executes VehiclePhysics and returns after the underlying engine call finishes.
VehiclePhysics()Executes VehiclePhysics and returns after the underlying engine call finishes.

Attributes

NameTypeDescription
instanceVehiclePhysicsRepresents the instance value stored on this instance. Read or assign to update the property.

Virtual Attributes

NameTypeAccessDescription
angularDampingfloatget/setReturns the angular damping of the Rigidbody.
angularVelocityVector3get/setReturns the current angular velocity of the Rigidbody.
bouncinessfloatget/setReturns the bounciness of the Rigidbody.
freezePXbooleanget/setReturns whether movement on the X axis is frozen.
freezePYbooleanget/setReturns whether movement on the Y axis is frozen.
freezePZbooleanget/setReturns whether movement on the Z axis is frozen.
freezeRXbooleanget/setReturns whether rotation on the X axis is frozen.
freezeRYbooleanget/setReturns whether rotation on the Y axis is frozen.
freezeRZbooleanget/setReturns whether rotation on the Z axis is frozen.
frictionfloatget/setReturns the friction of the Rigidbody.
gravityEnabledbooleanget/setChecks whether gravity is enabled for the Rigidbody.
gravityMultiplierVector3get/setReturns the gravity multiplier of the Rigidbody.
linearDampingfloatget/setReturns the linear damping of the Rigidbody.
massfloatget/setReturns the mass of the Rigidbody.
physicsLayerPhysicsLayerget/setReturns the PhysicsLayer of the Rigidbody.
speedKMHfloatgetReturns the speed of the vehicle in KM/H.
suspensionLengthfloatget/setReturns the suspension length of the vehicle.
suspensionStiffnessfloatget/setReturns the suspension stiffness of the vehicle.
velocityVector3get/setReturns the current velocity of the Rigidbody.

Methods

SignatureReturnsDescription
setTorque(float, int)voidSets the torque for the specified wheel.
setBrake(float, int)voidSets the brake force for the specified wheel.
setSteer(float, int)voidSets the steering angle for the specified wheel (in degrees).
setMaxSpeed(float)voidSets the maximum speed the vehicle can reach (in KM/H). Used in the setSteerRelativeVelocity method as the maximum possible speed.
getWheels()List<VehicleWheel>Returns a list of all wheels on the vehicle.
addForce(Vector3)voidApplies a force to the Rigidbody in the specified direction.
addForce(float, float, float)voidApplies a force to the Rigidbody with the specified x, y and z values.
addForce(Vector3, Vector3)voidApplies a force to the Rigidbody at a specific relative position.
addVelocity(Vector3)voidAdds velocity to the Rigidbody in the specified direction.
addVelocity(float, float, float)voidAdds velocity to the Rigidbody with the specified x, y and z values.
addVelocityBySecond(Vector3)voidAdds velocity per second to the Rigidbody in the specified direction.
addVelocityBySecond(float, float, float)voidAdds velocity per second to the Rigidbody with the specified x, y and z values.