| 474 | } |
| 475 | |
| 476 | void Node::SetPosition(const Vector3f& position, CoordSys coordSys) |
| 477 | { |
| 478 | switch (coordSys) |
| 479 | { |
| 480 | case CoordSys_Global: |
| 481 | if (m_parent && m_inheritPosition) |
| 482 | { |
| 483 | if (!m_parent->m_derivedUpdated) |
| 484 | m_parent->UpdateDerived(); |
| 485 | |
| 486 | m_position = (m_parent->m_derivedRotation.GetConjugate()*(position - m_parent->m_derivedPosition))/m_parent->m_derivedScale - m_initialPosition; |
| 487 | } |
| 488 | else |
| 489 | m_position = position - m_initialPosition; |
| 490 | break; |
| 491 | |
| 492 | case CoordSys_Local: |
| 493 | m_position = position; |
| 494 | break; |
| 495 | } |
| 496 | |
| 497 | InvalidateNode(); |
| 498 | } |
| 499 | |
| 500 | void Node::SetPosition(float positionX, float positionY, float positionZ, CoordSys coordSys) |
| 501 | { |
no test coverage detected