You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vector3vector=newVector3();// we declare a placeholder vector since assimp uses its own vector class that doesn't directly convert to glm's vec3 class so we transfer the data to this placeholder glm::vec3 first.
74
-
// positions
75
-
vector.X=mesh->MVertices[i].X;
76
-
vector.Y=mesh->MVertices[i].Y;
77
-
vector.Z=mesh->MVertices[i].Z;
78
-
vertex.Position=vector;
73
+
74
+
vertex.Position=mesh->MVertices[i];
75
+
79
76
// normals
80
-
81
77
if(mesh->MNormals!=null)
82
-
{
83
-
vector.X=mesh->MNormals[i].X;
84
-
vector.Y=mesh->MNormals[i].Y;
85
-
vector.Z=mesh->MNormals[i].Z;
86
-
vertex.Normal=vector;
87
-
}
78
+
vertex.Normal=mesh->MNormals[i];
79
+
// tangent
80
+
if(mesh->MTangents!=null)
81
+
vertex.Tangent=mesh->MTangents[i];
82
+
// bitangent
83
+
if(mesh->MBitangents!=null)
84
+
vertex.Bitangent=mesh->MBitangents[i];
85
+
88
86
// texture coordinates
89
87
if(mesh->MTextureCoords[0]!=null)// does the mesh contain texture coordinates?
90
88
{
91
-
Vector2vec=newVector2();
92
89
// a vertex can contain up to 8 different texture coordinates. We thus make the assumption that we won't
93
90
// use models where a vertex can have multiple texture coordinates so we always take the first set (0).
0 commit comments