Files
jak-project/test/goalc/source_templates/with_game/test-basic-vector-math.gc
T
water111 35bdc9b1d3 add an optional, less-accurate-but-faster sprite render and fix silly math bug (#1102)
* also add a new sprite renderer

* claaaang

* goal build fix

* fix tests, add stack singleton option

* make all event-message-blocks the same

* diskboot
2022-01-21 21:11:57 -05:00

24 lines
645 B
Common Lisp

(defun test-basic-vector-math ()
(let ((vector-0 (new 'stack 'vector))
(vector-1 (new 'stack 'vector))
(vector-2 (new 'stack 'vector)))
(set! (-> vector-0 x) 1.0)
(set! (-> vector-0 y) 2.0)
(set! (-> vector-0 z) 3.0)
(set! (-> vector-0 w) 4.0)
(set! (-> vector-1 x) 10.0)
(set! (-> vector-1 y) 20.0)
(set! (-> vector-1 z) 30.0)
(set! (-> vector-1 w) 40.1)
(.nop.vf)
(vector-! vector-2 vector-1 vector-0)
(.nop.vf)
; 9 + 18 + 27 + 1 = 55.0000
(format #t "~f~%" (+ (-> vector-2 x) (-> vector-2 y) (-> vector-2 z) (-> vector-2 w)))
)
)
(test-basic-vector-math)