#include <acknex.h>
#include <default.c>
VECTOR vec_temp;
void debug_draw_cone(ENTITY* ent, COLOR* colour, var size, int ang){
int i = 0;
draw_line3d(vector(ent.x, ent.y, ent.z + ent.min_z + 4), NULL, 100);
for(i = 0; i < ang; i++){
vec_temp.x = ent.x + (sin(i - (ang/2) - ent.pan + 90) * size);
vec_temp.y = ent.y + (cos(i - (ang/2) - ent.pan + 90) * size);
vec_temp.z = ent.z + ent.min_z + 4;
draw_line3d(vec_temp, colour, 100);
i++;
}
draw_line3d(vector(ent.x, ent.y, ent.z + ent.min_z + 4), colour, 100);
}
void debug_draw_cross(VECTOR* vecPos, COLOR* colour, var len){
draw_line3d(vector(vecPos.x + len, vecPos.y + len, vecPos.z + len), NULL, 100);
draw_line3d(vector(vecPos.x - len, vecPos.y - len, vecPos.z - len), colour, 100);
draw_line3d(vector(vecPos.x - len, vecPos.y - len, vecPos.z + len), NULL, 100);
draw_line3d(vector(vecPos.x + len, vecPos.y + len, vecPos.z - len), colour, 100);
draw_line3d(vector(vecPos.x + len, vecPos.y - len, vecPos.z + len), NULL, 100);
draw_line3d(vector(vecPos.x - len, vecPos.y + len, vecPos.z - len), colour, 100);
draw_line3d(vector(vecPos.x - len, vecPos.y + len, vecPos.z + len), NULL, 100);
draw_line3d(vector(vecPos.x + len, vecPos.y - len, vecPos.z - len), colour, 100);
}
void debug_draw_scan(VECTOR* vecFrom, VECTOR* vecTo, COLOR* colour){
debug_draw_cross(vecFrom, colour, 5);
draw_line3d(vecFrom, colour, 100);
draw_line3d(vecTo, colour, 100);
debug_draw_cross(vecTo, colour, 5);
}
action act_cube(){
VECTOR vecFrom;
VECTOR vecTo;
while(me){
//c_scan ... blah
vec_set(vecFrom,my.x);
vec_set(vecTo,my.x);
vecFrom.z += 100;
vecTo.z -= 100;
debug_draw_scan(vecFrom, vecTo, COLOR_RED);
// debug_draw_cone(me, COLOR_GREEN, 100, 180);
my.pan += time_step;
wait(1);
}
}
void main(){
wait(1);
level_load(NULL);
vec_set(camera.x, vector(-40, -25, 120));
camera.tilt = -25;
ent_create(CUBE_MDL, vector(200, 0, 0), act_cube);
}