@@ 22,7 22,9 @@ class TransformComp: public Component
glm::mat4 GetMatrix()
{
- return glm::scale(glm::translate(glm::mat4(1.0f), translation), scale) * glm::toMat4(rotation);
+ return glm::translate(glm::mat4(1.0f), translation)
+ * glm::toMat4(rotation)
+ * glm::scale(glm::mat4(1.0f), scale);
}
glm::mat4 GetMatrixWorld()
@@ 30,11 32,10 @@ class TransformComp: public Component
glm::mat4 m = GetMatrix();
Node *parent = GetNode()->GetParent();
- if(parent == nullptr)
+ if(!parent)
return m;
-
TransformComp *parent_transform = parent->GetTransformComp();
- if(parent_transform == nullptr)
+ if(!parent_transform)
return m;
return parent_transform->GetMatrixWorld() * m;