feat: complete item 'model-name' support
This commit is contained in:
parent
7c933f89c6
commit
9c3d4af907
@ -25,7 +25,7 @@ end
|
|||||||
|
|
||||||
do -- setup visuals
|
do -- setup visuals
|
||||||
local matrix = mat4.idt()
|
local matrix = mat4.idt()
|
||||||
rig:set_model(0, item.name(dropitem.id)..".model")
|
rig:set_model(0, item.get_model_name(dropitem.id))
|
||||||
local bodysize = math.min(scale[1], scale[2], scale[3]) * DROP_SCALE
|
local bodysize = math.min(scale[1], scale[2], scale[3]) * DROP_SCALE
|
||||||
body:set_size({scale[1] * DROP_SCALE, bodysize, scale[3] * DROP_SCALE})
|
body:set_size({scale[1] * DROP_SCALE, bodysize, scale[3] * DROP_SCALE})
|
||||||
mat4.mul(matrix, rotation, matrix)
|
mat4.mul(matrix, rotation, matrix)
|
||||||
|
|||||||
@ -7,7 +7,7 @@ local itemIndex = rig:index("item")
|
|||||||
|
|
||||||
local function refresh_model(id)
|
local function refresh_model(id)
|
||||||
itemid = id
|
itemid = id
|
||||||
rig:set_model(itemIndex, item.name(itemid)..".model")
|
rig:set_model(itemIndex, item.get_model_name(itemid))
|
||||||
rig:set_matrix(itemIndex, mat4.rotate({0, 1, 0}, -80))
|
rig:set_matrix(itemIndex, mat4.rotate({0, 1, 0}, -80))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -381,7 +381,7 @@ void WorldRenderer::renderHands(const Camera& camera, const Assets& assets) {
|
|||||||
modelBatch->draw(
|
modelBatch->draw(
|
||||||
matrix,
|
matrix,
|
||||||
glm::vec3(1.0f),
|
glm::vec3(1.0f),
|
||||||
assets.get<model::Model>(def.name + ".model"),
|
assets.get<model::Model>(def.modelName),
|
||||||
&map
|
&map
|
||||||
);
|
);
|
||||||
Window::clearDepth();
|
Window::clearDepth();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user