Fixed typo of SEPARATE enums

git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14833 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield 2015-04-13 11:48:28 +00:00
parent 0a1db3d6fc
commit 87122ca369
7 changed files with 48 additions and 48 deletions

View File

@ -448,7 +448,7 @@ int main( int argc, char **argv )
while (arguments.read("--pbuffer")) { renderImplementation = osg::Camera::PIXEL_BUFFER; }
while (arguments.read("--pbuffer-rtt")) { renderImplementation = osg::Camera::PIXEL_BUFFER_RTT; }
while (arguments.read("--fb")) { renderImplementation = osg::Camera::FRAME_BUFFER; }
while (arguments.read("--window")) { renderImplementation = osg::Camera::SEPERATE_WINDOW; }
while (arguments.read("--window")) { renderImplementation = osg::Camera::SEPARATE_WINDOW; }
while (arguments.read("--fbo-samples", samples)) {}
while (arguments.read("--color-samples", colorSamples)) {}

View File

@ -110,7 +110,7 @@ osg::NodePath createReflector()
osg::PositionAttitudeTransform* pat = new osg::PositionAttitudeTransform;
pat->setPosition(osg::Vec3(0.0f,0.0f,0.0f));
pat->setAttitude(osg::Quat(osg::inDegrees(0.0f),osg::Vec3(0.0f,0.0f,1.0f)));
Geode* geode_1 = new Geode;
pat->addChild(geode_1);
@ -120,18 +120,18 @@ osg::NodePath createReflector()
ShapeDrawable* shape = new ShapeDrawable(new Sphere(Vec3(0.0f, 0.0f, 0.0f), radius * 1.5f), hints.get());
shape->setColor(Vec4(0.8f, 0.8f, 0.8f, 1.0f));
geode_1->addDrawable(shape);
osg::NodePath nodeList;
nodeList.push_back(pat);
nodeList.push_back(geode_1);
return nodeList;
}
class UpdateCameraAndTexGenCallback : public osg::NodeCallback
{
public:
typedef std::vector< osg::ref_ptr<osg::Camera> > CameraList;
UpdateCameraAndTexGenCallback(osg::NodePath& reflectorNodePath, CameraList& Cameras):
@ -139,7 +139,7 @@ class UpdateCameraAndTexGenCallback : public osg::NodeCallback
_Cameras(Cameras)
{
}
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
{
// first update subgraph to make sure objects are all moved into position
@ -161,43 +161,43 @@ class UpdateCameraAndTexGenCallback : public osg::NodeCallback
ImageData( osg::Vec3( 0, 0, -1), osg::Vec3( 0, -1, 0) ) // -Z
};
for(unsigned int i=0;
for(unsigned int i=0;
i<6 && i<_Cameras.size();
++i)
{
osg::Matrix localOffset;
localOffset.makeLookAt(position,position+id[i].first,id[i].second);
osg::Matrix viewMatrix = worldToLocal*localOffset;
_Cameras[i]->setReferenceFrame(osg::Camera::ABSOLUTE_RF);
_Cameras[i]->setProjectionMatrixAsFrustum(-1.0,1.0,-1.0,1.0,1.0,10000.0);
_Cameras[i]->setViewMatrix(viewMatrix);
}
}
protected:
virtual ~UpdateCameraAndTexGenCallback() {}
osg::NodePath _reflectorNodePath;
osg::NodePath _reflectorNodePath;
CameraList _Cameras;
};
class TexMatCullCallback : public osg::NodeCallback
{
public:
TexMatCullCallback(osg::TexMat* texmat):
_texmat(texmat)
{
}
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
{
// first update subgraph to make sure objects are all moved into position
traverse(node,nv);
osgUtil::CullVisitor* cv = dynamic_cast<osgUtil::CullVisitor*>(nv);
if (cv)
{
@ -205,9 +205,9 @@ class TexMatCullCallback : public osg::NodeCallback
_texmat->setMatrix(osg::Matrix::rotate(quat.inverse()));
}
}
protected:
osg::ref_ptr<TexMat> _texmat;
};
@ -216,7 +216,7 @@ osg::Group* createShadowedScene(osg::Node* reflectedSubgraph, osg::NodePath refl
{
osg::Group* group = new osg::Group;
osg::TextureCubeMap* texture = new osg::TextureCubeMap;
texture->setTextureSize(tex_width, tex_height);
@ -226,7 +226,7 @@ osg::Group* createShadowedScene(osg::Node* reflectedSubgraph, osg::NodePath refl
texture->setWrap(osg::Texture::WRAP_R, osg::Texture::CLAMP_TO_EDGE);
texture->setFilter(osg::TextureCubeMap::MIN_FILTER,osg::TextureCubeMap::LINEAR);
texture->setFilter(osg::TextureCubeMap::MAG_FILTER,osg::TextureCubeMap::LINEAR);
// set up the render to texture cameras.
UpdateCameraAndTexGenCallback::CameraList Cameras;
for(unsigned int i=0; i<6; ++i)
@ -251,23 +251,23 @@ osg::Group* createShadowedScene(osg::Node* reflectedSubgraph, osg::NodePath refl
// add subgraph to render
camera->addChild(reflectedSubgraph);
group->addChild(camera);
Cameras.push_back(camera);
}
// create the texgen node to project the tex coords onto the subgraph
osg::TexGenNode* texgenNode = new osg::TexGenNode;
texgenNode->getTexGen()->setMode(osg::TexGen::REFLECTION_MAP);
texgenNode->setTextureUnit(unit);
group->addChild(texgenNode);
// set the reflected subgraph so that it uses the texture and tex gen settings.
// set the reflected subgraph so that it uses the texture and tex gen settings.
{
osg::Node* reflectorNode = reflectorNodePath.front();
group->addChild(reflectorNode);
osg::StateSet* stateset = reflectorNode->getOrCreateStateSet();
stateset->setTextureAttributeAndModes(unit,texture,osg::StateAttribute::ON);
stateset->setTextureMode(unit,GL_TEXTURE_GEN_S,osg::StateAttribute::ON);
@ -277,13 +277,13 @@ osg::Group* createShadowedScene(osg::Node* reflectedSubgraph, osg::NodePath refl
osg::TexMat* texmat = new osg::TexMat;
stateset->setTextureAttributeAndModes(unit,texmat,osg::StateAttribute::ON);
reflectorNode->setCullCallback(new TexMatCullCallback(texmat));
}
// add the reflector scene to draw just as normal
group->addChild(reflectedSubgraph);
// set an update callback to keep moving the camera and tex gen in the right direction.
group->setUpdateCallback(new UpdateCameraAndTexGenCallback(reflectorNodePath, Cameras));
@ -316,19 +316,19 @@ int main(int argc, char** argv)
arguments.getApplicationUsage()->write(std::cout);
return 1;
}
unsigned tex_width = 256;
unsigned tex_height = 256;
while (arguments.read("--width", tex_width)) {}
while (arguments.read("--height", tex_height)) {}
osg::Camera::RenderTargetImplementation renderImplementation = osg::Camera::FRAME_BUFFER_OBJECT;
while (arguments.read("--fbo")) { renderImplementation = osg::Camera::FRAME_BUFFER_OBJECT; }
while (arguments.read("--pbuffer")) { renderImplementation = osg::Camera::PIXEL_BUFFER; }
while (arguments.read("--fb")) { renderImplementation = osg::Camera::FRAME_BUFFER; }
while (arguments.read("--window")) { renderImplementation = osg::Camera::SEPERATE_WINDOW; }
while (arguments.read("--window")) { renderImplementation = osg::Camera::SEPARATE_WINDOW; }
// any option left unread are converted into errors to write out later.
arguments.reportRemainingOptionsAsUnrecognized();
@ -343,7 +343,7 @@ int main(int argc, char** argv)
ref_ptr<MatrixTransform> scene = new MatrixTransform;
scene->setMatrix(osg::Matrix::rotate(osg::DegreesToRadians(125.0),1.0,0.0,0.0));
ref_ptr<Group> reflectedSubgraph = _create_scene();
ref_ptr<Group> reflectedSubgraph = _create_scene();
if (!reflectedSubgraph.valid()) return 1;
ref_ptr<Group> reflectedScene = createShadowedScene(reflectedSubgraph.get(), createReflector(), 0, viewer.getCamera()->getClearColor(),

View File

@ -292,7 +292,7 @@ class OSG_EXPORT Camera : public Transform, public CullSettings
PIXEL_BUFFER_RTT,
PIXEL_BUFFER,
FRAME_BUFFER,
SEPERATE_WINDOW
SEPARATE_WINDOW
};
/** Set the render target.*/

View File

@ -241,7 +241,7 @@ struct Segment
{
UNCLASSIFIED,
IDENTICAL,
SEPERATE,
SEPARATE,
JOINED,
OVERLAPPING,
ENCLOSING,
@ -262,10 +262,10 @@ struct Segment
if (delta_distance==0.0)
{
return SEPERATE;
return SEPARATE;
}
if (rhs._p2->distance < _p1->distance || _p2->distance < rhs._p1->distance) return SEPERATE;
if (rhs._p2->distance < _p1->distance || _p2->distance < rhs._p1->distance) return SEPARATE;
bool rhs_p1_inside = (_p1->distance <= rhs._p1->distance) && (rhs._p1->distance <= _p2->distance);
bool rhs_p2_inside = (_p1->distance <= rhs._p2->distance) && (rhs._p2->distance <= _p2->distance);
@ -406,7 +406,7 @@ struct LineConstructor
switch(classification)
{
case(Segment::IDENTICAL): OSG_NOTICE<<"i"; break;
case(Segment::SEPERATE): OSG_NOTICE<<"s"<<std::endl; break;
case(Segment::SEPARATE): OSG_NOTICE<<"s"<<std::endl; break;
case(Segment::JOINED): OSG_NOTICE<<"j"; break;
case(Segment::OVERLAPPING): OSG_NOTICE<<"o"; break;
case(Segment::ENCLOSING): OSG_NOTICE<<"E"; break;
@ -1110,7 +1110,7 @@ struct LineConstructor
Segment::Classification classification = prevItr->compare(*nextItr);
switch(classification)
{
case(Segment::SEPERATE):
case(Segment::SEPARATE):
{
intersections.push_back( nextItr->_p1->position );
distanceHeightIntersections.push_back( ElevationSlice::DistanceHeight(nextItr->_p1->distance, nextItr->_p1->height) );

View File

@ -610,7 +610,7 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
while (!getGraphicsContext() &&
(renderTargetImplementation==osg::Camera::PIXEL_BUFFER_RTT ||
renderTargetImplementation==osg::Camera::PIXEL_BUFFER ||
renderTargetImplementation==osg::Camera::SEPERATE_WINDOW) )
renderTargetImplementation==osg::Camera::SEPARATE_WINDOW) )
{
osg::ref_ptr<osg::GraphicsContext> context = getGraphicsContext();
if (!context)
@ -625,8 +625,8 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
// OSG_NOTICE<<"traits = "<<traits->width<<" "<<traits->height<<std::endl;
traits->pbuffer = (renderTargetImplementation==osg::Camera::PIXEL_BUFFER || renderTargetImplementation==osg::Camera::PIXEL_BUFFER_RTT);
traits->windowDecoration = (renderTargetImplementation==osg::Camera::SEPERATE_WINDOW);
traits->doubleBuffer = (renderTargetImplementation==osg::Camera::SEPERATE_WINDOW);
traits->windowDecoration = (renderTargetImplementation==osg::Camera::SEPARATE_WINDOW);
traits->doubleBuffer = (renderTargetImplementation==osg::Camera::SEPARATE_WINDOW);
osg::Texture* pBufferTexture = 0;
GLenum bufferFormat = GL_NONE;
@ -699,7 +699,7 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
}
default:
{
if (renderTargetImplementation==osg::Camera::SEPERATE_WINDOW)
if (renderTargetImplementation==osg::Camera::SEPARATE_WINDOW)
{
OSG_NOTICE<<"Warning: RenderStage::runCameraSetUp(State&) Window ";
}

View File

@ -125,7 +125,7 @@ bool Camera_readLocalData(Object& obj, Input& fr)
else if (fr[1].matchWord("PIXEL_BUFFER_RTT")) implementation = osg::Camera::PIXEL_BUFFER_RTT;
else if (fr[1].matchWord("PIXEL_BUFFER")) implementation = osg::Camera::PIXEL_BUFFER;
else if (fr[1].matchWord("FRAME_BUFFER")) implementation = osg::Camera::FRAME_BUFFER;
else if (fr[1].matchWord("SEPERATE_WINDOW")) implementation = osg::Camera::SEPERATE_WINDOW;
else if (fr[1].matchWord("SEPARATE_WINDOW")) implementation = osg::Camera::SEPARATE_WINDOW;
camera.setRenderTargetImplementation(implementation);
@ -141,7 +141,7 @@ bool Camera_readLocalData(Object& obj, Input& fr)
else if (fr[1].matchWord("PIXEL_BUFFER_RTT")) fallback = osg::Camera::PIXEL_BUFFER_RTT;
else if (fr[1].matchWord("PIXEL_BUFFER")) fallback = osg::Camera::PIXEL_BUFFER;
else if (fr[1].matchWord("FRAME_BUFFER")) fallback = osg::Camera::FRAME_BUFFER;
else if (fr[1].matchWord("SEPERATE_WINDOW")) fallback = osg::Camera::SEPERATE_WINDOW;
else if (fr[1].matchWord("SEPARATE_WINDOW")) fallback = osg::Camera::SEPARATE_WINDOW;
camera.setRenderTargetImplementation(camera.getRenderTargetImplementation(), fallback);
@ -273,7 +273,7 @@ bool Camera_writeLocalData(const Object& obj, Output& fw)
case(osg::Camera::PIXEL_BUFFER_RTT): fw <<"PIXEL_BUFFER_RTT"<<std::endl; break;
case(osg::Camera::PIXEL_BUFFER): fw <<"PIXEL_BUFFER"<<std::endl; break;
case(osg::Camera::FRAME_BUFFER): fw <<"FRAME_BUFFER"<<std::endl; break;
case(osg::Camera::SEPERATE_WINDOW): fw <<"SEPERATE_WINDOW"<<std::endl; break;
case(osg::Camera::SEPARATE_WINDOW): fw <<"SEPARATE_WINDOW"<<std::endl; break;
}
fw.indent()<<"renderTargetFallback ";
@ -283,7 +283,7 @@ bool Camera_writeLocalData(const Object& obj, Output& fw)
case(osg::Camera::PIXEL_BUFFER_RTT): fw <<"PIXEL_BUFFER_RTT"<<std::endl; break;
case(osg::Camera::PIXEL_BUFFER): fw <<"PIXEL_BUFFER"<<std::endl; break;
case(osg::Camera::FRAME_BUFFER): fw <<"FRAME_BUFFER"<<std::endl; break;
case(osg::Camera::SEPERATE_WINDOW): fw <<"SEPERATE_WINDOW"<<std::endl; break;
case(osg::Camera::SEPARATE_WINDOW): fw <<"SEPARATE_WINDOW"<<std::endl; break;
}
fw.indent()<<"drawBuffer "<<std::hex<<camera.getDrawBuffer()<<std::endl;

View File

@ -220,7 +220,7 @@ REGISTER_OBJECT_WRAPPER( Camera,
ADD_ENUM_VALUE( PIXEL_BUFFER_RTT );
ADD_ENUM_VALUE( PIXEL_BUFFER );
ADD_ENUM_VALUE( FRAME_BUFFER );
ADD_ENUM_VALUE( SEPERATE_WINDOW );
ADD_ENUM_VALUE( SEPARATE_WINDOW );
END_ENUM_SERIALIZER(); // _renderTargetImplementation
ADD_USER_SERIALIZER( BufferAttachmentMap ); // _bufferAttachmentMap