neural look
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
local Angle = { }
|
||||
|
||||
function Angle.towards(x, y, z)
|
||||
return math.deg(math.atan2(-x, z)), 0
|
||||
return math.deg(math.atan2(-x, z)), math.deg(-math.atan2(y, math.sqrt(x * x + z * z)))
|
||||
end
|
||||
|
||||
function Angle.away(x, y, z)
|
||||
|
||||
@@ -76,7 +76,7 @@ function Interface.getUniqueNames()
|
||||
end
|
||||
|
||||
function Interface.lookAt(pt)
|
||||
local yaw, pitch = Angle.towards(pt.x - .5, pt.y + 1, pt.z - .5)
|
||||
local yaw, pitch = Angle.towards(pt.x - .5, pt.y, pt.z - .5)
|
||||
return Interface.look(yaw, pitch)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user