AffineParts.h 890 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #ifndef CRYINCLUDE_EDITOR_UTIL_AFFINEPARTS_H
  9. #define CRYINCLUDE_EDITOR_UTIL_AFFINEPARTS_H
  10. #pragma once
  11. struct AffineParts
  12. {
  13. Vec3 pos; //!< Translation components
  14. Quat rot; //!< Essential rotation.
  15. Quat rotScale; //!< Stretch rotation.
  16. Vec3 scale; //!< Stretch factors.
  17. float fDet; //!< Sign of determinant.
  18. /** Decompose matrix to its affine parts.
  19. */
  20. void Decompose(const Matrix34& mat);
  21. /** Decompose matrix to its affine parts.
  22. Assume there`s no stretch rotation.
  23. */
  24. void SpectralDecompose(const Matrix34& mat);
  25. };
  26. #endif // CRYINCLUDE_EDITOR_UTIL_AFFINEPARTS_H