update comments oh my god i cant focus
This commit is contained in:
parent
e12ca0bb66
commit
a410c9c0e6
1 changed files with 5 additions and 5 deletions
|
@ -126,18 +126,18 @@ func next_velocity(speed: float, dir: Vector2 = movement_dir) -> Vector3:
|
|||
return Vector3(dir.x, 0, dir.y) * speed
|
||||
|
||||
func get_mouse_look() -> Vector3:
|
||||
var cam: Camera3D = _active_camera # Use your convenient getter
|
||||
var cam: Camera3D = _active_camera
|
||||
|
||||
if not cam:
|
||||
return Vector3.ZERO # Should not happen, but good for safety
|
||||
return Vector3.ZERO
|
||||
|
||||
var mouse_pos = _mouse_position # Your 2D mouse position getter
|
||||
var mouse_pos = _mouse_position
|
||||
|
||||
var ray_origin = cam.project_ray_origin(mouse_pos)
|
||||
var ray_direction = cam.project_ray_normal(mouse_pos)
|
||||
|
||||
var plane_normal = Vector3.UP # Normal vector of a horizontal plane
|
||||
var plane_d = 1.5 # The 'D' in the plane equation Ax+By+Cz=D
|
||||
var plane_normal = Vector3.UP
|
||||
var plane_d = 1.5 # make this read from the weapon transform, or at least export it
|
||||
var denominator = plane_normal.dot(ray_direction)
|
||||
if abs(denominator) < 0.0001:
|
||||
return Vector3(ray_origin.x, 1.5, ray_origin.z)
|
||||
|
|
Loading…
Add table
Reference in a new issue