Changeset 8638 in orxonox.OLD for branches/bsp_model/src/lib/graphics/importer/md3
- Timestamp:
- Jun 20, 2006, 5:04:15 PM (18 years ago)
- Location:
- branches/bsp_model/src/lib/graphics/importer/md3
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/bsp_model/src/lib/graphics/importer/md3/md3_bone_frame.h
r8490 r8638 6 6 */ 7 7 8 #ifndef _MD3_ ANIMATION_H9 #define _MD3_ ANIMATION_H8 #ifndef _MD3_BONE_FRAME_ANIMATION_H 9 #define _MD3_BONE_FRAME_ANIMATION_H 10 10 11 11 #include "vector.h" … … 51 51 } 52 52 53 #endif /* _MD3_ ANIMATION_H */53 #endif /* _MD3_BONE_FRAME_ANIMATION_H */ -
branches/bsp_model/src/lib/graphics/importer/md3/md3_data.h
r8634 r8638 40 40 class MD3Mesh; 41 41 class MD3Normal; 42 class MD3Animation; 42 43 43 44 //! This holds the header information that is read in at the beginning of the file: id software definition … … 118 119 float** tmpMatrix; //!< a temporary matrix 119 120 121 122 /* the animation part */ 123 MD3Animation* animation; //!< animation 124 int op; //!< the current operation 125 int upperBound; //!< the upper bound 126 bool bInterpolate; //!< interpolate the frames 120 127 }; 121 128 -
branches/bsp_model/src/lib/graphics/importer/md3/md3_model.cc
r8637 r8638 21 21 #include "md3_tag.h" 22 22 #include "md3_bone_frame.h" 23 #include "md3_animation.h" 23 24 24 25 #include "md3_animation_cfg.h" … … 547 548 * @param interpolate Should interpolation be done? 548 549 */ 549 void MD3Model::interpolate(MD3Data* data, MD3Animation* anim, int op, bool interpolate) 550 { 551 552 // // data-> 553 // this.anim=anim; 554 // if( op == NEXT || op == PREVIOUS || op == REWIND) 555 // this.op=op; 556 // 557 // this.interpolate=interpolate; 550 void MD3Model::interpolate(MD3Data* data, MD3Animation* anim, int op, bool bInterpolate) 551 { 552 data->animation = anim; 553 if( data->op == NEXT || data->op == PREVIOUS || data->op == REWIND) 554 data->op = op; 555 556 data->bInterpolate = bInterpolate; 558 557 } 559 558 … … 562 561 * calc next frame number 563 562 */ 564 int MD3Model::next(int nr) 565 { 566 #if 0 567 if( nr < (upperBound-1)) 568 return nr+1; 563 int MD3Model::next(MD3Data* data, int nr) 564 { 565 if( nr < (data->upperBound - 1)) 566 return nr + 1; 569 567 else 570 568 { //rewind needed 571 if( anim.num< 0)572 return anim.first;569 if( data->animation->numFrames < 0) 570 return data->animation->first; 573 571 else { 574 nr = (anim.looping != 0)?(anim.num - anim.looping):0; 575 return anim.first + nr; 576 } 577 } 578 #endif 572 nr = (data->animation->numLoopFrames != 0)?(data->animation->numFrames - data->animation->numLoopFrames):0; 573 return data->animation->first + nr; 574 } 575 } 579 576 } 580 577 … … 583 580 * calc prev frame number 584 581 */ 585 int MD3Model::prev( int nr)582 int MD3Model::prev(MD3Data* data, int nr) 586 583 { 587 584 #if 0 … … 597 594 * apply the specified operation to the animation state data members of the model 598 595 * taking the specified animation into account 596 * 597 * @param data: the data of the model 599 598 */ 600 599 void MD3Model::doOp(MD3Data* data) -
branches/bsp_model/src/lib/graphics/importer/md3/md3_model.h
r8637 r8638 13 13 14 14 15 #define FRACTION 0.34f 16 17 15 18 namespace md3 16 19 { … … 25 28 26 29 struct MD3Normal; 30 31 32 typedef enum MD3FrameHandling { 33 NEXT = 0, //!< swith to the next frame 34 PREVIOUS, //!< swith to the previous frame 35 REWIND //!< rewind the animation 36 }; 27 37 28 38 … … 56 66 float* interpolateTransformation(MD3Data* data, MD3Tag* currFrameTag, MD3Tag* nextFrameTag, float frac, int i); 57 67 58 void interpolate(MD3Data* data, MD3Animation* anim, int op, bool interpolate);59 int next( int nr);60 int prev( int nr);68 void interpolate(MD3Data* data, MD3Animation* anim, int op, bool bInterpolate); 69 int next(MD3Data* data, int nr); 70 int prev(MD3Data* data, int nr); 61 71 void doOp(MD3Data* data); 62 72 … … 70 80 MD3AnimationCfg* config; //!< the config file parsed 71 81 82 }; 72 83 73 };74 84 75 85 }
Note: See TracChangeset
for help on using the changeset viewer.