camera update
This commit is contained in:
@@ -63,7 +63,7 @@ mass = 0.001
|
|||||||
gravity_scale = 0.0
|
gravity_scale = 0.0
|
||||||
|
|
||||||
[node name="Camera3D" type="Camera3D" parent="RigidBody3D" node_paths=PackedStringArray("ownRigidBody", "endZoom")]
|
[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
|
current = true
|
||||||
script = ExtResource("7_6bp64")
|
script = ExtResource("7_6bp64")
|
||||||
rayLength = 1000.0
|
rayLength = 1000.0
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ var debugLabel
|
|||||||
var global_delta
|
var global_delta
|
||||||
var default_pos
|
var default_pos
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
default_pos = self.position
|
default_pos = self.position
|
||||||
debugLabel = $DebugLabel1
|
debugLabel = $DebugLabel1
|
||||||
@@ -16,11 +15,14 @@ func _ready() -> void:
|
|||||||
|
|
||||||
func _process(delta: float) -> void:
|
func _process(delta: float) -> void:
|
||||||
global_delta = delta
|
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")):
|
if(Input.is_action_just_released("move_camera_enable")):
|
||||||
ownRigidBody.angular_velocity = Vector3.ZERO
|
ownRigidBody.angular_velocity = Vector3.ZERO
|
||||||
if(Input.is_action_pressed("move_camera_enable")):
|
if(Input.is_action_pressed("move_camera_enable")):
|
||||||
var mouseV = Input.get_last_mouse_velocity()
|
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
|
#ownRigidBody.angular_velocity.x = mouseV.y * delta / camera_speed
|
||||||
#print(self.position.dot(ownRigidBody.position))
|
#print(self.position.dot(ownRigidBody.position))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user