action movable_glass()
{
c_setminmax(my);
pXent_settype(my,PH_RIGID,PH_CAPSULE );
pXent_setfriction (my, 50);
pXent_setdamping (my, 100, 100);
set (my, POLYGON);
my.emask |= ENABLE_SONAR;
my.event = entity_event_trace; // never put parenthesis to the function here!
}
function entity_event_trace()
{
vec_set(my.x,camera.x +30);
c_setminmax(my);
pXent_settype(my,PH_RIGID,PH_CAPSULE );
pXent_setfriction (my, 50);
pXent_setdamping (my, 100, 100);
set (my, POLYGON);
ANGLE my_pan;
if (event_type == EVENT_SONAR)
{
while (geworfen ==0)
{
camera.roll=0;
set(my,POLYGON);
vec_rotate(my.x,camera.pan);
vec_add(my.x,camera.x);
pXent_setposition(my, vector(30, 0, -10));
vec_set(my.pan,camera.pan);
my.pan = camera.pan;
my.tilt = camera.tilt;
smooth(my.pan, 0.3);
smooth(my.tilt, 0.3);
if (mouse_right)
{
geworfen =1;
}
wait (1);
}
}
}