[Plib-cvs] plib/src/ssg ssg.cxx,1.69,1.70 ssg.dsp,1.52,1.53 ssg.h,1.173,1.174
Brought to you by:
sjbaker
From: Wolfram K. <wol...@us...> - 2004-10-29 22:24:19
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2636 Modified Files: ssg.cxx ssg.dsp ssg.h Log Message: Implementing ssgAnimTransform Index: ssg.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.cxx,v retrieving revision 1.69 retrieving revision 1.70 diff -u -d -r1.69 -r1.70 --- ssg.cxx 6 Oct 2004 14:27:04 -0000 1.69 +++ ssg.cxx 29 Oct 2004 22:24:08 -0000 1.70 @@ -148,7 +148,7 @@ ssgAddModelFormat ( ".iv", ssgLoadIV , ssgSaveIV ) ; ssgAddModelFormat ( ".asc", ssgLoadASC , ssgSaveASC ) ; //ssgAddModelFormat ( ".pov", NULL , ssgSavePOV ) ; - + #ifdef SSG_LOAD_MDL_SUPPORTED ssgAddModelFormat ( ".mdl", ssgLoadMDL , NULL ) ; @@ -357,7 +357,8 @@ //static ssgBase *createBaseTransform () { return new ssgBaseTransform ; } static ssgBase *createTransform () { return new ssgTransform ; } static ssgBase *createTexTrans () { return new ssgTexTrans ; } -static ssgBase *createAxisTransform() { return new ssgAxisTransform; } +static ssgBase *createAnimTransform() { return new ssgAnimTransform ; } +static ssgBase *createAxisTransform() { return new ssgAxisTransform ; } static ssgBase *createSelector () { return new ssgSelector ; } static ssgBase *createRangeSelector () { return new ssgRangeSelector ; } static ssgBase *createTimedSelector () { return new ssgTimedSelector ; } @@ -400,9 +401,10 @@ { ssgTypeBranch () , createBranch }, //{ ssgTypeBaseTransform () , createBaseTransform }, { ssgTypeTransform () , createTransform }, + { ssgTypeAnimTransform () , createAnimTransform }, { ssgTypeTexTrans () , createTexTrans }, - { ssgTypeAxisTransform () , createAxisTransform }, - { ssgTypeSelector () , createSelector }, + { ssgTypeAxisTransform () , createAxisTransform }, + { ssgTypeSelector () , createSelector }, { ssgTypeRangeSelector () , createRangeSelector }, { ssgTypeTimedSelector () , createTimedSelector }, { ssgTypeTweenController () , createTweenController }, @@ -434,7 +436,7 @@ if ( type == 0 || func == NULL ) { ulSetError ( UL_WARNING, "ssgRegisterType: Bad arguments (type %#x, func %p).", - type, func ) ; + type, func ) ; return ; } @@ -469,8 +471,8 @@ ulSetError ( UL_WARNING, "ssgCreateOfType: Got null object for type %#x.", type ) ; else if ( obj -> getType () != type ) ulSetError ( UL_WARNING, - "ssgCreateOfType: Created object has wrong type %#x (%s), expected %#x.", - obj -> getType (), obj -> getTypeName (), type ) ; + "ssgCreateOfType: Created object has wrong type %#x (%s), expected %#x.", + obj -> getType (), obj -> getTypeName (), type ) ; return obj ; } Index: ssg.dsp =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.dsp,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- ssg.dsp 4 Oct 2004 18:47:24 -0000 1.52 +++ ssg.dsp 29 Oct 2004 22:24:08 -0000 1.53 @@ -112,6 +112,10 @@ # End Source File # Begin Source File +SOURCE=.\ssgAnimTransform.cxx +# End Source File +# Begin Source File + SOURCE=.\ssgAxisTransform.cxx # End Source File # Begin Source File Index: ssg.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.h,v retrieving revision 1.173 retrieving revision 1.174 diff -u -d -r1.173 -r1.174 --- ssg.h 4 Oct 2004 18:25:59 -0000 1.173 +++ ssg.h 29 Oct 2004 22:24:08 -0000 1.174 @@ -99,6 +99,7 @@ #define _SSG_TYPE_TRANSFORM 0x00001000 #define _SSG_TYPE_TEXTRANS 0x00002000 #define _SSG_TYPE_AXISTRANSFORM 0x00004000 +#define _SSG_TYPE_ANIMTRANSFORM 0x00008000 #define _SSG_TYPE_SELECTOR 0x00000100 #define _SSG_TYPE_RANGESELECTOR 0x00001000 #define _SSG_TYPE_TIMEDSELECTOR 0x00002000 @@ -142,6 +143,7 @@ inline int ssgTypeTweenController(){ return _SSG_TYPE_TWEENCONTROLLER | ssgTypeBranch() ; } inline int ssgTypeBaseTransform() { return _SSG_TYPE_BASETRANSFORM | ssgTypeBranch () ; } inline int ssgTypeTransform () { return _SSG_TYPE_TRANSFORM | ssgTypeBaseTransform () ; } +inline int ssgTypeAnimTransform() { return _SSG_TYPE_ANIMTRANSFORM | ssgTypeTransform () ; } inline int ssgTypeTexTrans () { return _SSG_TYPE_TEXTRANS | ssgTypeBaseTransform () ; } inline int ssgTypeAxisTransform() { return _SSG_TYPE_AXISTRANSFORM | ssgTypeTransform () ; } inline int ssgTypeSelector () { return _SSG_TYPE_SELECTOR | ssgTypeBranch () ; } @@ -1302,6 +1304,7 @@ extern sgVec3 _ssgNormalUp ; extern sgVec2 _ssgTexCoord00 ; extern short _ssgIndex0 ; +extern float _ssgGlobTime ; // used by ssgAnimTransform. Has to be set by the appliation! class ssgVTable : public ssgLeaf @@ -2047,6 +2050,39 @@ virtual void recalcBSphere () ; } ; +class ssgAnimTransform : public ssgTransform +{ + float curr_bank ; + int mode ; /* SSGTWEEN_STOP_AT_END or SSGTWEEN_REPEAT */ + class ssgTransformArray transformations; + +protected: + + virtual void copy_from ( ssgAnimTransform *src, int clone_flags ) ; + +public: + + void setNum ( unsigned int n ) { transformations.setNum( n ); } + void setATransform ( sgMat4 thing, unsigned int n ) { transformations.raw_set ( (char *) thing, n ) ; } ; + + + virtual ssgBase *clone ( int clone_flags = 0 ) ; + ssgAnimTransform (void) ; + virtual ~ssgAnimTransform (void) ; + + void setMode ( int _mode ) { mode = _mode ; } + int getMode () { return mode ; } + + void selectBank ( float f ) { curr_bank = f ; } + float getCurrBank () { return curr_bank ; } + + virtual void cull ( sgFrustum *f, sgMat4 m, int test_needed ) ; + virtual const char *getTypeName(void) ; + virtual void print ( FILE *fd = stderr, char *indent = "", int how_much = 2 ) ; + virtual int load ( FILE *fd ) ; + virtual int save ( FILE *fd ) ; +} ; + class ssgAxisTransform : public ssgTransform { |