mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-04-15 23:06:04 +02:00
normalize axes returned by Mat4.getForward getUp and getRight
This commit is contained in:
parent
e3f799d039
commit
521f64f152
1 changed files with 4 additions and 3 deletions
|
@ -70,15 +70,16 @@ glm::mat4 Mat4::inverse(const glm::mat4& m) const {
|
|||
}
|
||||
|
||||
glm::vec3 Mat4::getForward(const glm::mat4& m) const {
|
||||
return -glm::vec3(m[2]);
|
||||
// -z is forward
|
||||
return -glm::normalize(glm::vec3(m[2]));
|
||||
}
|
||||
|
||||
glm::vec3 Mat4::getRight(const glm::mat4& m) const {
|
||||
return glm::vec3(m[0]);
|
||||
return glm::normalize(glm::vec3(m[0]));
|
||||
}
|
||||
|
||||
glm::vec3 Mat4::getUp(const glm::mat4& m) const {
|
||||
return glm::vec3(m[1]);
|
||||
return glm::normalize(glm::vec3(m[1]));
|
||||
}
|
||||
|
||||
void Mat4::print(const QString& label, const glm::mat4& m, bool transpose) const {
|
||||
|
|
Loading…
Reference in a new issue