;;-*-Lisp-*- (in-package goal) ;; definition of type touching-prim (deftype touching-prim (structure) ((cprim collide-shape-prim) (has-tri? symbol) (tri collide-tri-result :inline) ) ) ;; definition for method 3 of type touching-prim (defmethod inspect ((this touching-prim)) (format #t "[~8x] ~A~%" this 'touching-prim) (format #t "~Tcprim: ~A~%" (-> this cprim)) (format #t "~Thas-tri?: ~A~%" (-> this has-tri?)) (format #t "~Ttri: #~%" (-> this tri)) this ) ;; definition of type touching-prims-entry (deftype touching-prims-entry (structure) ((next touching-prims-entry) (prev touching-prims-entry) (allocated? symbol) (u float) (prim1 touching-prim :inline) (prim2 touching-prim :inline) ) (:methods (get-touched-prim (_type_ trsqv touching-shapes-entry) collide-shape-prim) (touching-prims-entry-method-10 () none) (get-middle-of-bsphere-overlap (_type_ vector) vector) (get-touched-tri (_type_ collide-shape touching-shapes-entry) collide-tri-result) ) ) ;; definition for method 3 of type touching-prims-entry (defmethod inspect ((this touching-prims-entry)) (format #t "[~8x] ~A~%" this 'touching-prims-entry) (format #t "~Tnext: #~%" (-> this next)) (format #t "~Tprev: #~%" (-> this prev)) (format #t "~Tallocated?: ~A~%" (-> this allocated?)) (format #t "~Tu: ~f~%" (-> this u)) (format #t "~Tprim1: #~%" (-> this prim1)) (format #t "~Tprim2: #~%" (-> this prim2)) this ) ;; definition of type touching-prims-entry-pool (deftype touching-prims-entry-pool (structure) ((head touching-prims-entry) (nodes touching-prims-entry 64 :inline) ) (:methods (new (symbol type) _type_) (alloc-node (_type_) touching-prims-entry) (get-free-node-count (_type_) int) (init-list! (_type_) none) (free-node (_type_ touching-prims-entry) touching-prims-entry) ) ) ;; definition for method 3 of type touching-prims-entry-pool (defmethod inspect ((this touching-prims-entry-pool)) (format #t "[~8x] ~A~%" this 'touching-prims-entry-pool) (format #t "~Thead: #~%" (-> this head)) (format #t "~Tnodes[64] @ #x~X~%" (-> this nodes)) this ) ;; definition for method 11 of type touching-prims-entry-pool ;; INFO: Return type mismatch symbol vs none. (defmethod init-list! ((this touching-prims-entry-pool)) (let ((prev (the-as touching-prims-entry #f))) (let ((current (the-as touching-prims-entry (-> this nodes)))) (set! (-> this head) current) (countdown (a0-1 64) (set! (-> current prev) prev) (let ((next (&+ current 240))) (set! (-> current next) (the-as touching-prims-entry next)) (set! (-> current allocated?) #f) (set! prev current) (set! current (the-as touching-prims-entry next)) ) ) ) (set! (-> prev next) #f) ) (none) ) ;; definition for method 0 of type touching-prims-entry-pool ;; INFO: Return type mismatch structure vs touching-prims-entry-pool. (defmethod new touching-prims-entry-pool ((allocation symbol) (type-to-make type)) (let ((t9-0 (method-of-type structure new)) (v1-1 type-to-make) ) (-> type-to-make size) (let ((gp-0 (t9-0 allocation v1-1))) ((method-of-type touching-prims-entry-pool init-list!) (the-as touching-prims-entry-pool gp-0)) (the-as touching-prims-entry-pool gp-0) ) ) ) ;; definition of type touching-shapes-entry (deftype touching-shapes-entry (structure) ((cshape1 collide-shape) (cshape2 collide-shape) (resolve-u int8) (head touching-prims-entry) ) :allow-misaligned (:methods (touching-shapes-entry-method-9 (_type_) none) (get-touched-shape (_type_ collide-shape) collide-shape) (touching-shapes-entry-method-11 () none) (prims-touching? (_type_ collide-shape-moving uint) touching-prims-entry) (prims-touching-action? (_type_ collide-shape collide-action collide-action) touching-prims-entry) (touching-shapes-entry-method-14 () none) (free-touching-prims-list (_type_) symbol) (get-head (_type_) touching-prims-entry) (get-next (_type_ touching-prims-entry) touching-prims-entry) ) ) ;; definition for method 3 of type touching-shapes-entry (defmethod inspect ((this touching-shapes-entry)) (format #t "[~8x] ~A~%" this 'touching-shapes-entry) (format #t "~Tcshape1: ~A~%" (-> this cshape1)) (format #t "~Tcshape2: ~A~%" (-> this cshape2)) (format #t "~Tresolve-u: ~D~%" (-> this resolve-u)) (format #t "~Thead: #~%" (-> this head)) this ) ;; definition of type touching-list (deftype touching-list (structure) ((num-touching-shapes int32) (resolve-u int8) (touching-shapes touching-shapes-entry 32 :inline) ) (:methods (new (symbol type) _type_) (add-touching-prims (_type_ collide-shape-prim collide-shape-prim float collide-tri-result collide-tri-result) none) (touching-list-method-10 () none) (update-from-step-size (_type_ float) none) (send-events-for-touching-shapes (_type_) none) (get-shapes-entry (_type_ collide-shape collide-shape) touching-shapes-entry) (free-all-prim-nodes (_type_) none) ) ) ;; definition for method 3 of type touching-list (defmethod inspect ((this touching-list)) (format #t "[~8x] ~A~%" this 'touching-list) (format #t "~Tnum-touching-shapes: ~D~%" (-> this num-touching-shapes)) (format #t "~Tresolve-u: ~D~%" (-> this resolve-u)) (format #t "~Ttouching-shapes[32] @ #x~X~%" (-> this touching-shapes)) this ) ;; definition for method 0 of type touching-list ;; INFO: Return type mismatch structure vs touching-list. (defmethod new touching-list ((allocation symbol) (type-to-make type)) (let ((t9-0 (method-of-type structure new)) (v1-1 type-to-make) ) (-> type-to-make size) (let ((this (the-as touching-list (t9-0 allocation v1-1)))) (set! (-> this num-touching-shapes) 0) (set! (-> this resolve-u) 0) this ) ) ) ;; definition for method 16 of type touching-shapes-entry (defmethod get-head ((this touching-shapes-entry)) (-> this head) ) ;; definition for method 17 of type touching-shapes-entry (defmethod get-next ((this touching-shapes-entry) (arg0 touching-prims-entry)) (-> arg0 next) ) ;; definition (perm) for symbol *touching-prims-entry-pool*, type touching-prims-entry-pool (define-perm *touching-prims-entry-pool* touching-prims-entry-pool (new 'global 'touching-prims-entry-pool)) ;; definition (perm) for symbol *touching-list*, type touching-list (define-perm *touching-list* touching-list (new 'global 'touching-list))