_boundScale(1)
{
setReferenceFrame(RELATIVE_RF);
+ // see osg::Transform doc: If the transformation matrix scales the subgraph
+ // then the normals of the underlying geometry will need to be renormalized
+ // to be unit vectors once more.
+ osg::StateSet* stateset = getOrCreateStateSet();
+ stateset->setMode(GL_NORMALIZE, osg::StateAttribute::ON);
}
SGScaleTransform::SGScaleTransform(const SGScaleTransform& scale,
SGScaleTransform& scale = static_cast<SGScaleTransform&>(obj);
if (fr[0].matchWord("center")) {
++fr;
- SGVec3d center;
- if (fr.readSequence(center.osg()))
+ osg::Vec3d center;
+ if (fr.readSequence(center))
fr += 3;
else
return false;
- scale.setCenter(center);
+ scale.setCenter(toSG(center));
}
if (fr[0].matchWord("scaleFactor")) {
++fr;
- SGVec3d scaleFactor;
- if (fr.readSequence(scaleFactor.osg()))
+ osg::Vec3d scaleFactor;
+ if (fr.readSequence(scaleFactor))
fr += 3;
else
return false;
- scale.setScaleFactor(scaleFactor);
+ scale.setScaleFactor(toSG(scaleFactor));
}
return true;
}