13 lines
336 B
GDScript
13 lines
336 B
GDScript
class_name Car
|
|
extends RigidBody3D
|
|
|
|
@export var wheels: Array[Wheel]
|
|
|
|
func _physics_process(_delta: float) -> void:
|
|
for wheel: Wheel in wheels:
|
|
wheel.apply_forces(self)
|
|
|
|
##Point argument is in local space
|
|
func get_velocity_at_point(point: Vector3) -> Vector3:
|
|
return linear_velocity + angular_velocity.cross(point - center_of_mass)
|