add skeleton:is_visible(...), skeleton:set_visible(...)

This commit is contained in:
MihailRis
2024-07-15 12:05:11 +03:00
parent 055781eeaf
commit 8bb736bef0
10 changed files with 130 additions and 43 deletions
+7
View File
@@ -70,9 +70,16 @@ void SkeletonConfig::render(
const glm::mat4& matrix) const
{
update(skeleton, matrix);
if (!skeleton.visible) {
return;
}
for (size_t i = 0; i < nodes.size(); i++) {
auto* node = nodes[i];
node->refreshModel(assets);
if (!skeleton.flags[i].visible) {
continue;
}
if (auto model = node->getModel()) {
batch.pushMatrix(skeleton.calculated.matrices[i]);
batch.draw(model, &skeleton.textures);