;;-*-Lisp-*- (in-package goal) ;; name: joint-h.gc ;; name in dgo: joint-h ;; dgos: GAME, ENGINE (declare-type joint-control basic) (declare-type effect-control basic) (define-extern cspace<-parented-transformq-joint! (function cspace transformq none)) (define-extern cspace<-transformq! (function cspace transformq matrix)) (define-extern vector<-cspace! (function vector cspace vector)) (define-extern create-interpolated-joint-animation-frame (function (inline-array vector) int process-drawable int)) ;; These types are specific to joint control. ;; See mspace-h.gc for the actual joint types ;; A single joint control channel. It can control some number of joints through a single animation. ;; Multiple channels are blended together to create smooth transitions between animations. (deftype joint-control-channel (structure) ((parent joint-control :offset-assert 0) (command symbol :offset-assert 4) (frame-interp float :offset-assert 8) (frame-group art-joint-anim :offset-assert 12) (frame-num float :offset-assert 16) (num-func (function joint-control-channel float float float) :offset-assert 20) (param float 2 :offset-assert 24) (group-sub-index int16 :offset-assert 32) (group-size int16 :offset-assert 34) (dist meters :offset-assert 36) (eval-time uint32 :offset-assert 40) (inspector-amount float :offset-assert 44) ) :method-count-assert 10 :size-assert #x30 :flag-assert #xa00000030 (:methods (debug-print-frames (_type_) _type_ 9) ) ) (defenum janim-status :type uint16 :bitfield #t (inited 0) (drawn 1) (done 2) (blerc 3) (skelf04 4) (spool 5) (blerc-done 6) (eye-done 7) (eye 8) ) ;; A collection of joint-control-channels. (deftype joint-control (basic) ((status janim-status :offset-assert 4) (allocated-length int16 :offset-assert 6) (root-channel (inline-array joint-control-channel) :offset 16) (blend-index int32 :offset-assert 20) (active-channels int32 :offset-assert 24) (generate-frame-function (function (inline-array vector) int process-drawable int) :offset-assert 28) (prebind-function (function pointer int process-drawable none) :offset-assert 32) (postbind-function (function process-drawable none) :offset-assert 36) (effect effect-control :offset-assert 40) (channel joint-control-channel 3 :inline :offset-assert 48) ;; actually dynamic? (frame-group0 art-joint-anim :offset 60) (frame-num0 float :offset 64) (frame-interp0 float :offset 56) (frame-group1 art-joint-anim :offset 108) (frame-num1 float :offset 112) (frame-interp1 float :offset 104) (frame-group2 art-joint-anim :offset 156) (frame-num2 float :offset 160) (frame-interp2 float :offset 152) ) :method-count-assert 11 :size-assert #xc0 :flag-assert #xb000000c0 (:methods (new (symbol type int) _type_ 0) (dummy-9 (_type_) float 9) (debug-print-channels (_type_ symbol) int 10) ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; joint anim decompress ;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; these types are used to decompress joint animations. (deftype matrix-stack (structure) ((top matrix :offset-assert 0) (data matrix 24 :inline :offset-assert 16) ) :method-count-assert 9 :size-assert #x610 :flag-assert #x900000610 ) (deftype channel-upload-info (structure) ((fixed joint-anim-compressed-fixed :offset-assert 0) (fixed-qwc int32 :offset-assert 4) (frame joint-anim-compressed-frame :offset-assert 8) (frame-qwc int32 :offset-assert 12) (amount float :offset-assert 16) (interp float :offset-assert 20) ) :pack-me :method-count-assert 9 :size-assert #x18 :flag-assert #x900000018 ) (deftype joint-work (structure) ((temp-mtx matrix :inline :offset-assert 0) (joint-stack matrix-stack :inline :offset-assert 64) (fix-jmp-table (function none) 16 :offset-assert 1616) (frm-jmp-table (function none) 16 :offset-assert 1680) (pair-jmp-table (function none) 16 :offset-assert 1744) (uploads channel-upload-info 24 :inline :offset-assert 1808) (num-uploads int32 :offset-assert 2384) (mtx-acc matrix 2 :inline :offset-assert 2400) (tq-acc transformq 100 :inline :offset-assert 2528) (jacp-hdr joint-anim-compressed-hdr :inline :offset-assert 7328) (fixed-data joint-anim-compressed-fixed :inline :offset-assert 7392) (frame-data joint-anim-compressed-frame 2 :inline :offset-assert 9600) (flatten-array float 576 :offset 2400) ;; no clue! (flattened vector 24 :inline :offset 2400) ;; no clue! ) :method-count-assert 9 :size-assert #x3640 :flag-assert #x900003640 )