Skip to content

Commit

Permalink
More efficient way for ofNode::getGlobalOrientation (3x~ faster) (#6094)
Browse files Browse the repository at this point in the history
Fixes #6025
  • Loading branch information
yusuketomoto authored and arturoc committed Aug 1, 2018
1 parent 17c2246 commit a0c412a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libs/openFrameworks/3d/ofNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,8 +561,8 @@ glm::vec3 ofNode::getGlobalPosition() const {

//----------------------------------------
glm::quat ofNode::getGlobalOrientation() const {
auto rot = glm::scale(getGlobalTransformMatrix(), 1.f/getGlobalScale());
return glm::toQuat(rot);
if (parent) return parent->getGlobalOrientation() * getOrientationQuat();
return getOrientationQuat();
}

//----------------------------------------
Expand Down

0 comments on commit a0c412a

Please sign in to comment.