diff --git a/src/osgText/GlyphGeometry.cpp b/src/osgText/GlyphGeometry.cpp index e571db082..55504816d 100644 --- a/src/osgText/GlyphGeometry.cpp +++ b/src/osgText/GlyphGeometry.cpp @@ -115,18 +115,18 @@ public: _segments.push_back( Segment((*elements)[i], (*elements)[i+1], thickness) ); } } - + bool shorter(float original_thickness, float new_thickness) const { return (original_thickness<0.0f) ? (new_thickness>original_thickness) : (new_thicknesslargest) largest = t; } - + if (largest<0.0f) std::swap(smallest, largest); } @@ -328,10 +328,10 @@ public: osg::Vec3 new_vertex = intersection_abcd + bisector_abcd*new_thickness; //OSG_NOTICE<<"computeBisectorPoint("< orig_vertices = new osg::Vec3Array; osg::Geometry::PrimitiveSetList orig_primitives; - + orig_vertices->reserve(source_vertices->size()); orig_primitives.reserve(source_primitives.size()); - + typedef std::vector Indices; Indices remappedIndices(source_vertices->size(), -1); - + float convexCornerInsertionWidth = 0.02; float convexCornerCutoffAngle = osg::inDegrees(45.0f); - + int num_vertices_on_web = 10; - + for(osg::Geometry::PrimitiveSetList::const_iterator itr = source_primitives.begin(); itr != source_primitives.end(); @@ -666,11 +666,11 @@ OSGTEXT_EXPORT osg::Geometry* computeGlyphGeometry(const osgText::Glyph3D* glyph int vi_before = (i==0) ? (*elements)[(elements->size()-2)] : (*elements)[i-1]; int vi_curr = (*elements)[i]; int vi_after = (*elements)[i+1]; - + osg::Vec3 va = (*source_vertices)[vi_before]; osg::Vec3 vb = (*source_vertices)[vi_curr]; osg::Vec3 vc = (*source_vertices)[vi_after]; - + // OSG_NOTICE<<" "<=static_cast(remappedIndices.size())) remappedIndices.resize(vi_curr+1,-1); @@ -682,14 +682,14 @@ OSGTEXT_EXPORT osg::Geometry* computeGlyphGeometry(const osgText::Glyph3D* glyph orig_vertices->push_back(vb); } new_elements->push_back(new_index); - + if (roundedWebs) { osg::Vec3 vab = vb-va; osg::Vec3 vbc = vc-vb; float len_vab = vab.normalize(); float len_vbc = vbc.normalize(); - + if (len_vab*len_vbc==0.0f) { OSG_NOTICE<<"Warning: len_vab="<convexCornerCutoffAngle) { vab.normalize(); vbc.normalize(); float min_len = osg::minimum(len_vab, len_vbc); - + osg::Vec3 v_before = vb - vab*(min_len*convexCornerInsertionWidth); osg::Vec3 v_after = vb + vbc*(min_len*convexCornerInsertionWidth); osg::Vec3 v_mid = v_before + (v_after-v_before)*0.5f; - + float h = (vb-v_mid).length(); float w = (v_after-v_before).length()*0.5f; float l = w*w / h; float r = sqrt(l*l + w*w); float alpha = atan2(w,h); float beta = osg::PI-alpha*2.0f; - + // OSG_NOTICE<<" h = "<(new_geometry->getVertexArray()); @@ -911,11 +911,11 @@ OSGTEXT_EXPORT osg::Geometry* computeGlyphGeometry(const osgText::Glyph3D* glyph if (prim->getName()!="face") new_geometry->addPrimitiveSet(prim); } } - + #if REPORT_TIME OSG_NOTICE<<"Time to compute 3d glyp geometry: "<