Skip to content

Commit 4ea22e5

Browse files
authored
Merge pull request #51 from Im-Rises/develop
Corrected matrix bug
2 parents 2e7bf2d + a2fbab6 commit 4ea22e5

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

PhysicalEngine/Scene/GameObject.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@ void GameObject::draw(int display_w, int display_h, glm::mat4 view, float fov) {
100100

101101
// Matrix calculations
102102
auto matrix = transform.getMatrix();
103-
//auto m3 = matrix.extractMatrix33();
104-
//m3.inverseMat();
105-
//Matrix34 m4=matrix.matrix34FromRotationTranslation(m3, Vector3d(matrix(0, 3), matrix(1, 3), matrix(2, 3)));
106-
103+
// auto m3 = matrix.extractMatrix33();
104+
// m3.inverseMat();
105+
// Matrix34 m4=matrix.matrix34FromRotationTranslation(m3, Vector3d(matrix(0, 3), matrix(1, 3), matrix(2, 3)));
106+
107107
glm::mat4 model = convertToGlmMat4(matrix);
108108
glm::mat4 projection = glm::mat4(1.0f);
109109
projection = glm::perspective(glm::radians(fov / 2), static_cast<float>(display_w) / static_cast<float>(display_h),
@@ -176,10 +176,10 @@ Scene* GameObject::getScenePtr() const {
176176
}
177177

178178
glm::mat4 GameObject::convertToGlmMat4(Matrix34& matrix) const {
179-
//remplire colonne par colonne ... oui c'est con
179+
// remplire colonne par colonne
180180
return glm::mat4(matrix(0, 0), matrix(1, 0), matrix(2, 0), 0,
181181
matrix(0, 1), matrix(1, 1), matrix(2, 1), 0,
182-
matrix(0, 2), matrix(2, 1), matrix(2, 2), 0,
182+
matrix(0, 2), matrix(1, 2), matrix(2, 2), 0,
183183
matrix(0, 3), matrix(1, 3), matrix(2, 3), 1);
184184
}
185185

0 commit comments

Comments
 (0)