Attempt at fixing orientation for move to.
This commit is contained in:
parent
096de7f8e3
commit
9e9ea5dd2f
@ -410,8 +410,16 @@ local function moveTo(dest, relative)
|
||||
sendLog(FAILED, "Unable to orient for X axis.")
|
||||
return
|
||||
end
|
||||
if relative then
|
||||
forward = relHeading
|
||||
right = relRightAxis
|
||||
else
|
||||
forward = heading
|
||||
right = rightAxis
|
||||
end
|
||||
xblocked = not attemptMoveForward()
|
||||
end
|
||||
|
||||
if position.y ~= dest.y then
|
||||
if dest.y - pos.y > 0 then
|
||||
yBlocked = not attemptMoveUp()
|
||||
@ -419,6 +427,7 @@ local function moveTo(dest, relative)
|
||||
yBlocked = not attemptMoveDown()
|
||||
end
|
||||
end
|
||||
|
||||
if pos.z ~= dest.z then
|
||||
if not orient(vector.new(0, 0, dest.z - pos.z):normalize(), forward, right) then
|
||||
sendLog(FAILED, "Unable to orient for Z axis.")
|
||||
@ -426,6 +435,13 @@ local function moveTo(dest, relative)
|
||||
end
|
||||
zBlocked = not attemptMoveForward()
|
||||
end
|
||||
if relative then
|
||||
forward = relHeading
|
||||
right = relRightAxis
|
||||
else
|
||||
forward = heading
|
||||
right = rightAxis
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user