diff --git a/examples/osgtext3D/osgtext3D.cpp b/examples/osgtext3D/osgtext3D.cpp index 24178d039..62197139b 100644 --- a/examples/osgtext3D/osgtext3D.cpp +++ b/examples/osgtext3D/osgtext3D.cpp @@ -49,23 +49,34 @@ public: { if (ea.getKey() == osgGA::GUIEventAdapter::KEY_Up) { - m_Text3D->setCharacterSize(m_Text3D->getCharacterHeight() + 0.1); // failed - OSG_NOTICE<<"m_Text3D->getCharacterHeight()="<getCharacterHeight()<setCharacterSize(m_Text3D->getCharacterHeight() + 0.1); + OSG_NOTICE<<"m_Text3D->getCharacterHeight() = " << m_Text3D->getCharacterHeight() << std::endl; } else if (ea.getKey() == osgGA::GUIEventAdapter::KEY_Down) { - m_Text3D->setCharacterDepth(m_Text3D->getCharacterDepth() + 0.1); // ok - OSG_NOTICE<<"m_Text3D->getCharacterDepth()="<getCharacterDepth()<setCharacterDepth(m_Text3D->getCharacterDepth() + 0.1); + OSG_NOTICE<<"m_Text3D->getCharacterDepth() = " << m_Text3D->getCharacterDepth() << std::endl; } else if (ea.getKey() == osgGA::GUIEventAdapter::KEY_Left) { - m_Text3D->setText("setText\nworks!", osgText::String::ENCODING_UTF8); // ok - OSG_NOTICE<<"m_Text3D->getText()="<getText().size()<setText("Press arrow keys.", osgText::String::ENCODING_UTF8); + else if (counter%3 == 1) + m_Text3D->setText("setText\nworks!", osgText::String::ENCODING_UTF8); + else if (counter%3 == 2) + m_Text3D->setText("setText really works?", osgText::String::ENCODING_UTF8); + else if (counter%3 == 3) + m_Text3D->setText("setText works, really!", osgText::String::ENCODING_UTF8); + + ++counter; + + OSG_NOTICE<<"m_Text3D->getText().size() = " << m_Text3D->getText().size() << std::endl; } else if (ea.getKey() == osgGA::GUIEventAdapter::KEY_Right) { m_Text3D->setLineSpacing(m_Text3D->getLineSpacing() + 0.1); - OSG_NOTICE<<"m_Text3D->getLineSpacing()="<getLineSpacing()<getLineSpacing() = " << m_Text3D->getLineSpacing() << std::endl; } } @@ -90,7 +101,7 @@ int main(int argc, char** argv) if (!font) return 1; OSG_NOTICE<<"Read font "< style = new osgText::Style; @@ -238,18 +249,18 @@ int main(int argc, char** argv) geode->addDrawable( osg::createTexturedQuadGeometry(osg::Vec3(0.0f,characterSize*thickness,0.0f),osg::Vec3(characterSize,0.0,0.0),osg::Vec3(0.0f,0.0,characterSize), 0.0, 0.0, 1.0, 1.0) ); } - if (arguments.read("--add-axes")) - group->addChild(osgDB::readNodeFile("axes.osgt")); + if (arguments.read("--add-axes")) + group->addChild(osgDB::readNodeFile("axes.osgt")); - std::string mode; - if (arguments.read("--character-size-mode", mode)) - { - if (mode == "screen_coords") - { - text3D->setCharacterSizeMode(osgText::TextBase::SCREEN_COORDS); - text3D->setCharacterSize(1080/4); - } - } + std::string mode; + if (arguments.read("--character-size-mode", mode)) + { + if (mode == "screen_coords") + { + text3D->setCharacterSizeMode(osgText::TextBase::SCREEN_COORDS); + text3D->setCharacterSize(1080/4); + } + } viewer.addEventHandler(new Text3DAttributeHandler(text3D)); } diff --git a/src/osg/Program.cpp b/src/osg/Program.cpp index 7092a565a..85c49a37d 100644 --- a/src/osg/Program.cpp +++ b/src/osg/Program.cpp @@ -517,9 +517,10 @@ void Program::apply( osg::State& state ) const // for shader debugging: to minimize performance impact, // optionally validate based on notify level. // TODO: enable this using notify level, or perhaps its own getenv()? +#ifndef __APPLE__ if( osg::isNotifyEnabled(osg::INFO) ) pcp->validateProgram(); - +#endif pcp->useProgram(); state.setLastAppliedProgramObject(pcp); } diff --git a/src/osgAnimation/RigTransformHardware.cpp b/src/osgAnimation/RigTransformHardware.cpp index fbe4e9de1..651e48cf7 100644 --- a/src/osgAnimation/RigTransformHardware.cpp +++ b/src/osgAnimation/RigTransformHardware.cpp @@ -136,9 +136,6 @@ bool RigTransformHardware::createPalette(int nbVertexes, BoneMap boneMap, const OSG_INFO << "RigTransformHardware::createPalette will use " << boneNameCountMap.size() * 4 << " uniforms" << std::endl; - for (int i = 0 ; i < (int)vertexIndexWeight.size(); i++) - vertexIndexWeight[i].resize(maxBonePerVertex); - _nbVertexes = nbVertexes; _bonesPerVertex = maxBonePerVertex; _bonePalette = palette; @@ -181,7 +178,7 @@ RigTransformHardware::BoneWeightAttribList RigTransformHardware::createVertexAtt int boneIndexInVec4 = b*2; (*array)[j][0 + boneIndexInVec4] = 0; (*array)[j][1 + boneIndexInVec4] = 0; - if (boneIndexInList < getNumBonesPerVertex()) + if (boneIndexInList < _vertexIndexMatrixWeightList[j].size()) { float boneIndex = static_cast(_vertexIndexMatrixWeightList[j][boneIndexInList].getIndex()); float boneWeight = _vertexIndexMatrixWeightList[j][boneIndexInList].getWeight(); diff --git a/src/osgText/Text3D.cpp b/src/osgText/Text3D.cpp index 98056db58..ef9561422 100644 --- a/src/osgText/Text3D.cpp +++ b/src/osgText/Text3D.cpp @@ -438,9 +438,11 @@ void Text3D::computeGlyphRepresentation() { (*_coords)[i] += position; } + _coords->dirty(); // copy normals _normals->insert(_normals->end(), src_normals->begin(), src_normals->end()); + _normals->dirty(); copyAndOffsetPrimitiveSets(_frontPrimitiveSetList, it->_glyphGeometry->getFrontPrimitiveSetList(), base); copyAndOffsetPrimitiveSets(_wallPrimitiveSetList, it->_glyphGeometry->getWallPrimitiveSetList(), base); diff --git a/src/osgUtil/LineSegmentIntersector.cpp b/src/osgUtil/LineSegmentIntersector.cpp index 63cb30366..5a6b69afe 100644 --- a/src/osgUtil/LineSegmentIntersector.cpp +++ b/src/osgUtil/LineSegmentIntersector.cpp @@ -500,7 +500,7 @@ void LineSegmentIntersector::intersect(osgUtil::IntersectionVisitor& iv, osg::Dr if (reachedLimit()) return; osg::Vec3d s(_start), e(_end); - if ( !intersectAndClip( s, e, drawable->getBoundingBox() ) ) return; + if ( drawable->isCullingActive() && !intersectAndClip( s, e, drawable->getBoundingBox() ) ) return; if (iv.getDoDummyTraversal()) return;