Added Dart Physics

This commit is contained in:
ced
2026-06-20 16:19:33 -05:00
parent feab4d7e4f
commit a77cea1b3d
15 changed files with 296 additions and 1 deletions
+15
View File
@@ -0,0 +1,15 @@
extends Camera3D
const RAY_LENGTH = 1000
func ray_cast():
var space_state = get_world_3d().direct_space_state
var cam = $"."
var mousepos = get_viewport().get_mouse_position()
var origin = cam.project_ray_origin(mousepos)
var end = origin + cam.project_ray_normal(mousepos) * RAY_LENGTH
var query = PhysicsRayQueryParameters3D.create(origin,end)
query.collide_with_areas = true
var result = space_state.intersect_ray(query)
result = result.get("collider")
return result