// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#include <config.h>
#include <sys/types.h>
#include <iconv.h>
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;
}