summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt2
-rw-r--r--facetracknoir/main.cpp3
-rw-r--r--facetracknoir/rotation.h15
-rw-r--r--facetracknoir/tracker.cpp2
4 files changed, 13 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c6176b6e..7bc0f497 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -474,7 +474,7 @@ endif()
endif()
add_executable(opentrack ${opentrack-win32-executable} ${opentrack-bin-c} ${opentrack-bin-moc} ${opentrack-bin-uih} ${opentrack-bin-rcc})
if(WIN32)
- target_link_libraries(opentrack opentrack-pose-widget opentrack-spline-widget ${MY_QT_LIBS} "${CMAKE_SOURCE_DIR}/dinput/dinput8.lib" "${CMAKE_SOURCE_DIR}/dinput/dxguid.lib" "${CMAKE_SOURCE_DIR}/dinput/strmiids.lib")
+ target_link_libraries(opentrack "${CMAKE_SOURCE_DIR}/dinput/dinput8.lib" "${CMAKE_SOURCE_DIR}/dinput/dxguid.lib" "${CMAKE_SOURCE_DIR}/dinput/strmiids.lib" winmm)
endif()
if(MSVC)
SET_TARGET_PROPERTIES(opentrack PROPERTIES LINK_FLAGS "/ENTRY:mainCRTStartup")
diff --git a/facetracknoir/main.cpp b/facetracknoir/main.cpp
index 01b9d8ea..8ba437bf 100644
--- a/facetracknoir/main.cpp
+++ b/facetracknoir/main.cpp
@@ -40,6 +40,9 @@
#endif
int main(int argc, char** argv)
{
+#if defined(_WIN32)
+ (void) timeBeginPeriod(1);
+#endif
QApplication app(argc, argv);
QFont font;
font.setFamily(font.defaultFamily());
diff --git a/facetracknoir/rotation.h b/facetracknoir/rotation.h
index a1500969..5385b545 100644
--- a/facetracknoir/rotation.h
+++ b/facetracknoir/rotation.h
@@ -17,7 +17,7 @@ public:
Rotation(double a, double b, double c, double d) : a(a),b(b),c(c),d(d) {}
Rotation inv(){ // inverse
- return Rotation(a,-b,-c,-d);
+ return Rotation(a,-b,-c, -d);
}
@@ -25,6 +25,7 @@ public:
// see http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles
void fromEuler(double yaw, double pitch, double roll)
{
+
double sin_phi = sin(roll/2.0);
double cos_phi = cos(roll/2.0);
double sin_the = sin(pitch/2.0);
@@ -38,7 +39,7 @@ public:
d = cos_phi*cos_the*sin_psi - sin_phi*sin_the*cos_psi;
}
- void toEuler(double& yaw, double& pitch, double& roll)
+ void Rotation::toEuler(double& yaw, double& pitch, double& roll)
{
roll = atan2(2.0*(a*b + c*d), 1.0 - 2.0*(b*b + c*c));
pitch = asin(2.0*(a*c - b*d));
@@ -47,17 +48,17 @@ public:
/* const Rotation operator*(const Rotation& A, const Rotation& B)
{
- return Rotation(A.a*B.a - A.b*B.b - A.c*B.c - A.d*B.d, // quaternion multiplication
- A.a*B.b + A.b*B.a + A.c*B.d - A.d*B.c,
- A.a*B.c - A.b*B.d + A.c*B.a + A.d*B.b,
- A.a*B.d + A.b*B.c - A.c*B.b + A.d*B.a);
+ return Rotation(A.w*B.w - A.x*B.x - A.y*B.y - A.z*B.z, // quaternion multiplication
+ A.w*B.x + A.x*B.w + A.y*B.z - A.z*B.y,
+ A.w*B.y - A.x*B.z + A.y*B.w + A.z*B.x,
+ A.w*B.z + A.x*B.y - A.y*B.x + A.z*B.w);
}*/
const Rotation operator*(const Rotation& B)
{
const Rotation& A = *this;
- return Rotation(A.a*B.a - A.b*B.b - A.c*B.c - A.d*B.d, // quaternion multiplication
+return Rotation(A.a*B.a - A.b*B.b - A.c*B.c - A.d*B.d, // quaternion multiplication
A.a*B.b + A.b*B.a + A.c*B.d - A.d*B.c,
A.a*B.c - A.b*B.d + A.c*B.a + A.d*B.b,
A.a*B.d + A.b*B.c - A.c*B.b + A.d*B.a);
diff --git a/facetracknoir/tracker.cpp b/facetracknoir/tracker.cpp
index 25e09126..e34bf25e 100644
--- a/facetracknoir/tracker.cpp
+++ b/facetracknoir/tracker.cpp
@@ -200,7 +200,7 @@ void Tracker::run() {
}
//for lower cpu load
- usleep(1000);
+ msleep(1);
}
for (int i = 0; i < 6; i++)