osgSim.LightPoint
是 OpenSceneGraph 中的一个可视化节点,用于表示一个点光源。
继承自 osg::Geode
。
class LightPoint : public osg::Geode
#include <osgSim/LightPoint>
函数名称 | 返回类型 | 描述 |
---|---|---|
LightPoint() |
构造函数,创建一个空的点光源 | |
LightPoint(const osgSim::LightPoint& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY) |
拷贝构造函数 | |
void setHalfSize(const osg::Vec3& halfSize) |
设置点光源的半径 | |
const osg::Vec3& getHalfSize() const |
const osg::Vec3& |
获取点光源的半径 |
void setColor(const osg::Vec4& color) |
设置点光源的颜色 | |
const osg::Vec4& getColor() const |
const osg::Vec4& |
获取点光源的颜色 |
void setAttenuation(const osg::Vec3& attenuation) |
设置点光源的衰减系数 | |
const osg::Vec3& getAttenuation() const |
const osg::Vec3& |
获取点光源的衰减系数 |
int getLightPointIndex() const |
int |
获取点光源的索引 |
osg::ref_ptr<osgSim::LightPoint> lightpoint = new osgSim::LightPoint;
osg::ref_ptr<osgSim::LightPoint> lightpoint = new osgSim::LightPoint;
lightpoint->setHalfSize(osg::Vec3(1.0f, 1.0f, 1.0f));
lightpoint->setColor(osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f));
lightpoint->setAttenuation(osg::Vec3(1.0f, 0.0f, 0.0f));
lightpoint->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF);