Commit a2985cbfd8dd2f0bb861e5170e2d494985718f1a

henry 2004-10-18T21:41:36

Removed depth member var. Fixed a problem with normal generation.

diff --git a/include/FTExtrdGlyph.h b/include/FTExtrdGlyph.h
index 135b25a..e0e8a56 100644
--- a/include/FTExtrdGlyph.h
+++ b/include/FTExtrdGlyph.h
@@ -22,7 +22,7 @@ class FTGL_EXPORT FTExtrdGlyph : public FTGlyph
 {
     public:
         /**
-         * Constructor. Sets the Error to Invalid_Outline if the glyphs isn't an outline.
+         * Constructor. Sets the Error to Invalid_Outline if the glyph isn't an outline.
          *
          * @param glyph The Freetype glyph to be processed
          * @param depth The distance along the z axis to extrude the glyph
@@ -61,11 +61,6 @@ class FTGL_EXPORT FTExtrdGlyph : public FTGlyph
          * OpenGL display list
          */
         GLuint glList;
-        
-        /**
-         * Distance to extrude the glyph
-         */
-        float depth;
     
 };
 
diff --git a/src/FTExtrdGlyph.cpp b/src/FTExtrdGlyph.cpp
index 7696c4c..532dfbc 100644
--- a/src/FTExtrdGlyph.cpp
+++ b/src/FTExtrdGlyph.cpp
@@ -6,10 +6,9 @@
 #include    "FTVectoriser.h"
 
 
-FTExtrdGlyph::FTExtrdGlyph( FT_GlyphSlot glyph, float d, bool useDisplayList)
+FTExtrdGlyph::FTExtrdGlyph( FT_GlyphSlot glyph, float depth, bool useDisplayList)
 :   FTGlyph( glyph),
-    glList(0),
-    depth(d)
+    glList(0)
 {
     bBox.SetDepth( -depth);
         
@@ -100,8 +99,11 @@ FTExtrdGlyph::FTExtrdGlyph( FT_GlyphSlot glyph, float d, bool useDisplayList)
                 FTPoint point = contour->Point(pointIndex);
 
                 FTPoint normal = GetNormal( point, contour->Point(nextPointIndex));
-                glNormal3f( normal.X(), normal.Y(), 0.0f);
-                
+                if(normal != FTPoint( 0.0f, 0.0f, 0.0f))
+                {                   
+                    glNormal3dv((FTGL_DOUBLE*)normal);
+                }
+
                 if( contourFlag & ft_outline_reverse_fill)
                 {
                     glTexCoord2f( point.X() / horizontalTextureScale,
@@ -155,7 +157,7 @@ FTPoint FTExtrdGlyph::GetNormal( const FTPoint &a, const FTPoint &b)
                               
     float length = sqrt( vectorX * vectorX + vectorY * vectorY );
     
-    if( length > 0.0f)
+    if( length > 0.01f)
     {
         length = 1 / length;
     }