1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
<action name="drag" scope="local">
<!-- drag the spots around in 3D space -->
copy(last_mouse_x, mouse.x);
copy(last_mouse_y, mouse.y);
copy(last_view_tx, view.tx);
copy(last_view_ty, view.ty);
copy(last_view_tz, view.tz);
asyncloop(caller.pressed,
<!-- kind of working condition for four-wall room -->
if((caller.ath == 90) OR (caller.ath == '-90')
,
trace('wall 1 or 3);
copy(x, tempwalltx);
calc(y, caller.ty - view.ty);
calc(z, caller.tz - view.tz);
,
trace('wall 2 or 4');
calc(x, caller.tx - view.tx);
calc(y, caller.ty - view.ty);
copy(z, tempwalltz);
);
spacetosphere(x,y,z, h,v,d);
spheretoscreen(h,v, screen_x,screen_y);
calc(screen_x, screen_x + (mouse.x - last_mouse_x));
calc(screen_y, screen_y + (mouse.y - last_mouse_y));
copy(last_mouse_x, mouse.x);
copy(last_mouse_y, mouse.y);
screentosphere(screen_x,screen_y, h,v);
spheretospace(h,v,d, x,y,z);
calc(caller.tx, x + view.tx + (view.tx - last_view_tx));
calc(caller.ty, y + view.ty + (view.ty - last_view_ty));
calc(caller.tz, z + view.tz + (view.tz - last_view_tz));
copy(last_view_tx, view.tx);
copy(last_view_ty, view.ty);
copy(last_view_tz, view.tz);
);
</action>
|