Due to weak design, I had to rewrite my WHOLE math library and things related with math. Instead, I found out that I can use GLM. If you have encountered my previous questions, I have been dealing with skeletal animation so I have to upload large quantities of mat4s, vec3, vec2s. Here is my previous vertex struct :
struct Vertex {
Vec3 pos;
Vec3 normal;
Vec2 uv;
Vec4 boneindex;
Vec4 weightbias;
};
Unfortunately I have found out that my math library was not POD and I tried to upload the whole struct and I sure got weird results. Same for my final bone matrices defined as :
Mat4 bones[numBones];
and I also tried to upload that at once.
I just wonder If I replace my Vec3s, Vec2s and Mat4s with glm::vec3, vec2, mat4 and directly upload the whole Vertex struct (number of vertices times) and set an offset for each data using:
glBindBuffer(GL_ARRAY_BUFFER,everythingVBO);
glVertexAttribPointer(xx,xx,xx,xx, BUFFER_OFFSET(0)) // pos
glVertexAttribPointer(xx,xx,xx,xx, BUFFER_OFFSET(sizeof(glm::vec3)) // norm
..
..
same for matrix
glUniformMatrix4fv(xx, numBones, xx, glm::mat4 value)
.
Will it work as intended ? I just don't want to re-write whole thing and this time I must make sure that It works because I don't want to face another failure again.