Explorar el Código

Export with normal modifier (Closes #15)

Johannes Kreutz hace 2 años
padre
commit
dca865a2a8
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      trackpoint-app/src/TrackPoint.cpp

+ 2 - 1
trackpoint-app/src/TrackPoint.cpp

@@ -16,10 +16,11 @@ osg::Vec3 TrackPoint::getTranslation() {
 
 osg::Vec3 TrackPoint::getRotation() {
   osg::Vec3 start = osg::Vec3(0.0f, 0.0f, 1.0f);
+  osg::Vec3 finalNormal = _normal.operator+(_normalModifier);
 
   // From https://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles
   osg::Quat quat = osg::Quat(0.0f, 0.0f, 0.0f, 0.0f);
-  quat.makeRotate(start, _normal);
+  quat.makeRotate(start, finalNormal);
 
   float sinr_cosp = 2 * (quat.w() * quat.x() + quat.y() * quat.z());
   float cosr_cosp = 1 - 2 * (quat.x() * quat.x() + quat.y() * quat.y());