camera update

This commit is contained in:
Nikolai Fesenko
2025-08-13 15:03:14 +02:00
parent 37e0aa1a3e
commit 69d384345a
2 changed files with 5 additions and 3 deletions

View File

@@ -63,7 +63,7 @@ mass = 0.001
gravity_scale = 0.0
[node name="Camera3D" type="Camera3D" parent="RigidBody3D" node_paths=PackedStringArray("ownRigidBody", "endZoom")]
transform = Transform3D(1, 0, 0, 0, 0.710217, 0.703983, 0, -0.703983, 0.710217, 0, 17.894, 13.2384)
transform = Transform3D(1, 0, 0, 0, 0.707107, 0.707107, 0, -0.707107, 0.707107, 0, 17.894, 14)
current = true
script = ExtResource("7_6bp64")
rayLength = 1000.0

View File

@@ -8,7 +8,6 @@ var debugLabel
var global_delta
var default_pos
func _ready() -> void:
default_pos = self.position
debugLabel = $DebugLabel1
@@ -16,11 +15,14 @@ func _ready() -> void:
func _process(delta: float) -> void:
global_delta = delta
look_at(ownRigidBody.position)
self.position.y = -0.1 * pow(self.position.z,2) + 40
if(Input.is_action_just_released("move_camera_enable")):
ownRigidBody.angular_velocity = Vector3.ZERO
if(Input.is_action_pressed("move_camera_enable")):
var mouseV = Input.get_last_mouse_velocity()
ownRigidBody.angular_velocity.y = -mouseV.x * delta / camera_speed
ownRigidBody.angular_velocity.y = -mouseV.x * delta / camera_speed
self.position.z += mouseV.y * delta / 10.0
#ownRigidBody.angular_velocity.x = mouseV.y * delta / camera_speed
#print(self.position.dot(ownRigidBody.position))