Changed the ReferenceFrame enums to be RELEATIVE and ABSOLUTE, and

deprecated the RELATIVE_TO_ABSOLUTE and RELATIVE_TO_PARENTS.
This commit is contained in:
Robert Osfield
2004-10-22 19:26:45 +00:00
parent 8ab8fc762f
commit 6821a80e14
36 changed files with 98 additions and 75 deletions

View File

@@ -38,13 +38,18 @@ class SG_EXPORT LightSource : public Group
enum ReferenceFrame
{
RELATIVE_TO_PARENTS,
RELATIVE_TO_ABSOLUTE
RELATIVE,
ABSOLUTE
#ifdef USE_DEPRECATED_API
,
RELATIVE_TO_PARENTS=RELATIVE,
RELATIVE_TO_ABSOLUTE=ABSOLUTE,
#endif
};
/** Set the light sources's ReferenceFrame, either to be relative to its
* parent reference frame, or relative to an absolute coordinate
* frame. RELATIVE_TO_PARENTS is the default.
* frame. RELATIVE is the default.
* Note: setting the ReferenceFrame to be RELATIVE_TO_ABSOLUTE will
* also set the CullingActive flag on the light source, and hence all
* of its parents, to false, thereby disabling culling of it and

View File

@@ -89,13 +89,18 @@ class SG_EXPORT Transform : public Group
enum ReferenceFrame
{
RELATIVE_TO_PARENTS,
RELATIVE_TO_ABSOLUTE
RELATIVE,
ABSOLUTE
#ifdef USE_DEPRECATED_API
,
RELATIVE_TO_PARENTS=RELATIVE,
RELATIVE_TO_ABSOLUTE=ABSOLUTE,
#endif
};
/** Set the transform's ReferenceFrame, either to be relative to its
* parent reference frame, or relative to an absolute coordinate
* frame. RELATIVE_TO_PARENTS is the default.
* frame. RELATIVE is the default.
* Note: Setting the ReferenceFrame to be RELATIVE_TO_ABSOLUTE will
* also set the CullingActive flag on the transform, and hence all
* of its parents, to false, thereby disabling culling of it and
@@ -111,7 +116,7 @@ class SG_EXPORT Transform : public Group
virtual bool computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const
{
if (_referenceFrame==RELATIVE_TO_PARENTS)
if (_referenceFrame==RELATIVE)
{
return false;
}
@@ -124,7 +129,7 @@ class SG_EXPORT Transform : public Group
virtual bool computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor*) const
{
if (_referenceFrame==RELATIVE_TO_PARENTS)
if (_referenceFrame==RELATIVE)
{
return false;
}

View File

@@ -95,7 +95,7 @@ namespace osgParticle
inline void AccelOperator::beginOperate(Program *prg)
{
if (prg->getReferenceFrame() == ModularProgram::RELATIVE_TO_PARENTS) {
if (prg->getReferenceFrame() == ModularProgram::RELATIVE) {
xf_accel_ = prg->rotateLocalToWorld(accel_);
} else {
xf_accel_ = accel_;

View File

@@ -86,7 +86,7 @@ namespace osgParticle
inline void AngularAccelOperator::beginOperate(Program *prg)
{
if (prg->getReferenceFrame() == ModularProgram::RELATIVE_TO_PARENTS) {
if (prg->getReferenceFrame() == ModularProgram::RELATIVE) {
xf_angular_accel_ = prg->rotateLocalToWorld(angular_accel_);
} else {
xf_angular_accel_ = angular_accel_;

View File

@@ -87,7 +87,7 @@ namespace osgParticle
inline void ForceOperator::beginOperate(Program *prg)
{
if (prg->getReferenceFrame() == ModularProgram::RELATIVE_TO_PARENTS) {
if (prg->getReferenceFrame() == ModularProgram::RELATIVE) {
xf_force_ = prg->rotateLocalToWorld(force_);
} else {
xf_force_ = force_;

View File

@@ -57,7 +57,7 @@ namespace osgParticle
/** Do something before processing particles via the <CODE>operate()</CODE> method.
Overriding this method could be necessary to query the calling <CODE>Program</CODE> object
for the current reference frame. If the reference frame is RELATIVE_TO_PARENTS, then your
for the current reference frame. If the reference frame is RELATIVE, then your
class should prepare itself to do all operations in local coordinates.
*/
virtual void beginOperate(Program *) {}

View File

@@ -39,8 +39,13 @@ namespace osgParticle
public:
enum ReferenceFrame {
RELATIVE_TO_PARENTS,
RELATIVE_TO_ABSOLUTE
RELATIVE,
ABSOLUTE
#ifdef USE_DEPRECATED_API
,
RELATIVE_TO_PARENTS=RELATIVE,
RELATIVE_TO_ABSOLUTE=ABSOLUTE,
#endif
};
ParticleProcessor();