Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //-----------------------------------------------------------------------
- void Node::rotate(const quaternion &quat, const TransformSpace::TransformSpace &space)
- {
- // Skip if no rotation
- if(quat == quaternion::IDENTITY) return;
- // Apply in correct space
- switch(space)
- {
- // Frist rotate, then apply current
- case TransformSpace::LOCAL :
- _orientation *= quat;
- break;
- // First apply current, then rotate
- case TransformSpace::PARENT :
- _orientation = quat * _orientation;
- break;
- }
- // Normalize quaternion
- _orientation = _orientation.normalize();
- // Set update flag
- _update = true;
- }
Advertisement
Add Comment
Please, Sign In to add comment