Changeset 4188 in orxonox.OLD for orxonox/branches/md2_loader/src/lib
- Timestamp:
- May 15, 2005, 10:31:15 PM (20 years ago)
- Location:
- orxonox/branches/md2_loader/src/lib/graphics/importer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/md2_loader/src/lib/graphics/importer/md2Model.cc
r4187 r4188 34 34 }; 35 35 36 static float *shadedots = MD2Model2::anormsDots[0]; 36 static float *shadeDots = MD2Model2::anormsDots[0]; 37 38 float md2Angle = 0.0f; 39 40 41 sAnim MD2Model2::animationList[21] = 42 { 43 { 0, 39, 9 }, // STAND 44 { 40, 45, 10 }, // RUN 45 { 46, 53, 10 }, // ATTACK 46 { 54, 57, 7 }, // PAIN_A 47 { 58, 61, 7 }, // PAIN_B 48 { 62, 65, 7 }, // PAIN_C 49 { 66, 71, 7 }, // JUMP 50 { 72, 83, 7 }, // FLIP 51 { 84, 94, 7 }, // SALUTE 52 { 95, 111, 10 }, // FALLBACK 53 { 112, 122, 7 }, // WAVE 54 { 123, 134, 6 }, // POINT 55 { 135, 153, 10 }, // CROUCH_STAND 56 { 154, 159, 7 }, // CROUCH_WALK 57 { 160, 168, 10 }, // CROUCH_ATTACK 58 { 196, 172, 7 }, // CROUCH_PAIN 59 { 173, 177, 5 }, // CROUCH_DEATH 60 { 178, 183, 7 }, // DEATH_FALLBACK 61 { 184, 189, 7 }, // DEATH_FALLFORWARD 62 { 190, 197, 7 }, // DEATH_FALLBACKSLOW 63 { 198, 198, 5 }, // BOOM 64 }; 37 65 38 66 … … 591 619 void MD2Model2::interpolate(sVec3D* verticesList) 592 620 { 621 sVec3D* currVec; 622 sVec3D* nextVec; 623 624 currVec = &this->pVertices[this->numVertices * this->animationState.currentFrame]; 625 nextVec = &this->pVertices[this->numVertices * this->animationState.currentFrame]; 626 593 627 for(int i = 0; i < this->numFrames; ++i) 594 628 { … … 603 637 void MD2Model2::processLighting() 604 638 { 639 shadeDots = anormsDots[ ((int)(md2Angle*(SHADEDOT_QUANT / 360.0)))&(SHADEDOT_QUANT - 1)]; 605 640 } 606 641 … … 617 652 glCullFace(GL_BACK); 618 653 654 this->processLighting(); 619 655 this->interpolate(verticesList); 620 656 this->material->select(); … … 637 673 { 638 674 /* for quake2 lighting */ 639 //float l = shadedots[this->pLightNormals[pCommands[2]]];675 float l = shadeDots[this->pLightNormals[pCommands[2]]]; 640 676 //glColor3f(l * lcolor[0], l * lcolor[1], l * lcolor[2]); 641 677 642 678 glTexCoord2f( ((float *)pCommands)[0], ((float *)pCommands)[1] ); 643 //glNormal3fv(anorms[this->pLightNormals[2]]);679 glNormal3fv(anorms[this->pLightNormals[2]]); 644 680 glVertex3fv(verticesList[pCommands[2]]); 645 681 } -
orxonox/branches/md2_loader/src/lib/graphics/importer/md2Model.h
r4172 r4188 112 112 typedef char tMd2Skin[64]; 113 113 114 typedef enum 115 { 116 STAND, 117 RUN, 118 ATTACK, 119 PAIN_A, 120 PAIN_B, 121 PAIN_C, 122 JUMP, 123 FLIP, 124 SALUTE, 125 FALLBACK, 126 WAVE, 127 POINT, 128 CROUCH_STAND, 129 CROUCH_WALK, 130 CROUCH_ATTACK, 131 CROUCH_PAIN, 132 CROUCH_DEATH, 133 DEATH_FALLBACK, 134 DEATH_FALLFORWARD, 135 DEATH_FALLBACKSLOW, 136 BOOM, 137 138 MAX_ANIMATIONS 139 } animType; 140 114 141 115 142 //! This is a MD2 Model class … … 146 173 class Material; 147 174 175 176 148 177 //! This is a MD2 Model class 149 178 class MD2Model2 : public AbstractModel {
Note: See TracChangeset
for help on using the changeset viewer.