-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmorz_pc_rgen.as
72 lines (60 loc) · 2.39 KB
/
morz_pc_rgen.as
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
.PROGRAM morz_pc_rgen()
; Copyright (C) 2014 Marco Maddiona, Riccardo Orizio, Mattia Rizzini, Maurizio Zucchelli
;
; This program is free software: you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program. If not, see <http://www.gnu.org/licenses/>.
;
; For any further information please contact us at
;
; Program which simulates points on a circumference, creating velocity to
; reach them.
;
; Created: 14 May 2014
; Last edited: 15 May 2014
morz_sig = 2048
.morz_angle = 0
.morz_radius = 10
.morz_dangle = 1
.morz_circ = 360
.morz_wait = 0.1
.morz_count = 0
DECOMPOSE .morz_m_c[0] = morz_m_cen
WHILE TRUE DO
; Creating the rotation values for Kiwi
; .morz_new_rx = .morz_radius * COS( .morz_angle ) + .morz_m_c[3]
; .morz_new_ry = .morz_radius * SIN( .morz_angle ) + .morz_m_c[4]
; .morz_new_rz = .morz_radius * SIN( .morz_angle ) + .morz_m_c[5]
.morz_new_rx = .morz_m_c[3] + 5
.morz_new_ry = .morz_m_c[4]
.morz_new_rz = .morz_m_c[5]
DECOMPOSE .morz_old_val[0] = HERE
.morz_old_rx = .morz_old_val[3]
.morz_old_ry = .morz_old_val[4]
.morz_old_rz = .morz_old_val[5]
morz_rx = .morz_new_rx - .morz_old_rx
morz_ry = .morz_new_ry - .morz_old_ry
morz_rz = .morz_new_rz - .morz_old_rz
; Notify of the new info
SIGNAL morz_sig
; Incrementing the angle of the circle, depending on the update time
.morz_count = ( .morz_count + 1 ) MOD ( 0.1 / .morz_wait )
IF .morz_count == 0 THEN
.morz_angle = ( .morz_angle + .morz_dangle ) MOD .morz_circ
; PRINT "Catch me: nrx = ", .morz_new_rx, "\tnry = ", .morz_new_ry, "\tnrz = ", .morz_new_rz
; PRINT "Catch me: orx = ", .morz_old_rx, "\tory = ", .morz_old_ry, "\torz = ", .morz_old_rz
; PRINT "Catch me: rx = ", morz_rx, "\try = ", morz_ry, "\trz = ", morz_rz
END
TWAIT .morz_wait
END
.END