diff options
author | Rafael Campos <rafaelcdn@gmail.com> | 2014-04-30 18:29:17 +0400 |
---|---|---|
committer | Rafael Campos <rafaelcdn@gmail.com> | 2014-04-30 18:29:17 +0400 |
commit | 155805b20959a7a41eb7e4fbbc4c5fad4c546869 (patch) | |
tree | b4e191219c33736ed40ab073f541ab7a338f41f4 /intern/iksolver | |
parent | 43481aa943508f742c897efaff0904281e1911f3 (diff) | |
parent | a15be343895d4f3481eb349b4d145ffbe1c10dce (diff) |
updated master into branch
Diffstat (limited to 'intern/iksolver')
-rw-r--r-- | intern/iksolver/intern/TNT/tntmath.h | 2 | ||||
-rw-r--r-- | intern/iksolver/test/ik_glut_test/intern/main.cpp | 62 |
2 files changed, 30 insertions, 34 deletions
diff --git a/intern/iksolver/intern/TNT/tntmath.h b/intern/iksolver/intern/TNT/tntmath.h index a1fef28075c..be72796da59 100644 --- a/intern/iksolver/intern/TNT/tntmath.h +++ b/intern/iksolver/intern/TNT/tntmath.h @@ -34,7 +34,7 @@ // conventional functions required by several matrix algorithms -#ifdef _WIN32 +#if defined(_MSC_VER) && (_MSC_VER < 1800) #define hypot _hypot #endif diff --git a/intern/iksolver/test/ik_glut_test/intern/main.cpp b/intern/iksolver/test/ik_glut_test/intern/main.cpp index 86fea76ef70..bfb9d8fa1a0 100644 --- a/intern/iksolver/test/ik_glut_test/intern/main.cpp +++ b/intern/iksolver/test/ik_glut_test/intern/main.cpp @@ -40,62 +40,58 @@ #include "MyGlutMouseHandler.h" #include "MyGlutKeyHandler.h" #include "ChainDrawer.h" - -void -init(MT_Vector3 min,MT_Vector3 max) + +void init(MT_Vector3 min,MT_Vector3 max) { - GLfloat light_diffuse0[] = {1.0, 0.0, 0.0, 1.0}; /* Red diffuse light. */ GLfloat light_position0[] = {1.0, 1.0, 1.0, 0.0}; /* Infinite light location. */ GLfloat light_diffuse1[] = {1.0, 1.0, 1.0, 1.0}; /* Red diffuse light. */ GLfloat light_position1[] = {1.0, 0, 0, 0.0}; /* Infinite light location. */ - /* Enable a single OpenGL light. */ - glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse0); - glLightfv(GL_LIGHT0, GL_POSITION, light_position0); + /* Enable a single OpenGL light. */ + glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse0); + glLightfv(GL_LIGHT0, GL_POSITION, light_position0); - glLightfv(GL_LIGHT1, GL_DIFFUSE, light_diffuse1); - glLightfv(GL_LIGHT1, GL_POSITION, light_position1); + glLightfv(GL_LIGHT1, GL_DIFFUSE, light_diffuse1); + glLightfv(GL_LIGHT1, GL_POSITION, light_position1); - glEnable(GL_LIGHT0); - glEnable(GL_LIGHT1); - glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + glEnable(GL_LIGHT1); + glEnable(GL_LIGHTING); - /* Use depth buffering for hidden surface elimination. */ - glEnable(GL_DEPTH_TEST); + /* Use depth buffering for hidden surface elimination. */ + glEnable(GL_DEPTH_TEST); - /* Setup the view of the cube. */ - glMatrixMode(GL_PROJECTION); + /* Setup the view of the cube. */ + glMatrixMode(GL_PROJECTION); // center of the box + 3* depth of box - MT_Vector3 center = (min + max) * 0.5; - MT_Vector3 diag = max - min; + MT_Vector3 center = (min + max) * 0.5; + MT_Vector3 diag = max - min; float depth = diag.length(); float distance = 2; - gluPerspective( - /* field of view in degree */ 40.0, - /* aspect ratio */ 1.0, - /* Z near */ 1.0, - /* Z far */ distance * depth * 2 - ); - glMatrixMode(GL_MODELVIEW); + gluPerspective(/* field of view in degree */ 40.0, + /* aspect ratio */ 1.0, + /* Z near */ 1.0, + /* Z far */ distance * depth * 2 + ); + glMatrixMode(GL_MODELVIEW); - gluLookAt( - center.x(), center.y(), center.z() + distance*depth, /* eye is at (0,0,5) */ - center.x(), center.y(), center.z(), /* center is at (0,0,0) */ - 0.0, 1.0, 0.); /* up is in positive Y direction */ + gluLookAt(center.x(), center.y(), center.z() + distance*depth, /* eye is at (0,0,5) */ + center.x(), center.y(), center.z(), /* center is at (0,0,0) */ + 0.0, 1.0, 0.); /* up is in positive Y direction */ + + glPushMatrix(); - glPushMatrix(); - } -int -main(int argc, char **argv) + +int main(int argc, char **argv) { |