* --------------------------------------------------------------------------
* ----------------
*/
void ProjectPathOnCellWall(int SideNumber, Line2D MotionPath) {
// compute the normalized vector of the cell wall in question
Vector2f WallNormal = m_Side[SideNumber].EndPointB().subtract(
m_Side[SideNumber].EndPointA());
WallNormal = WallNormal.normalize();
// determine the vector of our current movement
Vector2f MotionVector = MotionPath.EndPointB().subtract(
MotionPath.EndPointA());
// compute dot product of our MotionVector and the normalized cell wall
// this gives us the magnatude of our motion along the wall
float DotResult = MotionVector.dot(WallNormal);
// our projected vector is then the normalized wall vector times our new
// found magnatude
MotionVector = WallNormal.mult(DotResult);
// redirect our motion path along the new reflected direction
MotionPath.SetEndPointB(MotionPath.EndPointA().add(MotionVector));
//
// Make sure starting point of motion path is within the cell
//
Vector2f NewPoint = MotionPath.EndPointA();
ForcePointToCellCollumn(NewPoint);
MotionPath.SetEndPointA(NewPoint);
//
// Make sure destination point does not intersect this wall again