Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void MyCullVisitor::apply(osg::LightSource& node)
- {
- osg::Matrixd inverseViewMatrix = osg::Matrixd::inverse(getCurrentCamera()->getViewMatrix());
- osg::Matrixd worldMatrix = inverseViewMatrix * (*getModelViewMatrix());
- osg::Vec3d pos(node.getLight()->getPosition().x(), node.getLight()->getPosition().y(), node.getLight()->getPosition().z());
- worldMatrix = osg::Matrixd::translate(pos) * worldMatrix;
- node.setUserValue("WorldMatrix", worldMatrix);
- if (node.getLight()->getLightNum() == 0)
- {
- osgUtil::CullVisitor::apply(node);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement