#include <acknex.h>
#include <default.c>
void main()
{
level_load(NULL); wait(1); vec_set(camera.x, vector(-50, 0, 15));
ent_create(CUBE_MDL, vector(20,20,20), NULL); //'spare' target
me = ent_create(CUBE_MDL, nullvector, NULL);
wait(1); c_setminmax(me);
set(me, LIGHT); vec_set(me.blue, vector(0,0,200));
VECTOR to; vec_set(to, vector(me.x, me.y, me.z+20));
while(1)
{
to.x += (key_cuu - key_cud) / 5 * time_step;
to.y += (key_cul - key_cur) / 5 * time_step;
to.z += (key_home - key_end) / 5 * time_step;
var dist = c_trace(me.x, to, USE_POLYGON);
if(dist != 0)
{ draw_line3d(me.x, COLOR_RED, 100);
draw_line3d(to, COLOR_RED, 100);
draw_point3d(hit.x, COLOR_RED, 100, 0.25);
draw_text("HITTING!", 10, 10, COLOR_RED); }
if(dist == 0)
{ draw_line3d(me.x, COLOR_BLUE, 100);
draw_line3d(to, COLOR_BLUE, 100);
draw_text("NOT hitting.", 10, 10, COLOR_BLUE); }
wait(1);
}
}