Changed ABSOLUTE and RELATIVE to ABSOLUTE_RF and RELATIVE_RF to avoid stooppid Win32 #define
This commit is contained in:
@@ -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())*
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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())*
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ using namespace osg;
|
||||
|
||||
osgParticle::ParticleProcessor::ParticleProcessor()
|
||||
: osg::Node(),
|
||||
rf_(RELATIVE),
|
||||
rf_(RELATIVE_RF),
|
||||
enabled_(true),
|
||||
t0_(-1),
|
||||
ps_(0),
|
||||
|
||||
@@ -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";
|
||||
};
|
||||
|
||||
@@ -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";
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user