mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add rotation-order parameter to vca configure
This commit is contained in:
parent
2104bc7670
commit
eeff17e143
2 changed files with 7 additions and 2 deletions
|
|
@ -187,10 +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"}
|
||||||
for axis, var in ipairs(rotation) do
|
local axis_indices = {X=1, Y=2, Z=3}
|
||||||
|
local rotation_order = raw_track.rotation_order
|
||||||
|
for i=1,3 do
|
||||||
|
local axis = axis_indices[rotation_order[i]]
|
||||||
|
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