basic camera movement and textures update
This commit is contained in:
@@ -1,10 +1,37 @@
|
||||
extends Camera3D
|
||||
|
||||
@export var rayLength: float
|
||||
|
||||
@export var camera_speed: float
|
||||
@export var ownRigidBody: RigidBody3D
|
||||
@export var endZoom: Node3D
|
||||
var debugLabel
|
||||
var global_delta
|
||||
var default_pos
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
default_pos = self.position
|
||||
debugLabel = $DebugLabel1
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
global_delta = delta
|
||||
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.x = mouseV.y * delta / camera_speed
|
||||
#print(self.position.dot(ownRigidBody.position))
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if(event.is_action("camera_zoom")):
|
||||
if (event.as_text() == "Mouse Wheel Up"):
|
||||
self.position = self.position.lerp(Vector3.ZERO,global_delta * 5.0)
|
||||
else:
|
||||
self.position = self.position.lerp(endZoom.position,global_delta * 5.0)
|
||||
|
||||
|
||||
|
||||
func getGlobalRayTargetObject():
|
||||
var space = get_world_3d().direct_space_state
|
||||
|
||||
Reference in New Issue
Block a user