Documentation
¶
Overview ¶
A node used as a child of a graphics.gd/classdb/VehicleBody3D parent to simulate the behavior of one of its wheels. This node also acts as a collider to detect if the wheel is touching a surface.
Note: This class has known issues and isn't designed to provide realistic 3D vehicle physics. If you want advanced vehicle physics, you may need to write your own physics integration using another graphics.gd/classdb/PhysicsBody3D class.
Index ¶
- type Advanced
- type Any
- type Extension
- type ID
- type Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsNode3D() Node3D.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsVehicleWheel3D() Instance
- func (self Instance) Brake() Float.X
- func (self Instance) DampingCompression() Float.X
- func (self Instance) DampingRelaxation() Float.X
- func (self Instance) EngineForce() Float.X
- func (self Instance) GetContactBody() Node3D.Instance
- func (self Instance) GetContactNormal() Vector3.XYZ
- func (self Instance) GetContactPoint() Vector3.XYZ
- func (self Instance) GetRpm() Float.X
- func (self Instance) GetSkidinfo() Float.X
- func (self Instance) ID() ID
- func (self Instance) IsInContact() bool
- func (self Instance) SetBrake(value Float.X)
- func (self Instance) SetDampingCompression(value Float.X)
- func (self Instance) SetDampingRelaxation(value Float.X)
- func (self Instance) SetEngineForce(value Float.X)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetSteering(value Float.X)
- func (self Instance) SetSuspensionMaxForce(value Float.X)
- func (self Instance) SetSuspensionStiffness(value Float.X)
- func (self Instance) SetSuspensionTravel(value Float.X)
- func (self Instance) SetUseAsSteering(value bool)
- func (self Instance) SetUseAsTraction(value bool)
- func (self Instance) SetWheelFrictionSlip(value Float.X)
- func (self Instance) SetWheelRadius(value Float.X)
- func (self Instance) SetWheelRestLength(value Float.X)
- func (self Instance) SetWheelRollInfluence(value Float.X)
- func (self Instance) Steering() Float.X
- func (self Instance) SuspensionMaxForce() Float.X
- func (self Instance) SuspensionStiffness() Float.X
- func (self Instance) SuspensionTravel() Float.X
- func (self Instance) UseAsSteering() bool
- func (self Instance) UseAsTraction() bool
- func (self Instance) Virtual(name string) reflect.Value
- func (self Instance) WheelFrictionSlip() Float.X
- func (self Instance) WheelRadius() Float.X
- func (self Instance) WheelRestLength() Float.X
- func (self Instance) WheelRollInfluence() Float.X
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsVehicleWheel3D ¶
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Instance ¶
type Instance [1]gdclass.VehicleWheel3D
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AsVehicleWheel3D ¶
func (Instance) DampingCompression ¶
func (Instance) DampingRelaxation ¶
func (Instance) EngineForce ¶
func (Instance) GetContactBody ¶
Returns the contacting body node if valid in the tree, as graphics.gd/classdb/Node3D. At the moment, graphics.gd/classdb/GridMap is not supported so the node will be always of type graphics.gd/classdb/PhysicsBody3D.
Returns null if the wheel is not in contact with a surface, or the contact body is not a graphics.gd/classdb/PhysicsBody3D.
func (Instance) GetContactNormal ¶
Returns the normal of the suspension's collision in world space if the wheel is in contact. If the wheel isn't in contact with anything, returns a vector pointing directly along the suspension axis toward the vehicle in world space.
func (Instance) GetContactPoint ¶
Returns the point of the suspension's collision in world space if the wheel is in contact. If the wheel isn't in contact with anything, returns the maximum point of the wheel's ray cast in world space, which is defined by wheel_rest_length + wheel_radius.
func (Instance) GetSkidinfo ¶
Returns a value between 0.0 and 1.0 that indicates whether this wheel is skidding. 0.0 is skidding (the wheel has lost grip, e.g. icy terrain), 1.0 means not skidding (the wheel has full grip, e.g. dry asphalt road).
func (Instance) IsInContact ¶
Returns true if this wheel is in contact with a surface.