VehicleWheel3D

package
v0.0.0-...-535787f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2025 License: MIT Imports: 25 Imported by: 0

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

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 Any

type Any interface {
	gd.IsClass
	AsVehicleWheel3D() Instance
}

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

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]) AsNode

func (self *Extension[T]) AsNode() Node.Instance

func (*Extension[T]) AsNode3D

func (self *Extension[T]) AsNode3D() Node3D.Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsVehicleWheel3D

func (self *Extension[T]) AsVehicleWheel3D() Instance

type ID

type ID Object.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.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

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 New

func New() Instance

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsNode3D

func (self Instance) AsNode3D() Node3D.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsVehicleWheel3D

func (self Instance) AsVehicleWheel3D() Instance

func (Instance) Brake

func (self Instance) Brake() Float.X

func (Instance) DampingCompression

func (self Instance) DampingCompression() Float.X

func (Instance) DampingRelaxation

func (self Instance) DampingRelaxation() Float.X

func (Instance) EngineForce

func (self Instance) EngineForce() Float.X

func (Instance) GetContactBody

func (self Instance) GetContactBody() Node3D.Instance

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

func (self Instance) GetContactNormal() Vector3.XYZ

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

func (self Instance) GetContactPoint() Vector3.XYZ

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) GetRpm

func (self Instance) GetRpm() Float.X

Returns the rotational speed of the wheel in revolutions per minute.

func (Instance) GetSkidinfo

func (self Instance) GetSkidinfo() Float.X

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) ID

func (self Instance) ID() ID

func (Instance) IsInContact

func (self Instance) IsInContact() bool

Returns true if this wheel is in contact with a surface.

func (Instance) SetBrake

func (self Instance) SetBrake(value Float.X)

func (Instance) SetDampingCompression

func (self Instance) SetDampingCompression(value Float.X)

func (Instance) SetDampingRelaxation

func (self Instance) SetDampingRelaxation(value Float.X)

func (Instance) SetEngineForce

func (self Instance) SetEngineForce(value Float.X)

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetSteering

func (self Instance) SetSteering(value Float.X)

func (Instance) SetSuspensionMaxForce

func (self Instance) SetSuspensionMaxForce(value Float.X)

func (Instance) SetSuspensionStiffness

func (self Instance) SetSuspensionStiffness(value Float.X)

func (Instance) SetSuspensionTravel

func (self Instance) SetSuspensionTravel(value Float.X)

func (Instance) SetUseAsSteering

func (self Instance) SetUseAsSteering(value bool)

func (Instance) SetUseAsTraction

func (self Instance) SetUseAsTraction(value bool)

func (Instance) SetWheelFrictionSlip

func (self Instance) SetWheelFrictionSlip(value Float.X)

func (Instance) SetWheelRadius

func (self Instance) SetWheelRadius(value Float.X)

func (Instance) SetWheelRestLength

func (self Instance) SetWheelRestLength(value Float.X)

func (Instance) SetWheelRollInfluence

func (self Instance) SetWheelRollInfluence(value Float.X)

func (Instance) Steering

func (self Instance) Steering() Float.X

func (Instance) SuspensionMaxForce

func (self Instance) SuspensionMaxForce() Float.X

func (Instance) SuspensionStiffness

func (self Instance) SuspensionStiffness() Float.X

func (Instance) SuspensionTravel

func (self Instance) SuspensionTravel() Float.X

func (Instance) UseAsSteering

func (self Instance) UseAsSteering() bool

func (Instance) UseAsTraction

func (self Instance) UseAsTraction() bool

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

func (Instance) WheelFrictionSlip

func (self Instance) WheelFrictionSlip() Float.X

func (Instance) WheelRadius

func (self Instance) WheelRadius() Float.X

func (Instance) WheelRestLength

func (self Instance) WheelRestLength() Float.X

func (Instance) WheelRollInfluence

func (self Instance) WheelRollInfluence() Float.X

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL