13 lines
289 B
C++
13 lines
289 B
C++
#include "transform.h"
|
|
|
|
glm::mat4 Transform::getMatrix() const
|
|
{
|
|
return glm::toMat4(m_rotation) * glm::translate(glm::mat4(), m_position);
|
|
}
|
|
|
|
void Transform::setFromMatrix(const glm::mat4& mat)
|
|
{
|
|
m_position = glm::vec3(mat[3]);
|
|
m_rotation = glm::conjugate(glm::toQuat(mat));
|
|
}
|