Pass linear body velocity to collision detection separately
authorparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Sat, 31 Jul 2010 22:18:20 +0000 (22:18 +0000)
committerparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Sat, 31 Jul 2010 22:18:20 +0000 (22:18 +0000)
This hack brought to you by obviously glitchy collision detection on
objects that have a non-identity orientation, linear velocity, but no
angular velocity.

git-svn-id: https://s.snth.net/svn/neverball/trunk@3227 78b8d119-cf0a-0410-b17c-f493084dd1d7

share/solid_sim_sol.c

index 50fead0..3cfa6f3 100644 (file)
@@ -558,8 +558,7 @@ static float sol_test_body(float dt,
 
         /* Transform velocity. */
 
-        v_sub(v, up->v, W);
-        q_rot(ball.v, e, v);
+        q_rot(ball.v, e, up->v);
 
         /* Also add the velocity from rotation. */
 
@@ -572,9 +571,7 @@ static float sol_test_body(float dt,
         v[1] = 0.0f;
         v[2] = 0.0f;
 
-        w[0] = 0.0f;
-        w[1] = 0.0f;
-        w[2] = 0.0f;
+        q_rot(w, e, W);
 
         if ((u = sol_test_node(t, U, &ball, fp, np, v, w)) < t)
         {