#include <acknex.h>
<<<INCLUDE LINE-PLANE INTERSECTION TEST CODE HERE>>>
void main()
{
level_load(NULL);
mouse_mode = 4;
vec_set(camera.x, vector(-200,0,300));
camera.tilt = -45;
// Create a simple floor.
ENTITY *cube = ent_create(CUBE_MDL, NULLVECTOR, NULL);
cube.z -= cube.max_z;
vec_set(cube.scale_x, vector(8,8,1));
while(1)
{
VECTOR to;
vec_set(to,mouse_dir3d);
vec_add(to,mouse_pos3d);
// Get the intersection between the mouse ray and the floor.
VECTOR *ip = get_line_plane_intersection(mouse_pos3d, to, NULLVECTOR,
vector(0,0,1), NULL);
if (ip) // Draw intersection point.
draw_point3d(ip, COLOR_RED, 100, 6);
wait(1);
}
}