Changeset 187 in flair-src for trunk/lib/FlairCore/src/OneAxisRotation_impl.cpp
- Timestamp:
- 07/04/17 09:38:26 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairCore/src/OneAxisRotation_impl.cpp
r186 r187 17 17 18 18 #include "OneAxisRotation_impl.h" 19 #include "OneAxisRotation.h" 19 20 #include "GroupBox.h" 20 21 #include "ComboBox.h" … … 31 32 template void OneAxisRotation_impl::ComputeRotation(Vector3D<double>&) const; 32 33 33 OneAxisRotation_impl::OneAxisRotation_impl(GroupBox *box ) {34 OneAxisRotation_impl::OneAxisRotation_impl(GroupBox *box,int rotationType) { 34 35 rot_value = 35 36 new DoubleSpinBox(box->NewRow(), "value", " deg", -180., 180., 10., 1); … … 38 39 rot_axe->AddItem("y"); 39 40 rot_axe->AddItem("z"); 41 this->rotationType=rotationType; 40 42 } 41 43 … … 45 47 Quaternion rot; 46 48 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 case 0://x 50 rot=Quaternion(cosf(Euler::ToRadian(-rot_value->Value()/2)),sinf(Euler::ToRadian(-rot_value->Value()/2)),0,0); 49 51 break; 50 case 1: 51 rot=Quaternion(cosf(Euler::ToRadian( rot_value->Value()/2)),0,sinf(Euler::ToRadian(rot_value->Value()/2)),0);52 case 1://y 53 rot=Quaternion(cosf(Euler::ToRadian(-rot_value->Value()/2)),0,sinf(Euler::ToRadian(-rot_value->Value()/2)),0); 52 54 break; 53 case 2: 54 rot=Quaternion(cosf(Euler::ToRadian( rot_value->Value()/2)),0,0,sinf(Euler::ToRadian(rot_value->Value()/2)));55 case 2://z 56 rot=Quaternion(cosf(Euler::ToRadian(-rot_value->Value()/2)),0,0,sinf(Euler::ToRadian(-rot_value->Value()/2))); 55 57 break; 56 58 } 57 quat=quat*rot; 59 if(rotationType==OneAxisRotation::RotationType_t::PreRotation) { 60 quat=rot*quat; 61 } else { //post rotation 62 quat=quat*rot; 63 } 58 64 } 59 65
Note:
See TracChangeset
for help on using the changeset viewer.