;;-*-Lisp-*- (in-package goal) ;; definition for function position-in-front-of-camera! (defun position-in-front-of-camera! ((arg0 vector) (arg1 float) (arg2 float)) (vector-float*! arg0 (-> *math-camera* inv-camera-rot fvec) arg1) (vector+float*! arg0 arg0 (-> *math-camera* inv-camera-rot uvec) arg2) (vector+! arg0 arg0 (-> *math-camera* trans)) arg0 ) ;; definition for function position-in-front-of-screen! (defun position-in-front-of-screen! ((arg0 vector) (arg1 float) (arg2 vector)) (let ((a2-1 (vector-negate! (new 'stack-no-clear 'vector) (-> *math-camera* inv-camera-rot fvec))) (a1-3 (vector-float*! (new 'stack-no-clear 'vector) (-> *math-camera* inv-camera-rot fvec) arg1)) ) (vector+! a1-3 a1-3 (-> *math-camera* trans)) (reverse-transform-point! arg0 a1-3 a2-1 arg2) ) arg0 ) ;; definition for function matrix-local->world (defun matrix-local->world ((arg0 symbol) (arg1 symbol)) (if arg0 (-> *math-camera* inv-camera-rot-smooth) (-> *math-camera* inv-camera-rot) ) ) ;; definition for function matrix-world->local (defun matrix-world->local ((arg0 symbol) (arg1 object)) (-> *math-camera* camera-rot) ) ;; definition (perm) for symbol *camera-dummy-vector*, type vector (define-perm *camera-dummy-vector* vector (vector-reset! (new 'global 'vector))) ;; definition for function camera-pos (defun camera-pos () (cond (*camera-combiner* (-> *camera-combiner* trans) ) (*math-camera* (-> *math-camera* trans) ) (else *camera-dummy-vector* ) ) ) ;; definition for function math-camera-pos (defun math-camera-pos () (-> *math-camera* trans) ) ;; definition for function camera-matrix (defun camera-matrix () (if *camera-combiner* (-> *camera-combiner* inv-camera-rot) (-> *math-camera* inv-camera-rot) ) ) ;; definition for function math-camera-matrix (defun math-camera-matrix () (-> *math-camera* inv-camera-rot) ) ;; definition for function camera-angle (defun camera-angle () (let ((f0-0 (-> *math-camera* camera-rot rvec x)) (f1-0 (-> *math-camera* camera-rot rvec z)) ) (atan f1-0 f0-0) ) ) ;; definition for function camera-teleport-to-entity ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs symbol. (defbehavior camera-teleport-to-entity process ((arg0 entity-actor)) (let ((gp-0 (new 'stack 'transformq))) (set! (-> gp-0 trans quad) (-> arg0 extra trans quad)) (quaternion-copy! (-> gp-0 quat) (-> arg0 quat)) (vector-identity! (-> gp-0 scale)) (the-as symbol (send-event *camera* 'teleport-to-transformq gp-0)) ) ) ;; definition for function camera-teleport-to-entity-named ;; WARN: Return type mismatch int vs none. (defun camera-teleport-to-entity-named ((arg0 string)) (let* ((gp-0 (entity-by-name arg0)) (a0-3 (if (type? gp-0 entity-actor) gp-0 ) ) ) (if a0-3 (camera-teleport-to-entity (the-as entity-actor a0-3)) (format #t "sorry, couldn't find an actor named '~S'~%" arg0) ) ) 0 (none) ) ;; definition for function camera-teleport-to-location ;; WARN: Return type mismatch int vs none. (defun camera-teleport-to-location ((arg0 float) (arg1 float) (arg2 float)) (let ((v1-1 (new 'stack 'transformq))) (set-vector! (-> v1-1 trans) (* 4096.0 arg0) (* 4096.0 arg1) (* 4096.0 arg2) 1.0) (send-event *camera* 'teleport-to-transformq v1-1) ) 0 (none) )