Fix PagedLOD::addChild(,,) so that they allocate the correct size of range data.

This commit is contained in:
Robert Osfield 2005-07-14 20:32:25 +00:00
parent 0956674292
commit 0e4b263ddb
2 changed files with 14 additions and 4 deletions

View File

@ -232,7 +232,7 @@ bool PagedLOD::addChild( Node *child )
{
if (LOD::addChild(child))
{
expandPerRangeDataTo(_children.size());
expandPerRangeDataTo(_children.size()-1);
return true;
}
return false;
@ -242,7 +242,7 @@ bool PagedLOD::addChild(Node *child, float min, float max)
{
if (LOD::addChild(child,min,max))
{
expandPerRangeDataTo(_children.size());
expandPerRangeDataTo(_children.size()-1);
return true;
}
return false;

View File

@ -14,8 +14,12 @@
using namespace osg;
TexGenNode::TexGenNode()
TexGenNode::TexGenNode():
_referenceFrame(RELATIVE_RF)
{
// switch off culling of tex gen nodes by default.
setCullingActive(false);
_textureUnit = 0;
_value = StateAttribute::ON;
_stateset = new StateSet;
@ -26,7 +30,8 @@ TexGenNode::TexGenNode(const TexGenNode& cn, const CopyOp& copyop):
Group(cn,copyop),
_textureUnit(cn._textureUnit),
_value(cn._value),
_texgen(static_cast<TexGen*>(copyop(cn._texgen.get())))
_texgen(static_cast<TexGen*>(copyop(cn._texgen.get()))),
_referenceFrame(cn._referenceFrame)
{
}
@ -42,6 +47,11 @@ TexGenNode::~TexGenNode()
{
}
void TexGenNode::setReferenceFrame(ReferenceFrame rf)
{
_referenceFrame = rf;
}
void TexGenNode::setTexGen(TexGen* texgen)
{
_texgen = texgen;