Daniele Bartolini il y a 9 ans
Parent
commit
9a5ebffcec
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      samples/01-physics/core/level_editor/level_editor.lua

+ 2 - 2
samples/01-physics/core/level_editor/level_editor.lua

@@ -99,7 +99,7 @@ function draw_world_origin_grid(lines, size, step)
 	Device.set_temp_count(nv, nq, nm)
 end
 
-function raycast(pos, dir, objects)
+function raycast(objects, pos, dir)
 	local nearest = math.huge
 	local hit = nil
 
@@ -1255,7 +1255,7 @@ function LevelEditor:update(dt)
 	self._mouse.wheel.delta = 0
 
 	local pos, dir = self._fpscamera:camera_ray(self._mouse.x, self._mouse.y)
-	local t = raycast(pos, dir, self._objects)
+	local t = raycast(self._objects, pos, dir)
 	self._spawn_height = t and (pos + dir * t).y or 0
 
 	if self._show_grid then