summaryrefslogtreecommitdiffstats
path: root/Ship.gd
diff options
context:
space:
mode:
authordusoleil <howcansocksbereal@gmail.com>2022-10-09 04:45:45 -0400
committerdusoleil <howcansocksbereal@gmail.com>2022-10-09 04:46:01 -0400
commitf7ec57998a1c3d0cf91c1fb017fd5a91bb1e0b96 (patch)
treece0fbf5ed79731da5b216327a2e5cdc59df39fc6 /Ship.gd
parent4c9b0fdd23eda730abdc35f935bc011a3aea0765 (diff)
downloadgodot_wildjam_49-f7ec57998a1c3d0cf91c1fb017fd5a91bb1e0b96.tar.gz
godot_wildjam_49-f7ec57998a1c3d0cf91c1fb017fd5a91bb1e0b96.zip
Rework Buoyancy physicsduso-water-touchups
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.
Diffstat (limited to 'Ship.gd')
-rw-r--r--Ship.gd4
1 files changed, 2 insertions, 2 deletions
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)