add Transform.dirty flag

This commit is contained in:
MihailRis
2024-06-30 19:19:43 +03:00
parent df39a9a8f3
commit d4460928e5
5 changed files with 29 additions and 10 deletions
+3 -2
View File
@@ -22,7 +22,8 @@ end
function on_update()
if inair then
tsf:set_rot(mat4.rotate(tsf:get_rot(), {0, 1, 0}, math.random()*4))
tsf:set_rot(mat4.rotate(tsf:get_rot(), {0, 0, 1}, math.random()*4))
local dt = time.delta();
tsf:set_rot(mat4.rotate(tsf:get_rot(), {0, 1, 0}, 240*dt))
tsf:set_rot(mat4.rotate(tsf:get_rot(), {0, 0, 1}, 240*dt))
end
end
+3 -3
View File
@@ -9,9 +9,9 @@ function on_hud_open()
local ppos = vec3.add({player.get_pos(pid)}, {0, 0.7, 0})
local throw_force = vec3.mul(vec3.add(player.get_dir(pid),
{
(math.random() - 0.5) * 5,
(math.random() - 0.5) * 5,
(math.random() - 0.5) * 5
(math.random() - 0.5) * 1,
(math.random() - 0.5) * 1,
(math.random() - 0.5) * 1
}), DROP_FORCE)
local drop = entity.spawn("base:drop", ppos)