add standard components test
This commit is contained in:
@@ -7,5 +7,6 @@ function on_despawn(eid)
|
||||
end
|
||||
|
||||
function on_grounded(eid)
|
||||
Transform.set_rot(eid, mat4.rotate({0, 1, 0}, math.random()*360))
|
||||
local entity = stdcomp.new_Entity(eid) -- test
|
||||
entity.transform:set_rot(mat4.rotate({0, 1, 0}, math.random()*360))
|
||||
end
|
||||
|
||||
@@ -8,8 +8,8 @@ function on_hud_open()
|
||||
local ppos = vec3.add({player.get_pos(pid)}, {0, 0.7, 0})
|
||||
local eid = entity.spawn("base:drop", ppos)
|
||||
local throw_force = vec3.mul(player.get_dir(pid), DROP_FORCE)
|
||||
Rigidbody.set_vel(eid, vec3.add(throw_force, vec3.add(pvel, DROP_INIT_VEL)))
|
||||
Transform.set_rot(eid,
|
||||
__rigidbody.set_vel(eid, vec3.add(throw_force, vec3.add(pvel, DROP_INIT_VEL)))
|
||||
__transform.set_rot(eid,
|
||||
mat4.rotate(mat4.rotate(mat4.rotate({0, 1, 0}, math.random() * 360),
|
||||
{1, 0, 0}, math.random() * 360), {0, 0, 1}, math.random() * 360))
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user