Switch to using floats instead of shorts for normal data - they're supposed to be...
authorKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>
Wed, 30 Jun 2004 13:41:19 +0000 (13:41 +0000)
committerKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>
Wed, 30 Jun 2004 13:41:19 +0000 (13:41 +0000)
Also use shorts instead of ints for the index data, since index arrays are limited anyhow.

source/gameengine/Converter/BL_SkinMeshObject.h
source/gameengine/Ketsji/KX_VertexProxy.cpp
source/gameengine/Rasterizer/RAS_MaterialBucket.h
source/gameengine/Rasterizer/RAS_MeshObject.cpp
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp
source/gameengine/Rasterizer/RAS_TexVert.cpp
source/gameengine/Rasterizer/RAS_TexVert.h

index 2690bd2e3a18be97732686572bab06e9ee73bcd9..d7539031b35fb13837e6fa6fcddd078d437aeb69 100644 (file)
@@ -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]);
index d4f82c31ea2852decaec3ca596fb1d81970fb475..ae8a55558435f70fe6202d85a56baeb7400eb67d 100644 (file)
@@ -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;
index 480bd9f1d11c5331e439d226565873c71269cfb2..182ef1920ce28ef939c83919dc9ce89e4f288555 100644 (file)
 #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;
 
 
 /**
index ff5e674150bce9ed4901101a48a1cbf671087643..50bd2339f6eedec9f2f710c90b8d6e7665c548a2 100644 (file)
@@ -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
        
index 7105710bf08aa144c82e508d9335605f761403c1..ce58c8470c4360f01fbe9652d7e84819ad543078 100644 (file)
@@ -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++;
index 7d7a73b8f2d94287f74751705a2ecafc7cbea12b..a2687e6bb3d100e723318bdddc4a302cd8f9a9ed 100644 (file)
@@ -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();
        }
 }
index febe5dac5ee9d41aac041c4da61e1aaf8944be76..08eb67d7dc5392f697e87b775223a8b886244484 100644 (file)
 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;
 }
index 0480c97421dbf98cf81f0f35edadcd84f5b73d8e..b24a0ec2812938f69243eaebaa56b407591b94bd 100644 (file)
@@ -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();