diff options
author | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2004-06-30 17:41:19 +0400 |
---|---|---|
committer | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2004-06-30 17:41:19 +0400 |
commit | c9b4585618ea72f61c4671d4734c9e48b6ce6745 (patch) | |
tree | c085b7a47ce5db91e1b825419a7353a412431354 /source | |
parent | 09d3007b7148c6a0089c1cddcd7c463639d291cd (diff) |
Switch to using floats instead of shorts for normal data - they're supposed to be faster.
Also use shorts instead of ints for the index data, since index arrays are limited anyhow.
Diffstat (limited to 'source')
8 files changed, 50 insertions, 121 deletions
diff --git a/source/gameengine/Converter/BL_SkinMeshObject.h b/source/gameengine/Converter/BL_SkinMeshObject.h index 2690bd2e3a1..d7539031b35 100644 --- a/source/gameengine/Converter/BL_SkinMeshObject.h +++ b/source/gameengine/Converter/BL_SkinMeshObject.h @@ -142,12 +142,7 @@ public: const unsigned int rgbacolor, const MT_Vector3& normal, int defnr, bool flat, RAS_IPolyMaterial* mat) { - short newnormal[3]; - newnormal[0]=(short)(normal[0] * 32767.0); - newnormal[1]=(short)(normal[1] * 32767.0); - newnormal[2]=(short)(normal[2] * 32767.0); - - RAS_TexVert tempvert(xyz,uv,rgbacolor,newnormal,flat ? TV_CALCFACENORMAL : 0); + RAS_TexVert tempvert(xyz,uv,rgbacolor,normal,flat ? TV_CALCFACENORMAL : 0); // KX_ArrayOptimizer* ao = GetArrayOptimizer(mat);//*(m_matVertexArrays[*mat]); BL_SkinArrayOptimizer* ao = (BL_SkinArrayOptimizer*)GetArrayOptimizer(mat);//*(m_matVertexArrays[*mat]); diff --git a/source/gameengine/Ketsji/KX_VertexProxy.cpp b/source/gameengine/Ketsji/KX_VertexProxy.cpp index d4f82c31ea2..ae8a5555843 100644 --- a/source/gameengine/Ketsji/KX_VertexProxy.cpp +++ b/source/gameengine/Ketsji/KX_VertexProxy.cpp @@ -96,8 +96,7 @@ KX_VertexProxy::_getattr(const STR_String& attr) if (attr == "normal") { - MT_Vector3 normal(m_vertex->getNormal()[0], m_vertex->getNormal()[1], m_vertex->getNormal()[2]); - return PyObjectFromMT_Vector3(normal/32767.); + return PyObjectFromMT_Vector3(m_vertex->getNormal()); } // pos @@ -293,9 +292,7 @@ PyObject* KX_VertexProxy::PyGetNormal(PyObject* self, PyObject* kwds) { - const short* shortnormal = m_vertex->getNormal(); - MT_Vector3 normal(shortnormal[0],shortnormal[1],shortnormal[2]); - normal.normalize(); + MT_Vector3 normal(m_vertex->getNormal()); PyObject* resultlist = PyList_New(3); int index; diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.h b/source/gameengine/Rasterizer/RAS_MaterialBucket.h index 480bd9f1d11..182ef1920ce 100644 --- a/source/gameengine/Rasterizer/RAS_MaterialBucket.h +++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.h @@ -44,11 +44,10 @@ #include <set> using namespace std; -typedef vector< vector<class RAS_TexVert>* > vecVertexArray; -typedef vector<unsigned int> KX_IndexArray; +typedef vector<unsigned short> KX_IndexArray; typedef vector< KX_IndexArray* > vecIndexArrays; - typedef vector<RAS_TexVert> KX_VertexArray; +typedef vector< KX_VertexArray* > vecVertexArray; /** diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.cpp b/source/gameengine/Rasterizer/RAS_MeshObject.cpp index ff5e674150b..50bd2339f6e 100644 --- a/source/gameengine/Rasterizer/RAS_MeshObject.cpp +++ b/source/gameengine/Rasterizer/RAS_MeshObject.cpp @@ -254,16 +254,10 @@ int RAS_MeshObject::FindOrAddVertex(int vtxarray, RAS_IPolyMaterial* mat, int orgindex) { - short newnormal[3]; - - newnormal[0]=(short)((normal[0])*32767.0); - newnormal[1]=(short)((normal[1])*32767.0); - newnormal[2]=(short)((normal[2])*32767.0); - KX_ArrayOptimizer* ao = GetArrayOptimizer(mat);//*(m_matVertexArrays[*mat]); int numverts = ao->m_VertexArrayCache1[vtxarray]->size();//m_VertexArrayCount[vtxarray]; - RAS_TexVert newvert(xyz,uv,rgbacolor,newnormal, 0); + RAS_TexVert newvert(xyz,uv,rgbacolor,normal, 0); #define KX_FIND_SHARED_VERTICES #ifdef KX_FIND_SHARED_VERTICES diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp index 7105710bf08..ce58c8470c4 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp @@ -531,22 +531,22 @@ void RAS_OpenGLRasterizer::IndexPrimitives(const vecVertexArray & vertexarrays, glColor4d(rgbacolor[0], rgbacolor[1], rgbacolor[2], rgbacolor[3]); - glNormal3sv(vertexarray[(indexarray[vindex])].getNormal()); + glNormal3fv(vertexarray[(indexarray[vindex])].getNormal()); glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1()); glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ()); vindex++; - glNormal3sv(vertexarray[(indexarray[vindex])].getNormal()); + glNormal3fv(vertexarray[(indexarray[vindex])].getNormal()); glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1()); glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ()); vindex++; - glNormal3sv(vertexarray[(indexarray[vindex])].getNormal()); + glNormal3fv(vertexarray[(indexarray[vindex])].getNormal()); glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1()); glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ()); vindex++; - glNormal3sv(vertexarray[(indexarray[vindex])].getNormal()); + glNormal3fv(vertexarray[(indexarray[vindex])].getNormal()); glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1()); glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ()); vindex++; @@ -561,25 +561,25 @@ void RAS_OpenGLRasterizer::IndexPrimitives(const vecVertexArray & vertexarrays, // the m_rgba field of RAS_TexVert glColor4ubv((const GLubyte *)&(vertexarray[(indexarray[vindex])].getRGBA())); - glNormal3sv(vertexarray[(indexarray[vindex])].getNormal()); + glNormal3fv(vertexarray[(indexarray[vindex])].getNormal()); glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1()); glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ()); vindex++; glColor4ubv((const GLubyte *)&(vertexarray[(indexarray[vindex])].getRGBA())); - glNormal3sv(vertexarray[(indexarray[vindex])].getNormal()); + glNormal3fv(vertexarray[(indexarray[vindex])].getNormal()); glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1()); glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ()); vindex++; glColor4ubv((const GLubyte *)&(vertexarray[(indexarray[vindex])].getRGBA())); - glNormal3sv(vertexarray[(indexarray[vindex])].getNormal()); + glNormal3fv(vertexarray[(indexarray[vindex])].getNormal()); glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1()); glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ()); vindex++; glColor4ubv((const GLubyte *)&(vertexarray[(indexarray[vindex])].getRGBA())); - glNormal3sv(vertexarray[(indexarray[vindex])].getNormal()); + glNormal3fv(vertexarray[(indexarray[vindex])].getNormal()); glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1()); glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ()); vindex++; @@ -599,17 +599,17 @@ void RAS_OpenGLRasterizer::IndexPrimitives(const vecVertexArray & vertexarrays, glColor4d(rgbacolor[0], rgbacolor[1], rgbacolor[2], rgbacolor[3]); - glNormal3sv(vertexarray[(indexarray[vindex])].getNormal()); + glNormal3fv(vertexarray[(indexarray[vindex])].getNormal()); glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1()); glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ()); vindex++; - glNormal3sv(vertexarray[(indexarray[vindex])].getNormal()); + glNormal3fv(vertexarray[(indexarray[vindex])].getNormal()); glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1()); glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ()); vindex++; - glNormal3sv(vertexarray[(indexarray[vindex])].getNormal()); + glNormal3fv(vertexarray[(indexarray[vindex])].getNormal()); glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1()); glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ()); vindex++; @@ -621,19 +621,19 @@ void RAS_OpenGLRasterizer::IndexPrimitives(const vecVertexArray & vertexarrays, { glColor4ubv((const GLubyte *)&(vertexarray[(indexarray[vindex])].getRGBA())); - glNormal3sv(vertexarray[(indexarray[vindex])].getNormal()); + glNormal3fv(vertexarray[(indexarray[vindex])].getNormal()); glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1()); glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ()); vindex++; glColor4ubv((const GLubyte *)&(vertexarray[(indexarray[vindex])].getRGBA())); - glNormal3sv(vertexarray[(indexarray[vindex])].getNormal()); + glNormal3fv(vertexarray[(indexarray[vindex])].getNormal()); glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1()); glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ()); vindex++; glColor4ubv((const GLubyte *)&(vertexarray[(indexarray[vindex])].getRGBA())); - glNormal3sv(vertexarray[(indexarray[vindex])].getNormal()); + glNormal3fv(vertexarray[(indexarray[vindex])].getNormal()); glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1()); glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ()); vindex++; @@ -735,25 +735,25 @@ void RAS_OpenGLRasterizer::IndexPrimitives_Ex(const vecVertexArray & vertexarray glColor4d(rgbacolor[0], rgbacolor[1], rgbacolor[2], rgbacolor[3]); if (!recalc) - glNormal3sv(vertexarray[(indexarray[vindex])].getNormal()); + glNormal3fv(vertexarray[(indexarray[vindex])].getNormal()); glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1()); glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ()); vindex++; if (!recalc) - glNormal3sv(vertexarray[(indexarray[vindex])].getNormal()); + glNormal3fv(vertexarray[(indexarray[vindex])].getNormal()); glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1()); glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ()); vindex++; if (!recalc) - glNormal3sv(vertexarray[(indexarray[vindex])].getNormal()); + glNormal3fv(vertexarray[(indexarray[vindex])].getNormal()); glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1()); glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ()); vindex++; if (!recalc) - glNormal3sv(vertexarray[(indexarray[vindex])].getNormal()); + glNormal3fv(vertexarray[(indexarray[vindex])].getNormal()); glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1()); glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ()); vindex++; @@ -788,28 +788,28 @@ void RAS_OpenGLRasterizer::IndexPrimitives_Ex(const vecVertexArray & vertexarray glColor4ubv((const GLubyte *)&(vertexarray[(indexarray[vindex])].getRGBA())); if (!recalc) - glNormal3sv(vertexarray[(indexarray[vindex])].getNormal()); + glNormal3fv(vertexarray[(indexarray[vindex])].getNormal()); glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1()); glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ()); vindex++; glColor4ubv((const GLubyte *)&(vertexarray[(indexarray[vindex])].getRGBA())); if (!recalc) - glNormal3sv(vertexarray[(indexarray[vindex])].getNormal()); + glNormal3fv(vertexarray[(indexarray[vindex])].getNormal()); glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1()); glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ()); vindex++; glColor4ubv((const GLubyte *)&(vertexarray[(indexarray[vindex])].getRGBA())); if (!recalc) - glNormal3sv(vertexarray[(indexarray[vindex])].getNormal()); + glNormal3fv(vertexarray[(indexarray[vindex])].getNormal()); glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1()); glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ()); vindex++; glColor4ubv((const GLubyte *)&(vertexarray[(indexarray[vindex])].getRGBA())); if (!recalc) - glNormal3sv(vertexarray[(indexarray[vindex])].getNormal()); + glNormal3fv(vertexarray[(indexarray[vindex])].getNormal()); glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1()); glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ()); vindex++; @@ -846,19 +846,19 @@ void RAS_OpenGLRasterizer::IndexPrimitives_Ex(const vecVertexArray & vertexarray glColor4d(rgbacolor[0], rgbacolor[1], rgbacolor[2], rgbacolor[3]); if (!recalc) - glNormal3sv(vertexarray[(indexarray[vindex])].getNormal()); + glNormal3fv(vertexarray[(indexarray[vindex])].getNormal()); glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1()); glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ()); vindex++; if (!recalc) - glNormal3sv(vertexarray[(indexarray[vindex])].getNormal()); + glNormal3fv(vertexarray[(indexarray[vindex])].getNormal()); glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1()); glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ()); vindex++; if (!recalc) - glNormal3sv(vertexarray[(indexarray[vindex])].getNormal()); + glNormal3fv(vertexarray[(indexarray[vindex])].getNormal()); glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1()); glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ()); vindex++; @@ -888,21 +888,21 @@ void RAS_OpenGLRasterizer::IndexPrimitives_Ex(const vecVertexArray & vertexarray glColor4ubv((const GLubyte *)&(vertexarray[(indexarray[vindex])].getRGBA())); if (!recalc) - glNormal3sv(vertexarray[(indexarray[vindex])].getNormal()); + glNormal3fv(vertexarray[(indexarray[vindex])].getNormal()); glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1()); glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ()); vindex++; glColor4ubv((const GLubyte *)&(vertexarray[(indexarray[vindex])].getRGBA())); if (!recalc) - glNormal3sv(vertexarray[(indexarray[vindex])].getNormal()); + glNormal3fv(vertexarray[(indexarray[vindex])].getNormal()); glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1()); glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ()); vindex++; glColor4ubv((const GLubyte *)&(vertexarray[(indexarray[vindex])].getRGBA())); if (!recalc) - glNormal3sv(vertexarray[(indexarray[vindex])].getNormal()); + glNormal3fv(vertexarray[(indexarray[vindex])].getNormal()); glTexCoord2fv(vertexarray[(indexarray[vindex])].getUV1()); glVertex3fv(vertexarray[(indexarray[vindex])].getLocalXYZ()); vindex++; diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp index 7d7a73b8f2d..a2687e6bb3d 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp @@ -195,10 +195,10 @@ void RAS_VAOpenGLRasterizer::IndexPrimitives( const vecVertexArray& vertexarrays glVertexPointer(3,GL_FLOAT,vtxstride,vertexarray->getLocalXYZ()); glTexCoordPointer(2,GL_FLOAT,vtxstride,vertexarray->getUV1()); glColorPointer(4,GL_UNSIGNED_BYTE,vtxstride,&vertexarray->getRGBA()); - glNormalPointer(GL_SHORT,vtxstride,vertexarray->getNormal()); + glNormalPointer(GL_FLOAT,vtxstride,vertexarray->getNormal()); //glLockArraysEXT(0,numverts); // here the actual drawing takes places - glDrawElements(drawmode,numindices,GL_UNSIGNED_INT,&(indexarray[0])); + glDrawElements(drawmode,numindices,GL_UNSIGNED_SHORT,&(indexarray[0])); //glUnlockArraysEXT(); } } diff --git a/source/gameengine/Rasterizer/RAS_TexVert.cpp b/source/gameengine/Rasterizer/RAS_TexVert.cpp index febe5dac5ee..08eb67d7dc5 100644 --- a/source/gameengine/Rasterizer/RAS_TexVert.cpp +++ b/source/gameengine/Rasterizer/RAS_TexVert.cpp @@ -38,22 +38,16 @@ RAS_TexVert::RAS_TexVert(const MT_Point3& xyz, const MT_Point2& uv, const unsigned int rgba, - const short *normal, + const MT_Vector3& normal, const short flag) { xyz.getValue(m_localxyz); uv.getValue(m_uv1); SetRGBA(rgba); - m_normal[0] = normal[0]; - m_normal[1] = normal[1]; - m_normal[2] = normal[2]; + SetNormal(normal); m_flag = flag; } - - - - const MT_Point3& RAS_TexVert::xyz() { g_pt3.setValue(m_localxyz); @@ -69,8 +63,6 @@ void RAS_TexVert::SetRGBA(const MT_Vector4& rgba) colp[3] = rgba[3]*255.0; } -#ifndef RAS_TexVert_INLINE - void RAS_TexVert::SetXYZ(const MT_Point3& xyz) { xyz.getValue(m_localxyz); @@ -97,11 +89,10 @@ void RAS_TexVert::SetFlag(const short flag) } void RAS_TexVert::SetNormal(const MT_Vector3& normal) { - m_normal[0] = short(normal.x()*32767.0); - m_normal[1] = short(normal.y()*32767.0); - m_normal[2] = short(normal.z()*32767.0); + normal.getValue(m_normal); } +#ifndef RAS_TexVert_INLINE // leave multiline for debugging const float* RAS_TexVert::getUV1 () const @@ -110,7 +101,7 @@ const float* RAS_TexVert::getUV1 () const } -const short* RAS_TexVert::getNormal() const +const float* RAS_TexVert::getNormal() const { return m_normal; } @@ -136,30 +127,12 @@ bool RAS_TexVert::closeTo(const RAS_TexVert* other) { return (m_flag == other->m_flag && m_rgba == other->m_rgba && - m_normal[0] == other->m_normal[0] && - m_normal[1] == other->m_normal[1] && - m_normal[2] == other->m_normal[2] && - (MT_Vector2(m_uv1) - MT_Vector2(other->m_uv1)).fuzzyZero() && - (MT_Vector3(m_localxyz) - MT_Vector3(other->m_localxyz)).fuzzyZero()) ; + MT_fuzzyEqual(MT_Vector3(m_normal), MT_Vector3(other->m_normal)) && + MT_fuzzyEqual(MT_Vector2(m_uv1), MT_Vector2(other->m_uv1)) && + MT_fuzzyEqual(MT_Vector3(m_localxyz), MT_Vector3(other->m_localxyz))) ; } - - -bool RAS_TexVert::closeTo(const MT_Point3& otherxyz, - const MT_Point2& otheruv, - const unsigned int otherrgba, - short othernormal[3]) const -{ - return (m_rgba == otherrgba && - m_normal[0] == othernormal[0] && - m_normal[1] == othernormal[1] && - m_normal[2] == othernormal[2] && - (MT_Vector2(m_uv1) - otheruv).fuzzyZero() && - (MT_Vector3(m_localxyz) - otherxyz).fuzzyZero()) ; -} - - short RAS_TexVert::getFlag() const { return m_flag; @@ -169,6 +142,6 @@ void RAS_TexVert::getOffsets(void* &xyz, void* &uv1, void* &rgba, void* &normal) { xyz = (void *) m_localxyz; uv1 = (void *) m_uv1; - rgba = (void *) m_rgba; + rgba = (void *) &m_rgba; normal = (void *) m_normal; } diff --git a/source/gameengine/Rasterizer/RAS_TexVert.h b/source/gameengine/Rasterizer/RAS_TexVert.h index 0480c97421d..b24a0ec2812 100644 --- a/source/gameengine/Rasterizer/RAS_TexVert.h +++ b/source/gameengine/Rasterizer/RAS_TexVert.h @@ -50,7 +50,7 @@ class RAS_TexVert float m_localxyz[3]; // 3*4 = 12 = 24 float m_uv1[2]; // 2*4 = 8 = 24 + 16 = 40 unsigned int m_rgba; // 4 = 40 + 4 = 44 - short m_normal[3]; // 3*2 = 6 = 50 + float m_normal[3]; // 3*2 = 6 = 50 short m_flag; // 32 bytes total size, fits nice = 52 = not fit nice @@ -61,41 +61,12 @@ public: RAS_TexVert(const MT_Point3& xyz, const MT_Point2& uv, const unsigned int rgba, - const short *normal, + const MT_Vector3& normal, const short flag); ~RAS_TexVert() {}; // leave multiline for debugging #ifdef RAS_TexVert_INLINE - void SetXYZ(const MT_Point3& xyz) - { - xyz.getValue(m_localxyz); - } - - - - void SetUV(const MT_Point2& uv) - { - uv.getValue(m_uv1); - } - - void SetRGBA(const unsigned int rgba) - { - m_rgba = rgba; - } - - void SetFlag(const short flag) - { - m_flag = flag; - } - - void SetNormal(const MT_Vector3& normal) - { - m_normal[0] = short(normal.x()*32767.0); - m_normal[1] = short(normal.y()*32767.0); - m_normal[2] = short(normal.z()*32767.0); - } - const float* getUV1 () const { return m_uv1; }; @@ -104,7 +75,7 @@ public: return m_localxyz; }; - const short* getNormal() const { + const float* getNormal() const { return m_normal; } @@ -113,17 +84,17 @@ public: } #else const float* getUV1 () const; - const short* getNormal() const; + const float* getNormal() const; const float* getLocalXYZ() const; const unsigned int& getRGBA() const; +#endif void SetXYZ(const MT_Point3& xyz); void SetUV(const MT_Point2& uv); void SetRGBA(const unsigned int rgba); void SetNormal(const MT_Vector3& normal); void SetFlag(const short flag); -#endif void SetRGBA(const MT_Vector4& rgba); const MT_Point3& xyz(); |