| 503 | } |
| 504 | |
| 505 | void Node::SetRotation(const Quaternionf& rotation, CoordSys coordSys) |
| 506 | { |
| 507 | // Évitons toute mauvaise surprise .. |
| 508 | Quaternionf q(rotation); |
| 509 | q.Normalize(); |
| 510 | |
| 511 | switch (coordSys) |
| 512 | { |
| 513 | case CoordSys_Global: |
| 514 | if (m_parent && m_inheritRotation) |
| 515 | { |
| 516 | Quaternionf rot(m_parent->GetRotation() * m_initialRotation); |
| 517 | |
| 518 | m_rotation = rot.GetConjugate() * q; |
| 519 | } |
| 520 | else |
| 521 | m_rotation = q; |
| 522 | |
| 523 | break; |
| 524 | |
| 525 | case CoordSys_Local: |
| 526 | m_rotation = q; |
| 527 | break; |
| 528 | } |
| 529 | |
| 530 | InvalidateNode(); |
| 531 | } |
| 532 | |
| 533 | void Node::SetScale(const Vector3f& scale, CoordSys coordSys) |
| 534 | { |
no test coverage detected