iMSTK
Interactive Medical Simulation Toolkit
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
imstkIsometricMap.cpp
1 /*
2 ** This file is part of the Interactive Medical Simulation Toolkit (iMSTK)
3 ** iMSTK is distributed under the Apache License, Version 2.0.
4 ** See accompanying NOTICE for details.
5 */
6 
7 #include "imstkIsometricMap.h"
8 #include "imstkGeometry.h"
9 #include "imstkLogger.h"
10 
11 namespace imstk
12 {
13 void
15 {
16  // Decompose when using offset
17  if (m_useOffset)
18  {
19  Vec3d position = Vec3d::Zero();
20  Mat3d orientation = Mat3d::Identity();
21  Vec3d scale = Vec3d::Ones();
22  const Mat4d& transform = getParentGeometry()->getTransform();
23  mat4dTRS(transform, position, orientation, scale);
24 
25  getChildGeometry()->setTransform(
26  mat4dTranslate(position + orientation * m_localOffset) *
27  mat4dRotation(orientation));
28  }
29  else
30  {
31  getChildGeometry()->setTransform(getParentGeometry()->getTransform());
32  }
33 }
34 } // namespace imstk
void requestUpdate() override
Apply the map.
Compound Geometry.