# HG changeset patch # User saiam # Date 1228058117 0 # Node ID d6f2b9912449cc3b04c356fe60e54e88ecf448bb # Parent 233789c40c07ea0cf447763b16b4c9ca781c8e2d Not sure if this is the right way. But a lot simpler it is. diff -r 233789c40c07 -r d6f2b9912449 src/proto2/Physics.cc --- a/src/proto2/Physics.cc Sun Nov 30 14:58:48 2008 +0000 +++ b/src/proto2/Physics.cc Sun Nov 30 15:15:17 2008 +0000 @@ -280,10 +280,20 @@ * Computes hitten wall's normal. Calculated from 3*3 grid */ Vector PhysicsWorld::getNormal (Vector hitPoint, Vector prevPoint) { + // Why doesn't this work + Vector normal(0,0); + for (int i = 0; i < 8; i++) { + if (getType(hitPoint+DIRECTIONS[i]) == EMPTY) + normal += DIRECTIONS[i]; + } + return normal; + + /* // Search free points with bfs and put them to vector std::vector frees; Vector hit(hitPoint); - Vector prev(prevPoint); + Vector pre(prevPoint); + assert(hit != prev); @@ -312,6 +322,7 @@ } Engine::log(DEBUG, "physics.getNormal ") << "normal: " << normal; return normal; + */ } /**