osgVolume.SampleDensityProperty是OpenSceneGraph中的一个属性类,用于设置体积数据采样时的密度。
class SampleDensityProperty : public osg::Object
继承自osg::Object
。
#include <osgVolume/SampleDensity>
SampleDensityProperty(float density = 1.0f);
void setDensity(float density);
float getDensity() const;
virtual const char * className() const;
virtual Object * clone(const osg::CopyOp ©op) const;
virtual void serialize(ProtoBuf::Message &message) const;
virtual bool deserialize(const ProtoBuf::Message &message);
//设置SampleDensityProperty
osg::ref_ptr<osgVolume::SampleDensityProperty> densityProp = new osgVolume::SampleDensityProperty(0.5f);
//关联到VolumeObject节点
osg::ref_ptr<osgVolume::Volume> volumeNode = new osgVolume::Volume;
volumeNode->setProperty(densityProp);