~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to source/gameengine/Converter/BL_MeshDeformer.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2005-11-06 12:40:03 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051106124003-3pgs7tcg5rox96xg
Tags: 2.37a-1.1
* Non-maintainer upload.
* Split out parts of 01_SConstruct_debian.dpatch again: root_build_dir
  really needs to get adjusted before the clean target runs - closes: #333958,
  see #288882 for reference

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**
2
 
 * $Id: BL_MeshDeformer.cpp,v 1.5 2004/03/22 22:01:25 jesterking Exp $
 
2
 * $Id: BL_MeshDeformer.cpp,v 1.7 2004/07/16 14:45:06 sirdude Exp $
3
3
 *
4
4
 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
5
5
 *
58
58
        vecVertexArray  array;
59
59
        vecIndexArrays  mvarray;
60
60
        vecIndexArrays  diarray;
61
 
        float co[3];
62
61
        
63
62
        RAS_TexVert *tv;
64
63
        MVert   *mvert;
73
72
                //      For each vertex
74
73
                for (j=0; j<array[i]->size(); j++){
75
74
                        tv = &((*array[i])[j]);
76
 
                        MT_Point3 pt = tv->xyz();
77
 
                        
78
75
                        index = ((*diarray[i])[j]);
79
76
 
80
77
                        mvert = &(m_bmesh->mvert[((*mvarray[i])[index])]);
81
 
                        //      Do the nasty (in this case, copy the untransformed data from the blender mesh)
82
 
                        co[0]=mvert->co[0];
83
 
                        co[1]=mvert->co[1];
84
 
                        co[2]=mvert->co[2];
85
 
                        
86
 
                        pt[0] = co[0];
87
 
                        pt[1] = co[1];
88
 
                        pt[2] = co[2];
89
 
                        
90
 
                        tv->SetXYZ(pt);
 
78
                        tv->SetXYZ(MT_Point3(mvert->co));
91
79
                }
92
80
        }
93
81
        return true;
101
89
                delete []m_transnors;
102
90
};
103
91
 
 
92
/**
 
93
 * @warning This function is expensive!
 
94
 */
104
95
void BL_MeshDeformer::RecalcNormals()
105
96
{
106
97
        int v, f;
143
134
        }
144
135
        
145
136
        for (v =0; v<m_bmesh->totvert; v++){
146
 
                float nor[3];
 
137
//              float nor[3];
147
138
 
148
139
                m_transnors[v]=m_transnors[v].safe_normalized();
149
 
                nor[0]=m_transnors[v][0];
150
 
                nor[1]=m_transnors[v][1];
151
 
                nor[2]=m_transnors[v][2];
 
140
//              nor[0]=m_transnors[v][0];
 
141
//              nor[1]=m_transnors[v][1];
 
142
//              nor[2]=m_transnors[v][2];
152
143
                
153
144
        };
154
145
}