mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add Transform and Rigidbody components (test)
This commit is contained in:
parent
f70e923c7c
commit
94dd69350d
4 changed files with 34 additions and 4 deletions
|
|
@ -7,7 +7,7 @@ function on_hud_open()
|
|||
local pvel = {player.get_vel(pid)}
|
||||
local eid = entity.spawn("base:drop")
|
||||
local throw_force = vec3.mul(player.get_dir(pid), DROP_FORCE)
|
||||
entity.set_vel(eid, vec3.add(throw_force, vec3.add(pvel, DROP_INIT_VEL)))
|
||||
entity.set_rot(eid, mat4.rotate({0, 1, 0}, math.random() * 360))
|
||||
Rigidbody.set_vel(eid, vec3.add(throw_force, vec3.add(pvel, DROP_INIT_VEL)))
|
||||
Transform.set_rot(eid, mat4.rotate({0, 1, 0}, math.random() * 360))
|
||||
end)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue