Split GLTF model loading into separate functions for readability.
This commit is contained in:
parent
128f14586d
commit
47313dd601
|
|
@ -3769,10 +3769,10 @@ static Model LoadGLTF(const char *fileName)
|
||||||
}
|
}
|
||||||
else if (acc->component_type == cgltf_component_type_r_32u)
|
else if (acc->component_type == cgltf_component_type_r_32u)
|
||||||
{
|
{
|
||||||
unsigned int readValue[3];
|
int readValue[3];
|
||||||
for(int a = 0; a < acc->count; a++)
|
for(int a = 0; a < acc->count; a++)
|
||||||
{
|
{
|
||||||
GLTFReadValue(acc, a, readValue, 3, sizeof(unsigned int));
|
GLTFReadValue(acc, a, readValue, 3, sizeof(int));
|
||||||
model.meshes[primitiveIndex].vertices[(a * 3) + 0] = readValue[0];
|
model.meshes[primitiveIndex].vertices[(a * 3) + 0] = readValue[0];
|
||||||
model.meshes[primitiveIndex].vertices[(a * 3) + 1] = readValue[1];
|
model.meshes[primitiveIndex].vertices[(a * 3) + 1] = readValue[1];
|
||||||
model.meshes[primitiveIndex].vertices[(a * 3) + 2] = readValue[2];
|
model.meshes[primitiveIndex].vertices[(a * 3) + 2] = readValue[2];
|
||||||
|
|
@ -3803,10 +3803,10 @@ static Model LoadGLTF(const char *fileName)
|
||||||
}
|
}
|
||||||
else if (acc->component_type == cgltf_component_type_r_32u)
|
else if (acc->component_type == cgltf_component_type_r_32u)
|
||||||
{
|
{
|
||||||
unsigned int readValue[3];
|
int readValue[3];
|
||||||
for(int a = 0; a < acc->count; a++)
|
for(int a = 0; a < acc->count; a++)
|
||||||
{
|
{
|
||||||
GLTFReadValue(acc, a, readValue, 3, sizeof(unsigned int));
|
GLTFReadValue(acc, a, readValue, 3, sizeof(int));
|
||||||
model.meshes[primitiveIndex].normals[(a * 3) + 0] = readValue[0];
|
model.meshes[primitiveIndex].normals[(a * 3) + 0] = readValue[0];
|
||||||
model.meshes[primitiveIndex].normals[(a * 3) + 1] = readValue[1];
|
model.meshes[primitiveIndex].normals[(a * 3) + 1] = readValue[1];
|
||||||
model.meshes[primitiveIndex].normals[(a * 3) + 2] = readValue[2];
|
model.meshes[primitiveIndex].normals[(a * 3) + 2] = readValue[2];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user