mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 05:51:51 +00:00
fix incorrect matrix in some rotations
This commit is contained in:
parent
ab5a62c3aa
commit
e278f5992d
1 changed files with 10 additions and 1 deletions
|
|
@ -18,8 +18,17 @@ do -- setup visuals
|
||||||
local textures = block.get_textures(id)
|
local textures = block.get_textures(id)
|
||||||
for i,t in ipairs(textures) do
|
for i,t in ipairs(textures) do
|
||||||
rig:set_texture("$"..tostring(i-1), "blocks:"..textures[i])
|
rig:set_texture("$"..tostring(i-1), "blocks:"..textures[i])
|
||||||
rig:set_matrix(0, mat4.look_at({0,0,0}, {block.get_Z(id, rotation)}, {block.get_Y(id, rotation)}))
|
|
||||||
end
|
end
|
||||||
|
local axisX = {block.get_X(id, rotation)}
|
||||||
|
local axisY = {block.get_Y(id, rotation)}
|
||||||
|
local axisZ = {block.get_Z(id, rotation)}
|
||||||
|
local matrix = {
|
||||||
|
axisX[1], axisX[2], axisX[3], 0,
|
||||||
|
axisY[1], axisY[2], axisY[3], 0,
|
||||||
|
axisZ[1], axisZ[2], axisZ[3], 0,
|
||||||
|
0, 0, 0, 1
|
||||||
|
}
|
||||||
|
rig:set_matrix(0, matrix)
|
||||||
end
|
end
|
||||||
|
|
||||||
function on_grounded()
|
function on_grounded()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue