Changeset 8557 in orxonox.OLD for branches/bsp_model
- Timestamp:
- Jun 17, 2006, 11:39:34 AM (19 years ago)
- Location:
- branches/bsp_model/src/lib/graphics/importer/md3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/bsp_model/src/lib/graphics/importer/md3/md3_model.cc
r8556 r8557 39 39 40 40 this->tmpBoneFrame = new MD3BoneFrame(); 41 this->tmpMesh = new sVec3D[2048]; //!< the temporary mesh, hopefully newer bigger than 2048 vertices 41 42 } 42 43 … … 46 47 { 47 48 delete this->tmpBoneFrame; 49 delete [] this->tmpMesh; 48 50 } 49 51 … … 101 103 data->animationState.currentFrame != data->animationState.nextFrame) { 102 104 //interpolate mesh frame between the 2 current mesh frames 103 frame = this->interpolateMeshFrame(mesh, data->animationState.currentFrame, data->animationState.nextFrame, 104 data->animationState.interpolationFraction); 105 // frame = this->interpolateMeshFrame(mesh, data->animationState.currentFrame, data->animationState.nextFrame, 106 // data->animationState.interpolationFraction); 107 frame = this->interpolateMeshFrame( data->meshes[data->animationState.currentFrame]->meshFrames, 108 data->meshes[data->animationState.nextFrame]->meshFrames, 109 data->animationState.interpolationFraction, mesh); 105 110 } 106 111 else { … … 194 199 195 200 /** 201 * draw bone frame 202 */ 203 void MD3Model::drawBoneFrame(MD3BoneFrame* frame) 204 {} 205 206 207 /** 196 208 * interpolate bone frame 197 209 * @param currBoneFrame Start bone frame. … … 212 224 213 225 return this->tmpBoneFrame; 214 215 } 216 217 218 /** 219 * draw bone frame 220 */ 221 void MD3Model::drawBoneFrame(MD3BoneFrame* frame) 222 {} 226 } 223 227 224 228 … … 226 230 * interpolate mesh frame 227 231 */ 228 sVec3D* MD3Model::interpolateMeshFrame(MD3Mesh* mesh, int startFrame, int nextMeshFrame, float frac) 229 {} 232 sVec3D* MD3Model::interpolateMeshFrame(sVec3D* currMeshFrame, sVec3D* nextMeshFrame, float frac, MD3Mesh* mesh) 233 { 234 int vertexNum = mesh->header->vertexNum; 235 236 // calc interpolated vertices 237 for( int t = 0; t < vertexNum * 3.0f; t++) 238 { 239 this->tmpMesh[t][0] = (1.0f - frac) * currMeshFrame[t][0] + frac * nextMeshFrame[t][0]; 240 this->tmpMesh[t][1] = (1.0f - frac) * currMeshFrame[t][1] + frac * nextMeshFrame[t][1]; 241 this->tmpMesh[t][2] = (1.0f - frac) * currMeshFrame[t][2] + frac * nextMeshFrame[t][2]; 242 } 243 244 return this->tmpMesh; 245 } 230 246 231 247 -
branches/bsp_model/src/lib/graphics/importer/md3/md3_model.h
r8556 r8557 49 49 void drawBoneFrame(MD3BoneFrame* frame); 50 50 51 sVec3D* interpolateMeshFrame( MD3Mesh* mesh, int startFrame, int nextMeshFrame, float frac);51 sVec3D* interpolateMeshFrame(sVec3D* currMeshFrame, sVec3D* nextMeshFrame, float frac, MD3Mesh* mesh); 52 52 MD3Normal* interpolateVertexNormals(MD3Normal* curNormals, MD3Normal* nextNormals, float frac); 53 53 float* interpolateTransformation(MD3Tag* currFrameTag, MD3Tag* nextFrameTag, float frac); … … 60 60 61 61 MD3BoneFrame* tmpBoneFrame; //!< a temporary bone frame 62 sVec3D* tmpMesh; //!< a temportary mesh frame 62 63 }; 63 64
Note: See TracChangeset
for help on using the changeset viewer.