Changeset 403

Show
Ignore:
Timestamp:
10/09/11 14:26:27 (8 months ago)
Author:
Carsten
Message:

Model support:
For model files that bring fixed/given tangent-space vectors (.ase and .lwo), the "given" tangent-space vectors were no longer accounted for since r400. Fixed.

(Note that this fix is understood to be temporary: "fixed, given tangent-space" is supposed to soon be replaced by means to compute it on-the-fly, just as with animated models. This will most likely be implemented in the course of introducing support for smoothgroups.)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • cafu/trunk/Libs/Models/AnimPose.cpp

    r402 r403  
    611611    { 
    612612        assert(Anims.Size()==0);  // It doesn't make sense to have statically given tangent-space axes with *animated* geometry... 
     613 
     614        // Copy the given tangent space details into the pose. 
     615        for (unsigned long MeshNr=0; MeshNr<Meshes.Size(); MeshNr++) 
     616        { 
     617            const MeshT& Mesh    =Meshes[MeshNr]; 
     618            MeshInfoT&   MeshInfo=m_MeshInfos[MeshNr]; 
     619 
     620            for (unsigned long TriNr=0; TriNr<Mesh.Triangles.Size(); TriNr++) 
     621            { 
     622                MeshInfo.Triangles[TriNr].Normal = Mesh.Triangles[TriNr].gts_Normal; 
     623            } 
     624 
     625            for (unsigned long VertexNr=0; VertexNr<Mesh.Vertices.Size(); VertexNr++) 
     626            { 
     627                MeshInfo.Vertices[VertexNr].Pos      = Mesh.Vertices[VertexNr].gts_Pos; 
     628                MeshInfo.Vertices[VertexNr].Normal   = Mesh.Vertices[VertexNr].gts_Normal; 
     629                MeshInfo.Vertices[VertexNr].Tangent  = Mesh.Vertices[VertexNr].gts_Tangent; 
     630                MeshInfo.Vertices[VertexNr].BiNormal = Mesh.Vertices[VertexNr].gts_BiNormal; 
     631            } 
     632        } 
     633 
    613634        goto DoneComputingTS; 
    614635    }