From f7ec57998a1c3d0cf91c1fb017fd5a91bb1e0b96 Mon Sep 17 00:00:00 2001 From: dusoleil Date: Sun, 9 Oct 2022 04:45:45 -0400 Subject: Rework Buoyancy physics Simplify creating a buoyant object to just extending a class and setting the water plane. Implement a new buoyancy estimation that should be a bit more accurate. --- Ship.gd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Ship.gd') diff --git a/Ship.gd b/Ship.gd index feb5ad2..db200bd 100644 --- a/Ship.gd +++ b/Ship.gd @@ -1,4 +1,4 @@ -extends RigidBody +extends BuoyantBody export var ang_acceleration = 240.0 @@ -29,4 +29,4 @@ func _input(event): func _integrate_forces(_state): var stick = Input.get_axis("ship_right","ship_left") if stick != 0.0: - self.add_torque(Vector3.UP*stick*ang_acceleration) + self.add_torque(Vector3.UP*stick*ang_acceleration*self.mass) -- cgit v1.2.3