feat: item models generation simple & remove core:item_models

This commit is contained in:
MihailRis
2024-10-26 18:42:21 +03:00
parent 7a5fe3b2b0
commit fae372d19f
16 changed files with 136 additions and 63 deletions
@@ -1,5 +1,3 @@
local item_models = require "core:item_models"
local tsf = entity.transform
local body = entity.rigidbody
local rig = entity.skeleton
@@ -9,12 +7,7 @@ local itemIndex = rig:index("item")
local function refresh_model(id)
itemid = id
if id == 0 then
rig:set_model(itemIndex, "")
else
local scale = item_models.setup(itemid, rig, itemIndex)
rig:set_matrix(itemIndex, mat4.scale(scale))
end
rig:set_model(itemIndex, item.name(itemid)..".model")
end
function on_render()