[Super-tux-commit] supertux/lib/special collision.cpp,1.3,1.4
Brought to you by:
wkendrick
From: Matze B. <mat...@us...> - 2004-11-25 13:16:18
|
Update of /cvsroot/super-tux/supertux/lib/special In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24663/lib/special Modified Files: collision.cpp Log Message: added missing time calculation to slopes Index: collision.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/special/collision.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- collision.cpp 24 Nov 2004 14:10:22 -0000 1.3 +++ collision.cpp 25 Nov 2004 13:15:57 -0000 1.4 @@ -108,11 +108,15 @@ break; } - float depth = -(normal * p1) - c; + float n_p1 = -(normal * p1); + float depth = n_p1 - c; if(depth < 0) return false; - if(depth < hit.depth) { + float time = depth / -(normal * movement); + if(time < hit.time) { + printf("Time: %f.\n", time); hit.depth = depth; + hit.time = time; hit.normal = normal; } |