MCPcopy Create free account
hub / github.com/BoomingTech/Piccolo / rotate

Method rotate

engine/source/runtime/function/animation/node.cpp:135–157  ·  view source on GitHub ↗

-----------------------------------------------------------------------

Source from the content-addressed store, hash-verified

133
134 //-----------------------------------------------------------------------
135 void Node::rotate(const Quaternion& q, TransformSpace relativeTo)
136 {
137 // Normalize Quaternionernion to avoid drift
138 Quaternion qnorm = q;
139 qnorm.normalise();
140
141 switch (relativeTo)
142 {
143 case TransformSpace::AREN:
144 // Rotations are normally relative to local axes, transform up
145 m_orientation = qnorm * m_orientation;
146 break;
147 case TransformSpace::OBJECT:
148 // Rotations are normally relative to local axes, transform up
149 m_orientation = m_orientation * _getDerivedOrientation().inverse() * qnorm * _getDerivedOrientation();
150 break;
151 case TransformSpace::LOCAL:
152 // Note the order of the mult, i.e. q comes after
153 m_orientation = m_orientation * qnorm;
154 break;
155 }
156 setDirty();
157 }
158
159 //-----------------------------------------------------------------------
160 //-----------------------------------------------------------------------

Callers 2

onCursorPosMethod · 0.45
applyAnimationMethod · 0.45

Calls 1

inverseMethod · 0.45

Tested by

no test coverage detected