Changeset 8655 in orxonox.OLD for branches/bsp_model
- Timestamp:
- Jun 21, 2006, 2:10:11 AM (18 years ago)
- Location:
- branches/bsp_model/src/lib/graphics/importer/md3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/bsp_model/src/lib/graphics/importer/md3/md3_animation_cfg.cc
r8547 r8655 144 144 PRINTF(0)("got footsteps: %s\n", this->footsteps.c_str()); 145 145 } 146 else { 146 else 147 { 147 148 // assume it's an animation line 148 149 inHeader = false; … … 159 160 // workaround for strange numbering in animation.cfg: skip TORSO frames 160 161 // for LEGS animation lines... 161 if (animation->type == LEGS) { 162 //when first LEGS animation is found, calc # of TORSO frames 162 if( animation->type == LEGS) 163 { 164 //when first LEGS animation is found, calc # of TORSO frames 163 165 if( torsoOffset == -1) 164 166 torsoOffset = animation->first - firstTorsoFrame; … … 167 169 animation->offset = torsoOffset; 168 170 } 169 else if (animation->type == TORSO)171 else if( animation->type == TORSO) 170 172 if( firstTorsoFrame == -1) 171 173 firstTorsoFrame = animation->first; -
branches/bsp_model/src/lib/graphics/importer/md3/md3_model.cc
r8654 r8655 46 46 47 47 // set the animation 48 this->interpolate(this->md3Data, this->config->getAnimation(" Walk"), REWIND, true);48 this->interpolate(this->md3Data, this->config->getAnimation("Dead 3"), MD3_ANIM_NEXT, true); 49 49 } 50 50 … … 474 474 475 475 // calc interpolated vertices 476 for( int t = 0; t < vertexNum * 3.0f; t++)476 for( int t = 0; t < vertexNum; t++) 477 477 { 478 478 data->tmpMesh[i][t][0] = (1.0f - frac) * currMeshFrame[t][0] + frac * nextMeshFrame[t][0]; … … 580 580 { 581 581 data->animation = anim; 582 if( data->op == NEXT || data->op == PREVIOUS || data->op ==REWIND)582 if( op == MD3_ANIM_NEXT || op == MD3_ANIM_PREVIOUS || op == MD3_ANIM_REWIND) 583 583 data->op = op; 584 584 … … 626 626 void MD3Model::doOp(MD3Data* data) 627 627 { 628 return;629 628 // animation to be applied could have illegal data with respect to this model, 630 629 // ignore anim in this case 631 if( data->animation->first >= data->header->boneFrameNum || data->animation->first < 0) 630 631 if( data->animation->first >= data->animation->numFrames || data->animation->first < 0) 632 { 633 PRINTF(0)("MD3: this animation type seems to be invalid, no animation calculated\n"); 632 634 return; 635 } 636 633 637 634 638 //calc upper bound for animation frames in this model … … 636 640 data->upperBound = data->header->boneFrameNum; //use all available frames 637 641 else 638 data->upperBound = data->header->boneFrameNum < 639 (data->animation->first + data->animation->numFrames)?data->header->boneFrameNum:(data->animation->first + 640 data->animation->numFrames); 641 642 { 643 if( data->header->boneFrameNum < (data->animation->first + data->animation->numFrames)) 644 data->upperBound = data->header->boneFrameNum; 645 else 646 data->upperBound = (data->animation->first + 647 data->animation->numFrames); 648 } 649 650 651 // PRINTF(0)("anim op: %i\n", data->op); 642 652 switch( data->op) { 643 653 644 case NEXT:654 case MD3_ANIM_NEXT: 645 655 if( data->bInterpolate) 646 656 { … … 657 667 data->animationState.nextFrame = next(data, data->animationState.nextFrame); 658 668 } 669 PRINTF(0)("interpolate fraction: %f, curr frame: %i\n", data->animationState.interpolationFraction, data->animationState.currentFrame); 659 670 break; 660 671 661 case PREVIOUS:672 case MD3_ANIM_PREVIOUS: 662 673 if( data->bInterpolate) 663 674 { … … 677 688 break; 678 689 679 case REWIND:690 case MD3_ANIM_REWIND: 680 691 data->animationState.currentFrame = data->animation->first; 681 692 data->animationState.nextFrame = next(data, data->animationState.currentFrame); … … 683 694 break; 684 695 } 696 685 697 } 686 698 -
branches/bsp_model/src/lib/graphics/importer/md3/md3_model.h
r8654 r8655 31 31 32 32 typedef enum MD3FrameHandling { 33 NEXT = 0, //!< swith to the next frame34 PREVIOUS, //!< swith to the previous frame35 REWIND //!< rewind the animation33 MD3_ANIM_NEXT = 0, //!< swith to the next frame 34 MD3_ANIM_PREVIOUS, //!< swith to the previous frame 35 MD3_ANIM_REWIND //!< rewind the animation 36 36 }; 37 37
Note: See TracChangeset
for help on using the changeset viewer.