- Timestamp:
- 02/28/06 20:36:18 (7 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgprerendercubemap/osgprerendercubemap.cpp
r4713 r5020 17 17 #include <osg/CullFace> 18 18 #include <osg/Material> 19 #include <osg/RefNodePath>20 19 #include <osg/PositionAttitudeTransform> 21 20 … … 86 85 } 87 86 88 osg:: RefNodePath createReflector()89 { 90 ref_ptr<osg::PositionAttitudeTransform>pat = new osg::PositionAttitudeTransform;87 osg::NodePath createReflector() 88 { 89 osg::PositionAttitudeTransform* pat = new osg::PositionAttitudeTransform; 91 90 pat->setPosition(osg::Vec3(0.0f,0.0f,0.0f)); 92 91 pat->setAttitude(osg::Quat(osg::inDegrees(0.0f),osg::Vec3(0.0f,0.0f,1.0f))); 93 92 94 ref_ptr<Geode>geode_1 = new Geode;95 pat->addChild(geode_1 .get());93 Geode* geode_1 = new Geode; 94 pat->addChild(geode_1); 96 95 97 96 const float radius = 0.8f; 98 97 ref_ptr<TessellationHints> hints = new TessellationHints; 99 98 hints->setDetailRatio(2.0f); 100 ref_ptr<ShapeDrawable>shape = new ShapeDrawable(new Sphere(Vec3(0.0f, 0.0f, 0.0f), radius * 1.5f), hints.get());99 ShapeDrawable* shape = new ShapeDrawable(new Sphere(Vec3(0.0f, 0.0f, 0.0f), radius * 1.5f), hints.get()); 101 100 shape->setColor(Vec4(0.8f, 0.8f, 0.8f, 1.0f)); 102 geode_1->addDrawable(shape .get());101 geode_1->addDrawable(shape); 103 102 104 osg:: RefNodePath refNodeList;105 refNodeList.push_back(pat.get());106 refNodeList.push_back(geode_1.get());103 osg::NodePath nodeList; 104 nodeList.push_back(pat); 105 nodeList.push_back(geode_1); 107 106 108 return refNodeList;107 return nodeList; 109 108 } 110 109 … … 115 114 typedef std::vector< osg::ref_ptr<osg::CameraNode> > CameraList; 116 115 117 UpdateCameraAndTexGenCallback(osg:: RefNodePath& reflectorNodePath, CameraList& cameraNodes):116 UpdateCameraAndTexGenCallback(osg::NodePath& reflectorNodePath, CameraList& cameraNodes): 118 117 _reflectorNodePath(reflectorNodePath), 119 118 _cameraNodes(cameraNodes) … … 161 160 virtual ~UpdateCameraAndTexGenCallback() {} 162 161 163 osg:: RefNodePath_reflectorNodePath;162 osg::NodePath _reflectorNodePath; 164 163 CameraList _cameraNodes; 165 164 }; … … 194 193 195 194 196 osg::Group* createShadowedScene(osg::Node* reflectedSubgraph, osg:: RefNodePath reflectorNodePath, unsigned int unit, const osg::Vec4& clearColor, unsigned tex_width, unsigned tex_height, osg::CameraNode::RenderTargetImplementation renderImplementation)195 osg::Group* createShadowedScene(osg::Node* reflectedSubgraph, osg::NodePath reflectorNodePath, unsigned int unit, const osg::Vec4& clearColor, unsigned tex_width, unsigned tex_height, osg::CameraNode::RenderTargetImplementation renderImplementation) 197 196 { 198 197
