From b70ff91eaf558e377a64361be211d3bbd865c6d5 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sun, 24 Oct 2004 20:04:00 +0000 Subject: [PATCH] Changed ABSOLUTE and RELATIVE to ABSOLUTE_RF and RELATIVE_RF to avoid stooppid Win32 #define --- examples/osgdistortion/osgdistortion.cpp | 2 +- examples/osgforest/osgforest.cpp | 2 +- examples/osgfxbrowser/osgfxbrowser.cpp | 2 +- examples/osghud/osghud.cpp | 4 ++-- examples/osglauncher/osglauncher.cpp | 2 +- examples/osgparticle/osgparticle.cpp | 4 ++-- examples/osgphotoalbum/osgphotoalbum.cpp | 4 ++-- examples/osgpick/osgpick.cpp | 2 +- examples/osgscalarbar/osgscalarbar.cpp | 2 +- examples/osgtesselate/osgtesselate.cpp | 2 +- examples/osgtext/osgtext.cpp | 2 +- .../osgtexturerectangle/osgtexturerectangle.cpp | 2 +- include/osg/LightSource | 12 ++++++------ include/osg/Transform | 16 ++++++++-------- include/osgParticle/AccelOperator | 2 +- include/osgParticle/AngularAccelOperator | 2 +- include/osgParticle/ForceOperator | 2 +- include/osgParticle/Operator | 2 +- include/osgParticle/ParticleProcessor | 8 ++++---- src/osg/AutoTransform.cpp | 4 ++-- src/osg/Group.cpp | 4 ++-- src/osg/LightSource.cpp | 6 +++--- src/osg/MatrixTransform.cpp | 6 +++--- src/osg/PositionAttitudeTransform.cpp | 4 ++-- src/osg/Transform.cpp | 4 ++-- src/osgParticle/FluidFrictionOperator.cpp | 2 +- src/osgParticle/ModularEmitter.cpp | 2 +- src/osgParticle/ParticleProcessor.cpp | 2 +- src/osgPlugins/osg/LightSource.cpp | 8 ++++---- src/osgPlugins/osg/Transform.cpp | 8 ++++---- .../osgParticle/IO_ParticleProcessor.cpp | 8 ++++---- src/osgProducer/Viewer.cpp | 4 ++-- src/osgSim/DOFTransform.cpp | 4 ++-- src/osgUtil/CullVisitor.cpp | 2 +- src/osgUtil/Optimizer.cpp | 2 +- 35 files changed, 72 insertions(+), 72 deletions(-) diff --git a/examples/osgdistortion/osgdistortion.cpp b/examples/osgdistortion/osgdistortion.cpp index 3b1acb7d3..c69a8a7c5 100644 --- a/examples/osgdistortion/osgdistortion.cpp +++ b/examples/osgdistortion/osgdistortion.cpp @@ -144,7 +144,7 @@ void DistortionNode::createHUDSubgraph() // create the hud. osg::MatrixTransform* modelview_abs = new osg::MatrixTransform; - modelview_abs->setReferenceFrame(osg::Transform::ABSOLUTE); + modelview_abs->setReferenceFrame(osg::Transform::ABSOLUTE_RF); modelview_abs->setMatrix(osg::Matrix::identity()); modelview_abs->addChild(geode); diff --git a/examples/osgforest/osgforest.cpp b/examples/osgforest/osgforest.cpp index 9a794c17d..03dc25c7c 100644 --- a/examples/osgforest/osgforest.cpp +++ b/examples/osgforest/osgforest.cpp @@ -744,7 +744,7 @@ osg::Node* ForestTechniqueManager::createHUDWithText(const std::string& str) // create the hud. osg::MatrixTransform* modelview_abs = new osg::MatrixTransform; - modelview_abs->setReferenceFrame(osg::Transform::ABSOLUTE); + modelview_abs->setReferenceFrame(osg::Transform::ABSOLUTE_RF); modelview_abs->setMatrix(osg::Matrix::identity()); modelview_abs->addChild(geode); diff --git a/examples/osgfxbrowser/osgfxbrowser.cpp b/examples/osgfxbrowser/osgfxbrowser.cpp index 18080e7e6..1c08622d1 100644 --- a/examples/osgfxbrowser/osgfxbrowser.cpp +++ b/examples/osgfxbrowser/osgfxbrowser.cpp @@ -232,7 +232,7 @@ osg::Group *build_hud_base(osg::Group *root) root->addChild(proj.get()); osg::ref_ptr xform = new osg::MatrixTransform(osg::Matrix::identity()); - xform->setReferenceFrame(osg::Transform::ABSOLUTE); + xform->setReferenceFrame(osg::Transform::ABSOLUTE_RF); proj->addChild(xform.get()); osg::StateSet *ss = xform->getOrCreateStateSet(); diff --git a/examples/osghud/osghud.cpp b/examples/osghud/osghud.cpp index 19e36f25d..3cedf6959 100644 --- a/examples/osghud/osghud.cpp +++ b/examples/osghud/osghud.cpp @@ -102,7 +102,7 @@ osg::Node* createHUD() text->setFont(timesFont); text->setPosition(position); - text->setText("And add an osg::ModelViewMatrix set to ABSOLUTE to ensure\nit remains independent from any external model view matrices."); + text->setText("And add an osg::ModelViewMatrix set to ABSOLUTE_RF to ensure\nit remains independent from any external model view matrices."); position += delta; } @@ -148,7 +148,7 @@ osg::Node* createHUD() // create the hud. osg::MatrixTransform* modelview_abs = new osg::MatrixTransform; - modelview_abs->setReferenceFrame(osg::Transform::ABSOLUTE); + modelview_abs->setReferenceFrame(osg::Transform::ABSOLUTE_RF); modelview_abs->setMatrix(osg::Matrix::identity()); modelview_abs->addChild(geode); diff --git a/examples/osglauncher/osglauncher.cpp b/examples/osglauncher/osglauncher.cpp index d4825d2b7..10144666d 100644 --- a/examples/osglauncher/osglauncher.cpp +++ b/examples/osglauncher/osglauncher.cpp @@ -111,7 +111,7 @@ osg::Node* createHUD(osgText::Text* updateText) // eg to be used as a menuing/help system! // Can pick texts too! osg::MatrixTransform* modelview_abs = new osg::MatrixTransform; - modelview_abs->setReferenceFrame(osg::Transform::ABSOLUTE); + modelview_abs->setReferenceFrame(osg::Transform::ABSOLUTE_RF); modelview_abs->setMatrix(osg::Matrix::identity()); osg::Projection* projection = new osg::Projection; diff --git a/examples/osgparticle/osgparticle.cpp b/examples/osgparticle/osgparticle.cpp index c3fda3e57..469f9d28a 100644 --- a/examples/osgparticle/osgparticle.cpp +++ b/examples/osgparticle/osgparticle.cpp @@ -47,10 +47,10 @@ public: // operators on the particle set via the operate() method. void beginOperate(osgParticle::Program *prg) { - // we have to check whether the reference frame is relative to parents + // we have to check whether the reference frame is RELATIVE_RF to parents // or it's absolute; in the first case, we must transform the vectors // from local to world space. - if (prg->getReferenceFrame() == osgParticle::Program::RELATIVE) { + if (prg->getReferenceFrame() == osgParticle::Program::RELATIVE_RF) { // transform the center point (full transformation) xf_center_ = prg->transformLocalToWorld(center_); // transform the axis vector (only rotation and scale) diff --git a/examples/osgphotoalbum/osgphotoalbum.cpp b/examples/osgphotoalbum/osgphotoalbum.cpp index e39b81316..96ece6e26 100644 --- a/examples/osgphotoalbum/osgphotoalbum.cpp +++ b/examples/osgphotoalbum/osgphotoalbum.cpp @@ -80,7 +80,7 @@ public: virtual bool computeLocalToWorldMatrix(osg::Matrix& matrix,osg::NodeVisitor*) const { - if (_referenceFrame==RELATIVE) + if (_referenceFrame==RELATIVE_RF) { matrix.preMult(getMatrix()); } @@ -96,7 +96,7 @@ public: { const osg::Matrix& inverse = getInverseMatrix(); - if (_referenceFrame==RELATIVE) + if (_referenceFrame==RELATIVE_RF) { matrix.postMult(inverse); } diff --git a/examples/osgpick/osgpick.cpp b/examples/osgpick/osgpick.cpp index 42691b691..b4c7268f5 100644 --- a/examples/osgpick/osgpick.cpp +++ b/examples/osgpick/osgpick.cpp @@ -112,7 +112,7 @@ osg::Node* createHUD(osgText::Text* updateText) // eg to be used as a menuing/help system! // Can pick texts too! osg::MatrixTransform* modelview_abs = new osg::MatrixTransform; - modelview_abs->setReferenceFrame(osg::Transform::ABSOLUTE); + modelview_abs->setReferenceFrame(osg::Transform::ABSOLUTE_RF); modelview_abs->setMatrix(osg::Matrix::identity()); osg::Projection* projection = new osg::Projection; diff --git a/examples/osgscalarbar/osgscalarbar.cpp b/examples/osgscalarbar/osgscalarbar.cpp index d035aaa9e..d0de89127 100644 --- a/examples/osgscalarbar/osgscalarbar.cpp +++ b/examples/osgscalarbar/osgscalarbar.cpp @@ -84,7 +84,7 @@ osg::Node * createScalarBar_HUD() stateset->setRenderBinDetails(11, "RenderBin"); osg::MatrixTransform * modelview = new osg::MatrixTransform; - modelview->setReferenceFrame(osg::Transform::ABSOLUTE); + modelview->setReferenceFrame(osg::Transform::ABSOLUTE_RF); osg::Matrixd matrix(osg::Matrixd::scale(1000,1000,1000) * osg::Matrixd::translate(120,10,0)); // I've played with these values a lot and it seems to work, but I have no idea why modelview->setMatrix(matrix); modelview->addChild(geode); diff --git a/examples/osgtesselate/osgtesselate.cpp b/examples/osgtesselate/osgtesselate.cpp index 337500ea7..f815d3834 100644 --- a/examples/osgtesselate/osgtesselate.cpp +++ b/examples/osgtesselate/osgtesselate.cpp @@ -525,7 +525,7 @@ osg::Node* createHUD() // create the hud. osg::MatrixTransform* modelview_abs = new osg::MatrixTransform; - modelview_abs->setReferenceFrame(osg::Transform::ABSOLUTE); + modelview_abs->setReferenceFrame(osg::Transform::ABSOLUTE_RF); modelview_abs->setMatrix(osg::Matrix::identity()); modelview_abs->addChild(geode); diff --git a/examples/osgtext/osgtext.cpp b/examples/osgtext/osgtext.cpp index 70bfeeae7..4ae541636 100644 --- a/examples/osgtext/osgtext.cpp +++ b/examples/osgtext/osgtext.cpp @@ -501,7 +501,7 @@ int main( int argc, char **argv ) projection->setMatrix(osg::Matrix::ortho2D(0,1280,0,1024)); osg::MatrixTransform* modelview_abs = new osg::MatrixTransform; - modelview_abs->setReferenceFrame(osg::Transform::ABSOLUTE); + modelview_abs->setReferenceFrame(osg::Transform::ABSOLUTE_RF); modelview_abs->setMatrix(osg::Matrix::identity()); modelview_abs->addChild(createHUDText()); diff --git a/examples/osgtexturerectangle/osgtexturerectangle.cpp b/examples/osgtexturerectangle/osgtexturerectangle.cpp index 638bd79e9..87e55d6ee 100644 --- a/examples/osgtexturerectangle/osgtexturerectangle.cpp +++ b/examples/osgtexturerectangle/osgtexturerectangle.cpp @@ -209,7 +209,7 @@ osg::Node* createHUD() // create HUD osg::MatrixTransform* modelview_abs = new osg::MatrixTransform; - modelview_abs->setReferenceFrame(osg::Transform::ABSOLUTE); + modelview_abs->setReferenceFrame(osg::Transform::ABSOLUTE_RF); modelview_abs->setMatrix(osg::Matrix::identity()); modelview_abs->addChild(group); diff --git a/include/osg/LightSource b/include/osg/LightSource index 65c57494d..cafa90c25 100644 --- a/include/osg/LightSource +++ b/include/osg/LightSource @@ -38,19 +38,19 @@ class SG_EXPORT LightSource : public Group enum ReferenceFrame { - RELATIVE, - ABSOLUTE + RELATIVE_RF, + ABSOLUTE_RF #ifdef USE_DEPRECATED_API , - RELATIVE_TO_PARENTS=RELATIVE, - RELATIVE_TO_ABSOLUTE=ABSOLUTE, + RELATIVE_TO_PARENTS=RELATIVE_RF, + RELATIVE_TO_ABSOLUTE=ABSOLUTE_RF, #endif }; /** Set the light sources's ReferenceFrame, either to be relative to its * parent reference frame, or relative to an absolute coordinate - * frame. RELATIVE is the default. - * Note: setting the ReferenceFrame to be RELATIVE_TO_ABSOLUTE will + * frame. RELATIVE_RF is the default. + * Note: setting the ReferenceFrame to be ABSOLUTE_RF will * also set the CullingActive flag on the light source, and hence all * of its parents, to false, thereby disabling culling of it and * all its parents. This is necessary to prevent inappropriate diff --git a/include/osg/Transform b/include/osg/Transform index cebaf09ab..1b11c190f 100644 --- a/include/osg/Transform +++ b/include/osg/Transform @@ -89,19 +89,19 @@ class SG_EXPORT Transform : public Group enum ReferenceFrame { - RELATIVE, - ABSOLUTE + RELATIVE_RF, + ABSOLUTE_RF #ifdef USE_DEPRECATED_API , - RELATIVE_TO_PARENTS=RELATIVE, - RELATIVE_TO_ABSOLUTE=ABSOLUTE, + RELATIVE_TO_PARENTS=RELATIVE_RF, + RELATIVE_TO_ABSOLUTE=ABSOLUTE_RF, #endif }; /** Set the transform's ReferenceFrame, either to be relative to its * parent reference frame, or relative to an absolute coordinate - * frame. RELATIVE is the default. - * Note: Setting the ReferenceFrame to be RELATIVE_TO_ABSOLUTE will + * frame. RELATIVE_RF is the default. + * Note: Setting the ReferenceFrame to be ABSOLUTE_RF will * also set the CullingActive flag on the transform, and hence all * of its parents, to false, thereby disabling culling of it and * all its parents. This is neccessary to prevent inappropriate @@ -116,7 +116,7 @@ class SG_EXPORT Transform : public Group virtual bool computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const { - if (_referenceFrame==RELATIVE) + if (_referenceFrame==RELATIVE_RF) { return false; } @@ -129,7 +129,7 @@ class SG_EXPORT Transform : public Group virtual bool computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor*) const { - if (_referenceFrame==RELATIVE) + if (_referenceFrame==RELATIVE_RF) { return false; } diff --git a/include/osgParticle/AccelOperator b/include/osgParticle/AccelOperator index 044362f9c..8ff4b40ff 100644 --- a/include/osgParticle/AccelOperator +++ b/include/osgParticle/AccelOperator @@ -95,7 +95,7 @@ namespace osgParticle inline void AccelOperator::beginOperate(Program *prg) { - if (prg->getReferenceFrame() == ModularProgram::RELATIVE) { + if (prg->getReferenceFrame() == ModularProgram::RELATIVE_RF) { xf_accel_ = prg->rotateLocalToWorld(accel_); } else { xf_accel_ = accel_; diff --git a/include/osgParticle/AngularAccelOperator b/include/osgParticle/AngularAccelOperator index 78b523a91..439f75796 100644 --- a/include/osgParticle/AngularAccelOperator +++ b/include/osgParticle/AngularAccelOperator @@ -86,7 +86,7 @@ namespace osgParticle inline void AngularAccelOperator::beginOperate(Program *prg) { - if (prg->getReferenceFrame() == ModularProgram::RELATIVE) { + if (prg->getReferenceFrame() == ModularProgram::RELATIVE_RF) { xf_angular_accel_ = prg->rotateLocalToWorld(angular_accel_); } else { xf_angular_accel_ = angular_accel_; diff --git a/include/osgParticle/ForceOperator b/include/osgParticle/ForceOperator index 36953778b..64d327544 100644 --- a/include/osgParticle/ForceOperator +++ b/include/osgParticle/ForceOperator @@ -87,7 +87,7 @@ namespace osgParticle inline void ForceOperator::beginOperate(Program *prg) { - if (prg->getReferenceFrame() == ModularProgram::RELATIVE) { + if (prg->getReferenceFrame() == ModularProgram::RELATIVE_RF) { xf_force_ = prg->rotateLocalToWorld(force_); } else { xf_force_ = force_; diff --git a/include/osgParticle/Operator b/include/osgParticle/Operator index c9fd51c2c..abbfd094c 100644 --- a/include/osgParticle/Operator +++ b/include/osgParticle/Operator @@ -57,7 +57,7 @@ namespace osgParticle /** Do something before processing particles via the operate() method. Overriding this method could be necessary to query the calling Program object - for the current reference frame. If the reference frame is RELATIVE, then your + for the current reference frame. If the reference frame is RELATIVE_RF, then your class should prepare itself to do all operations in local coordinates. */ virtual void beginOperate(Program *) {} diff --git a/include/osgParticle/ParticleProcessor b/include/osgParticle/ParticleProcessor index e4f4e1e9e..73079b431 100644 --- a/include/osgParticle/ParticleProcessor +++ b/include/osgParticle/ParticleProcessor @@ -39,12 +39,12 @@ namespace osgParticle public: enum ReferenceFrame { - RELATIVE, - ABSOLUTE + RELATIVE_RF, + ABSOLUTE_RF #ifdef USE_DEPRECATED_API , - RELATIVE_TO_PARENTS=RELATIVE, - RELATIVE_TO_ABSOLUTE=ABSOLUTE, + RELATIVE_RF_TO_PARENTS=RELATIVE_RF, + RELATIVE_RF_TO_ABSOLUTE=ABSOLUTE_RF, #endif }; diff --git a/src/osg/AutoTransform.cpp b/src/osg/AutoTransform.cpp index 3dc21138c..440d2b1d5 100644 --- a/src/osg/AutoTransform.cpp +++ b/src/osg/AutoTransform.cpp @@ -45,7 +45,7 @@ bool AutoTransform::computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const { if (_matrixDirty) computeMatrix(); - if (_referenceFrame==RELATIVE) + if (_referenceFrame==RELATIVE_RF) { matrix.preMult(_cachedMatrix); } @@ -59,7 +59,7 @@ bool AutoTransform::computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const bool AutoTransform::computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor*) const { - if (_referenceFrame==RELATIVE) + if (_referenceFrame==RELATIVE_RF) { matrix.postMult(osg::Matrix::translate(-_position)* osg::Matrix::rotate(_rotation.inverse())* diff --git a/src/osg/Group.cpp b/src/osg/Group.cpp index 47faa05c1..ed8ed34aa 100644 --- a/src/osg/Group.cpp +++ b/src/osg/Group.cpp @@ -360,7 +360,7 @@ bool Group::computeBound() const ++itr) { const osg::Transform* transform = (*itr)->asTransform(); - if (!transform || transform->getReferenceFrame()==osg::Transform::RELATIVE) + if (!transform || transform->getReferenceFrame()==osg::Transform::RELATIVE_RF) { bb.expandBy((*itr)->getBound()); } @@ -379,7 +379,7 @@ bool Group::computeBound() const ++itr) { const osg::Transform* transform = (*itr)->asTransform(); - if (!transform || transform->getReferenceFrame()==osg::Transform::RELATIVE) + if (!transform || transform->getReferenceFrame()==osg::Transform::RELATIVE_RF) { _bsphere.expandRadiusBy((*itr)->getBound()); } diff --git a/src/osg/LightSource.cpp b/src/osg/LightSource.cpp index 46d923830..259377c08 100644 --- a/src/osg/LightSource.cpp +++ b/src/osg/LightSource.cpp @@ -16,7 +16,7 @@ using namespace osg; LightSource::LightSource(): _value(StateAttribute::ON), - _referenceFrame(RELATIVE) + _referenceFrame(RELATIVE_RF) { // switch off culling of light source nodes by default. setCullingActive(false); @@ -33,7 +33,7 @@ LightSource::~LightSource() void LightSource::setReferenceFrame(ReferenceFrame rf) { _referenceFrame = rf; - setCullingActive(_referenceFrame==RELATIVE); + setCullingActive(_referenceFrame==RELATIVE_RF); } void LightSource::setLight(Light* light) @@ -62,7 +62,7 @@ bool LightSource::computeBound() const { Group::computeBound(); - if (_light.valid() && _referenceFrame==RELATIVE) + if (_light.valid() && _referenceFrame==RELATIVE_RF) { const Vec4& pos = _light->getPosition(); if (pos[3]!=0.0f) diff --git a/src/osg/MatrixTransform.cpp b/src/osg/MatrixTransform.cpp index 03d50ee9c..79de87ce5 100644 --- a/src/osg/MatrixTransform.cpp +++ b/src/osg/MatrixTransform.cpp @@ -29,7 +29,7 @@ MatrixTransform::MatrixTransform(const MatrixTransform& transform,const CopyOp& MatrixTransform::MatrixTransform(const Matrix& mat ) { - _referenceFrame = RELATIVE; + _referenceFrame = RELATIVE_RF; _matrix = mat; _inverseDirty = false; @@ -42,7 +42,7 @@ MatrixTransform::~MatrixTransform() bool MatrixTransform::computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const { - if (_referenceFrame==RELATIVE) + if (_referenceFrame==RELATIVE_RF) { matrix.preMult(_matrix); } @@ -57,7 +57,7 @@ bool MatrixTransform::computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor*) con { const Matrix& inverse = getInverseMatrix(); - if (_referenceFrame==RELATIVE) + if (_referenceFrame==RELATIVE_RF) { matrix.postMult(inverse); } diff --git a/src/osg/PositionAttitudeTransform.cpp b/src/osg/PositionAttitudeTransform.cpp index 946918615..b74041135 100644 --- a/src/osg/PositionAttitudeTransform.cpp +++ b/src/osg/PositionAttitudeTransform.cpp @@ -21,7 +21,7 @@ PositionAttitudeTransform::PositionAttitudeTransform(): bool PositionAttitudeTransform::computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const { - if (_referenceFrame==RELATIVE) + if (_referenceFrame==RELATIVE_RF) { matrix.preMult(osg::Matrix::translate(-_pivotPoint)* osg::Matrix::scale(_scale)* @@ -41,7 +41,7 @@ bool PositionAttitudeTransform::computeLocalToWorldMatrix(Matrix& matrix,NodeVis bool PositionAttitudeTransform::computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor*) const { - if (_referenceFrame==RELATIVE) + if (_referenceFrame==RELATIVE_RF) { matrix.postMult(osg::Matrix::translate(-_position)* osg::Matrix::rotate(_attitude.inverse())* diff --git a/src/osg/Transform.cpp b/src/osg/Transform.cpp index 573652977..7fc9187b0 100644 --- a/src/osg/Transform.cpp +++ b/src/osg/Transform.cpp @@ -98,7 +98,7 @@ Matrix osg::computeEyeToLocal(const Matrix& modelview,const NodePath& nodePath) Transform::Transform() { - _referenceFrame = RELATIVE; + _referenceFrame = RELATIVE_RF; } Transform::Transform(const Transform& transform,const CopyOp& copyop): @@ -118,7 +118,7 @@ void Transform::setReferenceFrame(ReferenceFrame rf) _referenceFrame = rf; // switch off culling if transform is absolute. - if (_referenceFrame==RELATIVE) setCullingActive(false); + if (_referenceFrame==RELATIVE_RF) setCullingActive(false); else setCullingActive(true); } diff --git a/src/osgParticle/FluidFrictionOperator.cpp b/src/osgParticle/FluidFrictionOperator.cpp index 9a96f5412..81325c520 100644 --- a/src/osgParticle/FluidFrictionOperator.cpp +++ b/src/osgParticle/FluidFrictionOperator.cpp @@ -37,7 +37,7 @@ void osgParticle::FluidFrictionOperator::operate(Particle *P, double dt) osg::Vec3 Fr(-R * v.x(), -R * v.y(), -R * v.z()); - if (current_program_->getReferenceFrame() == ModularProgram::RELATIVE) { + if (current_program_->getReferenceFrame() == ModularProgram::RELATIVE_RF) { Fr = current_program_->rotateLocalToWorld(Fr); } diff --git a/src/osgParticle/ModularEmitter.cpp b/src/osgParticle/ModularEmitter.cpp index 4290c1ecf..b8605f4b7 100644 --- a/src/osgParticle/ModularEmitter.cpp +++ b/src/osgParticle/ModularEmitter.cpp @@ -25,7 +25,7 @@ void osgParticle::ModularEmitter::emit(double dt) if (P) { placer_->place(P); shooter_->shoot(P); - if (getReferenceFrame() == RELATIVE) { + if (getReferenceFrame() == RELATIVE_RF) { P->transformPositionVelocity(getLocalToWorldMatrix()); } } diff --git a/src/osgParticle/ParticleProcessor.cpp b/src/osgParticle/ParticleProcessor.cpp index d8ca15db4..1be4f275d 100644 --- a/src/osgParticle/ParticleProcessor.cpp +++ b/src/osgParticle/ParticleProcessor.cpp @@ -13,7 +13,7 @@ using namespace osg; osgParticle::ParticleProcessor::ParticleProcessor() : osg::Node(), - rf_(RELATIVE), + rf_(RELATIVE_RF), enabled_(true), t0_(-1), ps_(0), diff --git a/src/osgPlugins/osg/LightSource.cpp b/src/osgPlugins/osg/LightSource.cpp index be145387a..7bbf62f45 100644 --- a/src/osgPlugins/osg/LightSource.cpp +++ b/src/osgPlugins/osg/LightSource.cpp @@ -29,12 +29,12 @@ bool LightSource_readLocalData(Object& obj, Input& fr) if (fr[0].matchWord("referenceFrame")) { if (fr[1].matchWord("RELATIVE_TO_ABSOLUTE") || fr[1].matchWord("ABSOLUTE")) { - lightsource.setReferenceFrame(LightSource::ABSOLUTE); + lightsource.setReferenceFrame(LightSource::ABSOLUTE_RF); fr += 2; iteratorAdvanced = true; } if (fr[1].matchWord("RELATIVE_TO_PARENTS") || fr[1].matchWord("RELATIVE")) { - lightsource.setReferenceFrame(LightSource::RELATIVE); + lightsource.setReferenceFrame(LightSource::RELATIVE_RF); fr += 2; iteratorAdvanced = true; } @@ -58,10 +58,10 @@ bool LightSource_writeLocalData(const Object& obj, Output& fw) fw.indent() << "referenceFrame "; switch (lightsource.getReferenceFrame()) { - case LightSource::ABSOLUTE: + case LightSource::ABSOLUTE_RF: fw << "RELATIVE_TO_ABSOLUTE\n"; break; - case LightSource::RELATIVE: + case LightSource::RELATIVE_RF: default: fw << "RELATIVE\n"; }; diff --git a/src/osgPlugins/osg/Transform.cpp b/src/osgPlugins/osg/Transform.cpp index 470f6ad79..cb55d494e 100644 --- a/src/osgPlugins/osg/Transform.cpp +++ b/src/osgPlugins/osg/Transform.cpp @@ -51,12 +51,12 @@ bool Transform_readLocalData(Object& obj, Input& fr) if (fr[0].matchWord("referenceFrame")) { if (fr[1].matchWord("RELATIVE_TO_ABSOLUTE") || fr[1].matchWord("ABSOLUTE") ) { - transform.setReferenceFrame(Transform::ABSOLUTE); + transform.setReferenceFrame(Transform::ABSOLUTE_RF); fr += 2; iteratorAdvanced = true; } if (fr[1].matchWord("RELATIVE_TO_PARENTS") || fr[1].matchWord("RELATIVE")) { - transform.setReferenceFrame(Transform::RELATIVE); + transform.setReferenceFrame(Transform::RELATIVE_RF); fr += 2; iteratorAdvanced = true; } @@ -72,10 +72,10 @@ bool Transform_writeLocalData(const Object& obj, Output& fw) fw.indent() << "referenceFrame "; switch (transform.getReferenceFrame()) { - case Transform::ABSOLUTE: + case Transform::ABSOLUTE_RF: fw << "ABSOLUTE\n"; break; - case Transform::RELATIVE: + case Transform::RELATIVE_RF: default: fw << "RELATIVE\n"; }; diff --git a/src/osgPlugins/osgParticle/IO_ParticleProcessor.cpp b/src/osgPlugins/osgParticle/IO_ParticleProcessor.cpp index 115eade88..ccbb183b5 100644 --- a/src/osgPlugins/osgParticle/IO_ParticleProcessor.cpp +++ b/src/osgPlugins/osgParticle/IO_ParticleProcessor.cpp @@ -52,12 +52,12 @@ bool ParticleProcessor_readLocalData(osg::Object &obj, osgDB::Input &fr) if (fr[0].matchWord("referenceFrame")) { if (fr[1].matchWord("RELATIVE_TO_ABSOLUTE") || fr[1].matchWord("ABSOLUTE")) { - myobj.setReferenceFrame(osgParticle::ParticleProcessor::ABSOLUTE); + myobj.setReferenceFrame(osgParticle::ParticleProcessor::ABSOLUTE_RF); fr += 2; itAdvanced = true; } if (fr[1].matchWord("RELATIVE_TO_PARENTS") || fr[1].matchWord("RELATIVE")) { - myobj.setReferenceFrame(osgParticle::ParticleProcessor::RELATIVE); + myobj.setReferenceFrame(osgParticle::ParticleProcessor::RELATIVE_RF); fr += 2; itAdvanced = true; } @@ -129,10 +129,10 @@ bool ParticleProcessor_writeLocalData(const osg::Object &obj, osgDB::Output &fw) fw.indent() << "referenceFrame "; switch (myobj.getReferenceFrame()) { - case osgParticle::ParticleProcessor::ABSOLUTE: + case osgParticle::ParticleProcessor::ABSOLUTE_RF: fw << "ABSOLUTE" << std::endl; break; - case osgParticle::ParticleProcessor::RELATIVE: + case osgParticle::ParticleProcessor::RELATIVE_RF: default: fw << "RELATIVE" << std::endl; } diff --git a/src/osgProducer/Viewer.cpp b/src/osgProducer/Viewer.cpp index e7d9879ae..14265a1ea 100644 --- a/src/osgProducer/Viewer.cpp +++ b/src/osgProducer/Viewer.cpp @@ -468,11 +468,11 @@ void Viewer::setUpViewer(unsigned int options) lightsource->setLight(light); if (options & HEAD_LIGHT_SOURCE) { - lightsource->setReferenceFrame(osg::LightSource::ABSOLUTE); // headlight. + lightsource->setReferenceFrame(osg::LightSource::ABSOLUTE_RF); // headlight. } else { - lightsource->setReferenceFrame(osg::LightSource::RELATIVE); // skylight + lightsource->setReferenceFrame(osg::LightSource::RELATIVE_RF); // skylight } lightsource->setLocalStateSetModes(osg::StateAttribute::ON); } diff --git a/src/osgSim/DOFTransform.cpp b/src/osgSim/DOFTransform.cpp index d89bc51e0..47195c4a1 100644 --- a/src/osgSim/DOFTransform.cpp +++ b/src/osgSim/DOFTransform.cpp @@ -141,7 +141,7 @@ bool DOFTransform::computeLocalToWorldMatrix(osg::Matrix& matrix,osg::NodeVisito l2w.postMult(getInversePutMatrix()); // finally. - if (_referenceFrame==RELATIVE) + if (_referenceFrame==RELATIVE_RF) { matrix.preMult(l2w); } @@ -209,7 +209,7 @@ bool DOFTransform::computeWorldToLocalMatrix(osg::Matrix& matrix,osg::NodeVisito //and impose inverse put: w2l.postMult(getPutMatrix()); - if (_referenceFrame==RELATIVE) + if (_referenceFrame==RELATIVE_RF) { //finally: matrix.postMult(w2l); diff --git a/src/osgUtil/CullVisitor.cpp b/src/osgUtil/CullVisitor.cpp index e73c19aff..7a196f801 100644 --- a/src/osgUtil/CullVisitor.cpp +++ b/src/osgUtil/CullVisitor.cpp @@ -830,7 +830,7 @@ void CullVisitor::apply(LightSource& node) StateAttribute* light = node.getLight(); if (light) { - if (node.getReferenceFrame()==osg::LightSource::RELATIVE) + if (node.getReferenceFrame()==osg::LightSource::RELATIVE_RF) { RefMatrix& matrix = getModelViewMatrix(); addPositionedAttribute(&matrix,light); diff --git a/src/osgUtil/Optimizer.cpp b/src/osgUtil/Optimizer.cpp index 181fc2219..cdf0c779b 100644 --- a/src/osgUtil/Optimizer.cpp +++ b/src/osgUtil/Optimizer.cpp @@ -625,7 +625,7 @@ class CollectLowestTransformsVisitor : public osg::NodeVisitor if (transform) { if (transform->getDataVariance()==osg::Transform::DYNAMIC) _moreThanOneMatrixRequired=true; - else if (transform->getReferenceFrame()==osg::Transform::RELATIVE) _moreThanOneMatrixRequired=true; + else if (transform->getReferenceFrame()==osg::Transform::RELATIVE_RF) _moreThanOneMatrixRequired=true; else { if (_transformSet.empty()) transform->computeLocalToWorldMatrix(_firstMatrix,0);