mesh patch 1

This commit is contained in:
h4570
2022-08-09 23:12:09 +02:00
parent 6b45629595
commit 2dad96d396
33 changed files with 252 additions and 661 deletions
@@ -51,35 +51,6 @@ MeshMaterial::MeshMaterial(const MeshBuilder2Data& data,
_isMother = true;
}
MeshMaterial::MeshMaterial(const MeshBuilderData& data,
const u32& materialIndex)
: color(false) {
TYRA_ASSERT(materialIndex < data.materialsCount && materialIndex >= 0,
"Provided index \"", materialIndex, "\" is out of range");
id = rand() % 1000000;
if (data.manyColorsEnabled) {
singleColorFlag = false;
TYRA_ASSERT(data.frames[0]->colors != nullptr, "Colors faces are required");
} else {
singleColorFlag = true;
}
color.set(128.0F, 128.0F, 128.0F, 128.0F);
_name = data.materials[materialIndex]->name;
TYRA_ASSERT(_name.length() > 0, "MeshMaterial name cannot be empty");
framesCount = data.framesCount;
frames = new MeshMaterialFrame*[framesCount];
for (u32 i = 0; i < framesCount; i++) {
frames[i] = new MeshMaterialFrame(data, i, materialIndex);
}
_isMother = true;
}
MeshMaterial::MeshMaterial(const MeshMaterial& mesh) {
id = rand() % 1000000;