mirror of
https://github.com/open-goal/jak-project
synced 2026-06-06 11:47:44 -04:00
637990314b
Closes #736 --------- Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
596 lines
22 KiB
Common Lisp
596 lines
22 KiB
Common Lisp
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; name: manipulator.gc
|
|
;; name in dgo: manipulator
|
|
;; dgos: GAME
|
|
|
|
;; +++manipulator-action
|
|
(defenum manipulator-action
|
|
:type uint32
|
|
(ma0 0)
|
|
(ma1 1)
|
|
(ma2 2)
|
|
(ma3 3)
|
|
(ma4 4)
|
|
(ma5 5)
|
|
(ma6 6)
|
|
(ma7 7)
|
|
)
|
|
;; ---manipulator-action
|
|
|
|
|
|
;; +++manipulator-mode
|
|
(defenum manipulator-mode
|
|
:type uint32
|
|
(mm0 0)
|
|
(mm1 1)
|
|
(mm2 2)
|
|
)
|
|
;; ---manipulator-mode
|
|
|
|
|
|
;; DECOMP BEGINS
|
|
|
|
;; this file is debug only
|
|
(declare-file (debug))
|
|
|
|
(deftype manipulator (structure)
|
|
((action manipulator-action)
|
|
(mode manipulator-mode)
|
|
(dragging? symbol)
|
|
(position vector :inline)
|
|
(speed vector :inline)
|
|
(drag-ref-position vector :inline)
|
|
(mouse-ref-position vector :inline)
|
|
(mat matrix :inline)
|
|
(rotate-ref int32)
|
|
(angles euler-angles :inline)
|
|
)
|
|
(:methods
|
|
(set-mode (_type_ manipulator-mode) none)
|
|
(manipulator-method-10 (_type_ vector vector) none)
|
|
(manipulator-method-11 (_type_) none)
|
|
(manipulator-method-12 (_type_ vector) none)
|
|
(manipulator-method-13 (_type_ vector vector) none)
|
|
(manipulator-method-14 (_type_) none)
|
|
)
|
|
)
|
|
|
|
|
|
;; WARN: Return type mismatch symbol vs none.
|
|
(defun draw-axis ((arg0 vector) (arg1 vector) (arg2 float) (arg3 float) (arg4 rgba))
|
|
(rlet ((acc :class vf)
|
|
(vf0 :class vf)
|
|
(vf4 :class vf)
|
|
(vf5 :class vf)
|
|
(vf6 :class vf)
|
|
(vf7 :class vf)
|
|
)
|
|
(init-vf0-vector)
|
|
(let ((s1-0 (new 'stack-no-clear 'vector)))
|
|
(cond
|
|
((< (fabs (vector-dot arg1 *x-vector*)) 0.5)
|
|
(vector-cross! s1-0 *x-vector* arg1)
|
|
)
|
|
((< (fabs (vector-dot arg1 *y-vector*)) 0.5)
|
|
(vector-cross! s1-0 *y-vector* arg1)
|
|
)
|
|
(else
|
|
(vector-cross! s1-0 *z-vector* arg1)
|
|
)
|
|
)
|
|
(vector-cross! s1-0 s1-0 arg1)
|
|
(vector-normalize! s1-0 1.0)
|
|
(let ((s0-1 (vector+*! (new 'stack-no-clear 'vector) arg0 arg1 arg2))
|
|
(sv-160 0)
|
|
)
|
|
(while (< sv-160 8)
|
|
(let ((sv-176 add-debug-flat-triangle)
|
|
(sv-192 #t)
|
|
(sv-208 584)
|
|
(sv-224 (new 'stack-no-clear 'vector))
|
|
)
|
|
(let ((v1-16 s0-1))
|
|
(let ((a0-9 arg1))
|
|
(let ((a1-10 arg3))
|
|
(.mov vf7 a1-10)
|
|
)
|
|
(.lvf vf5 (&-> a0-9 quad))
|
|
)
|
|
(.lvf vf4 (&-> v1-16 quad))
|
|
)
|
|
(.add.x.vf.w vf6 vf0 vf0)
|
|
(.mul.x.vf.xyz acc vf5 vf7)
|
|
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
|
(.svf (&-> sv-224 quad) vf6)
|
|
(let ((sv-256 (new 'stack-no-clear 'vector)))
|
|
(let ((sv-240 s0-1))
|
|
(let* ((a2-3
|
|
(quaternion-vector-angle! (new 'stack-no-clear 'quaternion) arg1 (* 182.04445 (the float (* 45 sv-160))))
|
|
)
|
|
(v1-22 (vector-orient-by-quat! (new 'stack-no-clear 'vector) s1-0 a2-3))
|
|
)
|
|
(let ((a0-13 (/ arg3 4)))
|
|
(.mov vf7 a0-13)
|
|
)
|
|
(.lvf vf5 (&-> v1-22 quad))
|
|
)
|
|
(.lvf vf4 (&-> sv-240 quad))
|
|
)
|
|
(.add.x.vf.w vf6 vf0 vf0)
|
|
(.mul.x.vf.xyz acc vf5 vf7)
|
|
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
|
(.svf (&-> sv-256 quad) vf6)
|
|
(let ((sv-288 (new 'stack-no-clear 'vector)))
|
|
(let ((sv-272 s0-1))
|
|
(let* ((a2-7 (quaternion-vector-angle!
|
|
(new 'stack-no-clear 'quaternion)
|
|
arg1
|
|
(* 182.04445 (the float (* 45 (+ sv-160 1))))
|
|
)
|
|
)
|
|
(v1-29 (vector-orient-by-quat! (new 'stack-no-clear 'vector) s1-0 a2-7))
|
|
)
|
|
(let ((a0-17 (/ arg3 4)))
|
|
(.mov vf7 a0-17)
|
|
)
|
|
(.lvf vf5 (&-> v1-29 quad))
|
|
)
|
|
(.lvf vf4 (&-> sv-272 quad))
|
|
)
|
|
(.add.x.vf.w vf6 vf0 vf0)
|
|
(.mul.x.vf.xyz acc vf5 vf7)
|
|
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
|
(.svf (&-> sv-288 quad) vf6)
|
|
(sv-176 sv-192 (the-as bucket-id sv-208) sv-224 sv-256 sv-288 arg4)
|
|
)
|
|
)
|
|
)
|
|
(+! sv-160 1)
|
|
)
|
|
)
|
|
)
|
|
(add-debug-vector #t (bucket-id debug-no-zbuf2) arg0 arg1 arg2 arg4)
|
|
(none)
|
|
)
|
|
)
|
|
|
|
(defmethod set-mode ((this manipulator) (arg0 manipulator-mode))
|
|
(set! (-> this mode) arg0)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
(defmethod manipulator-method-10 ((this manipulator) (arg0 vector) (arg1 vector))
|
|
(local-vars (v1-11 symbol))
|
|
(let ((sv-176 arg1)
|
|
(s4-0 (-> this position))
|
|
)
|
|
0.0
|
|
(let* ((v0-0
|
|
(vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> *math-camera* trans) (-> this position)) 1.0)
|
|
)
|
|
(s3-0 (< (fabs (vector-dot v0-0 (-> this mat rvec))) 0.9))
|
|
(s2-0 (< (fabs (vector-dot v0-0 (-> this mat uvec))) 0.9))
|
|
)
|
|
(b! (< (fabs (vector-dot v0-0 (-> this mat fvec))) 0.9) cfg-6 :delay (set! v1-11 #t))
|
|
(let ((sv-160 v1-11))
|
|
(set! sv-160 #f)
|
|
(label cfg-6)
|
|
(let ((f28-0 (the-as float #x7f800000))
|
|
(f30-1 (* 0.15 (vector-vector-distance (-> *math-camera* trans) s4-0)))
|
|
)
|
|
(set! (-> this action) (manipulator-action ma0))
|
|
(let ((s1-0 (new 'stack-no-clear 'vector)))
|
|
0.0
|
|
(let ((s0-1 (vector-! (new 'stack-no-clear 'vector) sv-176 arg0)))
|
|
(let ((f0-14 (ray-sphere-intersect arg0 s0-1 s4-0 (/ f30-1 5))))
|
|
(when (and (< 0.0 f0-14) (>= f28-0 f0-14))
|
|
(set! f28-0 f0-14)
|
|
(set! (-> this action) (manipulator-action ma7))
|
|
)
|
|
)
|
|
(when (= (-> this action) (manipulator-action ma0))
|
|
(when (and s3-0 s2-0)
|
|
(let ((f0-18 (ray-sphere-intersect
|
|
arg0
|
|
s0-1
|
|
(vector+*!
|
|
(new 'stack-no-clear 'vector)
|
|
s4-0
|
|
(vector+! (new 'stack-no-clear 'vector) (-> this mat rvec) (-> this mat uvec))
|
|
f30-1
|
|
)
|
|
(* 0.3 f30-1)
|
|
)
|
|
)
|
|
)
|
|
(when (and (< 0.0 f0-18) (>= f28-0 f0-18))
|
|
(set! f28-0 f0-18)
|
|
(set! (-> this action) (manipulator-action ma4))
|
|
)
|
|
)
|
|
)
|
|
(when (and s3-0 sv-160)
|
|
(let ((f0-22 (ray-sphere-intersect
|
|
arg0
|
|
s0-1
|
|
(vector+*!
|
|
(new 'stack-no-clear 'vector)
|
|
s4-0
|
|
(vector+! (new 'stack-no-clear 'vector) (-> this mat rvec) (-> this mat fvec))
|
|
f30-1
|
|
)
|
|
(* 0.3 f30-1)
|
|
)
|
|
)
|
|
)
|
|
(when (and (< 0.0 f0-22) (>= f28-0 f0-22))
|
|
(set! f28-0 f0-22)
|
|
(set! (-> this action) (manipulator-action ma5))
|
|
)
|
|
)
|
|
)
|
|
(when (and s2-0 sv-160)
|
|
(let ((f0-26 (ray-sphere-intersect
|
|
arg0
|
|
s0-1
|
|
(vector+*!
|
|
(new 'stack-no-clear 'vector)
|
|
s4-0
|
|
(vector+! (new 'stack-no-clear 'vector) (-> this mat uvec) (-> this mat fvec))
|
|
f30-1
|
|
)
|
|
(* 0.3 f30-1)
|
|
)
|
|
)
|
|
)
|
|
(when (and (< 0.0 f0-26) (>= f28-0 f0-26))
|
|
(set! f28-0 f0-26)
|
|
(set! (-> this action) (manipulator-action ma6))
|
|
)
|
|
)
|
|
)
|
|
(when s3-0
|
|
(let ((f0-31 (ray-cylinder-intersect arg0 s0-1 s4-0 (-> this mat rvec) (/ f30-1 10) (* 1.3 f30-1) s1-0)))
|
|
(when (and (< 0.0 f0-31) (>= f28-0 f0-31))
|
|
(set! f28-0 f0-31)
|
|
(set! (-> this action) (manipulator-action ma1))
|
|
)
|
|
)
|
|
)
|
|
(when s2-0
|
|
(let ((f0-36 (ray-cylinder-intersect arg0 s0-1 s4-0 (-> this mat uvec) (/ f30-1 10) (* 1.3 f30-1) s1-0)))
|
|
(if (and (< 0.0 f0-36) (>= f28-0 f0-36))
|
|
(set! (-> this action) (manipulator-action ma2))
|
|
)
|
|
)
|
|
)
|
|
(when sv-160
|
|
(let ((f0-41 (ray-cylinder-intersect arg0 s0-1 s4-0 (-> this mat fvec) (/ f30-1 10) (* 1.3 f30-1) s1-0)))
|
|
(if (and (< 0.0 f0-41) (>= f0-41 f0-41))
|
|
(set! (-> this action) (manipulator-action ma3))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
(defmethod manipulator-method-11 ((this manipulator))
|
|
(local-vars (sv-240 rgba))
|
|
(format *stdcon* "~M ~M ~M~%" (-> this position x) (-> this position y) (-> this position z))
|
|
(let ((s5-0 (-> this position)))
|
|
0.0
|
|
(let* ((v0-1
|
|
(vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> *math-camera* trans) (-> this position)) 1.0)
|
|
)
|
|
(s4-0 (< (fabs (vector-dot v0-1 (-> this mat rvec))) 0.9))
|
|
(s3-0 (< (fabs (vector-dot v0-1 (-> this mat uvec))) 0.9))
|
|
(s2-0 (< (fabs (vector-dot v0-1 (-> this mat fvec))) 0.9))
|
|
(f30-1 (* 0.15 (vector-vector-distance (-> *math-camera* trans) s5-0)))
|
|
)
|
|
(if s4-0
|
|
(draw-axis s5-0 (-> this mat rvec) f30-1 (/ f30-1 4) (if (= (-> this action) (manipulator-action ma1))
|
|
*color-yellow*
|
|
*color-red*
|
|
)
|
|
)
|
|
)
|
|
(if s3-0
|
|
(draw-axis s5-0 (-> this mat uvec) f30-1 (/ f30-1 4) (if (= (-> this action) (manipulator-action ma2))
|
|
*color-yellow*
|
|
*color-green*
|
|
)
|
|
)
|
|
)
|
|
(if s2-0
|
|
(draw-axis s5-0 (-> this mat fvec) f30-1 (/ f30-1 4) (if (= (-> this action) (manipulator-action ma3))
|
|
*color-yellow*
|
|
*color-blue*
|
|
)
|
|
)
|
|
)
|
|
(let ((s1-0 (new 'stack-no-clear 'vector))
|
|
(s0-0 (new 'stack-no-clear 'vector))
|
|
)
|
|
(let ((f28-0 0.1))
|
|
(set! sv-240 (cond
|
|
((= (-> this action) (manipulator-action ma7))
|
|
(set! sv-240 *color-yellow*)
|
|
sv-240
|
|
)
|
|
(else
|
|
*color-light-blue*
|
|
)
|
|
)
|
|
)
|
|
(vector+*!
|
|
s1-0
|
|
s5-0
|
|
(vector+!
|
|
(new 'stack-no-clear 'vector)
|
|
(-> *math-camera* inv-camera-rot rvec)
|
|
(-> *math-camera* inv-camera-rot uvec)
|
|
)
|
|
(* f30-1 f28-0)
|
|
)
|
|
(vector+*! s0-0 s1-0 (-> *math-camera* inv-camera-rot uvec) (* -2.0 f30-1 f28-0))
|
|
(add-debug-line #t (bucket-id debug-no-zbuf1) s1-0 s0-0 sv-240 #f (the-as rgba -1))
|
|
(vector-copy! s1-0 s0-0)
|
|
(vector+*! s0-0 s0-0 (-> *math-camera* inv-camera-rot rvec) (* -2.0 f30-1 f28-0))
|
|
(add-debug-line #t (bucket-id debug-no-zbuf1) s1-0 s0-0 sv-240 #f (the-as rgba -1))
|
|
(vector-copy! s1-0 s0-0)
|
|
(vector+*! s0-0 s0-0 (-> *math-camera* inv-camera-rot uvec) (* 2.0 f30-1 f28-0))
|
|
(add-debug-line #t (bucket-id debug-no-zbuf1) s1-0 s0-0 sv-240 #f (the-as rgba -1))
|
|
(vector-copy! s1-0 s0-0)
|
|
(vector+*! s0-0 s0-0 (-> *math-camera* inv-camera-rot rvec) (* 2.0 f30-1 f28-0))
|
|
)
|
|
(add-debug-line #t (bucket-id debug-no-zbuf1) s1-0 s0-0 sv-240 #f (the-as rgba -1))
|
|
)
|
|
(let ((s1-1 (new 'stack-no-clear 'vector)))
|
|
(when (and s3-0 s2-0)
|
|
(vector+*! s1-1 s5-0 (vector+! (new 'stack-no-clear 'vector) (-> this mat fvec) (-> this mat uvec)) f30-1)
|
|
(let ((s0-1 draw-axis)
|
|
(sv-256 s1-1)
|
|
)
|
|
(s0-1
|
|
sv-256
|
|
(vector-negate! (new 'stack-no-clear 'vector) (-> this mat uvec))
|
|
(* 0.15 f30-1)
|
|
(* 0.15 f30-1)
|
|
(if (= (-> this action) (manipulator-action ma6))
|
|
*color-yellow*
|
|
*color-green*
|
|
)
|
|
)
|
|
)
|
|
(let ((s0-2 draw-axis)
|
|
(sv-272 s1-1)
|
|
)
|
|
(s0-2
|
|
sv-272
|
|
(vector-negate! (new 'stack-no-clear 'vector) (-> this mat fvec))
|
|
(* 0.15 f30-1)
|
|
(* 0.15 f30-1)
|
|
(if (= (-> this action) (manipulator-action ma6))
|
|
*color-yellow*
|
|
*color-blue*
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(set! s2-0 (and s4-0 s2-0))
|
|
(when s2-0
|
|
(vector+*! s1-1 s5-0 (vector+! (new 'stack-no-clear 'vector) (-> this mat rvec) (-> this mat fvec)) f30-1)
|
|
(draw-axis
|
|
s1-1
|
|
(vector-negate! (new 'stack-no-clear 'vector) (-> this mat rvec))
|
|
(* 0.15 f30-1)
|
|
(* 0.15 f30-1)
|
|
(if (= (-> this action) (manipulator-action ma5))
|
|
*color-yellow*
|
|
*color-red*
|
|
)
|
|
)
|
|
(draw-axis
|
|
s1-1
|
|
(vector-negate! (new 'stack-no-clear 'vector) (-> this mat fvec))
|
|
(* 0.15 f30-1)
|
|
(* 0.15 f30-1)
|
|
(if (= (-> this action) (manipulator-action ma5))
|
|
*color-yellow*
|
|
*color-blue*
|
|
)
|
|
)
|
|
)
|
|
(set! s3-0 (and s4-0 s3-0))
|
|
(when s3-0
|
|
(vector+*! s1-1 s5-0 (vector+! (new 'stack-no-clear 'vector) (-> this mat rvec) (-> this mat uvec)) f30-1)
|
|
(draw-axis
|
|
s1-1
|
|
(vector-negate! (new 'stack-no-clear 'vector) (-> this mat rvec))
|
|
(* 0.15 f30-1)
|
|
(* 0.15 f30-1)
|
|
(if (= (-> this action) (manipulator-action ma4))
|
|
*color-yellow*
|
|
*color-red*
|
|
)
|
|
)
|
|
(draw-axis
|
|
s1-1
|
|
(vector-negate! (new 'stack-no-clear 'vector) (-> this mat uvec))
|
|
(* 0.15 f30-1)
|
|
(* 0.15 f30-1)
|
|
(if (= (-> this action) (manipulator-action ma4))
|
|
*color-yellow*
|
|
*color-green*
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
(defmethod manipulator-method-12 ((this manipulator) (arg0 vector))
|
|
(set! (-> this rotate-ref) (the int (-> *mouse* posx)))
|
|
(vector-copy! (-> this mouse-ref-position) arg0)
|
|
(vector-copy! (-> this drag-ref-position) (-> this position))
|
|
(set! (-> this dragging?) #t)
|
|
(set! (-> this speed quad) (the-as uint128 0))
|
|
0
|
|
(none)
|
|
)
|
|
|
|
(defmethod manipulator-method-13 ((this manipulator) (arg0 vector) (arg1 vector))
|
|
(cond
|
|
((= (-> this mode) (manipulator-mode mm0))
|
|
(vector-copy! (-> this speed) (-> this position))
|
|
(let ((s5-1 (vector-! (new 'stack-no-clear 'vector) arg1 arg0))
|
|
(s4-1 (vector-! (new 'stack-no-clear 'vector) (-> this mouse-ref-position) arg0))
|
|
)
|
|
0.0
|
|
0.0
|
|
(let ((s2-0 (new 'stack-no-clear 'vector))
|
|
(s1-0 (new 'stack-no-clear 'vector))
|
|
)
|
|
(cond
|
|
((or (= (-> this action) (manipulator-action ma1))
|
|
(= (-> this action) (manipulator-action ma2))
|
|
(= (-> this action) (manipulator-action ma3))
|
|
)
|
|
(cond
|
|
((= (-> this action) (manipulator-action ma1))
|
|
(cond
|
|
((< (fabs (vector-dot s5-1 (-> this mat uvec))) (fabs (vector-dot s5-1 (-> this mat fvec))))
|
|
(vector-copy! s2-0 (-> this mat fvec))
|
|
(vector-copy! s1-0 (-> this mat uvec))
|
|
)
|
|
(else
|
|
(vector-copy! s2-0 (-> this mat uvec))
|
|
(vector-copy! s1-0 (-> this mat fvec))
|
|
)
|
|
)
|
|
)
|
|
((= (-> this action) (manipulator-action ma2))
|
|
(cond
|
|
((< (fabs (vector-dot s5-1 (-> this mat rvec))) (fabs (vector-dot s5-1 (-> this mat fvec))))
|
|
(vector-copy! s2-0 (-> this mat fvec))
|
|
(vector-copy! s1-0 (-> this mat rvec))
|
|
)
|
|
(else
|
|
(vector-copy! s2-0 (-> this mat rvec))
|
|
(vector-copy! s1-0 (-> this mat fvec))
|
|
)
|
|
)
|
|
)
|
|
((= (-> this action) (manipulator-action ma3))
|
|
(cond
|
|
((< (fabs (vector-dot s5-1 (-> this mat uvec))) (fabs (vector-dot s5-1 (-> this mat rvec))))
|
|
(vector-copy! s2-0 (-> this mat rvec))
|
|
(vector-copy! s1-0 (-> this mat uvec))
|
|
)
|
|
(else
|
|
(vector-copy! s2-0 (-> this mat uvec))
|
|
(vector-copy! s1-0 (-> this mat rvec))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(let ((f30-0 (intersect-ray-plane arg0 s5-1 (-> this position) s2-0))
|
|
(f0-11 (intersect-ray-plane arg0 s4-1 (-> this position) s2-0))
|
|
)
|
|
(vector+*! s5-1 arg0 s5-1 f30-0)
|
|
(vector+*! s4-1 arg0 s4-1 f0-11)
|
|
)
|
|
(vector-flatten! s5-1 (vector-! (new 'stack-no-clear 'vector) s5-1 (-> this position)) s1-0)
|
|
(vector-flatten! s4-1 (vector-! (new 'stack-no-clear 'vector) s4-1 (-> this position)) s1-0)
|
|
(let ((v1-46 (vector-! (new 'stack-no-clear 'vector) s5-1 s4-1)))
|
|
(vector+! (-> this position) (-> this drag-ref-position) v1-46)
|
|
(format *stdcon* "delta ~M ~M ~M~%" (-> v1-46 x) (-> v1-46 y) (-> v1-46 z))
|
|
)
|
|
)
|
|
((or (= (-> this action) (manipulator-action ma4))
|
|
(= (-> this action) (manipulator-action ma5))
|
|
(= (-> this action) (manipulator-action ma6))
|
|
(= (-> this action) (manipulator-action ma7))
|
|
)
|
|
(cond
|
|
((= (-> this action) (manipulator-action ma4))
|
|
(vector-copy! s2-0 *z-vector*)
|
|
)
|
|
((= (-> this action) (manipulator-action ma5))
|
|
(vector-copy! s2-0 *y-vector*)
|
|
)
|
|
((= (-> this action) (manipulator-action ma6))
|
|
(vector-copy! s2-0 *x-vector*)
|
|
)
|
|
((= (-> this action) (manipulator-action ma7))
|
|
(vector-copy! s2-0 (-> *math-camera* inv-camera-rot fvec))
|
|
)
|
|
)
|
|
(vector-normalize! s2-0 1.0)
|
|
(let ((f30-1 (intersect-ray-plane arg0 s5-1 (-> this position) s2-0))
|
|
(f0-15 (intersect-ray-plane arg0 s4-1 (-> this position) s2-0))
|
|
)
|
|
(vector+*! s5-1 arg0 s5-1 f30-1)
|
|
(vector+*! s4-1 arg0 s4-1 f0-15)
|
|
)
|
|
(vector+! (-> this position) (-> this drag-ref-position) (vector-! (new 'stack-no-clear 'vector) s5-1 s4-1))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(vector-! (-> this speed) (-> this position) (-> this speed))
|
|
)
|
|
((= (-> this mode) (manipulator-mode mm1))
|
|
(let ((s4-2 (- (-> this rotate-ref) (the int (-> *mouse* posx))))
|
|
(s5-2 (new 'stack-no-clear 'matrix))
|
|
)
|
|
(new 'stack 'euler-angles)
|
|
(matrix-identity! s5-2)
|
|
(cond
|
|
((= (-> this action) (manipulator-action ma1))
|
|
(matrix-axis-angle! s5-2 (-> this mat rvec) (* 182.04445 (the float s4-2)))
|
|
)
|
|
((= (-> this action) (manipulator-action ma2))
|
|
(matrix-axis-angle! s5-2 (-> this mat uvec) (* 182.04445 (the float s4-2)))
|
|
)
|
|
((= (-> this action) (manipulator-action ma3))
|
|
(matrix-axis-angle! s5-2 (-> this mat fvec) (* 182.04445 (the float s4-2)))
|
|
)
|
|
)
|
|
(matrix*! (-> this mat) (-> this mat) s5-2)
|
|
)
|
|
(vector-normalize! (-> this mat rvec) 1.0)
|
|
(vector-normalize! (-> this mat uvec) 1.0)
|
|
(vector-normalize! (-> this mat fvec) 1.0)
|
|
(matrix->eul (-> this angles) (-> this mat) 21)
|
|
(format *stdcon* "X = ~R~%Y = ~R~%Z = ~R~%" (-> this angles x) (-> this angles y) (-> this angles z))
|
|
(set! (-> this rotate-ref) (the int (-> *mouse* posx)))
|
|
)
|
|
(else
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
(defmethod manipulator-method-14 ((this manipulator))
|
|
(set! (-> this speed quad) (the-as uint128 0))
|
|
(set! (-> this dragging?) #f)
|
|
0
|
|
(none)
|
|
)
|