mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-11-20 17:39:46 +00:00
feat: individual bone tints
This commit is contained in:
parent
dbeeef90a8
commit
f5f17b7746
2 changed files with 5 additions and 2 deletions
|
|
@ -46,7 +46,8 @@ Skeleton::Skeleton(std::shared_ptr<const SkeletonConfig> config)
|
|||
flags(config ? config->getBones().size() : 0),
|
||||
textures(),
|
||||
modelOverrides(config ? config->getBones().size() : 0),
|
||||
visible(true) {
|
||||
visible(true),
|
||||
boneTints(config ? config->getBones().size() : 0, glm::vec4(1.0f)) {
|
||||
if (config == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -99,6 +100,7 @@ void Skeleton::setConfig(std::shared_ptr<const SkeletonConfig> rigConfig) {
|
|||
|
||||
modelOverrides.resize(bonesCount);
|
||||
flags.resize(bonesCount);
|
||||
boneTints.resize(bonesCount, glm::vec4(1.0f));
|
||||
|
||||
for (size_t i = 0; i < bonesCount; i++) {
|
||||
flags[i].visible = true;
|
||||
|
|
@ -204,7 +206,7 @@ void SkeletonConfig::render(
|
|||
if (model) {
|
||||
batch.draw(
|
||||
skeleton.calculated.matrices[i],
|
||||
skeleton.tint,
|
||||
skeleton.tint * skeleton.boneTints[i],
|
||||
model,
|
||||
&skeleton.textures
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue