2024-11-11 18:39:12 +00:00
|
|
|
class_name GameBall extends RigidBody3D
|
|
|
|
## Base class for all gfolf balls
|
|
|
|
|
|
|
|
signal entered_water
|
2024-11-13 01:16:30 +00:00
|
|
|
|
|
|
|
## Angular damping while in air
|
|
|
|
@export var air_damping := 0.0
|
|
|
|
## Angular damping while in collision with rough terrain
|
|
|
|
@export var rough_damping := 8.0
|
|
|
|
|
|
|
|
|
|
|
|
func _integrate_forces(state: PhysicsDirectBodyState3D) -> void:
|
|
|
|
if state.get_contact_count():
|
|
|
|
angular_damp = rough_damping
|
|
|
|
else:
|
|
|
|
angular_damp = air_damping
|