mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-12 14:31:50 +00:00
revert "remove rotation-order (use original directives order)"
Keeping VCA directives unordered is seems more preferred
This reverts commit 3b1ab36ac1.
This commit is contained in:
parent
3b1ab36ac1
commit
49e4b1f519
2 changed files with 6 additions and 8 deletions
|
|
@ -187,17 +187,14 @@ local function codegen_track(raw_track, lineset, memoised, keysets, use_tsf)
|
||||||
end
|
end
|
||||||
|
|
||||||
local axis_names = {"X", "Y", "Z"}
|
local axis_names = {"X", "Y", "Z"}
|
||||||
local axes = {1, 2, 3}
|
local axis_indices = {X=1, Y=2, Z=3}
|
||||||
|
local rotation_order = raw_track.rotation_order
|
||||||
table.sort(axes, function(a, b)
|
for i=1,3 do
|
||||||
return rotation[a] < rotation[b]
|
local axis = axis_indices[rotation_order[i]]
|
||||||
end)
|
|
||||||
|
|
||||||
for _, axis in ipairs(axes) do
|
|
||||||
local var = rotation[axis]
|
local var = rotation[axis]
|
||||||
if var then
|
if var then
|
||||||
code = code .. "\n mat4.rotate(dst, " .. axis_names[axis] ..
|
code = code .. "\n mat4.rotate(dst, " .. axis_names[axis] ..
|
||||||
", l" .. var .. ", dst)"
|
", l" .. var .. ", dst)"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ local function parse_configure(raw_track, node)
|
||||||
elseif node.duration then
|
elseif node.duration then
|
||||||
raw_track.duration = node.duration
|
raw_track.duration = node.duration
|
||||||
end
|
end
|
||||||
|
raw_track.rotation_order = string.upper(node["rotation-order"]) or "XYZ"
|
||||||
end
|
end
|
||||||
|
|
||||||
local function parse_curve(line, node)
|
local function parse_curve(line, node)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue