| … | … | @@ -82,6 +82,7 @@ func get_player_object(id): |
| 82 | 82 | return remotePlayer |
| 83 | 83 | |
| 84 | 84 | func _broadcast_player(): |
| 85 | var physics : int = player_local.mode | |
| 85 | 86 | var translation : Vector3 = player_local.translation |
| 86 | 87 | var rotation : Vector3 = player_local.rotation_degrees |
| 87 | 88 | var velocity_linear : Vector3 = player_local.linear_velocity |
| … | … | @@ -89,6 +90,9 @@ func _broadcast_player(): |
| 89 | 90 | |
| 90 | 91 | var data = { |
| 91 | 92 | #"profile": profile, |
| 93 | "physics": { | |
| 94 | "mode": physics | |
| 95 | }, | |
| 92 | 96 | "translation": { |
| 93 | 97 | "x": translation.x, |
| 94 | 98 | "y": translation.y, |
| … | … | @@ -117,12 +121,14 @@ func _on_remote_player_moved(positionData, id): |
| 117 | 121 | # print('Moving player', id, " ", positionData) |
| 118 | 122 | var remotePlayer = get_player_object(id) |
| 119 | 123 | |
| 124 | var physics : int = int(positionData.physics.mode) | |
| 120 | 125 | var translation : Vector3 = Vector3(positionData.translation.x, positionData.translation.y, positionData.translation.z) |
| 121 | 126 | var rotation : Vector3 = Vector3(positionData.rotation.x, positionData.rotation.y, positionData.rotation.z) |
| 122 | 127 | var velocity_linear : Vector3 = Vector3(positionData.velocity_linear.x, positionData.velocity_linear.y, positionData.velocity_linear.z) |
| 123 | 128 | var velocity_angular : Vector3 = Vector3(positionData.velocity_angular.x, positionData.velocity_angular.y, positionData.velocity_angular.z) |
| 124 | 129 | |
| 125 | 130 | remotePlayer.update_position( |
| 131 | physics, | |
| 126 | 132 | translation, |
| 127 | 133 | rotation, |
| 128 | 134 | velocity_linear, |
| … | … | @@ -1,4 +1,4 @@ |
| 1 | [gd_scene load_steps=14 format=2] | |
| 1 | [gd_scene load_steps=16 format=2] | |
| 2 | 2 | |
| 3 | 3 | [ext_resource path="res://assets/levels/level0/assets_level_0.tscn" type="PackedScene" id=1] |
| 4 | 4 | [ext_resource path="res://levels/spawn_point/spawn_point.tscn" type="PackedScene" id=2] |
| … | … | @@ -13,6 +13,8 @@ |
| 13 | 13 | [ext_resource path="res://hypergodot/hyper_gossip/hyper_gossip.gd" type="Script" id=11] |
| 14 | 14 | [ext_resource path="res://ui/debug/hypercore/ui_debug_hypercore.tscn" type="PackedScene" id=12] |
| 15 | 15 | [ext_resource path="res://ui/PlayerConfig.tscn" type="PackedScene" id=13] |
| 16 | [ext_resource path="res://player/ball/player_ball_remote.tscn" type="PackedScene" id=14] | |
| 17 | [ext_resource path="res://player/ball/player_ball_controller.gd" type="Script" id=15] | |
| 16 | 18 | |
| 17 | 19 | [node name="Spatial" type="Node"] |
| 18 | 20 | script = ExtResource( 3 ) |
| … | … | @@ -24,12 +26,16 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.178, 1.877, -3.673 ) |
| 24 | 26 | |
| 25 | 27 | [node name="PlayerLocal" parent="Players" instance=ExtResource( 4 )] |
| 26 | 28 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.733258, 2.26544, -8.91449 ) |
| 29 | script = ExtResource( 15 ) | |
| 27 | 30 | |
| 28 | 31 | [node name="PlayerLocalCamera" parent="Players" instance=ExtResource( 7 )] |
| 29 | 32 | pause_mode = 2 |
| 30 | 33 | script = ExtResource( 8 ) |
| 31 | 34 | player_ball = NodePath("../PlayerLocal") |
| 32 | 35 | |
| 36 | [node name="PlayerBallRemote" parent="Players" instance=ExtResource( 14 )] | |
| 37 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.03321, 1.38366, -6.26667 ) | |
| 38 | ||
| 33 | 39 | [node name="WorldEnvironment" type="WorldEnvironment" parent="."] |
| 34 | 40 | environment = ExtResource( 9 ) |
| 35 | 41 | |
| … | … | @@ -68,7 +74,6 @@ script = ExtResource( 11 ) |
| 68 | 74 | [node name="GossipEventTimer" type="Timer" parent="HyperGodot"] |
| 69 | 75 | autostart = true |
| 70 | 76 | |
| 71 | [connection signal="moved" from="Players/PlayerLocal" to="." method="_on_PlayerLocal_moved"] | |
| 72 | 77 | [connection signal="reset_ball" from="special_input" to="Players/PlayerLocal" method="_on_special_input_reset_ball"] |
| 73 | 78 | [connection signal="started_gateway" from="HyperGodot/HyperGateway" to="." method="_on_HyperGateway_started_gateway"] |
| 74 | 79 | [connection signal="stopped_gateway" from="HyperGodot/HyperGateway" to="." method="_on_HyperGateway_stopped_gateway"] |
| … | … | @@ -1,152 +0,0 @@ |
| 1 | extends RigidBody | |
| 2 | ||
| 3 | enum BallPhysicsMode { | |
| 4 | FREE_FLY, | |
| 5 | ENGINE_PHYSICS_ROLL, | |
| 6 | ENGINE_PHYSICS_LINEAR, | |
| 7 | PHYSICS_MAX | |
| 8 | } | |
| 9 | ||
| 10 | signal moved | |
| 11 | ||
| 12 | var rolling_force : float = 10.0 | |
| 13 | var rolling_force_max : float = 50.0 | |
| 14 | ||
| 15 | var linear_force : float = 2.0 | |
| 16 | ||
| 17 | var freefly_force : float = 3.0 | |
| 18 | ||
| 19 | onready var ballInitialOrigin : Vector3 = self.translation | |
| 20 | ||
| 21 | var ball_physics_mode : int = BallPhysicsMode.ENGINE_PHYSICS_LINEAR | |
| 22 | var bFirstPersonCamera = false | |
| 23 | ||
| 24 | var lVelocity : Label | |
| 25 | var lAngularVelocity : Label | |
| 26 | var lBallPhysicsMode : Label | |
| 27 | ||
| 28 | func _ready(): | |
| 29 | lVelocity = get_tree().get_current_scene().get_node("BallDebugUI").find_node("BallVelocity_Value") | |
| 30 | lAngularVelocity = get_tree().get_current_scene().get_node("BallDebugUI").find_node("BallAngularVelocity_Value") | |
| 31 | lBallPhysicsMode = get_tree().get_current_scene().get_node("BallDebugUI").find_node("BallPhysicsMode_Value") | |
| 32 | ||
| 33 | updateBallPhysicsMode() | |
| 34 | ||
| 35 | func _process(_delta: float) -> void: | |
| 36 | pass | |
| 37 | ||
| 38 | func resetBall() -> void: | |
| 39 | self.angular_velocity = Vector3(0, 0, 0) | |
| 40 | self.linear_velocity = Vector3(0, 0, 0) | |
| 41 | self.rotation = Vector3(0, 0, 0) | |
| 42 | ball_physics_mode = BallPhysicsMode.ENGINE_PHYSICS_LINEAR | |
| 43 | updateBallPhysicsMode() | |
| 44 | self.translation = ballInitialOrigin | |
| 45 | ||
| 46 | func updateBallPhysicsMode() -> void: | |
| 47 | if(ball_physics_mode == BallPhysicsMode.FREE_FLY): | |
| 48 | lBallPhysicsMode.text = "Free Fly" | |
| 49 | self.angular_velocity = Vector3(0, 0, 0) | |
| 50 | self.rotation = Vector3(0, 0, 0) | |
| 51 | self.linear_velocity = Vector3(0, 0, 0) | |
| 52 | self.mode = RigidBody.MODE_STATIC | |
| 53 | elif(ball_physics_mode == BallPhysicsMode.ENGINE_PHYSICS_ROLL): | |
| 54 | lBallPhysicsMode.text = "Engine Physics (Roll)" | |
| 55 | self.physics_material_override.friction = 1.0 | |
| 56 | self.mode = RigidBody.MODE_RIGID | |
| 57 | else: | |
| 58 | lBallPhysicsMode.text = "Engine Physics (Linear)" | |
| 59 | self.physics_material_override.friction = 0.035 | |
| 60 | self.mode = RigidBody.MODE_RIGID | |
| 61 | ||
| 62 | func checkAngularVelocity(delta : float, angVelocity : float, bAdd : bool) -> float: | |
| 63 | if bAdd: | |
| 64 | angVelocity = angVelocity + rolling_force*delta | |
| 65 | else: | |
| 66 | angVelocity = angVelocity - rolling_force*delta | |
| 67 | ||
| 68 | var cappedVelocity = min(rolling_force_max, abs(angVelocity) ) | |
| 69 | if (angVelocity < 0): | |
| 70 | return cappedVelocity * -1 | |
| 71 | else: | |
| 72 | return cappedVelocity | |
| 73 | ||
| 74 | func _physics_process(delta: float) -> void: | |
| 75 | #if Input.is_action_just_pressed("camera_toggle_fps"): | |
| 76 | # if bFirstPersonCamera == true: | |
| 77 | # bFirstPersonCamera = false | |
| 78 | # ballCamera.global_transform.origin = ballCameraOriginalOrigin | |
| 79 | # else: | |
| 80 | # bFirstPersonCamera = true | |
| 81 | ||
| 82 | #if false: | |
| 83 | # ballCamera.global_transform.origin = lerp( | |
| 84 | # ballCamera.global_transform.origin, | |
| 85 | # global_transform.origin, 1.0 | |
| 86 | # ) | |
| 87 | # ballCamera.global_transform.origin = lerp( | |
| 88 | # ballCamera.global_transform.origin, | |
| 89 | # global_transform.origin, 1.0 | |
| 90 | # ) | |
| 91 | ||
| 92 | if Input.is_action_just_pressed("ball_cycle_physics_mode"): | |
| 93 | ball_physics_mode = (ball_physics_mode + 1) % BallPhysicsMode.PHYSICS_MAX | |
| 94 | if(ball_physics_mode == BallPhysicsMode.FREE_FLY): | |
| 95 | self.mode = RigidBody.MODE_STATIC | |
| 96 | else: | |
| 97 | self.mode = RigidBody.MODE_RIGID | |
| 98 | updateBallPhysicsMode() | |
| 99 | ||
| 100 | ||
| 101 | #if(ball_physics_mode == BallPhysicsMode.FREE_FLY): | |
| 102 | # return | |
| 103 | ||
| 104 | if Input.is_action_pressed("ball_roll_up"): | |
| 105 | if(ball_physics_mode == BallPhysicsMode.ENGINE_PHYSICS_ROLL): | |
| 106 | angular_velocity.x = clamp(angular_velocity.x - rolling_force*delta, rolling_force_max * -1, rolling_force_max) | |
| 107 | elif(ball_physics_mode == BallPhysicsMode.FREE_FLY): | |
| 108 | self.translate( Vector3(0, 0, -freefly_force) * delta) | |
| 109 | else: | |
| 110 | linear_velocity.z -= (linear_force * delta); | |
| 111 | elif Input.is_action_pressed("ball_roll_down"): | |
| 112 | if(ball_physics_mode == BallPhysicsMode.ENGINE_PHYSICS_ROLL): | |
| 113 | angular_velocity.x = clamp(angular_velocity.x + rolling_force*delta, rolling_force_max * -1, rolling_force_max) | |
| 114 | elif(ball_physics_mode == BallPhysicsMode.FREE_FLY): | |
| 115 | self.translate( Vector3(0, 0, freefly_force) * delta) | |
| 116 | else: | |
| 117 | linear_velocity.z += (linear_force * delta); | |
| 118 | ||
| 119 | if Input.is_action_pressed("ball_roll_left"): | |
| 120 | if(ball_physics_mode == BallPhysicsMode.ENGINE_PHYSICS_ROLL): | |
| 121 | angular_velocity.z = clamp(angular_velocity.z + rolling_force*delta, rolling_force_max * -1, rolling_force_max) | |
| 122 | elif(ball_physics_mode == BallPhysicsMode.FREE_FLY): | |
| 123 | self.translate( Vector3(-freefly_force, 0, 0) * delta) | |
| 124 | else: | |
| 125 | linear_velocity.x -= (linear_force * delta); | |
| 126 | elif Input.is_action_pressed("ball_roll_right"): | |
| 127 | if(ball_physics_mode == BallPhysicsMode.ENGINE_PHYSICS_ROLL): | |
| 128 | angular_velocity.z = clamp(angular_velocity.z - rolling_force*delta, rolling_force_max * -1, rolling_force_max) | |
| 129 | elif(ball_physics_mode == BallPhysicsMode.FREE_FLY): | |
| 130 | self.translate( Vector3(freefly_force, 0, 0) * delta) | |
| 131 | else: | |
| 132 | linear_velocity.x += (linear_force * delta); | |
| 133 | ||
| 134 | if Input.is_action_pressed("ball_fly_up"): | |
| 135 | if(ball_physics_mode == BallPhysicsMode.FREE_FLY): | |
| 136 | self.translate( Vector3(0, freefly_force, 0) * delta) | |
| 137 | elif Input.is_action_pressed("ball_fly_down"): | |
| 138 | if(ball_physics_mode == BallPhysicsMode.FREE_FLY): | |
| 139 | self.translate( Vector3(0, -freefly_force, 0) * delta) | |
| 140 | ||
| 141 | #if Input.is_action_just_pressed("jump") and $FloorCheck.is_colliding(): | |
| 142 | # apply_impulse(Vector3(), Vector3.UP*1000) | |
| 143 | ||
| 144 | # Update Debug UI | |
| 145 | lVelocity.text = String(self.linear_velocity) | |
| 146 | lAngularVelocity.text = String(self.angular_velocity) | |
| 147 | ||
| 148 | func _on_PlayerLocal_reset_ball() -> void: | |
| 149 | resetBall() | |
| 150 | ||
| 151 | func _on_special_input_reset_ball() -> void: | |
| 152 | resetBall() |
| … | … | @@ -1,7 +1,6 @@ |
| 1 | [gd_scene load_steps=5 format=2] | |
| 1 | [gd_scene load_steps=4 format=2] | |
| 2 | 2 | |
| 3 | 3 | [ext_resource path="res://assets/models/pixar-ball/pixar-ball.tscn" type="PackedScene" id=1] |
| 4 | [ext_resource path="res://player/ball/player_ball.gd" type="Script" id=2] | |
| 5 | 4 | |
| 6 | 5 | [sub_resource type="PhysicsMaterial" id=2] |
| 7 | 6 | friction = 0.0 |
| … | … | @@ -11,7 +10,6 @@ rough = true |
| 11 | 10 | |
| 12 | 11 | [node name="PlayerBall" type="RigidBody"] |
| 13 | 12 | physics_material_override = SubResource( 2 ) |
| 14 | script = ExtResource( 2 ) | |
| 15 | 13 | |
| 16 | 14 | [node name="CollisionShape" type="CollisionShape" parent="."] |
| 17 | 15 | transform = Transform( 0.1, 0, 0, 0, 0.1, 0, 0, 0, 0.1, 0, 0, 0 ) |
| … | … | @@ -0,0 +1,152 @@ |
| 1 | extends RigidBody | |
| 2 | ||
| 3 | enum BallPhysicsMode { | |
| 4 | FREE_FLY, | |
| 5 | ENGINE_PHYSICS_ROLL, | |
| 6 | ENGINE_PHYSICS_LINEAR, | |
| 7 | PHYSICS_MAX | |
| 8 | } | |
| 9 | ||
| 10 | signal moved | |
| 11 | ||
| 12 | var rolling_force : float = 10.0 | |
| 13 | var rolling_force_max : float = 50.0 | |
| 14 | ||
| 15 | var linear_force : float = 2.0 | |
| 16 | ||
| 17 | var freefly_force : float = 3.0 | |
| 18 | ||
| 19 | onready var ballInitialOrigin : Vector3 = self.translation | |
| 20 | ||
| 21 | var ball_physics_mode : int = BallPhysicsMode.ENGINE_PHYSICS_LINEAR | |
| 22 | var bFirstPersonCamera = false | |
| 23 | ||
| 24 | var lVelocity : Label | |
| 25 | var lAngularVelocity : Label | |
| 26 | var lBallPhysicsMode : Label | |
| 27 | ||
| 28 | func _ready(): | |
| 29 | lVelocity = get_tree().get_current_scene().get_node("BallDebugUI").find_node("BallVelocity_Value") | |
| 30 | lAngularVelocity = get_tree().get_current_scene().get_node("BallDebugUI").find_node("BallAngularVelocity_Value") | |
| 31 | lBallPhysicsMode = get_tree().get_current_scene().get_node("BallDebugUI").find_node("BallPhysicsMode_Value") | |
| 32 | ||
| 33 | updateBallPhysicsMode() | |
| 34 | ||
| 35 | func _process(_delta: float) -> void: | |
| 36 | pass | |
| 37 | ||
| 38 | func resetBall() -> void: | |
| 39 | self.angular_velocity = Vector3(0, 0, 0) | |
| 40 | self.linear_velocity = Vector3(0, 0, 0) | |
| 41 | self.rotation = Vector3(0, 0, 0) | |
| 42 | ball_physics_mode = BallPhysicsMode.ENGINE_PHYSICS_LINEAR | |
| 43 | updateBallPhysicsMode() | |
| 44 | self.translation = ballInitialOrigin | |
| 45 | ||
| 46 | func updateBallPhysicsMode() -> void: | |
| 47 | if(ball_physics_mode == BallPhysicsMode.FREE_FLY): | |
| 48 | lBallPhysicsMode.text = "Free Fly" | |
| 49 | self.angular_velocity = Vector3(0, 0, 0) | |
| 50 | self.rotation = Vector3(0, 0, 0) | |
| 51 | self.linear_velocity = Vector3(0, 0, 0) | |
| 52 | self.mode = RigidBody.MODE_STATIC | |
| 53 | elif(ball_physics_mode == BallPhysicsMode.ENGINE_PHYSICS_ROLL): | |
| 54 | lBallPhysicsMode.text = "Engine Physics (Roll)" | |
| 55 | self.physics_material_override.friction = 1.0 | |
| 56 | self.mode = RigidBody.MODE_RIGID | |
| 57 | else: | |
| 58 | lBallPhysicsMode.text = "Engine Physics (Linear)" | |
| 59 | self.physics_material_override.friction = 0.035 | |
| 60 | self.mode = RigidBody.MODE_RIGID | |
| 61 | ||
| 62 | func checkAngularVelocity(delta : float, angVelocity : float, bAdd : bool) -> float: | |
| 63 | if bAdd: | |
| 64 | angVelocity = angVelocity + rolling_force*delta | |
| 65 | else: | |
| 66 | angVelocity = angVelocity - rolling_force*delta | |
| 67 | ||
| 68 | var cappedVelocity = min(rolling_force_max, abs(angVelocity) ) | |
| 69 | if (angVelocity < 0): | |
| 70 | return cappedVelocity * -1 | |
| 71 | else: | |
| 72 | return cappedVelocity | |
| 73 | ||
| 74 | func _physics_process(delta: float) -> void: | |
| 75 | #if Input.is_action_just_pressed("camera_toggle_fps"): | |
| 76 | # if bFirstPersonCamera == true: | |
| 77 | # bFirstPersonCamera = false | |
| 78 | # ballCamera.global_transform.origin = ballCameraOriginalOrigin | |
| 79 | # else: | |
| 80 | # bFirstPersonCamera = true | |
| 81 | ||
| 82 | #if false: | |
| 83 | # ballCamera.global_transform.origin = lerp( | |
| 84 | # ballCamera.global_transform.origin, | |
| 85 | # global_transform.origin, 1.0 | |
| 86 | # ) | |
| 87 | # ballCamera.global_transform.origin = lerp( | |
| 88 | # ballCamera.global_transform.origin, | |
| 89 | # global_transform.origin, 1.0 | |
| 90 | # ) | |
| 91 | ||
| 92 | if Input.is_action_just_pressed("ball_cycle_physics_mode"): | |
| 93 | ball_physics_mode = (ball_physics_mode + 1) % BallPhysicsMode.PHYSICS_MAX | |
| 94 | if(ball_physics_mode == BallPhysicsMode.FREE_FLY): | |
| 95 | self.mode = RigidBody.MODE_STATIC | |
| 96 | else: | |
| 97 | self.mode = RigidBody.MODE_RIGID | |
| 98 | updateBallPhysicsMode() | |
| 99 | ||
| 100 | ||
| 101 | #if(ball_physics_mode == BallPhysicsMode.FREE_FLY): | |
| 102 | # return | |
| 103 | ||
| 104 | if Input.is_action_pressed("ball_roll_up"): | |
| 105 | if(ball_physics_mode == BallPhysicsMode.ENGINE_PHYSICS_ROLL): | |
| 106 | angular_velocity.x = clamp(angular_velocity.x - rolling_force*delta, rolling_force_max * -1, rolling_force_max) | |
| 107 | elif(ball_physics_mode == BallPhysicsMode.FREE_FLY): | |
| 108 | self.translate( Vector3(0, 0, -freefly_force) * delta) | |
| 109 | else: | |
| 110 | linear_velocity.z -= (linear_force * delta); | |
| 111 | elif Input.is_action_pressed("ball_roll_down"): | |
| 112 | if(ball_physics_mode == BallPhysicsMode.ENGINE_PHYSICS_ROLL): | |
| 113 | angular_velocity.x = clamp(angular_velocity.x + rolling_force*delta, rolling_force_max * -1, rolling_force_max) | |
| 114 | elif(ball_physics_mode == BallPhysicsMode.FREE_FLY): | |
| 115 | self.translate( Vector3(0, 0, freefly_force) * delta) | |
| 116 | else: | |
| 117 | linear_velocity.z += (linear_force * delta); | |
| 118 | ||
| 119 | if Input.is_action_pressed("ball_roll_left"): | |
| 120 | if(ball_physics_mode == BallPhysicsMode.ENGINE_PHYSICS_ROLL): | |
| 121 | angular_velocity.z = clamp(angular_velocity.z + rolling_force*delta, rolling_force_max * -1, rolling_force_max) | |
| 122 | elif(ball_physics_mode == BallPhysicsMode.FREE_FLY): | |
| 123 | self.translate( Vector3(-freefly_force, 0, 0) * delta) | |
| 124 | else: | |
| 125 | linear_velocity.x -= (linear_force * delta); | |
| 126 | elif Input.is_action_pressed("ball_roll_right"): | |
| 127 | if(ball_physics_mode == BallPhysicsMode.ENGINE_PHYSICS_ROLL): | |
| 128 | angular_velocity.z = clamp(angular_velocity.z - rolling_force*delta, rolling_force_max * -1, rolling_force_max) | |
| 129 | elif(ball_physics_mode == BallPhysicsMode.FREE_FLY): | |
| 130 | self.translate( Vector3(freefly_force, 0, 0) * delta) | |
| 131 | else: | |
| 132 | linear_velocity.x += (linear_force * delta); | |
| 133 | ||
| 134 | if Input.is_action_pressed("ball_fly_up"): | |
| 135 | if(ball_physics_mode == BallPhysicsMode.FREE_FLY): | |
| 136 | self.translate( Vector3(0, freefly_force, 0) * delta) | |
| 137 | elif Input.is_action_pressed("ball_fly_down"): | |
| 138 | if(ball_physics_mode == BallPhysicsMode.FREE_FLY): | |
| 139 | self.translate( Vector3(0, -freefly_force, 0) * delta) | |
| 140 | ||
| 141 | #if Input.is_action_just_pressed("jump") and $FloorCheck.is_colliding(): | |
| 142 | # apply_impulse(Vector3(), Vector3.UP*1000) | |
| 143 | ||
| 144 | # Update Debug UI | |
| 145 | lVelocity.text = String(self.linear_velocity) | |
| 146 | lAngularVelocity.text = String(self.angular_velocity) | |
| 147 | ||
| 148 | func _on_PlayerLocal_reset_ball() -> void: | |
| 149 | resetBall() | |
| 150 | ||
| 151 | func _on_special_input_reset_ball() -> void: | |
| 152 | resetBall() |
| … | … | @@ -1,6 +1,7 @@ |
| 1 | extends "res://player/ball/player_ball.gd" | |
| 1 | extends RigidBody | |
| 2 | 2 | |
| 3 | func update_position(new_translation : Vector3, new_rotation : Vector3, new_velocity_linear : Vector3, new_velocity_angular : Vector3): | |
| 3 | func update_position(new_mode : int, new_translation : Vector3, new_rotation : Vector3, new_velocity_linear : Vector3, new_velocity_angular : Vector3): | |
| 4 | self.mode = new_mode | |
| 4 | 5 | self.translation = new_translation |
| 5 | 6 | self.rotation = new_rotation |
| 6 | 7 | self.linear_velocity = new_velocity_linear |