--- a/doc/kishna.tex Mon Dec 08 22:51:19 2008 +0000
+++ b/doc/kishna.tex Mon Dec 08 22:56:07 2008 +0000
@@ -142,24 +142,16 @@
iteration it checks if theres a collision (i.e. the type of the
current point is ROCK or DIRT).
-In the
-terrain-object collision the collision part is rather easy. When a
-object is about to move point A to point B we draw a line between
-those points. Then we iterate over that line and check that none of
-the vertices of the object's shape are inside the terrain. However, we
-have to be able to bounce the object from the terrain and in order to
-do that, a normal for the collision point needs to be calculated. For
-a polygon this would easy, but for a discrete array of pixels it's
-little bit different.
-
-We come up with the following algorithm for calculating an
+In order to implement bouncing from the terrain we have to have a way
+of calculating a normal for the slope of the terrain in the collision
+point. We came up with the following algorithm for calculating the
approximation for the normal. Take the collision point and the point
before the collision and consider a 3x3 array of pixels which has the
collision point in the middle of it. Then, do sort of an bredth-first
search from the previous point to get all the empty pixels. Take the
vectors from the collision point to the empty point and sum these
vectors. The resulting vector will point approximately along the
-normal. Picture explains this a lot.
+normal. % Picture would explain this a lot.
\subsection{Physics}