Changeset 186 in flairsrc for trunk/lib/FlairCore/src/OneAxisRotation_impl.cpp
 Timestamp:
 Jun 23, 2017, 5:33:03 PM (4 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/lib/FlairCore/src/OneAxisRotation_impl.cpp
r167 r186 22 22 #include <Euler.h> 23 23 #include <Quaternion.h> 24 #include <math.h> 24 25 25 26 using std::string; … … 41 42 OneAxisRotation_impl::~OneAxisRotation_impl() {} 42 43 43 // compute rotation of each axis through ComputeRotation(Vector3D& vector)44 44 void OneAxisRotation_impl::ComputeRotation(Quaternion &quat) const { 45 Vector3Df rot = Vector3Df(quat.q1, quat.q2, quat.q3); 46 ComputeRotation(rot); 47 quat.q1 = rot.x; 48 quat.q2 = rot.y; 49 quat.q3 = rot.z; 45 Quaternion rot; 46 switch (rot_axe>CurrentIndex()) { 47 case 0: 48 rot=Quaternion(cosf(Euler::ToRadian(rot_value>Value()/2)),sinf(Euler::ToRadian(rot_value>Value()/2)), 0,0); 49 break; 50 case 1: 51 rot=Quaternion(cosf(Euler::ToRadian(rot_value>Value()/2)),0,sinf(Euler::ToRadian(rot_value>Value()/2)),0); 52 break; 53 case 2: 54 rot=Quaternion(cosf(Euler::ToRadian(rot_value>Value()/2)),0,0,sinf(Euler::ToRadian(rot_value>Value()/2))); 55 break; 56 } 57 quat=quat*rot; 50 58 } 51 59
Note: See TracChangeset
for help on using the changeset viewer.