Converted the instances of const built in types being returned from methods
and passed as paramters into straight forward non const built in types, i.e. const bool foogbar(const int) becomes bool foobar(int).
This commit is contained in:
parent
52518673d1
commit
12226e4371
@ -56,7 +56,7 @@ class SG_EXPORT AlphaFunc : public StateAttribute
|
||||
ALWAYS = GL_ALWAYS
|
||||
};
|
||||
|
||||
inline void setFunction(const ComparisonFunction func,const float ref)
|
||||
inline void setFunction(const ComparisonFunction func,float ref)
|
||||
{
|
||||
_comparisonFunc = func;
|
||||
_referenceValue = ref;
|
||||
@ -64,7 +64,7 @@ class SG_EXPORT AlphaFunc : public StateAttribute
|
||||
|
||||
inline const ComparisonFunction getFunction() const { return _comparisonFunc; }
|
||||
|
||||
inline const float getReferenceValue() const { return _referenceValue; }
|
||||
inline float getReferenceValue() const { return _referenceValue; }
|
||||
|
||||
virtual void apply(State& state) const;
|
||||
|
||||
|
@ -45,7 +45,7 @@ class SG_EXPORT AnimationPath : public osg::Referenced
|
||||
osg::Quat _rotation;
|
||||
osg::Vec3 _scale;
|
||||
|
||||
inline void interpolate(const float ratio,const ControlPoint& first, const ControlPoint& second)
|
||||
inline void interpolate(float ratio,const ControlPoint& first, const ControlPoint& second)
|
||||
{
|
||||
float one_minus_ratio = 1.0f-ratio;
|
||||
_position = first._position*one_minus_ratio + second._position*ratio;
|
||||
|
@ -31,9 +31,9 @@ class SG_EXPORT Billboard : public Geode
|
||||
META_Node(osg, Billboard);
|
||||
|
||||
/** Set the billboard rotation mode. */
|
||||
void setMode(const Mode mode);
|
||||
void setMode(Mode mode);
|
||||
/** Get the billboard rotation mode. */
|
||||
inline const Mode getMode() const { return _mode; }
|
||||
inline Mode getMode() const { return _mode; }
|
||||
|
||||
/** Set the axis about which all the billboard's drawable rotate. Only utlized when mode==AXIAL_ROT*/
|
||||
void setAxis(const Vec3& axis);
|
||||
@ -47,9 +47,9 @@ class SG_EXPORT Billboard : public Geode
|
||||
|
||||
|
||||
/** Set the position of specified drawable. */
|
||||
inline void setPos(int i,const Vec3& pos) { _positionList[i] = pos; }
|
||||
inline void setPos(unsigned int i,const Vec3& pos) { _positionList[i] = pos; }
|
||||
/** Get the position of specified drawable. */
|
||||
inline const Vec3& getPos(int i) const { return _positionList[i]; }
|
||||
inline const Vec3& getPos(unsigned int i) const { return _positionList[i]; }
|
||||
|
||||
/** PositionList represents a list of pivot points for each drawable.*/
|
||||
typedef std::vector<Vec3> PositionList;
|
||||
@ -65,14 +65,14 @@ class SG_EXPORT Billboard : public Geode
|
||||
* reference count, and dirty the bounding box to cause it to recompute on
|
||||
* next getBound() and return true for success. Otherwise return false.
|
||||
*/
|
||||
virtual const bool addDrawable( Drawable *gset );
|
||||
virtual bool addDrawable( Drawable *gset );
|
||||
|
||||
/** Add Drawable to Geode at position pos.
|
||||
* If gset not NULL and is not contained in Billboard then increment its
|
||||
* reference count, and dirty the bounding box to cause it to recompute on
|
||||
* next getBound() and return true for success. Otherwise return false.
|
||||
*/
|
||||
virtual const bool addDrawable(Drawable *gset,const Vec3& pos);
|
||||
virtual bool addDrawable(Drawable *gset,const Vec3& pos);
|
||||
|
||||
/** Remove Drawable and associated position from Billboard.
|
||||
* If gset is contained in Billboard then remove it from the geoset
|
||||
@ -81,23 +81,23 @@ class SG_EXPORT Billboard : public Geode
|
||||
* return true for success. If gset is not found then return false
|
||||
* and do not the reference count of gset is left unchanged.
|
||||
*/
|
||||
virtual const bool removeDrawable( Drawable *gset );
|
||||
virtual bool removeDrawable( Drawable *gset );
|
||||
|
||||
|
||||
|
||||
|
||||
inline const bool getMatrix(Matrix& modelview, const Vec3& eye_local, const Vec3& pos_local) const
|
||||
inline bool getMatrix(Matrix& modelview, const Vec3& eye_local, const Vec3& pos_local) const
|
||||
{
|
||||
return computeMatrix(modelview,eye_local,pos_local);
|
||||
}
|
||||
|
||||
virtual const bool computeMatrix(Matrix& modelview, const Vec3& eye_local, const Vec3& pos_local) const;
|
||||
virtual bool computeMatrix(Matrix& modelview, const Vec3& eye_local, const Vec3& pos_local) const;
|
||||
|
||||
protected:
|
||||
|
||||
virtual ~Billboard();
|
||||
|
||||
virtual const bool computeBound() const;
|
||||
virtual bool computeBound() const;
|
||||
|
||||
enum AxisAligned
|
||||
{
|
||||
|
@ -57,17 +57,17 @@ class SG_EXPORT BlendFunc : public StateAttribute
|
||||
ZERO = GL_ZERO
|
||||
};
|
||||
|
||||
inline void setFunction( const int source, const int destination )
|
||||
inline void setFunction( GLenum source, GLenum destination )
|
||||
{
|
||||
_source_factor = source;
|
||||
_destination_factor = destination;
|
||||
}
|
||||
|
||||
void setSource(const int source) { _source_factor = source; }
|
||||
inline const int getSource() const { return _source_factor; }
|
||||
void setSource(GLenum source) { _source_factor = source; }
|
||||
inline GLenum getSource() const { return _source_factor; }
|
||||
|
||||
void setDestination(const int destination) { _destination_factor = destination; }
|
||||
inline const int getDestination() const { return _destination_factor; }
|
||||
void setDestination(GLenum destination) { _destination_factor = destination; }
|
||||
inline GLenum getDestination() const { return _destination_factor; }
|
||||
|
||||
virtual void apply(State& state) const;
|
||||
|
||||
@ -75,8 +75,8 @@ class SG_EXPORT BlendFunc : public StateAttribute
|
||||
|
||||
virtual ~BlendFunc();
|
||||
|
||||
int _source_factor;
|
||||
int _destination_factor;
|
||||
GLenum _source_factor;
|
||||
GLenum _destination_factor;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ class SG_EXPORT BoundingBox
|
||||
_max.set(-FLT_MAX,-FLT_MAX,-FLT_MAX);
|
||||
}
|
||||
|
||||
inline const bool valid() const
|
||||
inline bool valid() const
|
||||
{
|
||||
return _max.x()>=_min.x();
|
||||
}
|
||||
@ -71,22 +71,22 @@ class SG_EXPORT BoundingBox
|
||||
|
||||
|
||||
inline float& xMin() { return _min.x(); }
|
||||
inline const float xMin() const { return _min.x(); }
|
||||
inline float xMin() const { return _min.x(); }
|
||||
|
||||
inline float& yMin() { return _min.y(); }
|
||||
inline const float yMin() const { return _min.y(); }
|
||||
inline float yMin() const { return _min.y(); }
|
||||
|
||||
inline float& zMin() { return _min.z(); }
|
||||
inline const float zMin() const { return _min.z(); }
|
||||
inline float zMin() const { return _min.z(); }
|
||||
|
||||
inline float& xMax() { return _max.x(); }
|
||||
inline const float xMax() const { return _max.x(); }
|
||||
inline float xMax() const { return _max.x(); }
|
||||
|
||||
inline float& yMax() { return _max.y(); }
|
||||
inline const float yMax() const { return _max.y(); }
|
||||
inline float yMax() const { return _max.y(); }
|
||||
|
||||
inline float& zMax() { return _max.z(); }
|
||||
inline const float zMax() const { return _max.z(); }
|
||||
inline float zMax() const { return _max.z(); }
|
||||
|
||||
/** Calculate and return the center of the bounding box.*/
|
||||
inline const Vec3 center() const
|
||||
@ -95,14 +95,14 @@ class SG_EXPORT BoundingBox
|
||||
}
|
||||
|
||||
/** Calculate and return the radius of the bounding box.*/
|
||||
inline const float radius() const
|
||||
inline float radius() const
|
||||
{
|
||||
return sqrtf(radius2());
|
||||
}
|
||||
|
||||
/** Calculate and return the radius squared of the bounding box.
|
||||
Note, radius2() is faster to calculate than radius().*/
|
||||
inline const float radius2() const
|
||||
inline float radius2() const
|
||||
{
|
||||
return 0.25f*((_max-_min).length2());
|
||||
}
|
||||
@ -154,7 +154,7 @@ class SG_EXPORT BoundingBox
|
||||
void expandBy(const BoundingSphere& sh);
|
||||
|
||||
/** return true is vertex v is within the box.*/
|
||||
inline const bool contains(const Vec3& v) const
|
||||
inline bool contains(const Vec3& v) const
|
||||
{
|
||||
return valid() &&
|
||||
(v.x()>=_min.x() && v.x()<=_max.x()) &&
|
||||
|
@ -40,7 +40,7 @@ class SG_EXPORT BoundingSphere
|
||||
|
||||
/** return true if the bounding sphere contains valid values,
|
||||
false if the bounding sphere is effectively unset.*/
|
||||
inline const bool valid() const { return _radius>=0.0f; }
|
||||
inline bool valid() const { return _radius>=0.0f; }
|
||||
|
||||
/** set bounding sphere.*/
|
||||
inline void set(const Vec3& center,float radius)
|
||||
@ -58,13 +58,13 @@ class SG_EXPORT BoundingSphere
|
||||
inline float& radius() { return _radius; }
|
||||
|
||||
/** return the const radius of the bounding sphere.*/
|
||||
inline const float radius() const { return _radius; }
|
||||
inline float radius() const { return _radius; }
|
||||
|
||||
/** return the radius squared.
|
||||
Note, for performance reasons, assumes the calling method has ensured
|
||||
that the sphere is valid before calling radius2(), i.e. has _radius>=0.0,
|
||||
as it does not check th validity of sphere and will erroneously return a positive value.*/
|
||||
inline const float radius2() const { return _radius*_radius; }
|
||||
inline float radius2() const { return _radius*_radius; }
|
||||
|
||||
/** If the vertex is out-with the sphere expand to encompass vertex.
|
||||
Calculates the combination of movement of center and radius which
|
||||
@ -100,13 +100,13 @@ class SG_EXPORT BoundingSphere
|
||||
void expandRadiusBy(const BoundingBox& bb);
|
||||
|
||||
/** return true is vertex v is within the sphere.*/
|
||||
inline const bool contains(const Vec3& v) const
|
||||
inline bool contains(const Vec3& v) const
|
||||
{
|
||||
return valid() && ((v-_center).length2()<=radius2());
|
||||
}
|
||||
|
||||
/** return true if bounding sphere's intersect each other.*/
|
||||
inline const bool intersects( const BoundingSphere& bs ) const
|
||||
inline bool intersects( const BoundingSphere& bs ) const
|
||||
{
|
||||
return valid() && bs.valid() &&
|
||||
((_center - bs._center).length2() <= (_radius + bs._radius)*(_radius + bs._radius));
|
||||
|
@ -61,7 +61,7 @@ inline void clampBetweenRange(T& value,const T minValue,const T maxValue,const c
|
||||
* otherwise clamp value to specified maximum value and return warning
|
||||
* with valueName specifying which variable was clamped.*/
|
||||
template <class A, class T>
|
||||
inline void clampArrayElementGEQUAL(A& value,const unsigned int i,const T minValue,const char* valueName)
|
||||
inline void clampArrayElementGEQUAL(A& value,unsigned int i,const T minValue,const char* valueName)
|
||||
{
|
||||
if (value[i]<minValue)
|
||||
{
|
||||
@ -74,7 +74,7 @@ inline void clampArrayElementGEQUAL(A& value,const unsigned int i,const T minVal
|
||||
* otherwise clamp value to specified maximum value and return warning
|
||||
* with valueName specifying which variable was clamped.*/
|
||||
template <class A, class T>
|
||||
inline void clampArrayElementLEQUAL(A& value,const unsigned int i,const T maxValue,const char* valueName)
|
||||
inline void clampArrayElementLEQUAL(A& value,unsigned int i,const T maxValue,const char* valueName)
|
||||
{
|
||||
if (value[i]>maxValue)
|
||||
{
|
||||
@ -88,7 +88,7 @@ inline void clampArrayElementLEQUAL(A& value,const unsigned int i,const T maxVal
|
||||
* with valueName specifying which variable was clamped. Equivilant to
|
||||
* calling clampGEQUAL(value,minValue,valueName); clampLEQUAL(value,maxValue,valueName); */
|
||||
template <class A, class T>
|
||||
inline void clampArrayElementBetweenRange(A& value,const unsigned int i,const T minValue,const T maxValue,const char* valueName)
|
||||
inline void clampArrayElementBetweenRange(A& value,unsigned int i,const T minValue,const T maxValue,const char* valueName)
|
||||
{
|
||||
if (value[i]<minValue)
|
||||
{
|
||||
@ -108,7 +108,7 @@ inline void clampArrayElementBetweenRange(A& value,const unsigned int i,const T
|
||||
* otherwise clamp value to specified maximum value and return warning
|
||||
* with valueName specifying which variable was clamped.*/
|
||||
template <class A, class T>
|
||||
inline void clampArrayElementsGEQUAL(A& value,const unsigned int first,const unsigned int last,const T minValue,const char* valueName)
|
||||
inline void clampArrayElementsGEQUAL(A& value,unsigned int first,unsigned int last,const T minValue,const char* valueName)
|
||||
{
|
||||
for(unsigned int i=first;i<=last;++i)
|
||||
clampArrayElementGEQUAL(value,i,minValue,valueName);
|
||||
@ -118,7 +118,7 @@ inline void clampArrayElementsGEQUAL(A& value,const unsigned int first,const uns
|
||||
* otherwise clamp value to specified maximum value and return warning
|
||||
* with valueName specifying which variable was clamped.*/
|
||||
template <class A, class T>
|
||||
inline void clampArrayElementsLEQUAL(A& value,const unsigned int first,const unsigned int last,const T maxValue,const char* valueName)
|
||||
inline void clampArrayElementsLEQUAL(A& value,unsigned int first,unsigned int last,const T maxValue,const char* valueName)
|
||||
{
|
||||
for(unsigned int i=first;i<=last;++i)
|
||||
clampArrayElementLEQUAL(value,i,maxValue,valueName);
|
||||
@ -129,7 +129,7 @@ inline void clampArrayElementsLEQUAL(A& value,const unsigned int first,const uns
|
||||
* with valueName specifying which variable was clamped. Equivalent to
|
||||
* calling clampGEQUAL(value,minValue,valueName); clampLEQUAL(value,maxValue,valueName); */
|
||||
template <class A, class T>
|
||||
inline void clampArrayElementsBetweenRange(A& value,const unsigned int first,const unsigned int last,const T minValue,const T maxValue,const char* valueName)
|
||||
inline void clampArrayElementsBetweenRange(A& value,unsigned int first,unsigned int last,const T minValue,const T maxValue,const char* valueName)
|
||||
{
|
||||
for(unsigned int i=first;i<=last;++i)
|
||||
clampArrayElementBetweenRange(value,i,minValue,maxValue,valueName);
|
||||
@ -179,7 +179,7 @@ inline void clampArray4GEQUAL(A& value,const T minValue,const char* valueName)
|
||||
* otherwise clamp value to specified maximum value and return warning
|
||||
* with valueName specifying which variable was clamped.*/
|
||||
template <class A, class T>
|
||||
inline void clampArray4LEQUAL(A& value,const unsigned int first,const unsigned int last,const T maxValue,const char* valueName)
|
||||
inline void clampArray4LEQUAL(A& value,unsigned int first,unsigned int last,const T maxValue,const char* valueName)
|
||||
{
|
||||
clampArrayElementsLEQUAL(value,0u,3u,maxValue,valueName);
|
||||
}
|
||||
|
@ -50,30 +50,30 @@ class SG_EXPORT Camera: public osg::Referenced
|
||||
const ProjectionType getProjectionType() const { return _projectionType; }
|
||||
|
||||
/** Set a orthographic projection. See glOrtho for further details.*/
|
||||
void setOrtho(const double left, const double right,
|
||||
const double bottom, const double top,
|
||||
const double zNear, const double zFar);
|
||||
void setOrtho(double left, double right,
|
||||
double bottom, double top,
|
||||
double zNear, double zFar);
|
||||
|
||||
/** Set a 2D orthographic projection. See gluOrtho2D for further details.*/
|
||||
void setOrtho2D(const double left, const double right,
|
||||
const double bottom, const double top);
|
||||
void setOrtho2D(double left, double right,
|
||||
double bottom, double top);
|
||||
|
||||
/** Set a perspective projection. See glFrustum for further details.*/
|
||||
void setFrustum(const double left, const double right,
|
||||
const double bottom, const double top,
|
||||
const double zNear, const double zFar);
|
||||
void setFrustum(double left, double right,
|
||||
double bottom, double top,
|
||||
double zNear, double zFar);
|
||||
|
||||
/** Set a symmetrical perspective projection, See gluPerspective for further details.
|
||||
* Aspect ratio is defined as width/height.*/
|
||||
void setPerspective(const double fovy,const double aspectRatio,
|
||||
const double zNear, const double zFar);
|
||||
void setPerspective(double fovy,double aspectRatio,
|
||||
double zNear, double zFar);
|
||||
|
||||
/** Set a sysmmetical perspective projection using field of view.*/
|
||||
void setFOV(const double fovx,const double fovy,
|
||||
const double zNear, const double zFar);
|
||||
void setFOV(double fovx,double fovy,
|
||||
double zNear, double zFar);
|
||||
|
||||
/** Set the near and far clipping planes.*/
|
||||
void setNearFar(const double zNear, const double zFar);
|
||||
void setNearFar(double zNear, double zFar);
|
||||
|
||||
/** Use in combination with adjustAspectRatio, to control
|
||||
* the change in frustum clipping planes to account for
|
||||
@ -96,7 +96,7 @@ class SG_EXPORT Camera: public osg::Referenced
|
||||
/** Adjust the clipping planes to account for a new window aspect ratio.
|
||||
* Typically used after resizing a window. Aspect ratio is defined as
|
||||
* width/height.*/
|
||||
void adjustAspectRatio(const double newAspectRatio)
|
||||
void adjustAspectRatio(double newAspectRatio)
|
||||
{
|
||||
adjustAspectRatio(newAspectRatio,_adjustAspectRatioMode);
|
||||
}
|
||||
@ -104,28 +104,28 @@ class SG_EXPORT Camera: public osg::Referenced
|
||||
/** Adjust the clipping planes to account for a new window aspect ratio.
|
||||
* Typicall used after resizeing a window. Aspect ratio is defined as
|
||||
* width/height.*/
|
||||
void adjustAspectRatio(const double newAspectRatio, const AdjustAspectRatioMode aa);
|
||||
void adjustAspectRatio(double newAspectRatio, const AdjustAspectRatioMode aa);
|
||||
|
||||
const double left() const { return _left; }
|
||||
const double right() const { return _right; }
|
||||
const double bottom() const { return _bottom; }
|
||||
const double top() const { return _top; }
|
||||
const double zNear() const { return _zNear; }
|
||||
const double zFar() const { return _zFar; }
|
||||
double left() const { return _left; }
|
||||
double right() const { return _right; }
|
||||
double bottom() const { return _bottom; }
|
||||
double top() const { return _top; }
|
||||
double zNear() const { return _zNear; }
|
||||
double zFar() const { return _zFar; }
|
||||
|
||||
/** Calculate and return the equivalent fovx for the current project setting.
|
||||
* This value is only valid for when a symmetric perspective projection exists.
|
||||
* i.e. getProjectionType()==PERSPECTIVE.*/
|
||||
const double calc_fovy() const;
|
||||
double calc_fovy() const;
|
||||
|
||||
/** Calculate and return the equivalent fovy for the current project setting.
|
||||
* This value is only valid for when a symmetric perspective projection exists.
|
||||
* i.e. getProjectionType()==PERSPECTIVE.*/
|
||||
const double calc_fovx() const;
|
||||
double calc_fovx() const;
|
||||
|
||||
/** Calculate and return the projection aspect ratio.
|
||||
* Aspect ratio is defined as width/height.*/
|
||||
const double calc_aspectRatio() const;
|
||||
double calc_aspectRatio() const;
|
||||
|
||||
|
||||
|
||||
@ -166,9 +166,9 @@ class SG_EXPORT Camera: public osg::Referenced
|
||||
/** set the position and orientation of the camera, using the same convention as
|
||||
* gluLookAt.
|
||||
*/
|
||||
void setLookAt(const double eyeX, const double eyeY, const double eyeZ,
|
||||
const double centerX, const double centerY, const double centerZ,
|
||||
const double upX, const double upY, const double upZ);
|
||||
void setLookAt(double eyeX, double eyeY, double eyeZ,
|
||||
double centerX, double centerY, double centerZ,
|
||||
double upX, double upY, double upZ);
|
||||
|
||||
/** post multiple the existing eye point and orientation by matrix.
|
||||
* note, does not affect any ModelTransforms that are applied.*/
|
||||
@ -186,10 +186,10 @@ class SG_EXPORT Camera: public osg::Referenced
|
||||
inline const Vec3& getUpVector() const { return _up; }
|
||||
|
||||
/** calculate look vector.*/
|
||||
const Vec3 getLookVector() const;
|
||||
Vec3 getLookVector() const;
|
||||
|
||||
/** calculate side vector.*/
|
||||
const Vec3 getSideVector() const;
|
||||
Vec3 getSideVector() const;
|
||||
|
||||
/** calculate the look distance which is the distance between the eye and the center.*/
|
||||
inline float getLookDistance() const { return (_center-_eye).length(); }
|
||||
@ -249,7 +249,7 @@ class SG_EXPORT Camera: public osg::Referenced
|
||||
float getFusionDistanceRatio() const { return _fusionDistanceRatio; }
|
||||
|
||||
/** Calculate and return the fusion distance, using the FusionDistanceFunction.*/
|
||||
const float getFusionDistance() const;
|
||||
float getFusionDistance() const;
|
||||
|
||||
|
||||
/** Set the physical distance between the viewers eyes and the display system.
|
||||
@ -257,19 +257,19 @@ class SG_EXPORT Camera: public osg::Referenced
|
||||
void setScreenDistance(float screenDistance) { _screenDistance = screenDistance; }
|
||||
|
||||
/** Get the physical distance between the viewers eyes and the display system.*/
|
||||
const float getScreenDistance() const { return _screenDistance; }
|
||||
float getScreenDistance() const { return _screenDistance; }
|
||||
|
||||
|
||||
|
||||
/** Get the Projection Matrix.*/
|
||||
const Matrix getProjectionMatrix() const;
|
||||
Matrix getProjectionMatrix() const;
|
||||
|
||||
/** Get the ModelView matrix.
|
||||
* If a ModelTransform is supplied then the ModelView matrix is
|
||||
* created by multiplying the current LookAt by ModelTransform.
|
||||
* Otherwise it is simply created by using the current LookAt,
|
||||
* equivalent to using gluLookAt.*/
|
||||
const Matrix getModelViewMatrix() const;
|
||||
Matrix getModelViewMatrix() const;
|
||||
|
||||
|
||||
/** Get the camera view frustum.*/
|
||||
|
@ -35,10 +35,10 @@ class SG_EXPORT ClearNode : public Group
|
||||
META_Node(osg, ClearNode);
|
||||
|
||||
/** Sets the flag which control whether a glClear is required at the beginning of each frame. */
|
||||
inline void setRequiresClear(const bool requiresClear) { _requiresClear = requiresClear; }
|
||||
inline void setRequiresClear(bool requiresClear) { _requiresClear = requiresClear; }
|
||||
|
||||
/** Gets the flag which control whether a glClear is required at the beginning of each frame. */
|
||||
inline const bool getRequiresClear() const { return _requiresClear; }
|
||||
inline bool getRequiresClear() const { return _requiresClear; }
|
||||
|
||||
/** Sets the clear color. */
|
||||
inline void setClearColor(const Vec4& color) { _clearColor = color; }
|
||||
|
@ -31,18 +31,18 @@ class SG_EXPORT ClipNode : public Group
|
||||
|
||||
/** Add a ClipPlane to a ClipNode. Return true if plane is added,
|
||||
* return false if plane already exists in ClipNode, or clipplane is false.*/
|
||||
const bool addClipPlane(ClipPlane* clipplane);
|
||||
bool addClipPlane(ClipPlane* clipplane);
|
||||
|
||||
/** Remove ClipPlane from a ClipNode. Return true if plane is removed,
|
||||
* return false if plane does not exists in ClipNode.*/
|
||||
const bool removeClipPlane(ClipPlane* clipplane);
|
||||
bool removeClipPlane(ClipPlane* clipplane);
|
||||
|
||||
/** Remove ClipPlane, at specified index, from a ClipNode. Return true if plane is removed,
|
||||
* return false if plane does not exists in ClipNode.*/
|
||||
const bool removeClipPlane(unsigned int pos);
|
||||
bool removeClipPlane(unsigned int pos);
|
||||
|
||||
/** return the number of ClipPlanes.*/
|
||||
inline const unsigned int getNumClipPlanes() const { return _planes.size(); }
|
||||
inline unsigned int getNumClipPlanes() const { return _planes.size(); }
|
||||
|
||||
|
||||
/** Get ClipPlane at specificed index position.*/
|
||||
@ -58,16 +58,16 @@ class SG_EXPORT ClipNode : public Group
|
||||
inline const ClipPlaneList& getClipPlaneList() const { return _planes; }
|
||||
|
||||
/** Set the GLModes on StateSet associated with the ClipPlanes.*/
|
||||
void setStateSetModes(StateSet&,const StateAttribute::GLModeValue) const;
|
||||
void setStateSetModes(StateSet&,StateAttribute::GLModeValue) const;
|
||||
|
||||
/** Set up the local StateSet */
|
||||
void setLocalStateSetModes(const StateAttribute::GLModeValue=StateAttribute::ON);
|
||||
void setLocalStateSetModes(StateAttribute::GLModeValue=StateAttribute::ON);
|
||||
|
||||
protected:
|
||||
|
||||
virtual ~ClipNode();
|
||||
|
||||
virtual const bool computeBound() const;
|
||||
virtual bool computeBound() const;
|
||||
|
||||
StateAttribute::GLModeValue _value;
|
||||
ClipPlaneList _planes;
|
||||
|
@ -81,10 +81,10 @@ class SG_EXPORT ClipPlane : public StateAttribute
|
||||
void getClipPlane(double* plane) const;
|
||||
|
||||
/** Set the clip plane number. */
|
||||
void setClipPlaneNum(const unsigned int num);
|
||||
void setClipPlaneNum(unsigned int num);
|
||||
|
||||
/** Get the clip plane number. */
|
||||
const unsigned int getClipPlaneNum() const;
|
||||
unsigned int getClipPlaneNum() const;
|
||||
|
||||
/** Apply the clip plane's state to the OpenGL state machine. */
|
||||
virtual void apply(State& state) const;
|
||||
|
@ -55,13 +55,13 @@ class SG_EXPORT ColorMask : public StateAttribute
|
||||
|
||||
}
|
||||
|
||||
inline const bool getRedMask() const { return _red; }
|
||||
inline bool getRedMask() const { return _red; }
|
||||
|
||||
inline const bool getGreenMask() const { return _green; }
|
||||
inline bool getGreenMask() const { return _green; }
|
||||
|
||||
inline const bool getBlueMask() const { return _blue; }
|
||||
inline bool getBlueMask() const { return _blue; }
|
||||
|
||||
inline const bool getAlphaMask() const { return _alpha; }
|
||||
inline bool getAlphaMask() const { return _alpha; }
|
||||
|
||||
virtual void apply(State& state) const;
|
||||
|
||||
|
@ -49,9 +49,9 @@ class SG_EXPORT CullFace : public StateAttribute
|
||||
FRONT_AND_BACK = GL_FRONT_AND_BACK
|
||||
};
|
||||
|
||||
inline void setMode(const Mode mode) { _mode = mode; }
|
||||
inline void setMode(Mode mode) { _mode = mode; }
|
||||
|
||||
inline const Mode getMode() const { return _mode; }
|
||||
inline Mode getMode() const { return _mode; }
|
||||
|
||||
virtual void apply(State& state) const;
|
||||
|
||||
|
@ -66,8 +66,8 @@ class SG_EXPORT CullStack
|
||||
/** Returns the current CullingMode.*/
|
||||
CullingMode getCullingMode() const { return _cullingMode; }
|
||||
|
||||
void setLODBias(const float bias) { _LODBias = bias; }
|
||||
const float getLODBias() const { return _LODBias; }
|
||||
void setLODBias(float bias) { _LODBias = bias; }
|
||||
float getLODBias() const { return _LODBias; }
|
||||
|
||||
void setSmallFeatureCullingPixelSize(float value) { _smallFeatureCullingPixelSize=value; }
|
||||
float getSmallFeatureCullingPixelSize() const { return _smallFeatureCullingPixelSize; }
|
||||
|
@ -102,9 +102,9 @@ class SG_EXPORT DOFTransform : public Transform
|
||||
|
||||
void animate();
|
||||
|
||||
virtual const bool computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor* nv) const;
|
||||
virtual bool computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor* nv) const;
|
||||
|
||||
virtual const bool computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor* nv) const;
|
||||
virtual bool computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor* nv) const;
|
||||
|
||||
protected:
|
||||
virtual ~DOFTransform() {}
|
||||
|
@ -63,23 +63,23 @@ class SG_EXPORT Depth : public StateAttribute
|
||||
ALWAYS = GL_ALWAYS
|
||||
};
|
||||
|
||||
inline void setFunction(const Function func) { _func = func; }
|
||||
inline void setFunction(Function func) { _func = func; }
|
||||
|
||||
inline const Function getFunction() const { return _func; }
|
||||
inline Function getFunction() const { return _func; }
|
||||
|
||||
|
||||
inline void setWriteMask(const bool mask) { _depthWriteMask = mask; }
|
||||
inline void setWriteMask(bool mask) { _depthWriteMask = mask; }
|
||||
|
||||
inline const bool getWriteMask() const { return _depthWriteMask; }
|
||||
inline bool getWriteMask() const { return _depthWriteMask; }
|
||||
|
||||
inline void setRange(const double zNear, const double zFar)
|
||||
inline void setRange(double zNear, double zFar)
|
||||
{
|
||||
_zNear = zNear;
|
||||
_zFar = zFar;
|
||||
}
|
||||
|
||||
inline const double getZNear() const { return _zNear; }
|
||||
inline const double getZFar() const { return _zFar; }
|
||||
inline double getZNear() const { return _zNear; }
|
||||
inline double getZFar() const { return _zFar; }
|
||||
|
||||
virtual void apply(State& state) const;
|
||||
|
||||
|
@ -56,8 +56,8 @@ class SG_EXPORT DisplaySettings : public osg::Referenced
|
||||
|
||||
|
||||
|
||||
void setStereo(const bool on) { _stereo = on; }
|
||||
const bool getStereo() const { return _stereo; }
|
||||
void setStereo(bool on) { _stereo = on; }
|
||||
bool getStereo() const { return _stereo; }
|
||||
|
||||
enum StereoMode
|
||||
{
|
||||
@ -67,14 +67,14 @@ class SG_EXPORT DisplaySettings : public osg::Referenced
|
||||
VERTICAL_SPLIT
|
||||
};
|
||||
|
||||
void setStereoMode(const StereoMode mode) { _stereoMode = mode; }
|
||||
const StereoMode getStereoMode() const { return _stereoMode; }
|
||||
void setStereoMode(StereoMode mode) { _stereoMode = mode; }
|
||||
StereoMode getStereoMode() const { return _stereoMode; }
|
||||
|
||||
void setEyeSeparation(const float eyeSeparation) { _eyeSeparation = eyeSeparation; }
|
||||
const float getEyeSeparation() const { return _eyeSeparation; }
|
||||
void setEyeSeparation(float eyeSeparation) { _eyeSeparation = eyeSeparation; }
|
||||
float getEyeSeparation() const { return _eyeSeparation; }
|
||||
|
||||
void setScreenDistance(const float distance) { _screenDistance = distance; }
|
||||
const float getScreenDistance() const { return _screenDistance; }
|
||||
void setScreenDistance(float distance) { _screenDistance = distance; }
|
||||
float getScreenDistance() const { return _screenDistance; }
|
||||
|
||||
enum SplitStereoHorizontalEyeMapping
|
||||
{
|
||||
@ -85,8 +85,8 @@ class SG_EXPORT DisplaySettings : public osg::Referenced
|
||||
void setSplitStereoHorizontalEyeMapping(SplitStereoHorizontalEyeMapping m) { _splitStereoHorizontalEyeMapping = m; }
|
||||
SplitStereoHorizontalEyeMapping getSplitStereoHorizontalEyeMapping() const { return _splitStereoHorizontalEyeMapping; }
|
||||
|
||||
void setSplitStereoHorizontalSeparation(const int s) { _splitStereoHorizontalSeparation = s; }
|
||||
const int getSplitStereoHorizontalSeparation() const { return _splitStereoHorizontalSeparation; }
|
||||
void setSplitStereoHorizontalSeparation(int s) { _splitStereoHorizontalSeparation = s; }
|
||||
int getSplitStereoHorizontalSeparation() const { return _splitStereoHorizontalSeparation; }
|
||||
|
||||
enum SplitStereoVerticalEyeMapping
|
||||
{
|
||||
@ -97,38 +97,38 @@ class SG_EXPORT DisplaySettings : public osg::Referenced
|
||||
void setSplitStereoVerticalEyeMapping(SplitStereoVerticalEyeMapping m) { _splitStereoVerticalEyeMapping = m; }
|
||||
SplitStereoVerticalEyeMapping getSplitStereoVerticalEyeMapping() const { return _splitStereoVerticalEyeMapping; }
|
||||
|
||||
void setSplitStereoVerticalSeparation(const int s) { _splitStereoVerticalSeparation = s; }
|
||||
const int getSplitStereoVerticalSeparation() const { return _splitStereoVerticalSeparation; }
|
||||
void setSplitStereoVerticalSeparation(int s) { _splitStereoVerticalSeparation = s; }
|
||||
int getSplitStereoVerticalSeparation() const { return _splitStereoVerticalSeparation; }
|
||||
|
||||
|
||||
void setScreenHeight(const float height) { _screenHeight = height; }
|
||||
const float getScreenHeight() const { return _screenHeight; }
|
||||
void setScreenHeight(float height) { _screenHeight = height; }
|
||||
float getScreenHeight() const { return _screenHeight; }
|
||||
|
||||
|
||||
void setDoubleBuffer(const bool flag) { _doubleBuffer = flag; }
|
||||
const bool getDoubleBuffer() const { return _doubleBuffer; }
|
||||
void setDoubleBuffer(bool flag) { _doubleBuffer = flag; }
|
||||
bool getDoubleBuffer() const { return _doubleBuffer; }
|
||||
|
||||
|
||||
void setRGB(const bool flag) { _RGB = flag; }
|
||||
const bool getRGB() const { return _RGB; }
|
||||
void setRGB(bool flag) { _RGB = flag; }
|
||||
bool getRGB() const { return _RGB; }
|
||||
|
||||
|
||||
void setDepthBuffer(const bool flag) { _depthBuffer = flag; }
|
||||
const bool getDepthBuffer() const { return _depthBuffer; }
|
||||
void setDepthBuffer(bool flag) { _depthBuffer = flag; }
|
||||
bool getDepthBuffer() const { return _depthBuffer; }
|
||||
|
||||
|
||||
void setMinimumNumAlphaBits(const unsigned int bits) { _minimumNumberAlphaBits = bits; }
|
||||
const unsigned int getMinimumNumAlphaBits() const { return _minimumNumberAlphaBits; }
|
||||
const bool getAlphaBuffer() const { return _minimumNumberAlphaBits!=0; }
|
||||
void setMinimumNumAlphaBits(unsigned int bits) { _minimumNumberAlphaBits = bits; }
|
||||
unsigned int getMinimumNumAlphaBits() const { return _minimumNumberAlphaBits; }
|
||||
bool getAlphaBuffer() const { return _minimumNumberAlphaBits!=0; }
|
||||
|
||||
|
||||
void setMinimumNumStencilBits(const unsigned int bits) { _minimumNumberStencilBits = bits; }
|
||||
const unsigned int getMinimumNumStencilBits() const { return _minimumNumberStencilBits; }
|
||||
const bool getStencilBuffer() const { return _minimumNumberStencilBits!=0; }
|
||||
void setMinimumNumStencilBits(unsigned int bits) { _minimumNumberStencilBits = bits; }
|
||||
unsigned int getMinimumNumStencilBits() const { return _minimumNumberStencilBits; }
|
||||
bool getStencilBuffer() const { return _minimumNumberStencilBits!=0; }
|
||||
|
||||
|
||||
void setMaxNumberOfGraphicsContexts(const int num) { _maxNumOfGraphicsContexts = num; }
|
||||
const int getMaxNumberOfGraphicsContexts() const { return _maxNumOfGraphicsContexts; }
|
||||
void setMaxNumberOfGraphicsContexts(int num) { _maxNumOfGraphicsContexts = num; }
|
||||
int getMaxNumberOfGraphicsContexts() const { return _maxNumOfGraphicsContexts; }
|
||||
|
||||
|
||||
protected:
|
||||
|
@ -48,7 +48,7 @@ class SG_EXPORT DrawPixels : public Drawable
|
||||
|
||||
void getSubImageDimensions(unsigned int& offsetX,unsigned int& offsetY,unsigned int& width,unsigned int& height) const;
|
||||
|
||||
const bool getUseSubImage() const { return _useSubImage; }
|
||||
bool getUseSubImage() const { return _useSubImage; }
|
||||
|
||||
|
||||
virtual void drawImmediateMode(State& state);
|
||||
@ -60,7 +60,7 @@ class SG_EXPORT DrawPixels : public Drawable
|
||||
|
||||
virtual ~DrawPixels();
|
||||
|
||||
virtual const bool computeBound() const;
|
||||
virtual bool computeBound() const;
|
||||
|
||||
Vec3 _position;
|
||||
ref_ptr<Image> _image;
|
||||
|
@ -64,31 +64,36 @@ class SG_EXPORT Drawable : public Object
|
||||
* @param i index of the parent to get.
|
||||
* @return the parent i.
|
||||
*/
|
||||
inline Node* getParent(const unsigned int i) { return _parents[i]; }
|
||||
inline Node* getParent(unsigned int i) { return _parents[i]; }
|
||||
/** Get a single const parent of Drawable.
|
||||
* @param i index of the parent to get.
|
||||
* @return the parent i.
|
||||
*/
|
||||
inline const Node* getParent(const unsigned int i) const { return _parents[i]; }
|
||||
inline const Node* getParent(unsigned int i) const { return _parents[i]; }
|
||||
|
||||
/**
|
||||
* Get the number of parents of node.
|
||||
* @return the number of parents of this node.
|
||||
*/
|
||||
inline const unsigned int getNumParents() const { return _parents.size(); }
|
||||
inline unsigned int getNumParents() const { return _parents.size(); }
|
||||
|
||||
|
||||
|
||||
/** Set the StateSet attached to the Drawable.
|
||||
Previously attached StateSet are automatically unreferenced on
|
||||
assignment of a new drawstate.*/
|
||||
inline void setStateSet(StateSet *state) { _dstate = state; }
|
||||
inline void setStateSet(StateSet *state) { _stateset = state; }
|
||||
|
||||
/** Get the attached StateSet.*/
|
||||
inline StateSet* getStateSet() { return _dstate.get();}
|
||||
inline StateSet* getStateSet() { return _stateset.get();}
|
||||
|
||||
/** Get the attached const StateSet.*/
|
||||
inline const StateSet* getStateSet() const { return _dstate.get();}
|
||||
inline const StateSet* getStateSet() const { return _stateset.get();}
|
||||
|
||||
/** Get the attached const StateSet,
|
||||
* if one is not already attach create one,
|
||||
* attach it to the drawable and return a pointer to it.*/
|
||||
inline StateSet* getOrCreateStateSet();
|
||||
|
||||
|
||||
/** Set the drawable to it can or cannot be used in conjunction with OpenGL
|
||||
@ -98,19 +103,19 @@ class SG_EXPORT Drawable : public Object
|
||||
* is typically used to guard against the switching on of display lists
|
||||
* on objects with dynamic internal data such as continuous Level of Detail
|
||||
* algorithms.*/
|
||||
void setSupportsDisplayList(const bool flag);
|
||||
void setSupportsDisplayList(bool flag);
|
||||
|
||||
/** Get whether display lists are supported for this drawable instance.*/
|
||||
inline const bool getSupportsDisplayList() const { return _supportsDisplayList; }
|
||||
inline bool getSupportsDisplayList() const { return _supportsDisplayList; }
|
||||
|
||||
|
||||
/** When set to true, force the draw method to use OpenGL Display List for rendering.
|
||||
If false rendering directly. If the display list has not been already
|
||||
compile the next call to draw will automatically create the display list.*/
|
||||
void setUseDisplayList(const bool flag);
|
||||
void setUseDisplayList(bool flag);
|
||||
|
||||
/** Return whether OpenGL display lists are being used for rendering.*/
|
||||
inline const bool getUseDisplayList() const { return _useDisplayList; }
|
||||
inline bool getUseDisplayList() const { return _useDisplayList; }
|
||||
|
||||
/** Force a recompile on next draw() of any OpenGL display list associated with this geoset.*/
|
||||
void dirtyDisplayList();
|
||||
@ -292,7 +297,7 @@ class SG_EXPORT Drawable : public Object
|
||||
|
||||
/** compute the bounding box of the drawable. Method must be
|
||||
implemented by subclasses.*/
|
||||
virtual const bool computeBound() const;
|
||||
virtual bool computeBound() const;
|
||||
|
||||
void addParent(osg::Node* node);
|
||||
void removeParent(osg::Node* node);
|
||||
@ -301,7 +306,7 @@ class SG_EXPORT Drawable : public Object
|
||||
friend class Node;
|
||||
friend class Geode;
|
||||
|
||||
ref_ptr<StateSet> _dstate;
|
||||
ref_ptr<StateSet> _stateset;
|
||||
|
||||
bool _supportsDisplayList;
|
||||
bool _useDisplayList;
|
||||
|
@ -70,14 +70,14 @@ class SG_EXPORT Fog : public StateAttribute
|
||||
inline void setMode( const Mode mode ) { _mode = mode; }
|
||||
inline Mode getMode() const { return _mode; }
|
||||
|
||||
inline void setDensity( const float density ) { _density = density; }
|
||||
inline const float getDensity() const { return _density; }
|
||||
inline void setDensity( float density ) { _density = density; }
|
||||
inline float getDensity() const { return _density; }
|
||||
|
||||
inline void setStart( const float start ) { _start = start; }
|
||||
inline const float getStart() const { return _start; }
|
||||
inline void setStart( float start ) { _start = start; }
|
||||
inline float getStart() const { return _start; }
|
||||
|
||||
inline void setEnd( const float end ) { _end = end; }
|
||||
inline const float getEnd() const { return _end; }
|
||||
inline void setEnd( float end ) { _end = end; }
|
||||
inline float getEnd() const { return _end; }
|
||||
|
||||
inline void setColor( const Vec4 &color ) { _color = color; }
|
||||
inline const Vec4& getColor() const { return _color; }
|
||||
|
@ -23,7 +23,7 @@ namespace osg {
|
||||
* note: Must only called within a valid OpenGL context,
|
||||
* undefined behavior may occur otherwise.
|
||||
*/
|
||||
SG_EXPORT extern const bool isGLExtensionSupported(const char *extension);
|
||||
SG_EXPORT extern bool isGLExtensionSupported(const char *extension);
|
||||
|
||||
/** return the address of the specified OpenGL function.
|
||||
* return NULL if function not supported by OpenGL library.
|
||||
@ -74,7 +74,7 @@ inline void* getGLExtensionFuncPtr(const char *funcName,const char *fallbackFunc
|
||||
* note: Must only called within a valid OpenGL context,
|
||||
* undefined behavior may occur otherwise.
|
||||
*/
|
||||
SG_EXPORT extern const bool isGLUExtensionSupported(const char *extension);
|
||||
SG_EXPORT extern bool isGLUExtensionSupported(const char *extension);
|
||||
|
||||
inline void* getGLUExtensionFuncPtr(const char *funcName)
|
||||
{
|
||||
|
@ -90,19 +90,19 @@ class SG_EXPORT GeoSet : public Drawable
|
||||
|
||||
IndexPointer() { _size=0;_is_ushort=true;_ptr._ushort = (GLushort*)0; }
|
||||
|
||||
inline const bool operator == (const IndexPointer& ip) const
|
||||
inline bool operator == (const IndexPointer& ip) const
|
||||
{
|
||||
return _size == ip._size &&
|
||||
_is_ushort == ip._is_ushort &&
|
||||
_ptr._ushort == ip._ptr._ushort;
|
||||
}
|
||||
|
||||
inline const bool valid() const
|
||||
inline bool valid() const
|
||||
{
|
||||
return _ptr._ushort != (GLushort*)0;
|
||||
}
|
||||
|
||||
inline const bool null() const
|
||||
inline bool null() const
|
||||
{
|
||||
return _ptr._ushort == (GLushort*)0;
|
||||
}
|
||||
@ -122,14 +122,14 @@ class SG_EXPORT GeoSet : public Drawable
|
||||
}
|
||||
|
||||
|
||||
void set(const uint size,GLuint* data)
|
||||
void set(uint size,GLuint* data)
|
||||
{
|
||||
_size = size;
|
||||
_is_ushort = false;
|
||||
_ptr._uint = data;
|
||||
}
|
||||
|
||||
inline const uint maxIndex() const
|
||||
inline uint maxIndex() const
|
||||
{
|
||||
uint max = 0;
|
||||
if (_is_ushort)
|
||||
@ -145,7 +145,7 @@ class SG_EXPORT GeoSet : public Drawable
|
||||
return max;
|
||||
}
|
||||
|
||||
inline const GLint operator [] (const GLuint pos) const
|
||||
inline GLint operator [] (const GLuint pos) const
|
||||
{
|
||||
if (_is_ushort) return _ptr._ushort[pos];
|
||||
else return _ptr._uint[pos];
|
||||
@ -169,27 +169,27 @@ class SG_EXPORT GeoSet : public Drawable
|
||||
|
||||
|
||||
// data access methods.
|
||||
inline void setNumPrims( const int n ) { _numprims = n; }
|
||||
inline const int getNumPrims() const { return _numprims; }
|
||||
inline void setNumPrims( int n ) { _numprims = n; }
|
||||
inline int getNumPrims() const { return _numprims; }
|
||||
|
||||
void setPrimType( const PrimitiveType type );
|
||||
inline const PrimitiveType getPrimType() const { return _primtype; }
|
||||
void setPrimType( PrimitiveType type );
|
||||
inline PrimitiveType getPrimType() const { return _primtype; }
|
||||
|
||||
inline void setPrimLengths( int *lens ) { _primLengths = lens; }
|
||||
inline int *getPrimLengths() { return _primLengths; }
|
||||
inline const int *getPrimLengths() const { return _primLengths; }
|
||||
inline int *getPrimLengths() const { return _primLengths; }
|
||||
|
||||
void computeNumVerts() const;
|
||||
|
||||
/** get the number of coords required by the defined primitives. */
|
||||
inline const int getNumCoords() const
|
||||
inline int getNumCoords() const
|
||||
{ if( _numcoords == 0 ) computeNumVerts(); return _numcoords; }
|
||||
/** get a pointer to Vec3 coord array. */
|
||||
inline Vec3* getCoords() { return _coords; }
|
||||
/** get a const pointer to Vec3 coord array. */
|
||||
inline const Vec3* getCoords() const { return _coords; }
|
||||
/** get the number of indices required by the defined primitives. */
|
||||
inline const int getNumCoordIndices() const { return _cindex._size; }
|
||||
inline int getNumCoordIndices() const { return _cindex._size; }
|
||||
/** get the coord index array. */
|
||||
inline IndexPointer& getCoordIndices() { return _cindex; }
|
||||
/** get the const coord index array. */
|
||||
@ -208,7 +208,7 @@ class SG_EXPORT GeoSet : public Drawable
|
||||
void setCoords( Vec3 *cp, IndexPointer& ip );
|
||||
|
||||
/** get the number of normals required by the defined primitives and normals binding.*/
|
||||
inline const int getNumNormals() const { return _numnormals; }
|
||||
inline int getNumNormals() const { return _numnormals; }
|
||||
/** get a pointer to Vec3 normal array. */
|
||||
inline Vec3* getNormals() { return _normals; }
|
||||
/** get a const pointer to Vec3 normal array. */
|
||||
@ -228,11 +228,11 @@ class SG_EXPORT GeoSet : public Drawable
|
||||
/** set the normals and normal indices of the geoset.*/
|
||||
void setNormals( Vec3 *np, IndexPointer& ip );
|
||||
/** set the normals binding to the vertices/primitives/overall.*/
|
||||
void setNormalBinding( const BindingType binding );
|
||||
inline const BindingType getNormalBinding() const { return _normal_binding; }
|
||||
void setNormalBinding( BindingType binding );
|
||||
inline BindingType getNormalBinding() const { return _normal_binding; }
|
||||
|
||||
/** get the number of colors required by the defined primitives and color binding.*/
|
||||
inline const int getNumColors() const { return _numcolors; }
|
||||
inline int getNumColors() const { return _numcolors; }
|
||||
/** get a pointer to Vec4 color array. */
|
||||
inline Vec4* getColors() { return _colors; }
|
||||
/** get a pointer to Vec4 color array. */
|
||||
@ -252,17 +252,17 @@ class SG_EXPORT GeoSet : public Drawable
|
||||
/** set the colors and color indices of the geoset.*/
|
||||
void setColors( Vec4 *cp, IndexPointer& ip );
|
||||
/** set the color binding to the vertices/primitives/overall.*/
|
||||
void setColorBinding( const BindingType binding );
|
||||
void setColorBinding( BindingType binding );
|
||||
inline BindingType getColorBinding() const { return _color_binding; }
|
||||
|
||||
/** get the number of texture coords required by the defined primitives and textures binding.*/
|
||||
inline const int getNumTextureCoords() const { return _numtcoords; }
|
||||
inline int getNumTextureCoords() const { return _numtcoords; }
|
||||
/** get a pointer to Vec4 color array. */
|
||||
inline Vec2* getTextureCoords() { return _tcoords; }
|
||||
/** get a pointer to Vec4 color array. */
|
||||
inline const Vec2* getTextureCoords() const { return _tcoords; }
|
||||
/** get the number of texture coord indices required by the defined primitives and texture binding.*/
|
||||
inline const int getNumTextureIndices() const { return _tindex._size; }
|
||||
inline int getNumTextureIndices() const { return _tindex._size; }
|
||||
/** get the texture index array. */
|
||||
inline IndexPointer& getTextureIndices() { return _tindex; }
|
||||
/** get the texture index array. */
|
||||
@ -276,29 +276,29 @@ class SG_EXPORT GeoSet : public Drawable
|
||||
/** set the texture coords and texture indices of the geoset.*/
|
||||
void setTextureCoords( Vec2 *tc, IndexPointer& ip );
|
||||
/** set the texture coord binding to the vertices/primitives/overall.*/
|
||||
void setTextureBinding( const BindingType binding );
|
||||
inline const BindingType getTextureBinding() const { return _texture_binding; }
|
||||
void setTextureBinding( BindingType binding );
|
||||
inline BindingType getTextureBinding() const { return _texture_binding; }
|
||||
|
||||
/** get the number of texture coords required by the defined primitives and textures binding.*/
|
||||
inline const int getNumInterleavedCoords() const { return _numcoords; }
|
||||
inline int getNumInterleavedCoords() const { return _numcoords; }
|
||||
/** get a pointer to interleaved float array. */
|
||||
inline void* getInterleavedArray() { return _iarray; }
|
||||
/** get a const pointer to interleaved float array. */
|
||||
inline const void* getInterleavedArray() const { return _iarray; }
|
||||
/** get the number of texture coord indices required by the defined primitives and texture binding.*/
|
||||
inline const int getNumInterleavedIndices() const { return _iaindex._size; }
|
||||
inline int getNumInterleavedIndices() const { return _iaindex._size; }
|
||||
/** get the texture index array. */
|
||||
inline IndexPointer& getInterleavedIndices() { return _iaindex; }
|
||||
/** get the interleaved index array. */
|
||||
inline const IndexPointer& getInterleavedIndices() const { return _iaindex; }
|
||||
/** get the interleaved array storage format. */
|
||||
inline const InterleaveArrayType getInterleavedFormat() const { return _iaformat; }
|
||||
inline InterleaveArrayType getInterleavedFormat() const { return _iaformat; }
|
||||
|
||||
/** set the interleaved arrays of the geoset.*/
|
||||
void setInterleavedArray( const InterleaveArrayType format, float *ia );
|
||||
void setInterleavedArray( const InterleaveArrayType format, float *ia, GLushort *iai );
|
||||
void setInterleavedArray( const InterleaveArrayType format, float *ia, GLuint *iai );
|
||||
void setInterleavedArray( const InterleaveArrayType format, float *ia, IndexPointer& iai );
|
||||
void setInterleavedArray( InterleaveArrayType format, float *ia );
|
||||
void setInterleavedArray( InterleaveArrayType format, float *ia, GLushort *iai );
|
||||
void setInterleavedArray( InterleaveArrayType format, float *ia, GLuint *iai );
|
||||
void setInterleavedArray( InterleaveArrayType format, float *ia, IndexPointer& iai );
|
||||
|
||||
/** draw geoset directly ignoring an OpenGL display list which could be attached.
|
||||
* This is the internal draw method which does the drawing itself,
|
||||
@ -306,7 +306,7 @@ class SG_EXPORT GeoSet : public Drawable
|
||||
*/
|
||||
virtual void drawImmediateMode(State& state);
|
||||
|
||||
const bool check() const;
|
||||
bool check() const;
|
||||
|
||||
|
||||
/** function object which is used to handling the clean up of attribute arrays
|
||||
@ -345,7 +345,7 @@ class SG_EXPORT GeoSet : public Drawable
|
||||
|
||||
virtual ~GeoSet();
|
||||
|
||||
virtual const bool computeBound() const;
|
||||
virtual bool computeBound() const;
|
||||
|
||||
ref_ptr<AttributeDeleteFunctor> _adf;
|
||||
|
||||
|
@ -31,7 +31,7 @@ class SG_EXPORT Geode : public Node
|
||||
* sphere to force it to recompute on next getBound() and return true for success.
|
||||
* Otherwise return false.
|
||||
*/
|
||||
virtual const bool addDrawable( Drawable *drawable );
|
||||
virtual bool addDrawable( Drawable *drawable );
|
||||
|
||||
/** Remove Drawable from Geode.
|
||||
* If gset is contained in Geode then remove it from the geoset
|
||||
@ -40,7 +40,7 @@ class SG_EXPORT Geode : public Node
|
||||
* return true for success. If gset is not found then return false
|
||||
* and do not change the reference count of gset.
|
||||
*/
|
||||
virtual const bool removeDrawable( Drawable *drawable );
|
||||
virtual bool removeDrawable( Drawable *drawable );
|
||||
|
||||
/** Replace specified Drawable with another Drawable.
|
||||
* Decrement the reference count origGSet and increments the
|
||||
@ -50,20 +50,20 @@ class SG_EXPORT Geode : public Node
|
||||
* add newGset. If newGset is NULL then return false and do
|
||||
* not remove origGset.
|
||||
*/
|
||||
virtual const bool replaceDrawable( Drawable *origDraw, Drawable *newDraw );
|
||||
virtual bool replaceDrawable( Drawable *origDraw, Drawable *newDraw );
|
||||
|
||||
|
||||
/** return the number of geoset's.*/
|
||||
inline const unsigned int getNumDrawables() const { return _drawables.size(); }
|
||||
inline unsigned int getNumDrawables() const { return _drawables.size(); }
|
||||
|
||||
/** return geoset at position i.*/
|
||||
inline Drawable* getDrawable( const unsigned int i ) { return _drawables[i].get(); }
|
||||
inline Drawable* getDrawable( unsigned int i ) { return _drawables[i].get(); }
|
||||
|
||||
/** return geoset at position i.*/
|
||||
inline const Drawable* getDrawable( const unsigned int i ) const { return _drawables[i].get(); }
|
||||
inline const Drawable* getDrawable( unsigned int i ) const { return _drawables[i].get(); }
|
||||
|
||||
/** return true if geoset is contained within Geode.*/
|
||||
inline const bool containsDrawable(const Drawable* gset) const
|
||||
inline bool containsDrawable(const Drawable* gset) const
|
||||
{
|
||||
|
||||
for (DrawableList::const_iterator itr=_drawables.begin();
|
||||
@ -112,7 +112,7 @@ class SG_EXPORT Geode : public Node
|
||||
|
||||
virtual ~Geode();
|
||||
|
||||
virtual const bool computeBound() const;
|
||||
virtual bool computeBound() const;
|
||||
|
||||
DrawableList _drawables;
|
||||
|
||||
|
@ -122,11 +122,7 @@ class SG_EXPORT Geometry : public Drawable
|
||||
Geometry& operator = (const Geometry&) { return *this;}
|
||||
|
||||
virtual ~Geometry();
|
||||
|
||||
//virtual const bool computeBound() const;
|
||||
|
||||
|
||||
|
||||
|
||||
PrimitiveList _primitives;
|
||||
|
||||
ref_ptr<Vec3Array> _vertexArray;
|
||||
|
@ -57,13 +57,13 @@ class SG_EXPORT Group : public Node
|
||||
virtual bool replaceChild( Node *origChild, Node* newChild );
|
||||
|
||||
/** return the number of chilren nodes.*/
|
||||
inline const unsigned int getNumChildren() const { return _children.size(); }
|
||||
inline unsigned int getNumChildren() const { return _children.size(); }
|
||||
|
||||
/** return child node at position i.*/
|
||||
inline Node *getChild( const unsigned int i ) { return _children[i].get(); }
|
||||
inline Node *getChild( unsigned int i ) { return _children[i].get(); }
|
||||
|
||||
/** return child node at position i.*/
|
||||
inline const Node *getChild( const unsigned int i ) const { return _children[i].get(); }
|
||||
inline const Node *getChild( unsigned int i ) const { return _children[i].get(); }
|
||||
|
||||
/** return true if node is contained within Group.*/
|
||||
inline bool containsNode( const Node* node ) const
|
||||
@ -111,7 +111,7 @@ class SG_EXPORT Group : public Node
|
||||
|
||||
virtual ~Group();
|
||||
|
||||
virtual const bool computeBound() const;
|
||||
virtual bool computeBound() const;
|
||||
|
||||
ChildList _children;
|
||||
|
||||
|
@ -81,7 +81,7 @@ class SG_EXPORT Image : public Object
|
||||
|
||||
|
||||
/** Scale image to specified size. */
|
||||
void scaleImage(const int s,const int t,const int r);
|
||||
void scaleImage(int s,int t,int r);
|
||||
|
||||
/** Copy a source Image into a subpart of this Image at specified position.
|
||||
* Typically used to copy to an already allocated image, such as creating
|
||||
@ -93,35 +93,35 @@ class SG_EXPORT Image : public Object
|
||||
|
||||
|
||||
/** Width of image.*/
|
||||
inline const int s() const { return _s; }
|
||||
inline int s() const { return _s; }
|
||||
|
||||
/** Height of image.*/
|
||||
inline const int t() const { return _t; }
|
||||
inline int t() const { return _t; }
|
||||
|
||||
/** Depth of image.*/
|
||||
inline const int r() const { return _r; }
|
||||
inline int r() const { return _r; }
|
||||
|
||||
void setInternalTextureFormat(GLint internalFormat);
|
||||
inline const GLint getInternalTextureFormat() const { return _internalTextureFormat; }
|
||||
inline GLint getInternalTextureFormat() const { return _internalTextureFormat; }
|
||||
|
||||
void setPixelFormat(const GLenum format);
|
||||
inline const GLenum getPixelFormat() const { return _pixelFormat; }
|
||||
void setPixelFormat(GLenum format);
|
||||
inline GLenum getPixelFormat() const { return _pixelFormat; }
|
||||
|
||||
inline const GLenum getDataType() const { return _dataType; }
|
||||
inline GLenum getDataType() const { return _dataType; }
|
||||
|
||||
inline const unsigned int getPacking() const { return _packing; }
|
||||
inline unsigned int getPacking() const { return _packing; }
|
||||
|
||||
/** return the numbers of bits required for each pixel.*/
|
||||
inline const unsigned int getPixelSizeInBits() const { return computePixelSizeInBits(_pixelFormat,_dataType); }
|
||||
inline unsigned int getPixelSizeInBits() const { return computePixelSizeInBits(_pixelFormat,_dataType); }
|
||||
|
||||
/** return the numbers of bytes each row of pixels occupies once it has been packed.*/
|
||||
inline const unsigned int getRowSizeInBytes() const { return computeRowWidthInBytes(_s,_pixelFormat,_dataType,_packing); }
|
||||
inline unsigned int getRowSizeInBytes() const { return computeRowWidthInBytes(_s,_pixelFormat,_dataType,_packing); }
|
||||
|
||||
/** return the numbers of bytes each image (_s*_t) of pixels occupies..*/
|
||||
inline const unsigned int getImageSizeInBytes() const { return getRowSizeInBytes()*_t; }
|
||||
inline unsigned int getImageSizeInBytes() const { return getRowSizeInBytes()*_t; }
|
||||
|
||||
/** return the numbers of bytes the whole row/image/volume of pixels occupies.*/
|
||||
inline const unsigned int getTotalSizeInBytes() const { return getImageSizeInBytes()*_r; }
|
||||
inline unsigned int getTotalSizeInBytes() const { return getImageSizeInBytes()*_r; }
|
||||
|
||||
/** raw image data.*/
|
||||
inline unsigned char *data() { return _data; }
|
||||
@ -136,7 +136,7 @@ class SG_EXPORT Image : public Object
|
||||
return _data+(column*getPixelSizeInBits())/8+row*getRowSizeInBytes()+image*getImageSizeInBytes();
|
||||
}
|
||||
|
||||
inline const unsigned char* data(int column, int row=0,int image=0) const
|
||||
inline unsigned char* data(int column, int row=0,int image=0) const
|
||||
{
|
||||
if (!_data) return NULL;
|
||||
return _data+(column*getPixelSizeInBits())/8+row*getRowSizeInBytes()+image*getImageSizeInBytes();
|
||||
@ -159,18 +159,18 @@ class SG_EXPORT Image : public Object
|
||||
inline void dirty() { ++_modifiedTag; }
|
||||
|
||||
/** Set the modified tag value, only used by osg::Texture when using texture subloading. */
|
||||
inline void setModifiedTag(const unsigned int value) { _modifiedTag=value; }
|
||||
inline void setModifiedTag(unsigned int value) { _modifiedTag=value; }
|
||||
|
||||
/** Get modified tag value, only used by osg::Texture when using texture subloading. */
|
||||
inline const unsigned int getModifiedTag() const { return _modifiedTag; }
|
||||
inline unsigned int getModifiedTag() const { return _modifiedTag; }
|
||||
|
||||
|
||||
static const bool isPackedType(GLenum type);
|
||||
static const unsigned int computeNumComponents(GLenum format);
|
||||
static const unsigned int computePixelSizeInBits(GLenum format,GLenum type);
|
||||
static const unsigned int computeRowWidthInBytes(int width,GLenum format,GLenum type,int packing);
|
||||
static const unsigned int computeNearestPowerOfTwo(unsigned int s,float bias=0.5f);
|
||||
|
||||
static bool isPackedType(GLenum type);
|
||||
static unsigned int computeNumComponents(GLenum format);
|
||||
static unsigned int computePixelSizeInBits(GLenum format,GLenum type);
|
||||
static unsigned int computeRowWidthInBytes(int width,GLenum format,GLenum type,int packing);
|
||||
static unsigned int computeNearestPowerOfTwo(unsigned int s,float bias=0.5f);
|
||||
|
||||
// precomputed mipmaps stuff;
|
||||
typedef std::vector< unsigned int > MipmapDataType;
|
||||
|
||||
@ -231,7 +231,7 @@ SG_EXPORT extern Geode* createGeodeForImage(Image* image);
|
||||
* to return for readNode().
|
||||
* Use the specified s and t values scale the dimensions of the image.
|
||||
*/
|
||||
SG_EXPORT extern Geode* createGeodeForImage(Image* image,const float s,const float t);
|
||||
SG_EXPORT extern Geode* createGeodeForImage(Image* image,float s,float t);
|
||||
|
||||
}
|
||||
|
||||
|
@ -72,10 +72,10 @@ class SG_EXPORT Impostor : public LOD
|
||||
inline void setImpostorThresholdToBound(float ratio=1.0f) { _impostorThreshold = getBound().radius()*ratio; }
|
||||
|
||||
/* Get the Impostor threshold distance.*/
|
||||
inline const float getImpostorThreshold() const { return _impostorThreshold; }
|
||||
inline float getImpostorThreshold() const { return _impostorThreshold; }
|
||||
|
||||
/* Get the Impostor threshold distance squared.*/
|
||||
inline const float getImpostorThreshold2() const { return _impostorThreshold*_impostorThreshold; }
|
||||
inline float getImpostorThreshold2() const { return _impostorThreshold*_impostorThreshold; }
|
||||
|
||||
/** Find the ImposterSprite which fits the current eye point best.*/
|
||||
ImpostorSprite* findBestImpostorSprite(const osg::Vec3& currLocalEyePoint);
|
||||
@ -93,7 +93,7 @@ class SG_EXPORT Impostor : public LOD
|
||||
|
||||
virtual ~Impostor() {}
|
||||
|
||||
virtual const bool computeBound() const;
|
||||
virtual bool computeBound() const;
|
||||
|
||||
ImpostorSpriteList _impostorSpriteList;
|
||||
|
||||
|
@ -59,7 +59,7 @@ class SG_EXPORT ImpostorSprite : public Drawable
|
||||
inline const Vec3& getStoredLocalEyePoint() const { return _storedLocalEyePoint; }
|
||||
|
||||
/** Set the frame number for when the ImpostorSprite was last used in rendering.*/
|
||||
inline void setLastFrameUsed(const int frameNumber) { _lastFrameUsed = frameNumber; }
|
||||
inline void setLastFrameUsed(int frameNumber) { _lastFrameUsed = frameNumber; }
|
||||
|
||||
/** Get the frame number for when the ImpostorSprite was last used in rendering.*/
|
||||
inline int getLastFrameUsed() const { return _lastFrameUsed; }
|
||||
@ -104,14 +104,14 @@ class SG_EXPORT ImpostorSprite : public Drawable
|
||||
|
||||
/** calculate the pixel error value for passing in the ModelViewProjectionWindow transform,
|
||||
* which transform local coords into screen space.*/
|
||||
const float calcPixelError(const Matrix& MVPW) const;
|
||||
float calcPixelError(const Matrix& MVPW) const;
|
||||
|
||||
void setTexture(Texture2D* tex,int s,int t);
|
||||
|
||||
Texture2D* getTexture() { return _texture; }
|
||||
const Texture2D* getTexture() const { return _texture; }
|
||||
const int s() const { return _s; }
|
||||
const int t() const { return _t; }
|
||||
int s() const { return _s; }
|
||||
int t() const { return _t; }
|
||||
|
||||
/** draw ImpostorSprite directly. */
|
||||
virtual void drawImmediateMode(State& state);
|
||||
@ -129,7 +129,7 @@ class SG_EXPORT ImpostorSprite : public Drawable
|
||||
|
||||
virtual ~ImpostorSprite();
|
||||
|
||||
virtual const bool computeBound() const;
|
||||
virtual bool computeBound() const;
|
||||
|
||||
Impostor* _parent;
|
||||
|
||||
@ -163,7 +163,7 @@ class SG_EXPORT ImpostorSpriteManager : public Referenced
|
||||
|
||||
ImpostorSpriteManager();
|
||||
|
||||
const bool empty() const { return _first==0; }
|
||||
bool empty() const { return _first==0; }
|
||||
|
||||
ImpostorSprite* first() { return _first; }
|
||||
|
||||
|
@ -40,17 +40,17 @@ class SG_EXPORT LOD : public Group
|
||||
is a floating point distance specified in world coordinates.
|
||||
Range list automatically expands to accommodate values beyond
|
||||
the current getNumRanges().*/
|
||||
void setRange(const unsigned int index, const float range);
|
||||
void setRange(unsigned int index, float range);
|
||||
|
||||
/** returns the range for specified index.*/
|
||||
inline const float getRange(const unsigned int index) const { return _rangeList[index]; }
|
||||
inline float getRange(unsigned int index) const { return _rangeList[index]; }
|
||||
|
||||
/** returns the number of ranges currently set.*/
|
||||
inline const unsigned int getNumRanges() const { return _rangeList.size(); }
|
||||
inline unsigned int getNumRanges() const { return _rangeList.size(); }
|
||||
|
||||
/** Sets the object-space point which defines the center of the osg::LOD.
|
||||
center is affected by any transforms in the hierarchy above the osg::LOD.*/
|
||||
inline void setCenter(const Vec3 ¢er) { _center = center; }
|
||||
inline void setCenter(const Vec3& center) { _center = center; }
|
||||
|
||||
/** return the LOD center point. */
|
||||
inline const Vec3& getCenter() const { return _center; }
|
||||
@ -60,7 +60,7 @@ class SG_EXPORT LOD : public Group
|
||||
struct EvaluateLODCallback : public osg::Referenced
|
||||
{
|
||||
/** Compute the child to select.*/
|
||||
virtual const int evaluateLODChild(const osg::LOD* lod, const Vec3& eye_local, const float bias) const = 0;
|
||||
virtual int evaluateLODChild(const osg::LOD* lod, const Vec3& eye_local, float bias) const = 0;
|
||||
};
|
||||
|
||||
/** Set the EvaluateLODCallback which allows users to attach customize computation of the the selection of LOD children.*/
|
||||
@ -75,7 +75,7 @@ class SG_EXPORT LOD : public Group
|
||||
/** return the child to traverse.
|
||||
Selected by the distance between the eye point in local
|
||||
coordinates and the LOD center, multiplied by the bias.*/
|
||||
inline const int evaluate(const Vec3& eye_local,const float bias=1.0f) const
|
||||
inline int evaluate(const Vec3& eye_local,float bias=1.0f) const
|
||||
{
|
||||
if (_evaluateLODCallback.valid())
|
||||
return _evaluateLODCallback->evaluateLODChild(this,eye_local,bias);
|
||||
@ -84,7 +84,7 @@ class SG_EXPORT LOD : public Group
|
||||
}
|
||||
|
||||
|
||||
virtual const int evaluateLODChild(const Vec3& eye_local,const float bias) const;
|
||||
virtual int evaluateLODChild(const Vec3& eye_local,float bias) const;
|
||||
|
||||
protected :
|
||||
virtual ~LOD() {}
|
||||
|
@ -64,10 +64,10 @@ class SG_EXPORT Light : public StateAttribute
|
||||
}
|
||||
|
||||
/** Set which OpenGL light to operate on.*/
|
||||
void setLightNum(const int num) { _lightnum = num; }
|
||||
void setLightNum(int num) { _lightnum = num; }
|
||||
|
||||
/** Get which OpenGL light this osg::Light operates on.*/
|
||||
const int getLightNum() const { return _lightnum; }
|
||||
int getLightNum() const { return _lightnum; }
|
||||
|
||||
/** Set the ambient component of the light. */
|
||||
inline void setAmbient( const Vec4& ambient ) { _ambient = ambient; }
|
||||
@ -100,34 +100,34 @@ class SG_EXPORT Light : public StateAttribute
|
||||
inline const Vec3& getDirection() const { return _direction; }
|
||||
|
||||
/** Set the constant attenuation of the light. */
|
||||
inline void setConstantAttenuation( const float constant_attenuation ) { _constant_attenuation = constant_attenuation; }
|
||||
inline void setConstantAttenuation( float constant_attenuation ) { _constant_attenuation = constant_attenuation; }
|
||||
|
||||
/** Get the constant attenuation of the light. */
|
||||
inline const float getConstantAttenuation() const { return _constant_attenuation; }
|
||||
inline float getConstantAttenuation() const { return _constant_attenuation; }
|
||||
|
||||
/** Set the linear attenuation of the light. */
|
||||
inline void setLinearAttenuation ( const float linear_attenuation ) { _linear_attenuation = linear_attenuation; }
|
||||
inline void setLinearAttenuation ( float linear_attenuation ) { _linear_attenuation = linear_attenuation; }
|
||||
|
||||
/** Get the linear attenuation of the light. */
|
||||
inline const float getLinearAttenuation () const { return _linear_attenuation; }
|
||||
inline float getLinearAttenuation () const { return _linear_attenuation; }
|
||||
|
||||
/** Set the quadratic attenuation of the light. */
|
||||
inline void setQuadraticAttenuation ( const float quadratic_attenuation ) { _quadratic_attenuation = quadratic_attenuation; }
|
||||
inline void setQuadraticAttenuation ( float quadratic_attenuation ) { _quadratic_attenuation = quadratic_attenuation; }
|
||||
|
||||
/** Get the quadratic attenuation of the light. */
|
||||
inline const float getQuadraticAttenuation() const { return _quadratic_attenuation; }
|
||||
inline float getQuadraticAttenuation() const { return _quadratic_attenuation; }
|
||||
|
||||
/** Set the spot exponent of the light. */
|
||||
inline void setSpotExponent( const float spot_exponent ) { _spot_exponent = spot_exponent; }
|
||||
inline void setSpotExponent( float spot_exponent ) { _spot_exponent = spot_exponent; }
|
||||
|
||||
/** Get the spot exponent of the light. */
|
||||
inline const float getSpotExponent() const { return _spot_exponent; }
|
||||
inline float getSpotExponent() const { return _spot_exponent; }
|
||||
|
||||
/** Set the spot cutoff of the light. */
|
||||
inline void setSpotCutoff( const float spot_cutoff ) { _spot_cutoff = spot_cutoff; }
|
||||
inline void setSpotCutoff( float spot_cutoff ) { _spot_cutoff = spot_cutoff; }
|
||||
|
||||
/** Get the spot cutoff of the light. */
|
||||
inline const float getSpotCutoff() const { return _spot_cutoff; }
|
||||
inline float getSpotCutoff() const { return _spot_cutoff; }
|
||||
|
||||
/**
|
||||
* Capture the lighting settings of the current OpenGL state
|
||||
|
@ -54,16 +54,16 @@ class SG_EXPORT LightModel : public StateAttribute
|
||||
SINGLE_COLOR
|
||||
};
|
||||
|
||||
void setColorControl(const ColorControl cc) { _colorControl = cc; }
|
||||
inline const ColorControl getColorControl() const { return _colorControl; }
|
||||
void setColorControl(ColorControl cc) { _colorControl = cc; }
|
||||
inline ColorControl getColorControl() const { return _colorControl; }
|
||||
|
||||
|
||||
void setLocalViewer(const bool localViewer) { _localViewer=localViewer; }
|
||||
inline const bool getLocalViewer() const { return _localViewer; }
|
||||
void setLocalViewer(bool localViewer) { _localViewer=localViewer; }
|
||||
inline bool getLocalViewer() const { return _localViewer; }
|
||||
|
||||
|
||||
void setTwoSided(const bool twoSided) { _twoSided = twoSided; }
|
||||
inline const bool getTwoSided() const { return _twoSided; }
|
||||
void setTwoSided(bool twoSided) { _twoSided = twoSided; }
|
||||
inline bool getTwoSided() const { return _twoSided; }
|
||||
|
||||
|
||||
|
||||
|
@ -35,16 +35,16 @@ class SG_EXPORT LightSource : public Group
|
||||
inline const StateAttribute* getLight() const { return _light.get(); }
|
||||
|
||||
/** Set the GLModes on StateSet associated with the LightSource.*/
|
||||
void setStateSetModes(StateSet&,const StateAttribute::GLModeValue) const;
|
||||
void setStateSetModes(StateSet&,StateAttribute::GLModeValue) const;
|
||||
|
||||
/** Set up the local StateSet */
|
||||
void setLocalStateSetModes(const StateAttribute::GLModeValue=StateAttribute::ON);
|
||||
void setLocalStateSetModes(StateAttribute::GLModeValue=StateAttribute::ON);
|
||||
|
||||
protected:
|
||||
|
||||
virtual ~LightSource();
|
||||
|
||||
virtual const bool computeBound() const;
|
||||
virtual bool computeBound() const;
|
||||
|
||||
StateAttribute::GLModeValue _value;
|
||||
ref_ptr<StateAttribute> _light;
|
||||
|
@ -30,22 +30,22 @@ class SG_EXPORT LineSegment : public Referenced
|
||||
inline Vec3& end() { return _e; }
|
||||
inline const Vec3& end() const { return _e; }
|
||||
|
||||
inline const bool valid() const { return _s.valid() && _e.valid() && _s!=_e; }
|
||||
inline bool valid() const { return _s.valid() && _e.valid() && _s!=_e; }
|
||||
|
||||
/** return true if segment intersects BoundingBox.*/
|
||||
const bool intersect(const BoundingBox& bb) const;
|
||||
bool intersect(const BoundingBox& bb) const;
|
||||
|
||||
/** return true if segment intersects BoundingBox and return the intersection ratio's.*/
|
||||
const bool intersect(const BoundingBox& bb,float& r1,float& r2) const;
|
||||
bool intersect(const BoundingBox& bb,float& r1,float& r2) const;
|
||||
|
||||
/** return true if segment intersects BoundingSphere.*/
|
||||
const bool intersect(const BoundingSphere& bs) const;
|
||||
bool intersect(const BoundingSphere& bs) const;
|
||||
|
||||
/** return true if segment intersects BoundingSphere and return the intersection ratio's.*/
|
||||
const bool intersect(const BoundingSphere& bs,float& r1,float& r2) const;
|
||||
bool intersect(const BoundingSphere& bs,float& r1,float& r2) const;
|
||||
|
||||
/** return true if segment intersects triangle and set ratio long segment. */
|
||||
const bool intersect(const Vec3& v1,const Vec3& v2,const Vec3& v3,float& r);
|
||||
bool intersect(const Vec3& v1,const Vec3& v2,const Vec3& v3,float& r);
|
||||
|
||||
/** post multiply a segment by matrix.*/
|
||||
inline void mult(const LineSegment& seg,const Matrix& m) { _s = seg._s*m; _e = seg._e*m; }
|
||||
@ -56,7 +56,7 @@ class SG_EXPORT LineSegment : public Referenced
|
||||
|
||||
virtual ~LineSegment() {}
|
||||
|
||||
static const bool intersectAndClip(Vec3& s,Vec3& e,const BoundingBox& bb);
|
||||
static bool intersectAndClip(Vec3& s,Vec3& e,const BoundingBox& bb);
|
||||
|
||||
Vec3 _s;
|
||||
Vec3 _e;
|
||||
|
@ -42,11 +42,11 @@ class SG_EXPORT LineStipple : public StateAttribute
|
||||
modes.push_back(GL_LINE_STIPPLE);
|
||||
}
|
||||
|
||||
void setFactor(const int factor);
|
||||
inline const int getFactor() const { return _factor; }
|
||||
void setFactor(GLint factor);
|
||||
inline GLint getFactor() const { return _factor; }
|
||||
|
||||
void setPattern(const unsigned short pattern);
|
||||
inline const unsigned short getPattern() const { return _pattern; }
|
||||
void setPattern(GLushort pattern);
|
||||
inline GLushort getPattern() const { return _pattern; }
|
||||
|
||||
virtual void apply(State& state) const;
|
||||
|
||||
@ -55,8 +55,8 @@ class SG_EXPORT LineStipple : public StateAttribute
|
||||
|
||||
virtual ~LineStipple();
|
||||
|
||||
int _factor;
|
||||
unsigned short _pattern;
|
||||
GLint _factor;
|
||||
GLushort _pattern;
|
||||
|
||||
};
|
||||
|
||||
|
@ -36,8 +36,9 @@ class SG_EXPORT LineWidth : public StateAttribute
|
||||
return 0; // passed all the above comparison macro's, must be equal.
|
||||
}
|
||||
|
||||
void setWidth(const float width);
|
||||
inline const float getWidth() const { return _width; }
|
||||
void setWidth(float width);
|
||||
|
||||
inline float getWidth() const { return _width; }
|
||||
|
||||
virtual void apply(State& state) const;
|
||||
|
||||
|
@ -93,47 +93,47 @@ class SG_EXPORT Material : public StateAttribute
|
||||
OFF
|
||||
};
|
||||
|
||||
inline void setColorMode(const ColorMode mode) { _colorMode = mode; }
|
||||
inline const ColorMode getColorMode() const { return _colorMode; }
|
||||
inline void setColorMode(ColorMode mode) { _colorMode = mode; }
|
||||
inline ColorMode getColorMode() const { return _colorMode; }
|
||||
|
||||
void setAmbient( const Face face, const Vec4& ambient );
|
||||
const Vec4& getAmbient(const Face face) const;
|
||||
inline const bool getAmbientFrontAndBack() const { return _ambientFrontAndBack; }
|
||||
void setAmbient( Face face, const Vec4& ambient );
|
||||
const Vec4& getAmbient(Face face) const;
|
||||
inline bool getAmbientFrontAndBack() const { return _ambientFrontAndBack; }
|
||||
|
||||
void setDiffuse( const Face face, const Vec4& diffuse );
|
||||
const Vec4& getDiffuse(const Face face) const;
|
||||
inline const bool getDiffuseFrontAndBack() const { return _diffuseFrontAndBack; }
|
||||
void setDiffuse( Face face, const Vec4& diffuse );
|
||||
const Vec4& getDiffuse(Face face) const;
|
||||
inline bool getDiffuseFrontAndBack() const { return _diffuseFrontAndBack; }
|
||||
|
||||
/** Set specular value of specified face(s) of the material,
|
||||
* valid specular[0..3] range is 0.0 to 1.0.*/
|
||||
void setSpecular( const Face face, const Vec4& specular );
|
||||
void setSpecular( Face face, const Vec4& specular );
|
||||
/** Get the specular value for specified face.*/
|
||||
const Vec4& getSpecular(const Face face) const;
|
||||
const Vec4& getSpecular(Face face) const;
|
||||
/** Get the whether specular values are equal for front and back faces.*/
|
||||
inline const bool getSpecularFrontAndBack() const { return _specularFrontAndBack; }
|
||||
inline bool getSpecularFrontAndBack() const { return _specularFrontAndBack; }
|
||||
|
||||
/** Set emission value of specified face(s) of the material,
|
||||
* valid emmison[0..3] range is 0.0 to 1.0.*/
|
||||
void setEmission( const Face face, const Vec4& emission );
|
||||
void setEmission( Face face, const Vec4& emission );
|
||||
/** Get the emmsion value for specified face.*/
|
||||
const Vec4& getEmission(const Face face) const;
|
||||
const Vec4& getEmission(Face face) const;
|
||||
/** Get the whether emission values are equal for front and back faces.*/
|
||||
inline const bool getEmissionFrontAndBack() const { return _emissionFrontAndBack; }
|
||||
inline bool getEmissionFrontAndBack() const { return _emissionFrontAndBack; }
|
||||
|
||||
/** Set shininess of specified face(s) of the material, valid shininess range is 0.0 to 128.0.*/
|
||||
void setShininess( const Face face, float shininess );
|
||||
void setShininess(Face face, float shininess );
|
||||
/** Get the shininess value for specified face.*/
|
||||
const float getShininess(const Face face) const;
|
||||
float getShininess(Face face) const;
|
||||
/** Get the whether shininess values are equal for front and back faces.*/
|
||||
inline const bool getShininessFrontAndBack() const { return _shininessFrontAndBack; }
|
||||
inline bool getShininessFrontAndBack() const { return _shininessFrontAndBack; }
|
||||
|
||||
/** Set the alpha value of ambient,diffuse,specular and emission colors,
|
||||
* of specified face, to 1-transparency. Valid transparency range is 0.0 to 1.0.*/
|
||||
void setTransparency(const Face face,float trans);
|
||||
void setTransparency(Face face,float trans);
|
||||
|
||||
/** Set the alpha value of ambient,diffuse,specular and emission colors.
|
||||
* Valid transparency range is 0.0 to 1.0.*/
|
||||
void setAlpha(const Face face,float alpha);
|
||||
void setAlpha(Face face,float alpha);
|
||||
|
||||
protected :
|
||||
|
||||
|
@ -50,8 +50,8 @@ class SG_EXPORT Matrix : public Object
|
||||
inline float& operator()(int row, int col) { return _mat[row][col]; }
|
||||
inline float operator()(int row, int col) const { return _mat[row][col]; }
|
||||
|
||||
inline const bool valid() const { return !isNaN(); }
|
||||
inline const bool isNaN() const { return osg::isNaN(_mat[0][0]) || osg::isNaN(_mat[0][1]) || osg::isNaN(_mat[0][2]) || osg::isNaN(_mat[0][3]) ||
|
||||
inline bool valid() const { return !isNaN(); }
|
||||
inline bool isNaN() const { return osg::isNaN(_mat[0][0]) || osg::isNaN(_mat[0][1]) || osg::isNaN(_mat[0][2]) || osg::isNaN(_mat[0][3]) ||
|
||||
osg::isNaN(_mat[1][0]) || osg::isNaN(_mat[1][1]) || osg::isNaN(_mat[1][2]) || osg::isNaN(_mat[1][3]) ||
|
||||
osg::isNaN(_mat[2][0]) || osg::isNaN(_mat[2][1]) || osg::isNaN(_mat[2][2]) || osg::isNaN(_mat[2][3]) ||
|
||||
osg::isNaN(_mat[3][0]) || osg::isNaN(_mat[3][1]) || osg::isNaN(_mat[3][2]) || osg::isNaN(_mat[3][3]); }
|
||||
@ -61,13 +61,13 @@ class SG_EXPORT Matrix : public Object
|
||||
inline Matrix& operator = (const Matrix& other)
|
||||
{
|
||||
if( &other == this ) return *this;
|
||||
std::copy((const float*)other._mat,(const float*)other._mat+16,(float*)(_mat));
|
||||
std::copy((float*)other._mat,(float*)other._mat+16,(float*)(_mat));
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline void set(const Matrix& other)
|
||||
{
|
||||
std::copy((const float*)other._mat,(const float*)other._mat+16,(float*)(_mat));
|
||||
std::copy((float*)other._mat,(float*)other._mat+16,(float*)(_mat));
|
||||
}
|
||||
|
||||
inline void set(float const * const ptr)
|
||||
@ -81,7 +81,7 @@ class SG_EXPORT Matrix : public Object
|
||||
float a30, float a31, float a32, float a33);
|
||||
|
||||
float * ptr() { return (float *)_mat; }
|
||||
const float * ptr() const { return (const float *)_mat; }
|
||||
float * ptr() const { return (float *)_mat; }
|
||||
|
||||
void makeIdentity();
|
||||
|
||||
@ -102,26 +102,26 @@ class SG_EXPORT Matrix : public Object
|
||||
|
||||
|
||||
/** Set to a orthographic projection. See glOrtho for further details.*/
|
||||
void makeOrtho(const double left, const double right,
|
||||
const double bottom, const double top,
|
||||
const double zNear, const double zFar);
|
||||
void makeOrtho(double left, double right,
|
||||
double bottom, double top,
|
||||
double zNear, double zFar);
|
||||
|
||||
/** Set to a 2D orthographic projection. See glOrtho2D for further details.*/
|
||||
inline void makeOrtho2D(const double left, const double right,
|
||||
const double bottom, const double top)
|
||||
inline void makeOrtho2D(double left, double right,
|
||||
double bottom, double top)
|
||||
{
|
||||
makeOrtho(left,right,bottom,top,-1.0,1.0);
|
||||
}
|
||||
|
||||
/** Set to a perspective projection. See glFrustum for further details.*/
|
||||
void makeFrustum(const double left, const double right,
|
||||
const double bottom, const double top,
|
||||
const double zNear, const double zFar);
|
||||
void makeFrustum(double left, double right,
|
||||
double bottom, double top,
|
||||
double zNear, double zFar);
|
||||
|
||||
/** Set to a symmetrical perspective projection, See gluPerspective for further details.
|
||||
* Aspect ratio is defined as width/height.*/
|
||||
void makePerspective(const double fovy,const double aspectRatio,
|
||||
const double zNear, const double zFar);
|
||||
void makePerspective(double fovy,double aspectRatio,
|
||||
double zNear, double zFar);
|
||||
|
||||
/** Set to the position and orientation as per a camera, using the same convention as gluLookAt. */
|
||||
void makeLookAt(const Vec3& eye,const Vec3& center,const Vec3& up);
|
||||
@ -145,23 +145,23 @@ class SG_EXPORT Matrix : public Object
|
||||
inline static Matrix inverse( const Matrix& matrix);
|
||||
|
||||
/** Create a orthographic projection. See glOrtho for further details.*/
|
||||
inline static Matrix ortho(const double left, const double right,
|
||||
const double bottom, const double top,
|
||||
const double zNear, const double zFar);
|
||||
inline static Matrix ortho(double left, double right,
|
||||
double bottom, double top,
|
||||
double zNear, double zFar);
|
||||
|
||||
/** Create a 2D orthographic projection. See glOrtho for further details.*/
|
||||
inline static Matrix ortho2D(const double left, const double right,
|
||||
const double bottom, const double top);
|
||||
inline static Matrix ortho2D(double left, double right,
|
||||
double bottom, double top);
|
||||
|
||||
/** Create a perspective projection. See glFrustum for further details.*/
|
||||
inline static Matrix frustum(const double left, const double right,
|
||||
const double bottom, const double top,
|
||||
const double zNear, const double zFar);
|
||||
inline static Matrix frustum(double left, double right,
|
||||
double bottom, double top,
|
||||
double zNear, double zFar);
|
||||
|
||||
/** Create a symmetrical perspective projection, See gluPerspective for further details.
|
||||
* Aspect ratio is defined as width/height.*/
|
||||
inline static Matrix perspective(const double fovy,const double aspectRatio,
|
||||
const double zNear, const double zFar);
|
||||
inline static Matrix perspective(double fovy,double aspectRatio,
|
||||
double zNear, double zFar);
|
||||
|
||||
/** Create the position and orientation as per a camera, using the same convention as gluLookAt. */
|
||||
inline static Matrix lookAt(const Vec3& eye,const Vec3& center,const Vec3& up);
|
||||
@ -310,34 +310,34 @@ inline Matrix Matrix::inverse( const Matrix& matrix)
|
||||
return m;
|
||||
}
|
||||
|
||||
inline Matrix Matrix::ortho(const double left, const double right,
|
||||
const double bottom, const double top,
|
||||
const double zNear, const double zFar)
|
||||
inline Matrix Matrix::ortho(double left, double right,
|
||||
double bottom, double top,
|
||||
double zNear, double zFar)
|
||||
{
|
||||
Matrix m;
|
||||
m.makeOrtho(left,right,bottom,top,zNear,zFar);
|
||||
return m;
|
||||
}
|
||||
|
||||
inline Matrix Matrix::ortho2D(const double left, const double right,
|
||||
const double bottom, const double top)
|
||||
inline Matrix Matrix::ortho2D(double left, double right,
|
||||
double bottom, double top)
|
||||
{
|
||||
Matrix m;
|
||||
m.makeOrtho2D(left,right,bottom,top);
|
||||
return m;
|
||||
}
|
||||
|
||||
inline Matrix Matrix::frustum(const double left, const double right,
|
||||
const double bottom, const double top,
|
||||
const double zNear, const double zFar)
|
||||
inline Matrix Matrix::frustum(double left, double right,
|
||||
double bottom, double top,
|
||||
double zNear, double zFar)
|
||||
{
|
||||
Matrix m;
|
||||
m.makeFrustum(left,right,bottom,top,zNear,zFar);
|
||||
return m;
|
||||
}
|
||||
|
||||
inline Matrix Matrix::perspective(const double fovy,const double aspectRatio,
|
||||
const double zNear, const double zFar)
|
||||
inline Matrix Matrix::perspective(double fovy,double aspectRatio,
|
||||
double zNear, double zFar)
|
||||
{
|
||||
Matrix m;
|
||||
m.makePerspective(fovy,aspectRatio,zNear,zFar);
|
||||
|
@ -51,7 +51,7 @@ class SG_EXPORT MatrixTransform : public Transform
|
||||
return *_inverse;
|
||||
}
|
||||
|
||||
virtual const bool computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const
|
||||
virtual bool computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const
|
||||
{
|
||||
if (_referenceFrame==RELATIVE_TO_PARENTS)
|
||||
{
|
||||
@ -64,7 +64,7 @@ class SG_EXPORT MatrixTransform : public Transform
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual const bool computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor*) const
|
||||
virtual bool computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor*) const
|
||||
{
|
||||
const Matrix& inverse = getInverseMatrix();
|
||||
|
||||
|
@ -74,7 +74,7 @@ SG_EXPORT extern const unsigned int m_alloc_free;
|
||||
// Used by the macros
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
SG_EXPORT extern void m_setOwner(const char *file, const unsigned int line);
|
||||
SG_EXPORT extern void m_setOwner(const char *file, unsigned int line);
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------
|
||||
// Allocation breakpoints
|
||||
@ -88,12 +88,12 @@ SG_EXPORT extern void m_breakOnAllocation(unsigned int count);
|
||||
// The meat of the memory tracking software
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
SG_EXPORT extern void *m_allocator(const char *sourceFile, const unsigned int sourceLine,
|
||||
const unsigned int allocationType, const size_t reportedSize);
|
||||
SG_EXPORT extern void *m_reallocator(const char *sourceFile, const unsigned int sourceLine,
|
||||
const unsigned int reallocationType, const size_t reportedSize, void *reportedAddress);
|
||||
SG_EXPORT extern void m_deallocator(const char *sourceFile, const unsigned int sourceLine,
|
||||
const unsigned int deallocationType, const void *reportedAddress);
|
||||
SG_EXPORT extern void *m_allocator(const char *sourceFile, unsigned int sourceLine,
|
||||
unsigned int allocationType, const size_t reportedSize);
|
||||
SG_EXPORT extern void *m_reallocator(const char *sourceFile, unsigned int sourceLine,
|
||||
unsigned int reallocationType, const size_t reportedSize, void *reportedAddress);
|
||||
SG_EXPORT extern void m_deallocator(const char *sourceFile, unsigned int sourceLine,
|
||||
unsigned int deallocationType, const void *reportedAddress);
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------
|
||||
// Utilitarian functions
|
||||
@ -115,7 +115,7 @@ SG_EXPORT extern unsigned int m_calcAllUnused();
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
SG_EXPORT extern void m_dumpAllocUnit(const sAllocUnit *allocUnit, const char *prefix = "");
|
||||
SG_EXPORT extern void m_dumpMemoryReport(const char *filename = "memreport.log", const bool overwrite = true);
|
||||
SG_EXPORT extern void m_dumpMemoryReport(const char *filename = "memreport.log", bool overwrite = true);
|
||||
SG_EXPORT extern sMStats m_getMemoryStatistics();
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -86,19 +86,19 @@ class SG_EXPORT Node : public Object
|
||||
* prevent modification of the parent list.*/
|
||||
inline ParentList getParents() { return _parents; }
|
||||
|
||||
inline Group* getParent(const unsigned int i) { return _parents[i]; }
|
||||
inline Group* getParent(unsigned int i) { return _parents[i]; }
|
||||
/**
|
||||
* Get a single const parent of node.
|
||||
* @param i index of the parent to get.
|
||||
* @return the parent i.
|
||||
*/
|
||||
inline const Group* getParent(const unsigned int i) const { return _parents[i]; }
|
||||
inline const Group* getParent(unsigned int i) const { return _parents[i]; }
|
||||
|
||||
/**
|
||||
* Get the number of parents of node.
|
||||
* @return the number of parents of this node.
|
||||
*/
|
||||
inline const unsigned int getNumParents() const { return _parents.size(); }
|
||||
inline unsigned int getNumParents() const { return _parents.size(); }
|
||||
|
||||
|
||||
/** Set app node callback, called during app traversal. */
|
||||
@ -112,7 +112,7 @@ class SG_EXPORT Node : public Object
|
||||
|
||||
/** Get the number of Children of this node which require App traversal,
|
||||
* since they have an AppCallback attached to them or their children.*/
|
||||
inline const int getNumChildrenRequiringAppTraversal() const { return _numChildrenRequiringAppTraversal; }
|
||||
inline unsigned int getNumChildrenRequiringAppTraversal() const { return _numChildrenRequiringAppTraversal; }
|
||||
|
||||
|
||||
/** Set cull node callback, called during cull traversal. */
|
||||
@ -127,32 +127,32 @@ class SG_EXPORT Node : public Object
|
||||
/** Set the view frustum/small feature culling of this node to be active or inactive.
|
||||
* The default value to true for _cullingActive. Used a guide
|
||||
* to the cull traversal.*/
|
||||
void setCullingActive(const bool active);
|
||||
void setCullingActive(bool active);
|
||||
|
||||
/** Get the view frustum/small feature _cullingActive flag for this node. Used a guide
|
||||
* to the cull traversal.*/
|
||||
inline const bool getCullingActive() const { return _cullingActive; }
|
||||
inline bool getCullingActive() const { return _cullingActive; }
|
||||
|
||||
/** Get the number of Children of this node which have culling disabled.*/
|
||||
inline const int getNumChildrenWithCullingDisabled() const { return _numChildrenWithCullingDisabled; }
|
||||
inline unsigned int getNumChildrenWithCullingDisabled() const { return _numChildrenWithCullingDisabled; }
|
||||
|
||||
/** Return true if this node can be culled by view frustum, occlusion or small feature culling during the cull traversal.
|
||||
* note, return true only if no children have culling disabled, and the local _cullingActive flag is true.*/
|
||||
inline const bool isCullingActive() const { return _numChildrenWithCullingDisabled==0 && _cullingActive && _bsphere.valid(); }
|
||||
inline bool isCullingActive() const { return _numChildrenWithCullingDisabled==0 && _cullingActive && _bsphere.valid(); }
|
||||
|
||||
/** Get the number of Children of this node which are or have OccluderNode's.*/
|
||||
inline const int getNumChildrenWithOccluderNodes() const { return _numChildrenWithOccluderNodes; }
|
||||
inline unsigned int getNumChildrenWithOccluderNodes() const { return _numChildrenWithOccluderNodes; }
|
||||
|
||||
|
||||
/** return true if this node is an OccluderNode or the subgraph below this node are OccluderNodes.*/
|
||||
const bool containsOccluderNodes() const;
|
||||
bool containsOccluderNodes() const;
|
||||
|
||||
|
||||
typedef unsigned int NodeMask;
|
||||
/** Set the node mask. Note, node mask is will be replaced by TraversalMask.*/
|
||||
inline void setNodeMask(const NodeMask nm) { _nodeMask = nm; }
|
||||
inline void setNodeMask(NodeMask nm) { _nodeMask = nm; }
|
||||
/** Get the node Mask. Note, node mask is will be replaced by TraversalMask.*/
|
||||
inline const NodeMask getNodeMask() const { return _nodeMask; }
|
||||
inline NodeMask getNodeMask() const { return _nodeMask; }
|
||||
|
||||
|
||||
|
||||
@ -164,28 +164,28 @@ class SG_EXPORT Node : public Object
|
||||
/** Get the description list of the const node.*/
|
||||
inline DescriptionList& getDescriptions() { return _descriptions; }
|
||||
/** Get a single const description of the const node.*/
|
||||
inline const std::string& getDescription(const int i) const { return _descriptions[i]; }
|
||||
inline const std::string& getDescription(unsigned int i) const { return _descriptions[i]; }
|
||||
/** Get a single description of the node.*/
|
||||
inline std::string& getDescription(const int i) { return _descriptions[i]; }
|
||||
inline std::string& getDescription(unsigned int i) { return _descriptions[i]; }
|
||||
/** Get the number of descriptions of the node.*/
|
||||
inline const int getNumDescriptions() const { return _descriptions.size(); }
|
||||
inline unsigned int getNumDescriptions() const { return _descriptions.size(); }
|
||||
/** Add a description string to the node.*/
|
||||
void addDescription(const std::string& desc) { _descriptions.push_back(desc); }
|
||||
|
||||
|
||||
/** set the node's StateSet.*/
|
||||
inline void setStateSet(osg::StateSet* dstate) { _dstate = dstate; }
|
||||
inline void setStateSet(osg::StateSet* dstate) { _stateset = dstate; }
|
||||
|
||||
/** return the node's StateSet, if one does not already exist create it
|
||||
* set the node and return the newly created StateSet. This ensures
|
||||
* that a valid StateSet is always returned and can be used directly.*/
|
||||
osg::StateSet* getValidStateSet();
|
||||
osg::StateSet* getOrCreateStateSet();
|
||||
|
||||
/** return the node's StateSet. returns NULL if a stateset is not attached.*/
|
||||
inline osg::StateSet* getStateSet() { return _dstate.get(); }
|
||||
inline osg::StateSet* getStateSet() { return _stateset.get(); }
|
||||
|
||||
/** return the node's const StateSet. returns NULL if a stateset is not attached.*/
|
||||
inline const osg::StateSet* getStateSet() const { return _dstate.get(); }
|
||||
inline const osg::StateSet* getStateSet() const { return _stateset.get(); }
|
||||
|
||||
/** get the bounding sphere of node.
|
||||
Using lazy evaluation computes the bounding sphere if it is 'dirty'.*/
|
||||
@ -216,7 +216,7 @@ class SG_EXPORT Node : public Object
|
||||
/** Compute the bounding sphere around Node's geometry or children.
|
||||
This method is automatically called by getBound() when the bounding
|
||||
sphere has been marked dirty via dirtyBound().*/
|
||||
virtual const bool computeBound() const;
|
||||
virtual bool computeBound() const;
|
||||
|
||||
mutable BoundingSphere _bsphere;
|
||||
mutable bool _bsphere_computed;
|
||||
@ -231,23 +231,23 @@ class SG_EXPORT Node : public Object
|
||||
friend class osg::Drawable;
|
||||
|
||||
ref_ptr<NodeCallback> _appCallback;
|
||||
int _numChildrenRequiringAppTraversal;
|
||||
void setNumChildrenRequiringAppTraversal(const int num);
|
||||
unsigned int _numChildrenRequiringAppTraversal;
|
||||
void setNumChildrenRequiringAppTraversal(unsigned int num);
|
||||
|
||||
ref_ptr<NodeCallback> _cullCallback;
|
||||
|
||||
bool _cullingActive;
|
||||
int _numChildrenWithCullingDisabled;
|
||||
void setNumChildrenWithCullingDisabled(const int num);
|
||||
unsigned int _numChildrenWithCullingDisabled;
|
||||
void setNumChildrenWithCullingDisabled(unsigned int num);
|
||||
|
||||
int _numChildrenWithOccluderNodes;
|
||||
void setNumChildrenWithOccluderNodes(const int num);
|
||||
unsigned int _numChildrenWithOccluderNodes;
|
||||
void setNumChildrenWithOccluderNodes(unsigned int num);
|
||||
|
||||
NodeMask _nodeMask;
|
||||
|
||||
DescriptionList _descriptions;
|
||||
|
||||
ref_ptr<StateSet> _dstate;
|
||||
ref_ptr<StateSet> _stateset;
|
||||
|
||||
};
|
||||
|
||||
|
@ -85,10 +85,10 @@ class SG_EXPORT NodeVisitor : public Referenced
|
||||
inline VisitorType getVisitorType() const { return _visitorType; }
|
||||
|
||||
/** Set the traversal number. Typically used to denote the frame count.*/
|
||||
inline void setTraversalNumber(const int fn) { _traversalNumber = fn; }
|
||||
inline void setTraversalNumber(int fn) { _traversalNumber = fn; }
|
||||
|
||||
/** Get the traversal number. Typically used to denote the frame count.*/
|
||||
inline const int getTraversalNumber() const { return _traversalNumber; }
|
||||
inline int getTraversalNumber() const { return _traversalNumber; }
|
||||
|
||||
/** Set the FrameStamp that this traversal is assoicated with.*/
|
||||
inline void setFrameStamp(FrameStamp* fs) { _frameStamp = fs; }
|
||||
@ -127,7 +127,7 @@ class SG_EXPORT NodeVisitor : public Referenced
|
||||
* with the bit or between NodeVistor::_nodeMaskOverride and the Node::_nodeMask.
|
||||
* default values for _traversalMask is 0xffffffff, _nodeMaskOverride is 0x0,
|
||||
* and osg::Node::_nodeMask is 0xffffffff. */
|
||||
inline const bool validNodeMask(const osg::Node& node) const
|
||||
inline bool validNodeMask(const osg::Node& node) const
|
||||
{
|
||||
return (getTraversalMask() & (getNodeMaskOverride() | node.getNodeMask()))!=0;
|
||||
}
|
||||
@ -184,10 +184,10 @@ class SG_EXPORT NodeVisitor : public Referenced
|
||||
const NodePath& getNodePath() const { return _nodePath; }
|
||||
|
||||
/** Get the Local To World Matrix from the NodePath for specified Transform::Mode, and u.*/
|
||||
const bool getLocalToWorldMatrix(Matrix& matrix, Node* node);
|
||||
bool getLocalToWorldMatrix(Matrix& matrix, Node* node);
|
||||
|
||||
/** Get the World To Local Matrix from the NodePath for specified Transform::Mode.*/
|
||||
const bool getWorldToLocalMatrix(Matrix& matrix, Node* node);
|
||||
bool getWorldToLocalMatrix(Matrix& matrix, Node* node);
|
||||
|
||||
|
||||
virtual void apply(Node& node) { traverse(node);}
|
||||
|
@ -42,7 +42,7 @@ class SG_EXPORT OccluderNode : public Group
|
||||
virtual ~OccluderNode() {}
|
||||
|
||||
/** Override's Group's computeBound.*/
|
||||
virtual const bool computeBound() const;
|
||||
virtual bool computeBound() const;
|
||||
|
||||
ref_ptr<ConvexPlanarOccluder> _occluder;
|
||||
};
|
||||
|
@ -24,9 +24,9 @@ class SG_EXPORT Plane
|
||||
|
||||
inline Plane():_fv(0.0f,0.0f,0.0f,0.0f) { _lowerBBCorner = 0; _upperBBCorner = 0; }
|
||||
inline Plane(const Plane& pl):_fv(pl._fv) { calculateUpperLowerBBCorners(); }
|
||||
inline Plane(const float a,const float b,const float c,const float d):_fv(a,b,c,d) { calculateUpperLowerBBCorners(); }
|
||||
inline Plane(float a,float b,float c,float d):_fv(a,b,c,d) { calculateUpperLowerBBCorners(); }
|
||||
inline Plane(const Vec4& vec):_fv(vec) { calculateUpperLowerBBCorners(); }
|
||||
inline Plane(const Vec3& norm,const float d):_fv(norm[0],norm[1],norm[2],d) { calculateUpperLowerBBCorners(); }
|
||||
inline Plane(const Vec3& norm,float d):_fv(norm[0],norm[1],norm[2],d) { calculateUpperLowerBBCorners(); }
|
||||
inline Plane(const Vec3& v1, const Vec3& v2, const Vec3& v3) { set(v1,v2,v3); calculateUpperLowerBBCorners(); }
|
||||
|
||||
inline Plane& operator = (const Plane& pl)
|
||||
@ -39,9 +39,9 @@ class SG_EXPORT Plane
|
||||
}
|
||||
|
||||
inline void set(const Plane& pl) { _fv = pl._fv; calculateUpperLowerBBCorners(); }
|
||||
inline void set(const float a,const float b,const float c,const float d) { _fv.set(a,b,c,d); calculateUpperLowerBBCorners(); }
|
||||
inline void set(float a,float b,float c,float d) { _fv.set(a,b,c,d); calculateUpperLowerBBCorners(); }
|
||||
inline void set(const Vec4& vec) { _fv = vec; calculateUpperLowerBBCorners(); }
|
||||
inline void set(const Vec3& norm,const float d) { _fv.set(norm[0],norm[1],norm[2],d); calculateUpperLowerBBCorners(); }
|
||||
inline void set(const Vec3& norm,float d) { _fv.set(norm[0],norm[1],norm[2],d); calculateUpperLowerBBCorners(); }
|
||||
inline void set(const Vec3& v1, const Vec3& v2, const Vec3& v3)
|
||||
{
|
||||
osg::Vec3 norm = (v2-v1)^(v3-v2);
|
||||
@ -78,20 +78,20 @@ class SG_EXPORT Plane
|
||||
|
||||
}
|
||||
|
||||
inline const bool valid() const { return _fv[0]==0.0f && _fv[1]==0.0f && _fv[2]==0.0f; }
|
||||
inline bool valid() const { return _fv[0]==0.0f && _fv[1]==0.0f && _fv[2]==0.0f; }
|
||||
|
||||
inline Vec4& asVec4() { return _fv; }
|
||||
|
||||
inline const Vec4& asVec4() const { return _fv; }
|
||||
|
||||
inline float& operator [] (const int i) { return _fv[i]; }
|
||||
inline float operator [] (const int i) const { return _fv[i]; }
|
||||
inline float& operator [] (unsigned int i) { return _fv[i]; }
|
||||
inline float operator [] (unsigned int i) const { return _fv[i]; }
|
||||
|
||||
|
||||
inline osg::Vec3 getNormal() { return osg::Vec3(_fv[0],_fv[1],_fv[2]); }
|
||||
|
||||
/** calculate the distance between a point and the plane.*/
|
||||
inline const float distance(const osg::Vec3& v) const
|
||||
inline float distance(const osg::Vec3& v) const
|
||||
{
|
||||
return _fv[0]*v.x()+
|
||||
_fv[1]*v.y()+
|
||||
@ -103,7 +103,7 @@ class SG_EXPORT Plane
|
||||
return 1 if the bs is completely above plane,
|
||||
return 0 if the bs intersects the plane,
|
||||
return -1 if the bs is completely below the plane.*/
|
||||
inline const int intersect(const std::vector<Vec3>& vertices) const
|
||||
inline int intersect(const std::vector<Vec3>& vertices) const
|
||||
{
|
||||
if (vertices.empty()) return -1;
|
||||
|
||||
@ -132,7 +132,7 @@ class SG_EXPORT Plane
|
||||
return 1 if the bs is completely above plane,
|
||||
return 0 if the bs intersects the plane,
|
||||
return -1 if the bs is completely below the plane.*/
|
||||
inline const int intersect(const BoundingSphere& bs) const
|
||||
inline int intersect(const BoundingSphere& bs) const
|
||||
{
|
||||
float d = distance(bs.center());
|
||||
|
||||
@ -146,7 +146,7 @@ class SG_EXPORT Plane
|
||||
return 1 if the bs is completely above plane,
|
||||
return 0 if the bs intersects the plane,
|
||||
return -1 if the bs is completely below the plane.*/
|
||||
inline const int intersect(const BoundingBox& bb) const
|
||||
inline int intersect(const BoundingBox& bb) const
|
||||
{
|
||||
// if lowest point above plane than all above.
|
||||
if (distance(bb.corner(_lowerBBCorner))>0.0f) return 1;
|
||||
|
@ -46,11 +46,11 @@ class SG_EXPORT Point : public StateAttribute
|
||||
modes.push_back(GL_POINT_SMOOTH);
|
||||
}
|
||||
|
||||
void setSize(const float size);
|
||||
inline const float getSize() const { return _size; }
|
||||
void setSize(float size);
|
||||
inline float getSize() const { return _size; }
|
||||
|
||||
void setFadeThresholdSize(const float fadeThresholdSize);
|
||||
inline const float getFadeThresholdSize() const { return _fadeThresholdSize; }
|
||||
void setFadeThresholdSize(float fadeThresholdSize);
|
||||
inline float getFadeThresholdSize() const { return _fadeThresholdSize; }
|
||||
|
||||
void setDistanceAttenuation(const Vec3& distanceAttenuation);
|
||||
inline const Vec3& getDistanceAttenuation() const { return _distanceAttenuation; }
|
||||
|
@ -54,11 +54,11 @@ class SG_EXPORT PolygonMode : public StateAttribute
|
||||
FILL = GL_FILL
|
||||
};
|
||||
|
||||
void setMode(const Face face,const Mode mode);
|
||||
void setMode(Face face,Mode mode);
|
||||
|
||||
const Mode getMode(const Face face) const;
|
||||
Mode getMode(Face face) const;
|
||||
|
||||
inline const bool getFrontAndBack() const { return _frontAndBack; }
|
||||
inline bool getFrontAndBack() const { return _frontAndBack; }
|
||||
|
||||
virtual void apply(State& state) const;
|
||||
|
||||
|
@ -45,11 +45,11 @@ class SG_EXPORT PolygonOffset : public StateAttribute
|
||||
modes.push_back(GL_POLYGON_OFFSET_POINT);
|
||||
}
|
||||
|
||||
inline void setFactor(const float factor) { _factor = factor; }
|
||||
inline const float getFactor() const { return _factor; }
|
||||
inline void setFactor(float factor) { _factor = factor; }
|
||||
inline float getFactor() const { return _factor; }
|
||||
|
||||
inline void setUnits(const float units) { _units = units; }
|
||||
inline const float getUnits() const { return _units; }
|
||||
inline void setUnits(float units) { _units = units; }
|
||||
inline float getUnits() const { return _units; }
|
||||
|
||||
virtual void apply(State& state) const;
|
||||
|
||||
|
@ -122,7 +122,7 @@ class SG_EXPORT Polytope
|
||||
}
|
||||
|
||||
/** Check whether a vertex is contained with clipping set.*/
|
||||
inline const bool contains(const osg::Vec3& v) const
|
||||
inline bool contains(const osg::Vec3& v) const
|
||||
{
|
||||
if (!_maskStack.back()) return true;
|
||||
|
||||
@ -138,7 +138,7 @@ class SG_EXPORT Polytope
|
||||
}
|
||||
|
||||
/** Check whether any part of vertex list is contained with clipping set.*/
|
||||
inline const bool contains(const std::vector<Vec3>& vertices)
|
||||
inline bool contains(const std::vector<Vec3>& vertices)
|
||||
{
|
||||
if (!_maskStack.back()) return true;
|
||||
|
||||
@ -165,7 +165,7 @@ class SG_EXPORT Polytope
|
||||
modifying the mask to turn off planes which wouldn't contribute to clipping
|
||||
of any internal objects. This feature is used in osgUtil::CullVisitor
|
||||
to prevent redundant plane checking.*/
|
||||
inline const bool contains(const osg::BoundingSphere& bs)
|
||||
inline bool contains(const osg::BoundingSphere& bs)
|
||||
{
|
||||
if (!_maskStack.back()) return true;
|
||||
|
||||
@ -192,7 +192,7 @@ class SG_EXPORT Polytope
|
||||
modifying the mask to turn off planes which wouldn't contribute to clipping
|
||||
of any internal objects. This feature is used in osgUtil::CullVisitor
|
||||
to prevent redundant plane checking.*/
|
||||
inline const bool contains(const osg::BoundingBox& bb)
|
||||
inline bool contains(const osg::BoundingBox& bb)
|
||||
{
|
||||
if (!_maskStack.back()) return true;
|
||||
|
||||
@ -215,7 +215,7 @@ class SG_EXPORT Polytope
|
||||
}
|
||||
|
||||
/** Check whether all of vertex list is contained with clipping set.*/
|
||||
inline const bool containsAllOf(const std::vector<Vec3>& vertices)
|
||||
inline bool containsAllOf(const std::vector<Vec3>& vertices)
|
||||
{
|
||||
if (!_maskStack.back()) return false;
|
||||
|
||||
@ -238,7 +238,7 @@ class SG_EXPORT Polytope
|
||||
}
|
||||
|
||||
/** Check whether the entire bounding sphere is contained within clipping set.*/
|
||||
inline const bool containsAllOf(const osg::BoundingSphere& bs)
|
||||
inline bool containsAllOf(const osg::BoundingSphere& bs)
|
||||
{
|
||||
if (!_maskStack.back()) return false;
|
||||
|
||||
@ -261,7 +261,7 @@ class SG_EXPORT Polytope
|
||||
}
|
||||
|
||||
/** Check whether the entire bounding box is contained within clipping set.*/
|
||||
inline const bool containsAllOf(const osg::BoundingBox& bb)
|
||||
inline bool containsAllOf(const osg::BoundingBox& bb)
|
||||
{
|
||||
if (!_maskStack.back()) return false;
|
||||
|
||||
|
@ -45,9 +45,9 @@ class SG_EXPORT PositionAttitudeTransform : public Transform
|
||||
const Vec3& getPivotPoint() const { return _pivotPoint; }
|
||||
|
||||
|
||||
virtual const bool computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor* nv) const;
|
||||
virtual bool computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor* nv) const;
|
||||
|
||||
virtual const bool computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor* nv) const;
|
||||
virtual bool computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor* nv) const;
|
||||
|
||||
|
||||
/** Callback which can be attached to a PositionAttitudeTransform
|
||||
|
@ -51,7 +51,7 @@ class SG_EXPORT Quat
|
||||
return Vec3(_fv[0], _fv[1], _fv[2]);
|
||||
}
|
||||
|
||||
inline void set(const float x, const float y, const float z, const float w)
|
||||
inline void set(float x, float y, float z, float w)
|
||||
{
|
||||
_fv.set(x,y,z,w);
|
||||
}
|
||||
@ -82,13 +82,13 @@ class SG_EXPORT Quat
|
||||
Also define methods for conjugate and the multiplicative inverse.
|
||||
------------------------------------------------------------- */
|
||||
/// Multiply by scalar
|
||||
inline const Quat operator * (const float rhs) const
|
||||
inline const Quat operator * (float rhs) const
|
||||
{
|
||||
return Quat(_fv*rhs);
|
||||
}
|
||||
|
||||
/// Unary multiply by scalar
|
||||
inline Quat& operator *= (const float rhs)
|
||||
inline Quat& operator *= (float rhs)
|
||||
{
|
||||
_fv*=rhs;
|
||||
return *this; // enable nesting
|
||||
@ -119,13 +119,13 @@ class SG_EXPORT Quat
|
||||
}
|
||||
|
||||
/// Divide by scalar
|
||||
inline const Quat operator / (const float& rhs) const
|
||||
inline const Quat operator / (float rhs) const
|
||||
{
|
||||
return Quat(_fv/rhs);
|
||||
}
|
||||
|
||||
/// Unary divide by scalar
|
||||
inline Quat& operator /= (const float& rhs)
|
||||
inline Quat& operator /= (float rhs)
|
||||
{
|
||||
_fv/=rhs;
|
||||
return *this;
|
||||
@ -178,19 +178,19 @@ class SG_EXPORT Quat
|
||||
}
|
||||
|
||||
/// Length of the quaternion = sqrt( vec . vec )
|
||||
const float length() const
|
||||
float length() const
|
||||
{
|
||||
return _fv.length();
|
||||
}
|
||||
|
||||
/// Length of the quaternion = vec . vec
|
||||
const float length2() const
|
||||
float length2() const
|
||||
{
|
||||
return _fv.length2();
|
||||
}
|
||||
|
||||
/// Conjugate
|
||||
inline const Quat conj () const
|
||||
inline Quat conj () const
|
||||
{
|
||||
return Quat( -_fv[0], -_fv[1], -_fv[2], _fv[3] );
|
||||
}
|
||||
@ -211,9 +211,9 @@ class SG_EXPORT Quat
|
||||
|
||||
Not inlined - see the Quat.cpp file for implementation
|
||||
-------------------------------------------------------- */
|
||||
void makeRotate ( const float angle,
|
||||
const float x, const float y, const float z );
|
||||
void makeRotate ( const float angle, const Vec3& vec );
|
||||
void makeRotate ( float angle,
|
||||
float x, float y, float z );
|
||||
void makeRotate ( float angle, const Vec3& vec );
|
||||
|
||||
void makeRotate ( float angle1, const Vec3& axis1,
|
||||
float angle2, const Vec3& axis2,
|
||||
@ -233,7 +233,7 @@ class SG_EXPORT Quat
|
||||
|
||||
/** Spherical Linear Interpolation.
|
||||
As t goes from 0 to 1, the Quat object goes from "from" to "to". */
|
||||
void slerp ( const float t, const Quat& from, const Quat& to);
|
||||
void slerp ( float t, const Quat& from, const Quat& to);
|
||||
|
||||
/** Set quaternion to be equivalent to specified matrix.*/
|
||||
void set( const Matrix& m );
|
||||
|
@ -38,7 +38,7 @@ class SG_EXPORT Referenced
|
||||
inline void unref_nodelete() const { --_refCount; }
|
||||
|
||||
/** return the number pointers currently referencing this object. */
|
||||
inline const int referenceCount() const { return _refCount; }
|
||||
inline int referenceCount() const { return _refCount; }
|
||||
|
||||
protected:
|
||||
virtual ~Referenced();
|
||||
|
@ -31,7 +31,7 @@ public :
|
||||
void setTime(int frame, float t);
|
||||
|
||||
/** Get time for child */
|
||||
const float getTime(int frame) const;
|
||||
float getTime(int frame) const;
|
||||
|
||||
/** Interval modes */
|
||||
enum LoopMode
|
||||
|
@ -131,14 +131,14 @@ class SG_EXPORT State : public Referenced
|
||||
|
||||
|
||||
/** Apply an OpenGL mode if required. */
|
||||
inline const bool applyMode(const StateAttribute::GLMode mode,const bool enabled)
|
||||
inline bool applyMode(StateAttribute::GLMode mode,bool enabled)
|
||||
{
|
||||
ModeStack& ms = _modeMap[mode];
|
||||
ms.changed = true;
|
||||
return applyMode(mode,enabled,ms);
|
||||
}
|
||||
|
||||
inline const bool applyTextureMode(unsigned int unit, const StateAttribute::GLMode mode,const bool enabled)
|
||||
inline bool applyTextureMode(unsigned int unit, StateAttribute::GLMode mode,bool enabled)
|
||||
{
|
||||
ModeMap& modeMap = getOrCreateTextureModeMap(unit);
|
||||
ModeStack& ms = modeMap[mode];
|
||||
@ -147,14 +147,14 @@ class SG_EXPORT State : public Referenced
|
||||
}
|
||||
|
||||
/** Apply an attribute if required. */
|
||||
inline const bool applyAttribute(const StateAttribute* attribute)
|
||||
inline bool applyAttribute(const StateAttribute* attribute)
|
||||
{
|
||||
AttributeStack& as = _attributeMap[attribute->getType()];
|
||||
as.changed = true;
|
||||
return applyAttribute(attribute,as);
|
||||
}
|
||||
|
||||
inline const bool applyTextureAttribute(unsigned int unit, const StateAttribute* attribute)
|
||||
inline bool applyTextureAttribute(unsigned int unit, const StateAttribute* attribute)
|
||||
{
|
||||
AttributeMap& attributeMap = getOrCreateTextureAttributeMap(unit);
|
||||
AttributeStack& as = attributeMap[attribute->getType()];
|
||||
@ -163,11 +163,11 @@ class SG_EXPORT State : public Referenced
|
||||
}
|
||||
|
||||
/** Mode has been set externally, update state to reflect this setting.*/
|
||||
void haveAppliedMode(const StateAttribute::GLMode mode,const StateAttribute::GLModeValue value);
|
||||
void haveAppliedMode(StateAttribute::GLMode mode,StateAttribute::GLModeValue value);
|
||||
|
||||
/** Mode has been set externally, therefore dirty the associated mode in osg::State
|
||||
* so it is applied on next call to osg::State::apply(..)*/
|
||||
void haveAppliedMode(const StateAttribute::GLMode mode);
|
||||
void haveAppliedMode(StateAttribute::GLMode mode);
|
||||
|
||||
/** Attribute has been applied externally, update state to reflect this setting.*/
|
||||
void haveAppliedAttribute(const StateAttribute* attribute);
|
||||
@ -179,22 +179,22 @@ class SG_EXPORT State : public Referenced
|
||||
* then use the have_applied(attribute) method as this will the osg::State to
|
||||
* track the current state more accuratly and enable lazy state updating such
|
||||
* that only changed state will be applied.*/
|
||||
void haveAppliedAttribute(const StateAttribute::Type type);
|
||||
void haveAppliedAttribute(StateAttribute::Type type);
|
||||
|
||||
/** Get whether the current specified mode is enabled (true) or disabled (false).*/
|
||||
const bool getLastAppliedMode(const StateAttribute::GLMode mode) const;
|
||||
bool getLastAppliedMode(StateAttribute::GLMode mode) const;
|
||||
|
||||
/** Get the current specified attribute, return NULL is one has not yet been applied.*/
|
||||
const StateAttribute* getLastAppliedAttribute(const StateAttribute::Type type) const;
|
||||
const StateAttribute* getLastAppliedAttribute(StateAttribute::Type type) const;
|
||||
|
||||
|
||||
|
||||
/** texture Mode has been set externally, update state to reflect this setting.*/
|
||||
void haveAppliedTextureMode(unsigned int unit, const StateAttribute::GLMode mode,const StateAttribute::GLModeValue value);
|
||||
void haveAppliedTextureMode(unsigned int unit, StateAttribute::GLMode mode,StateAttribute::GLModeValue value);
|
||||
|
||||
/** texture Mode has been set externally, therefore dirty the associated mode in osg::State
|
||||
* so it is applied on next call to osg::State::apply(..)*/
|
||||
void haveAppliedTextureMode(unsigned int unit, const StateAttribute::GLMode mode);
|
||||
void haveAppliedTextureMode(unsigned int unit, StateAttribute::GLMode mode);
|
||||
|
||||
/** texture Attribute has been applied externally, update state to reflect this setting.*/
|
||||
void haveAppliedTextureAttribute(unsigned int unit, const StateAttribute* attribute);
|
||||
@ -206,13 +206,13 @@ class SG_EXPORT State : public Referenced
|
||||
* then use the have_applied(attribute) method as this will the osg::State to
|
||||
* track the current state more accuratly and enable lazy state updating such
|
||||
* that only changed state will be applied.*/
|
||||
void haveAppliedTextureAttribute(unsigned int unit, const StateAttribute::Type type);
|
||||
void haveAppliedTextureAttribute(unsigned int unit, StateAttribute::Type type);
|
||||
|
||||
/** Get whether the current specified texture mode is enabled (true) or disabled (false).*/
|
||||
const bool getLastAppliedTextureMode(unsigned int unit, const StateAttribute::GLMode mode) const;
|
||||
bool getLastAppliedTextureMode(unsigned int unit, StateAttribute::GLMode mode) const;
|
||||
|
||||
/** Get the current specified texture attribute, return NULL is one has not yet been applied.*/
|
||||
const StateAttribute* getLastAppliedTextureAttribute(unsigned int unit, const StateAttribute::Type type) const;
|
||||
const StateAttribute* getLastAppliedTextureAttribute(unsigned int unit, StateAttribute::Type type) const;
|
||||
|
||||
|
||||
|
||||
@ -437,7 +437,7 @@ class SG_EXPORT State : public Referenced
|
||||
inline void setContextID(unsigned int contextID) { _contextID=contextID; }
|
||||
|
||||
/** Get the current OpenGL context unique ID.*/
|
||||
inline const unsigned int getContextID() const { return _contextID; }
|
||||
inline unsigned int getContextID() const { return _contextID; }
|
||||
|
||||
|
||||
/** Set the frame stamp for the current frame.*/
|
||||
@ -506,7 +506,7 @@ class SG_EXPORT State : public Referenced
|
||||
};
|
||||
|
||||
/** apply an OpenGL mode if required, passing in mode, enable flag and appropriate mode stack */
|
||||
inline const bool applyMode(const StateAttribute::GLMode mode,const bool enabled,ModeStack& ms)
|
||||
inline bool applyMode(StateAttribute::GLMode mode,bool enabled,ModeStack& ms)
|
||||
{
|
||||
if (ms.last_applied_value != enabled)
|
||||
{
|
||||
@ -522,7 +522,7 @@ class SG_EXPORT State : public Referenced
|
||||
}
|
||||
|
||||
/** apply an attribute if required, passing in attribute and appropriate attribute stack */
|
||||
inline const bool applyAttribute(const StateAttribute* attribute,AttributeStack& as)
|
||||
inline bool applyAttribute(const StateAttribute* attribute,AttributeStack& as)
|
||||
{
|
||||
if (as.last_applied_attribute != attribute)
|
||||
{
|
||||
@ -536,7 +536,7 @@ class SG_EXPORT State : public Referenced
|
||||
return false;
|
||||
}
|
||||
|
||||
inline const bool applyGlobalDefaultAttribute(AttributeStack& as)
|
||||
inline bool applyGlobalDefaultAttribute(AttributeStack& as)
|
||||
{
|
||||
if (as.last_applied_attribute != as.global_default_attribute.get())
|
||||
{
|
||||
@ -614,12 +614,12 @@ class SG_EXPORT State : public Referenced
|
||||
inline void applyModeMap(ModeMap& modeMap);
|
||||
inline void applyAttributeMap(AttributeMap& attributeMap);
|
||||
|
||||
void haveAppliedMode(ModeMap& modeMap,const StateAttribute::GLMode mode,const StateAttribute::GLModeValue value);
|
||||
void haveAppliedMode(ModeMap& modeMap,const StateAttribute::GLMode mode);
|
||||
void haveAppliedMode(ModeMap& modeMap,StateAttribute::GLMode mode,StateAttribute::GLModeValue value);
|
||||
void haveAppliedMode(ModeMap& modeMap,StateAttribute::GLMode mode);
|
||||
void haveAppliedAttribute(AttributeMap& attributeMap,const StateAttribute* attribute);
|
||||
void haveAppliedAttribute(AttributeMap& attributeMap,const StateAttribute::Type type);
|
||||
const bool getLastAppliedMode(const ModeMap& modeMap,const StateAttribute::GLMode mode) const;
|
||||
const StateAttribute* getLastAppliedAttribute(const AttributeMap& attributeMap,const StateAttribute::Type type) const;
|
||||
void haveAppliedAttribute(AttributeMap& attributeMap,StateAttribute::Type type);
|
||||
bool getLastAppliedMode(const ModeMap& modeMap,StateAttribute::GLMode mode) const;
|
||||
const StateAttribute* getLastAppliedAttribute(const AttributeMap& attributeMap,StateAttribute::Type type) const;
|
||||
|
||||
};
|
||||
|
||||
|
@ -29,7 +29,7 @@ class StateSet;
|
||||
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const name *>(obj)!=NULL; } \
|
||||
virtual const char* libraryName() const { return #library; } \
|
||||
virtual const char* className() const { return #name; } \
|
||||
virtual const Type getType() const { return type; }
|
||||
virtual Type getType() const { return type; }
|
||||
|
||||
/** COMPARE_StateAttribute_Types macro is a helper for implementing the StatateAtribute::compare(..) method.*/
|
||||
#define COMPARE_StateAttribute_Types(TYPE,rhs_attribute) \
|
||||
@ -178,7 +178,7 @@ class SG_EXPORT StateAttribute : public Object
|
||||
virtual const char* className() const { return "StateAttribute"; }
|
||||
|
||||
/** return the Type identifier of the attribute's class type.*/
|
||||
virtual const Type getType() const = 0;
|
||||
virtual Type getType() const = 0;
|
||||
|
||||
/** return true if StateAttribute is a type which controls texturing and needs to be issued w.r.t to specific texture unit.*/
|
||||
virtual bool isTextureAttribute() const { return false; }
|
||||
|
@ -59,14 +59,14 @@ class SG_EXPORT StateSet : public Object
|
||||
typedef std::map<StateAttribute::GLMode,StateAttribute::GLModeValue> ModeList;
|
||||
|
||||
/** set this StateSet to contain specified GLMode and value.*/
|
||||
void setMode(const StateAttribute::GLMode mode, const StateAttribute::GLModeValue value);
|
||||
void setMode(StateAttribute::GLMode mode, StateAttribute::GLModeValue value);
|
||||
/** set this StateSet to inherit specified GLMode type from parents.
|
||||
* has the effect of deleting any GlMode of specified type from StateSet.*/
|
||||
void setModeToInherit(const StateAttribute::GLMode mode);
|
||||
void setModeToInherit(StateAttribute::GLMode mode);
|
||||
|
||||
/** get specified GLModeValue for specified GLMode.
|
||||
* returns INHERIT if no GLModeValue is contained within StateSet.*/
|
||||
const StateAttribute::GLModeValue getMode(const StateAttribute::GLMode mode) const;
|
||||
StateAttribute::GLModeValue getMode(StateAttribute::GLMode mode) const;
|
||||
|
||||
/** return the list of all GLModes contained in this StateSet.*/
|
||||
inline ModeList& getModeList() { return _modeList; }
|
||||
@ -82,24 +82,24 @@ class SG_EXPORT StateSet : public Object
|
||||
typedef std::map<StateAttribute::Type,RefAttributePair> AttributeList;
|
||||
|
||||
/** set this StateSet to contain specified attribute and override flag.*/
|
||||
void setAttribute(StateAttribute *attribute, const StateAttribute::OverrideValue value=StateAttribute::OFF);
|
||||
void setAttribute(StateAttribute *attribute, StateAttribute::OverrideValue value=StateAttribute::OFF);
|
||||
/** set this StateSet to contain specified attribute and set the associated GLMode's to specified value.*/
|
||||
void setAttributeAndModes(StateAttribute *attribute, const StateAttribute::GLModeValue value=StateAttribute::ON);
|
||||
void setAttributeAndModes(StateAttribute *attribute, StateAttribute::GLModeValue value=StateAttribute::ON);
|
||||
/** set this StateSet to inherit specified attribute type from parents.
|
||||
* has the effect of deleting any state attributes of specified type from StateSet.*/
|
||||
void setAttributeToInherit(const StateAttribute::Type type);
|
||||
void setAttributeToInherit(StateAttribute::Type type);
|
||||
|
||||
/** get specified StateAttribute for specified type.
|
||||
* returns NULL if no type is contained within StateSet.*/
|
||||
StateAttribute* getAttribute(const StateAttribute::Type type);
|
||||
StateAttribute* getAttribute(StateAttribute::Type type);
|
||||
|
||||
/** get specified const StateAttribute for specified type.
|
||||
* returns NULL if no type is contained within const StateSet.*/
|
||||
const StateAttribute* getAttribute(const StateAttribute::Type type) const;
|
||||
const StateAttribute* getAttribute(StateAttribute::Type type) const;
|
||||
|
||||
/** get specified RefAttributePair for specified type.
|
||||
* returns NULL if no type is contained within StateSet.*/
|
||||
const RefAttributePair* getAttributePair(const StateAttribute::Type type) const;
|
||||
const RefAttributePair* getAttributePair(StateAttribute::Type type) const;
|
||||
|
||||
/** return the list of all StateAttributes contained in this StateSet.*/
|
||||
inline AttributeList& getAttributeList() { return _attributeList; }
|
||||
@ -112,14 +112,14 @@ class SG_EXPORT StateSet : public Object
|
||||
typedef std::vector<ModeList> TextureModeList;
|
||||
|
||||
/** set this StateSet to contain specified GLMode and value.*/
|
||||
void setTextureMode(unsigned int unit,const StateAttribute::GLMode mode, const StateAttribute::GLModeValue value);
|
||||
void setTextureMode(unsigned int unit,StateAttribute::GLMode mode, StateAttribute::GLModeValue value);
|
||||
/** set this StateSet to inherit specified GLMode type from parents.
|
||||
* has the effect of deleting any GlMode of specified type from StateSet.*/
|
||||
void setTextureModeToInherit(unsigned int unit,const StateAttribute::GLMode mode);
|
||||
void setTextureModeToInherit(unsigned int unit,StateAttribute::GLMode mode);
|
||||
|
||||
/** get specified GLModeValue for specified GLMode.
|
||||
* returns INHERIT if no GLModeValue is contained within StateSet.*/
|
||||
const StateAttribute::GLModeValue getTextureMode(unsigned int unit,const StateAttribute::GLMode mode) const;
|
||||
StateAttribute::GLModeValue getTextureMode(unsigned int unit,StateAttribute::GLMode mode) const;
|
||||
|
||||
/** return the list of all Texture related GLModes contained in this StateSet.*/
|
||||
inline TextureModeList& getTextureModeList() { return _textureModeList; }
|
||||
@ -131,24 +131,24 @@ class SG_EXPORT StateSet : public Object
|
||||
typedef std::vector<AttributeList> TextureAttributeList;
|
||||
|
||||
/** set this StateSet to contain specified attribute and override flag.*/
|
||||
void setTextureAttribute(unsigned int unit,StateAttribute *attribute, const StateAttribute::OverrideValue value=StateAttribute::OFF);
|
||||
void setTextureAttribute(unsigned int unit,StateAttribute *attribute, StateAttribute::OverrideValue value=StateAttribute::OFF);
|
||||
/** set this StateSet to contain specified attribute and set the associated GLMode's to specified value.*/
|
||||
void setTextureAttributeAndModes(unsigned int unit,StateAttribute *attribute, const StateAttribute::GLModeValue value=StateAttribute::ON);
|
||||
void setTextureAttributeAndModes(unsigned int unit,StateAttribute *attribute, StateAttribute::GLModeValue value=StateAttribute::ON);
|
||||
/** set this StateSet to inherit specified attribute type from parents.
|
||||
* has the effect of deleting any state attributes of specified type from StateSet.*/
|
||||
void setTextureAttributeToInherit(unsigned int unit,const StateAttribute::Type type);
|
||||
void setTextureAttributeToInherit(unsigned int unit,StateAttribute::Type type);
|
||||
|
||||
/** get specified Texture related StateAttribute for specified type.
|
||||
* returns NULL if no type is contained within StateSet.*/
|
||||
StateAttribute* getTextureAttribute(unsigned int unit,const StateAttribute::Type type);
|
||||
StateAttribute* getTextureAttribute(unsigned int unit,StateAttribute::Type type);
|
||||
|
||||
/** get specified Texture related const StateAttribute for specified type.
|
||||
* returns NULL if no type is contained within const StateSet.*/
|
||||
const StateAttribute* getTextureAttribute(unsigned int unit,const StateAttribute::Type type) const;
|
||||
const StateAttribute* getTextureAttribute(unsigned int unit,StateAttribute::Type type) const;
|
||||
|
||||
/** get specified Texture related RefAttributePair for specified type.
|
||||
* returns NULL if no type is contained within StateSet.*/
|
||||
const RefAttributePair* getTextureAttributePair(unsigned int unit,const StateAttribute::Type type) const;
|
||||
const RefAttributePair* getTextureAttributePair(unsigned int unit,StateAttribute::Type type) const;
|
||||
|
||||
/** return the list of all Texture related StateAttributes contained in this StateSet.*/
|
||||
inline TextureAttributeList& getTextureAttributeList() { return _textureAttributeList; }
|
||||
@ -157,9 +157,9 @@ class SG_EXPORT StateSet : public Object
|
||||
inline const TextureAttributeList& getTextureAttributeList() const { return _textureAttributeList; }
|
||||
|
||||
|
||||
void setAssociatedModes(const StateAttribute* attribute, const StateAttribute::GLModeValue value);
|
||||
void setAssociatedModes(const StateAttribute* attribute, StateAttribute::GLModeValue value);
|
||||
|
||||
void setAssociatedTextureModes(unsigned int unit,const StateAttribute* attribute, const StateAttribute::GLModeValue value);
|
||||
void setAssociatedTextureModes(unsigned int unit,const StateAttribute* attribute, StateAttribute::GLModeValue value);
|
||||
|
||||
enum RenderingHint
|
||||
{
|
||||
@ -173,10 +173,10 @@ class SG_EXPORT StateSet : public Object
|
||||
* draw bin to drop associated osg::Drawables in. For opaque
|
||||
* objects OPAQUE_BIN would typical used, which TRANSPARENT_BIN
|
||||
* should be used for objects which need to be depth sorted.*/
|
||||
void setRenderingHint(const int hint);
|
||||
void setRenderingHint(int hint);
|
||||
|
||||
/** get the RenderingHint of the StateSet.*/
|
||||
inline const int getRenderingHint() const { return _renderingHint; }
|
||||
inline int getRenderingHint() const { return _renderingHint; }
|
||||
|
||||
enum RenderBinMode
|
||||
{
|
||||
@ -187,19 +187,19 @@ class SG_EXPORT StateSet : public Object
|
||||
};
|
||||
|
||||
/** set the render bin details.*/
|
||||
void setRenderBinDetails(const int binNum,const std::string& binName,const RenderBinMode mode=USE_RENDERBIN_DETAILS);
|
||||
void setRenderBinDetails(int binNum,const std::string& binName,RenderBinMode mode=USE_RENDERBIN_DETAILS);
|
||||
|
||||
/** set the render bin details to inherit.*/
|
||||
void setRendingBinToInherit();
|
||||
|
||||
/** get the render bin mode.*/
|
||||
inline const RenderBinMode getRenderBinMode() const { return _binMode; }
|
||||
inline RenderBinMode getRenderBinMode() const { return _binMode; }
|
||||
|
||||
/** get whether the render bin details are set and should be used.*/
|
||||
inline const bool useRenderBinDetails() const { return _binMode!=INHERIT_RENDERBIN_DETAILS; }
|
||||
inline bool useRenderBinDetails() const { return _binMode!=INHERIT_RENDERBIN_DETAILS; }
|
||||
|
||||
/** get the render bin number.*/
|
||||
inline const int getBinNumber() const { return _binNum; }
|
||||
inline int getBinNumber() const { return _binNum; }
|
||||
|
||||
/** get the render bin name.*/
|
||||
inline const std::string& getBinName() const { return _binName; }
|
||||
@ -237,10 +237,10 @@ class SG_EXPORT StateSet : public Object
|
||||
int compareAttributePtrs(const AttributeList& lhs,const AttributeList& rhs);
|
||||
int compareAttributeContents(const AttributeList& lhs,const AttributeList& rhs);
|
||||
|
||||
void setMode(ModeList& modeList,const StateAttribute::GLMode mode, const StateAttribute::GLModeValue value);
|
||||
void setModeToInherit(ModeList& modeList,const StateAttribute::GLMode mode);
|
||||
const StateAttribute::GLModeValue getMode(const ModeList& modeList,const StateAttribute::GLMode mode) const;
|
||||
void setAssociatedModes(ModeList& modeList,const StateAttribute* attribute, const StateAttribute::GLModeValue value);
|
||||
void setMode(ModeList& modeList,StateAttribute::GLMode mode, StateAttribute::GLModeValue value);
|
||||
void setModeToInherit(ModeList& modeList,StateAttribute::GLMode mode);
|
||||
StateAttribute::GLModeValue getMode(const ModeList& modeList,StateAttribute::GLMode mode) const;
|
||||
void setAssociatedModes(ModeList& modeList,const StateAttribute* attribute, StateAttribute::GLModeValue value);
|
||||
|
||||
void setAttribute(AttributeList& attributeList,StateAttribute *attribute, const StateAttribute::OverrideValue value=StateAttribute::OFF);
|
||||
|
||||
|
@ -78,13 +78,13 @@ class Statistics : public osg::Referenced, public osg::Drawable::PrimitiveFuncto
|
||||
|
||||
void addDrawable() { numDrawables++;}
|
||||
void addMatrix() { nummat++;}
|
||||
void addLight(const int np) { nlights+=np;}
|
||||
void addImpostor(const int np) { nimpostor+= np; }
|
||||
inline const int getBins() { return nbins;}
|
||||
void setDepth(const int d) { depth=d; }
|
||||
void addBins(const int np) { nbins+= np; }
|
||||
void addLight(int np) { nlights+=np;}
|
||||
void addImpostor(int np) { nimpostor+= np; }
|
||||
inline int getBins() { return nbins;}
|
||||
void setDepth(int d) { depth=d; }
|
||||
void addBins(int np) { nbins+= np; }
|
||||
|
||||
void setBinNo(const int n) { _binNo=n;}
|
||||
void setBinNo(int n) { _binNo=n;}
|
||||
|
||||
public:
|
||||
|
||||
|
@ -78,7 +78,7 @@ class SG_EXPORT Stencil : public StateAttribute
|
||||
|
||||
inline const Function getFunction() const { return _func; }
|
||||
|
||||
inline const int getFunctionRef() const { return _funcRef; }
|
||||
inline int getFunctionRef() const { return _funcRef; }
|
||||
|
||||
inline const uint getFunctionMask() const { return _funcMask; }
|
||||
|
||||
|
@ -45,11 +45,11 @@ class SG_EXPORT Switch : public Group
|
||||
* (first child == number 0) or SwitchType. Invalid values
|
||||
* will be ignored.
|
||||
*/
|
||||
inline void setValue(const int value) { _value = value; }
|
||||
inline void setValue(int value) { _value = value; }
|
||||
/**
|
||||
* Returns the number of the active child Node or the SwitchType.
|
||||
*/
|
||||
inline const int getValue() const { return _value; }
|
||||
inline int getValue() const { return _value; }
|
||||
|
||||
protected :
|
||||
|
||||
|
@ -83,7 +83,7 @@ class SG_EXPORT Texture : public osg::StateAttribute
|
||||
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const Texture *>(obj)!=NULL; }
|
||||
virtual const char* libraryName() const { return "osg"; }
|
||||
virtual const char* className() const { return "Texture"; }
|
||||
virtual const Type getType() const { return TEXTURE; }
|
||||
virtual Type getType() const { return TEXTURE; }
|
||||
|
||||
virtual bool isTextureAttribute() const { return true; }
|
||||
|
||||
@ -102,16 +102,16 @@ class SG_EXPORT Texture : public osg::StateAttribute
|
||||
};
|
||||
|
||||
/** Set the texture wrap mode.*/
|
||||
void setWrap(const WrapParameter which, const WrapMode wrap);
|
||||
void setWrap(WrapParameter which, WrapMode wrap);
|
||||
/** Get the texture wrap mode.*/
|
||||
const WrapMode getWrap(const WrapParameter which) const;
|
||||
WrapMode getWrap(WrapParameter which) const;
|
||||
|
||||
|
||||
/** Sets the border color for this texture. Makes difference only if
|
||||
* wrap mode is CLAMP_TO_BORDER */
|
||||
void setBorderColor(const Vec4& color) { _borderColor = color; _texParametersDirty = true; }
|
||||
|
||||
const Vec4& borderColor(void) const { return _borderColor; }
|
||||
const Vec4& getBorderColor() const { return _borderColor; }
|
||||
|
||||
|
||||
enum FilterParameter {
|
||||
@ -130,10 +130,10 @@ class SG_EXPORT Texture : public osg::StateAttribute
|
||||
|
||||
|
||||
/** Set the texture filter mode.*/
|
||||
void setFilter(const FilterParameter which, const FilterMode filter);
|
||||
void setFilter(FilterParameter which, FilterMode filter);
|
||||
|
||||
/** Get the texture filter mode.*/
|
||||
const FilterMode getFilter(const FilterParameter which) const;
|
||||
FilterMode getFilter(FilterParameter which) const;
|
||||
|
||||
/** Set the maximum anisotropy value, default value is 1.0 for
|
||||
* no anisotropic filtering. If hardware does not support anisotropic
|
||||
@ -159,22 +159,22 @@ class SG_EXPORT Texture : public osg::StateAttribute
|
||||
* USE_S3TC_COMPRESSION the internalFormat is automatically selected,
|
||||
* and will overwrite the previous _internalFormat.
|
||||
*/
|
||||
inline void setInternalFormatMode(const InternalFormatMode mode) { _internalFormatMode = mode; }
|
||||
inline void setInternalFormatMode(InternalFormatMode mode) { _internalFormatMode = mode; }
|
||||
|
||||
/** Get the internal format mode.*/
|
||||
inline const InternalFormatMode getInternalFormatMode() const { return _internalFormatMode; }
|
||||
inline InternalFormatMode getInternalFormatMode() const { return _internalFormatMode; }
|
||||
|
||||
/** Set the internal format to use when creating OpenGL textures.
|
||||
* Also sets the internalFormatMode to USE_USER_DEFINED_FORMAT.
|
||||
*/
|
||||
inline void setInternalFormat(const int internalFormat)
|
||||
inline void setInternalFormat(GLint internalFormat)
|
||||
{
|
||||
_internalFormatMode = USE_USER_DEFINED_FORMAT;
|
||||
_internalFormat = internalFormat;
|
||||
}
|
||||
|
||||
/** Get the internal format to use when creating OpenGL textures.*/
|
||||
inline const int getInternalFormat() const { if (_internalFormat==0) computeInternalFormat(); return _internalFormat; }
|
||||
inline GLint getInternalFormat() const { if (_internalFormat==0) computeInternalFormat(); return _internalFormat; }
|
||||
|
||||
bool isCompressedInternalFormat() const;
|
||||
|
||||
|
@ -44,7 +44,7 @@ class SG_EXPORT Texture1D : public Texture
|
||||
|
||||
/** Set the texture width and height. If width or height are zero then
|
||||
* the repsective size value is calculated from the source image sizes. */
|
||||
inline void setTextureSize(const int width) const
|
||||
inline void setTextureSize(int width) const
|
||||
{
|
||||
_textureWidth = width;
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ class SG_EXPORT Texture2D : public Texture
|
||||
|
||||
/** Set the texture width and height. If width or height are zero then
|
||||
* the repsective size value is calculated from the source image sizes. */
|
||||
inline void setTextureSize(const int width, const int height) const
|
||||
inline void setTextureSize(int width, int height) const
|
||||
{
|
||||
_textureWidth = width;
|
||||
_textureHeight = height;
|
||||
|
@ -44,7 +44,7 @@ class SG_EXPORT Texture3D : public Texture
|
||||
|
||||
/** Set the texture width and height. If width or height are zero then
|
||||
* the repsective size value is calculated from the source image sizes. */
|
||||
inline void setTextureSize(const int width, const int height, const int depth) const
|
||||
inline void setTextureSize(int width, int height, int depth) const
|
||||
{
|
||||
_textureWidth = width;
|
||||
_textureHeight = height;
|
||||
|
@ -39,18 +39,18 @@ class SG_EXPORT TextureCubeMap : public Texture
|
||||
};
|
||||
|
||||
/** Set the texture image for specified face. */
|
||||
void setImage(const Face, Image* image);
|
||||
void setImage(Face, Image* image);
|
||||
|
||||
/** Get the texture image for specified face. */
|
||||
Image* getImage(const Face);
|
||||
Image* getImage(Face);
|
||||
|
||||
/** Get the const texture image for specified face. */
|
||||
const Image* getImage(const Face) const;
|
||||
const Image* getImage(Face) const;
|
||||
|
||||
|
||||
/** Set the texture width and height. If width or height are zero then
|
||||
* the repsective size value is calculated from the source image sizes. */
|
||||
inline void setTextureSize(const int width, const int height) const
|
||||
inline void setTextureSize(int width, int height) const
|
||||
{
|
||||
_textureWidth = width;
|
||||
_textureHeight = height;
|
||||
|
@ -64,7 +64,7 @@ class SG_EXPORT Transform : public Group
|
||||
* headlight LightSources or Heads up displays. */
|
||||
void setReferenceFrame(ReferenceFrame rf);
|
||||
|
||||
const ReferenceFrame getReferenceFrame() const { return _referenceFrame; }
|
||||
ReferenceFrame getReferenceFrame() const { return _referenceFrame; }
|
||||
|
||||
|
||||
/** Callback attached to an Transform to specify how to compute the
|
||||
@ -74,11 +74,11 @@ class SG_EXPORT Transform : public Group
|
||||
{
|
||||
/** Get the transformation matrix which moves from local coords
|
||||
* to world coords.*/
|
||||
virtual const bool computeLocalToWorldMatrix(Matrix& matrix,const Transform* transform, NodeVisitor* nv) const = 0;
|
||||
virtual bool computeLocalToWorldMatrix(Matrix& matrix,const Transform* transform, NodeVisitor* nv) const = 0;
|
||||
|
||||
/** Get the transformation matrix which moves from world coords
|
||||
* to local coords.*/
|
||||
virtual const bool computeWorldToLocalMatrix(Matrix& matrix,const Transform* transform, NodeVisitor* nv) const = 0;
|
||||
virtual bool computeWorldToLocalMatrix(Matrix& matrix,const Transform* transform, NodeVisitor* nv) const = 0;
|
||||
};
|
||||
|
||||
/** Set the ComputerTransfromCallback which allows users to attach
|
||||
@ -96,7 +96,7 @@ class SG_EXPORT Transform : public Group
|
||||
/** Get the transformation matrix which moves from local coords to
|
||||
* world coords.
|
||||
* Returns true if the Matrix passed in has been updated. */
|
||||
inline const bool getLocalToWorldMatrix(Matrix& matrix,NodeVisitor* nv) const
|
||||
inline bool getLocalToWorldMatrix(Matrix& matrix,NodeVisitor* nv) const
|
||||
{
|
||||
if (_computeTransformCallback.valid())
|
||||
return _computeTransformCallback->computeLocalToWorldMatrix(matrix,this,nv);
|
||||
@ -107,7 +107,7 @@ class SG_EXPORT Transform : public Group
|
||||
/** Get the transformation matrix which moves from world coords to
|
||||
* local coords.
|
||||
* Return true if the Matrix passed in has been updated. */
|
||||
inline const bool getWorldToLocalMatrix(Matrix& matrix,NodeVisitor* nv) const
|
||||
inline bool getWorldToLocalMatrix(Matrix& matrix,NodeVisitor* nv) const
|
||||
{
|
||||
if (_computeTransformCallback.valid())
|
||||
return _computeTransformCallback->computeWorldToLocalMatrix(matrix,this,nv);
|
||||
@ -115,7 +115,7 @@ class SG_EXPORT Transform : public Group
|
||||
return computeWorldToLocalMatrix(matrix,nv);
|
||||
}
|
||||
|
||||
virtual const bool computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const
|
||||
virtual bool computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const
|
||||
{
|
||||
if (_referenceFrame==RELATIVE_TO_PARENTS)
|
||||
{
|
||||
@ -128,7 +128,7 @@ class SG_EXPORT Transform : public Group
|
||||
}
|
||||
}
|
||||
|
||||
virtual const bool computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor*) const
|
||||
virtual bool computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor*) const
|
||||
{
|
||||
if (_referenceFrame==RELATIVE_TO_PARENTS)
|
||||
{
|
||||
@ -149,7 +149,7 @@ class SG_EXPORT Transform : public Group
|
||||
* There is no need to override in subclasses from osg::Transform
|
||||
* since this computeBound() uses the underlying matrix (calling
|
||||
* computeMatrix if required.) */
|
||||
virtual const bool computeBound() const;
|
||||
virtual bool computeBound() const;
|
||||
|
||||
|
||||
ref_ptr<ComputeTransformCallback> _computeTransformCallback;
|
||||
|
@ -32,11 +32,11 @@ class UByte4
|
||||
|
||||
unsigned char _v[4];
|
||||
|
||||
inline const bool operator == (const UByte4& v) const { return _v[0]==v._v[0] && _v[1]==v._v[1] && _v[2]==v._v[2] && _v[3]==v._v[3]; }
|
||||
inline bool operator == (const UByte4& v) const { return _v[0]==v._v[0] && _v[1]==v._v[1] && _v[2]==v._v[2] && _v[3]==v._v[3]; }
|
||||
|
||||
inline const bool operator != (const UByte4& v) const { return _v[0]!=v._v[0] || _v[1]!=v._v[1] || _v[2]!=v._v[2] || _v[3]!=v._v[3]; }
|
||||
inline bool operator != (const UByte4& v) const { return _v[0]!=v._v[0] || _v[1]!=v._v[1] || _v[2]!=v._v[2] || _v[3]!=v._v[3]; }
|
||||
|
||||
inline const bool operator < (const UByte4& v) const
|
||||
inline bool operator < (const UByte4& v) const
|
||||
{
|
||||
if (_v[0]<v._v[0]) return true;
|
||||
else if (_v[0]>v._v[0]) return false;
|
||||
@ -55,8 +55,8 @@ class UByte4
|
||||
_v[0]=r; _v[1]=g; _v[2]=b; _v[3]=a;
|
||||
}
|
||||
|
||||
inline unsigned char& operator [] (const int i) { return _v[i]; }
|
||||
inline unsigned char operator [] (const int i) const { return _v[i]; }
|
||||
inline unsigned char& operator [] (unsigned int i) { return _v[i]; }
|
||||
inline unsigned char operator [] (unsigned int i) const { return _v[i]; }
|
||||
|
||||
inline unsigned char& r() { return _v[0]; }
|
||||
inline unsigned char& g() { return _v[1]; }
|
||||
@ -69,7 +69,7 @@ class UByte4
|
||||
inline unsigned char a() const { return _v[3]; }
|
||||
|
||||
/// multiply by scalar
|
||||
inline UByte4 operator * (const float rhs) const
|
||||
inline UByte4 operator * (float rhs) const
|
||||
{
|
||||
UByte4 col(*this);
|
||||
col *= rhs;
|
||||
@ -77,7 +77,7 @@ class UByte4
|
||||
}
|
||||
|
||||
/// unary multiply by scalar
|
||||
inline UByte4& operator *= (const float rhs)
|
||||
inline UByte4& operator *= (float rhs)
|
||||
{
|
||||
_v[0]=(unsigned char)((float)_v[0]*rhs);
|
||||
_v[1]=(unsigned char)((float)_v[1]*rhs);
|
||||
@ -87,7 +87,7 @@ class UByte4
|
||||
}
|
||||
|
||||
/// divide by scalar
|
||||
inline UByte4 operator / (const float rhs) const
|
||||
inline UByte4 operator / (float rhs) const
|
||||
{
|
||||
UByte4 col(*this);
|
||||
col /= rhs;
|
||||
@ -95,7 +95,7 @@ class UByte4
|
||||
}
|
||||
|
||||
/// unary divide by scalar
|
||||
inline UByte4& operator /= (const float rhs)
|
||||
inline UByte4& operator /= (float rhs)
|
||||
{
|
||||
float div = 1.0f/rhs;
|
||||
*this *= div;
|
||||
|
@ -27,11 +27,11 @@ class Vec2
|
||||
|
||||
float _v[2];
|
||||
|
||||
inline const bool operator == (const Vec2& v) const { return _v[0]==v._v[0] && _v[1]==v._v[1]; }
|
||||
inline bool operator == (const Vec2& v) const { return _v[0]==v._v[0] && _v[1]==v._v[1]; }
|
||||
|
||||
inline const bool operator != (const Vec2& v) const { return _v[0]!=v._v[0] || _v[1]!=v._v[1]; }
|
||||
inline bool operator != (const Vec2& v) const { return _v[0]!=v._v[0] || _v[1]!=v._v[1]; }
|
||||
|
||||
inline const bool operator < (const Vec2& v) const
|
||||
inline bool operator < (const Vec2& v) const
|
||||
{
|
||||
if (_v[0]<v._v[0]) return true;
|
||||
else if (_v[0]>v._v[0]) return false;
|
||||
@ -44,31 +44,31 @@ class Vec2
|
||||
inline void set( float x, float y ) { _v[0]=x; _v[1]=y; }
|
||||
|
||||
inline float& operator [] (int i) { return _v[i]; }
|
||||
inline const float operator [] (int i) const { return _v[i]; }
|
||||
inline float operator [] (int i) const { return _v[i]; }
|
||||
|
||||
inline float& x() { return _v[0]; }
|
||||
inline float& y() { return _v[1]; }
|
||||
|
||||
inline const float x() const { return _v[0]; }
|
||||
inline const float y() const { return _v[1]; }
|
||||
inline float x() const { return _v[0]; }
|
||||
inline float y() const { return _v[1]; }
|
||||
|
||||
inline const bool valid() const { return !isNaN(); }
|
||||
inline const bool isNaN() const { return osg::isNaN(_v[0]) || osg::isNaN(_v[1]); }
|
||||
inline bool valid() const { return !isNaN(); }
|
||||
inline bool isNaN() const { return osg::isNaN(_v[0]) || osg::isNaN(_v[1]); }
|
||||
|
||||
/// dot product
|
||||
inline const float operator * (const Vec2& rhs) const
|
||||
inline float operator * (const Vec2& rhs) const
|
||||
{
|
||||
return _v[0]*rhs._v[0]+_v[1]*rhs._v[1];
|
||||
}
|
||||
|
||||
/// multiply by scalar
|
||||
inline const Vec2 operator * (const float& rhs) const
|
||||
inline const Vec2 operator * (float rhs) const
|
||||
{
|
||||
return Vec2(_v[0]*rhs, _v[1]*rhs);
|
||||
}
|
||||
|
||||
/// unary multiply by scalar
|
||||
inline Vec2& operator *= (const float& rhs)
|
||||
inline Vec2& operator *= (float rhs)
|
||||
{
|
||||
_v[0]*=rhs;
|
||||
_v[1]*=rhs;
|
||||
@ -76,13 +76,13 @@ class Vec2
|
||||
}
|
||||
|
||||
/// divide by scalar
|
||||
inline const Vec2 operator / (const float& rhs) const
|
||||
inline const Vec2 operator / (float rhs) const
|
||||
{
|
||||
return Vec2(_v[0]/rhs, _v[1]/rhs);
|
||||
}
|
||||
|
||||
/// unary divide by scalar
|
||||
inline Vec2& operator /= (const float& rhs)
|
||||
inline Vec2& operator /= (float rhs)
|
||||
{
|
||||
_v[0]/=rhs;
|
||||
_v[1]/=rhs;
|
||||
@ -125,20 +125,20 @@ class Vec2
|
||||
}
|
||||
|
||||
/// Length of the vector = sqrt( vec . vec )
|
||||
inline const float length() const
|
||||
inline float length() const
|
||||
{
|
||||
return sqrtf( _v[0]*_v[0] + _v[1]*_v[1] );
|
||||
}
|
||||
|
||||
/// Length squared of the vector = vec . vec
|
||||
inline const float length2( void ) const
|
||||
inline float length2( void ) const
|
||||
{
|
||||
return _v[0]*_v[0] + _v[1]*_v[1];
|
||||
}
|
||||
|
||||
/** normalize the vector so that it has length unity
|
||||
returns the previous length of the vector*/
|
||||
inline const float normalize()
|
||||
inline float normalize()
|
||||
{
|
||||
float norm = Vec2::length();
|
||||
_v[0] /= norm;
|
||||
|
@ -26,11 +26,11 @@ class Vec3
|
||||
|
||||
float _v[3];
|
||||
|
||||
inline const bool operator == (const Vec3& v) const { return _v[0]==v._v[0] && _v[1]==v._v[1] && _v[2]==v._v[2]; }
|
||||
inline bool operator == (const Vec3& v) const { return _v[0]==v._v[0] && _v[1]==v._v[1] && _v[2]==v._v[2]; }
|
||||
|
||||
inline const bool operator != (const Vec3& v) const { return _v[0]!=v._v[0] || _v[1]!=v._v[1] || _v[2]!=v._v[2]; }
|
||||
inline bool operator != (const Vec3& v) const { return _v[0]!=v._v[0] || _v[1]!=v._v[1] || _v[2]!=v._v[2]; }
|
||||
|
||||
inline const bool operator < (const Vec3& v) const
|
||||
inline bool operator < (const Vec3& v) const
|
||||
{
|
||||
if (_v[0]<v._v[0]) return true;
|
||||
else if (_v[0]>v._v[0]) return false;
|
||||
@ -48,18 +48,18 @@ class Vec3
|
||||
}
|
||||
|
||||
inline float& operator [] (int i) { return _v[i]; }
|
||||
inline const float operator [] (int i) const { return _v[i]; }
|
||||
inline float operator [] (int i) const { return _v[i]; }
|
||||
|
||||
inline float& x() { return _v[0]; }
|
||||
inline float& y() { return _v[1]; }
|
||||
inline float& z() { return _v[2]; }
|
||||
|
||||
inline const float x() const { return _v[0]; }
|
||||
inline const float y() const { return _v[1]; }
|
||||
inline const float z() const { return _v[2]; }
|
||||
inline float x() const { return _v[0]; }
|
||||
inline float y() const { return _v[1]; }
|
||||
inline float z() const { return _v[2]; }
|
||||
|
||||
inline const bool valid() const { return !isNaN(); }
|
||||
inline const bool isNaN() const { return osg::isNaN(_v[0]) || osg::isNaN(_v[1]) || osg::isNaN(_v[2]); }
|
||||
inline bool valid() const { return !isNaN(); }
|
||||
inline bool isNaN() const { return osg::isNaN(_v[0]) || osg::isNaN(_v[1]) || osg::isNaN(_v[2]); }
|
||||
|
||||
/// dot product
|
||||
inline float operator * (const Vec3& rhs) const
|
||||
@ -76,13 +76,13 @@ class Vec3
|
||||
}
|
||||
|
||||
/// multiply by scalar
|
||||
inline const Vec3 operator * (const float& rhs) const
|
||||
inline const Vec3 operator * (float rhs) const
|
||||
{
|
||||
return Vec3(_v[0]*rhs, _v[1]*rhs, _v[2]*rhs);
|
||||
}
|
||||
|
||||
/// unary multiply by scalar
|
||||
inline Vec3& operator *= (const float& rhs)
|
||||
inline Vec3& operator *= (float rhs)
|
||||
{
|
||||
_v[0]*=rhs;
|
||||
_v[1]*=rhs;
|
||||
@ -91,13 +91,13 @@ class Vec3
|
||||
}
|
||||
|
||||
/// divide by scalar
|
||||
inline const Vec3 operator / (const float& rhs) const
|
||||
inline const Vec3 operator / (float rhs) const
|
||||
{
|
||||
return Vec3(_v[0]/rhs, _v[1]/rhs, _v[2]/rhs);
|
||||
}
|
||||
|
||||
/// unary divide by scalar
|
||||
inline Vec3& operator /= (const float& rhs)
|
||||
inline Vec3& operator /= (float rhs)
|
||||
{
|
||||
_v[0]/=rhs;
|
||||
_v[1]/=rhs;
|
||||
@ -143,20 +143,20 @@ class Vec3
|
||||
}
|
||||
|
||||
/// Length of the vector = sqrt( vec . vec )
|
||||
inline const float length() const
|
||||
inline float length() const
|
||||
{
|
||||
return sqrtf( _v[0]*_v[0] + _v[1]*_v[1] + _v[2]*_v[2] );
|
||||
}
|
||||
|
||||
/// Length squared of the vector = vec . vec
|
||||
inline const float length2() const
|
||||
inline float length2() const
|
||||
{
|
||||
return _v[0]*_v[0] + _v[1]*_v[1] + _v[2]*_v[2];
|
||||
}
|
||||
|
||||
/** normalize the vector so that it has length unity
|
||||
returns the previous length of the vector*/
|
||||
inline const float normalize()
|
||||
inline float normalize()
|
||||
{
|
||||
float norm = Vec3::length();
|
||||
if (norm>0.0f)
|
||||
|
@ -44,11 +44,11 @@ class Vec4
|
||||
|
||||
float _v[4];
|
||||
|
||||
inline const bool operator == (const Vec4& v) const { return _v[0]==v._v[0] && _v[1]==v._v[1] && _v[2]==v._v[2] && _v[3]==v._v[3]; }
|
||||
inline bool operator == (const Vec4& v) const { return _v[0]==v._v[0] && _v[1]==v._v[1] && _v[2]==v._v[2] && _v[3]==v._v[3]; }
|
||||
|
||||
inline const bool operator != (const Vec4& v) const { return _v[0]!=v._v[0] || _v[1]!=v._v[1] || _v[2]!=v._v[2] || _v[3]!=v._v[3]; }
|
||||
inline bool operator != (const Vec4& v) const { return _v[0]!=v._v[0] || _v[1]!=v._v[1] || _v[2]!=v._v[2] || _v[3]!=v._v[3]; }
|
||||
|
||||
inline const bool operator < (const Vec4& v) const
|
||||
inline bool operator < (const Vec4& v) const
|
||||
{
|
||||
if (_v[0]<v._v[0]) return true;
|
||||
else if (_v[0]>v._v[0]) return false;
|
||||
@ -67,8 +67,8 @@ class Vec4
|
||||
_v[0]=x; _v[1]=y; _v[2]=z; _v[3]=w;
|
||||
}
|
||||
|
||||
inline float& operator [] (const int i) { return _v[i]; }
|
||||
inline float operator [] (const int i) const { return _v[i]; }
|
||||
inline float& operator [] (unsigned int i) { return _v[i]; }
|
||||
inline float operator [] (unsigned int i) const { return _v[i]; }
|
||||
|
||||
inline float& x() { return _v[0]; }
|
||||
inline float& y() { return _v[1]; }
|
||||
@ -88,7 +88,7 @@ class Vec4
|
||||
(unsigned long)clampTo((_v[3]*255.0f),0.0f,255.0f);
|
||||
}
|
||||
|
||||
inline const unsigned long asRGBA() const
|
||||
inline unsigned long asRGBA() const
|
||||
{
|
||||
return (unsigned long)clampTo((_v[3]*255.0f),0.0f,255.0f)<<24 |
|
||||
(unsigned long)clampTo((_v[2]*255.0f),0.0f,255.0f)<<16 |
|
||||
@ -96,8 +96,8 @@ class Vec4
|
||||
(unsigned long)clampTo((_v[0]*255.0f),0.0f,255.0f);
|
||||
}
|
||||
|
||||
inline const bool valid() const { return !isNaN(); }
|
||||
inline const bool isNaN() const { return osg::isNaN(_v[0]) || osg::isNaN(_v[1]) || osg::isNaN(_v[2]) || osg::isNaN(_v[3]); }
|
||||
inline bool valid() const { return !isNaN(); }
|
||||
inline bool isNaN() const { return osg::isNaN(_v[0]) || osg::isNaN(_v[1]) || osg::isNaN(_v[2]) || osg::isNaN(_v[3]); }
|
||||
|
||||
/// dot product
|
||||
inline float operator * (const Vec4& rhs) const
|
||||
@ -109,13 +109,13 @@ class Vec4
|
||||
}
|
||||
|
||||
/// multiply by scalar
|
||||
inline Vec4 operator * (const float rhs) const
|
||||
inline Vec4 operator * (float rhs) const
|
||||
{
|
||||
return Vec4(_v[0]*rhs, _v[1]*rhs, _v[2]*rhs, _v[3]*rhs);
|
||||
}
|
||||
|
||||
/// unary multiply by scalar
|
||||
inline Vec4& operator *= (const float rhs)
|
||||
inline Vec4& operator *= (float rhs)
|
||||
{
|
||||
_v[0]*=rhs;
|
||||
_v[1]*=rhs;
|
||||
@ -125,13 +125,13 @@ class Vec4
|
||||
}
|
||||
|
||||
/// divide by scalar
|
||||
inline Vec4 operator / (const float rhs) const
|
||||
inline Vec4 operator / (float rhs) const
|
||||
{
|
||||
return Vec4(_v[0]/rhs, _v[1]/rhs, _v[2]/rhs, _v[3]/rhs);
|
||||
}
|
||||
|
||||
/// unary divide by scalar
|
||||
inline Vec4& operator /= (const float rhs)
|
||||
inline Vec4& operator /= (float rhs)
|
||||
{
|
||||
_v[0]/=rhs;
|
||||
_v[1]/=rhs;
|
||||
@ -182,20 +182,20 @@ class Vec4
|
||||
}
|
||||
|
||||
/// Length of the vector = sqrt( vec . vec )
|
||||
inline const float length() const
|
||||
inline float length() const
|
||||
{
|
||||
return sqrtf( _v[0]*_v[0] + _v[1]*_v[1] + _v[2]*_v[2] + _v[3]*_v[3]);
|
||||
}
|
||||
|
||||
/// Length squared of the vector = vec . vec
|
||||
inline const float length2() const
|
||||
inline float length2() const
|
||||
{
|
||||
return _v[0]*_v[0] + _v[1]*_v[1] + _v[2]*_v[2] + _v[3]*_v[3];
|
||||
}
|
||||
|
||||
/** normalize the vector so that it has length unity
|
||||
returns the previous length of the vector*/
|
||||
inline const float normalize()
|
||||
inline float normalize()
|
||||
{
|
||||
float norm = Vec4::length();
|
||||
_v[0] /= norm;
|
||||
|
@ -46,7 +46,7 @@ class SG_EXPORT Viewport : public StateAttribute
|
||||
return 0; // passed all the above comparison macro's, must be equal.
|
||||
}
|
||||
|
||||
inline void setViewport(const int x,const int y,const int width,const int height)
|
||||
inline void setViewport(int x,int y,int width,int height)
|
||||
{
|
||||
_x = x;
|
||||
_y = y;
|
||||
@ -62,16 +62,16 @@ class SG_EXPORT Viewport : public StateAttribute
|
||||
height = _height;
|
||||
}
|
||||
|
||||
inline const int x() const { return _x; }
|
||||
inline const int y() const { return _y; }
|
||||
inline const int width() const { return _width; }
|
||||
inline const int height() const { return _height; }
|
||||
inline int x() const { return _x; }
|
||||
inline int y() const { return _y; }
|
||||
inline int width() const { return _width; }
|
||||
inline int height() const { return _height; }
|
||||
|
||||
inline const bool valid() const { return _width!=0 && _height!=0; }
|
||||
inline bool valid() const { return _width!=0 && _height!=0; }
|
||||
|
||||
/** Return the aspcetRatio of the viewport, which is equal to width/height.
|
||||
* If height is zero, the potental division by zero is avoid by simply returning 1.0f.*/
|
||||
inline const float aspectRatio() const { if (_height!=0) return (float)_width/(float)_height; else return 1.0f; }
|
||||
inline float aspectRatio() const { if (_height!=0) return (float)_width/(float)_height; else return 1.0f; }
|
||||
|
||||
/** Compute the Window Matrix which takes projected coords into Window coordinates.
|
||||
* To converted local coodinates into window coordinates use v_window = v_local * MVPW matrix,
|
||||
|
@ -44,37 +44,37 @@ class ref_ptr
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline const bool operator == (const ref_ptr& rp) const
|
||||
inline bool operator == (const ref_ptr& rp) const
|
||||
{
|
||||
return (_ptr==rp._ptr);
|
||||
}
|
||||
|
||||
inline const bool operator == (const T* ptr) const
|
||||
inline bool operator == (const T* ptr) const
|
||||
{
|
||||
return (_ptr==ptr);
|
||||
}
|
||||
|
||||
inline const bool operator != (const ref_ptr& rp) const
|
||||
inline bool operator != (const ref_ptr& rp) const
|
||||
{
|
||||
return (_ptr!=rp._ptr);
|
||||
}
|
||||
|
||||
inline const bool operator != (const T* ptr) const
|
||||
inline bool operator != (const T* ptr) const
|
||||
{
|
||||
return (_ptr!=ptr);
|
||||
}
|
||||
|
||||
inline const bool operator < (const ref_ptr& rp) const
|
||||
inline bool operator < (const ref_ptr& rp) const
|
||||
{
|
||||
return (_ptr<rp._ptr);
|
||||
}
|
||||
|
||||
inline const bool operator > (const ref_ptr& rp) const
|
||||
inline bool operator > (const ref_ptr& rp) const
|
||||
{
|
||||
return (_ptr>rp._ptr);
|
||||
}
|
||||
|
||||
inline const bool operator > (const T* ptr) const
|
||||
inline bool operator > (const T* ptr) const
|
||||
{
|
||||
return (_ptr>ptr);
|
||||
}
|
||||
@ -87,9 +87,9 @@ class ref_ptr
|
||||
|
||||
inline const T* operator->() const { return _ptr; }
|
||||
|
||||
inline const bool operator!() const { return _ptr==0L; }
|
||||
inline bool operator!() const { return _ptr==0L; }
|
||||
|
||||
inline const bool valid() const { return _ptr!=0L; }
|
||||
inline bool valid() const { return _ptr!=0L; }
|
||||
|
||||
inline T* get() { return _ptr; }
|
||||
|
||||
|
@ -34,14 +34,14 @@ class OSGDB_EXPORT Output : public std::ofstream
|
||||
|
||||
Output& indent();
|
||||
|
||||
inline const int getIndentStep() const { return _indentStep; }
|
||||
inline void setIndentStep(int step) { _indentStep = step; }
|
||||
inline int getIndentStep() const { return _indentStep; }
|
||||
|
||||
inline const int getIndent() const { return _indent; }
|
||||
inline void setIndent(int indent) { _indent = indent; }
|
||||
inline int getIndent() const { return _indent; }
|
||||
|
||||
inline const int getNumIndicesPerLine() const { return _numIndicesPerLine; }
|
||||
inline void setNumIndicesPerLine(int num) { _numIndicesPerLine = num; }
|
||||
inline int getNumIndicesPerLine() const { return _numIndicesPerLine; }
|
||||
|
||||
void moveIn();
|
||||
void moveOut();
|
||||
|
@ -63,9 +63,9 @@ class OSGDB_EXPORT ReaderWriter : public osg::Referenced
|
||||
osg::Image* getImage() { return dynamic_cast<osg::Image*>(_object.get()); }
|
||||
osg::Node* getNode() { return dynamic_cast<osg::Node*>(_object.get()); }
|
||||
|
||||
const bool validObject() { return _object.valid(); }
|
||||
const bool validImage() { return getImage()!=0; }
|
||||
const bool validNode() { return getNode()!=0; }
|
||||
bool validObject() { return _object.valid(); }
|
||||
bool validImage() { return getImage()!=0; }
|
||||
bool validNode() { return getNode()!=0; }
|
||||
|
||||
osg::Object* takeObject() { osg::Object* obj = _object.get(); if (obj) { obj->ref(); _object=NULL; obj->unref_nodelete(); } return obj; }
|
||||
osg::Image* takeImage() { osg::Image* image=dynamic_cast<osg::Image*>(_object.get()); if (image) { image->ref(); _object=NULL; image->unref_nodelete(); } return image; }
|
||||
@ -73,10 +73,10 @@ class OSGDB_EXPORT ReaderWriter : public osg::Referenced
|
||||
|
||||
const std::string& message() const { return _message; }
|
||||
|
||||
const ReadStatus status() const { return _status; }
|
||||
const bool success() const { return _status==FILE_LOADED; }
|
||||
const bool error() const { return _status==ERROR_IN_READING_FILE; }
|
||||
const bool notHandled() const { return _status==FILE_NOT_HANDLED; }
|
||||
ReadStatus status() const { return _status; }
|
||||
bool success() const { return _status==FILE_LOADED; }
|
||||
bool error() const { return _status==ERROR_IN_READING_FILE; }
|
||||
bool notHandled() const { return _status==FILE_NOT_HANDLED; }
|
||||
|
||||
protected:
|
||||
|
||||
@ -104,10 +104,10 @@ class OSGDB_EXPORT ReaderWriter : public osg::Referenced
|
||||
|
||||
const std::string& message() const { return _message; }
|
||||
|
||||
const WriteStatus status() const { return _status; }
|
||||
const bool success() const { return _status==FILE_SAVED; }
|
||||
const bool error() const { return _status==ERROR_IN_WRITING_FILE; }
|
||||
const bool notHandled() const { return _status==FILE_NOT_HANDLED; }
|
||||
WriteStatus status() const { return _status; }
|
||||
bool success() const { return _status==FILE_SAVED; }
|
||||
bool error() const { return _status==ERROR_IN_WRITING_FILE; }
|
||||
bool notHandled() const { return _status==FILE_NOT_HANDLED; }
|
||||
|
||||
protected:
|
||||
|
||||
|
@ -48,7 +48,7 @@ class OSGGLUT_EXPORT Viewer : public Window, public osgGA::GUIActionAdapter
|
||||
float x = 0.0, float y = 0.0,
|
||||
float width = 1.0, float height = 1.0);
|
||||
|
||||
const unsigned int getNumViewports() const { return _viewportList.size(); }
|
||||
unsigned int getNumViewports() const { return _viewportList.size(); }
|
||||
|
||||
osgUtil::SceneView* getViewportSceneView(unsigned int pos)
|
||||
{ return _viewportList[pos].sceneView.get(); }
|
||||
@ -111,7 +111,7 @@ class OSGGLUT_EXPORT Viewer : public Window, public osgGA::GUIActionAdapter
|
||||
void setFocusedViewport(unsigned int pos);
|
||||
int mapWindowXYToSceneView(int x, int y);
|
||||
|
||||
void showStats(const unsigned int i); // gwm 24.09.01 pass the viewport to collect sta for each viewport
|
||||
void showStats(unsigned int i); // gwm 24.09.01 pass the viewport to collect sta for each viewport
|
||||
|
||||
static Viewer* s_theViewer;
|
||||
|
||||
|
@ -86,7 +86,7 @@ namespace osgParticle
|
||||
virtual ~ParticleProcessor() {}
|
||||
ParticleProcessor &operator=(const ParticleProcessor &) { return *this; }
|
||||
|
||||
inline const bool computeBound() const;
|
||||
inline bool computeBound() const;
|
||||
|
||||
virtual void process(double dt) = 0;
|
||||
|
||||
@ -140,7 +140,7 @@ namespace osgParticle
|
||||
ps_ = ps;
|
||||
}
|
||||
|
||||
inline const bool ParticleProcessor::computeBound() const
|
||||
inline bool ParticleProcessor::computeBound() const
|
||||
{
|
||||
_bsphere.init();
|
||||
_bsphere_computed = true;
|
||||
|
@ -148,7 +148,7 @@ namespace osgParticle
|
||||
|
||||
ParticleSystem &operator=(const ParticleSystem &) { return *this; }
|
||||
|
||||
inline virtual const bool computeBound() const;
|
||||
inline virtual bool computeBound() const;
|
||||
virtual void drawImmediateMode(osg::State &state);
|
||||
inline void update_bounds(const osg::Vec3 &p, float r);
|
||||
void single_pass_render(osg::State &state, const osg::Matrix &modelview);
|
||||
@ -282,7 +282,7 @@ namespace osgParticle
|
||||
return last_frame_;
|
||||
}
|
||||
|
||||
inline const bool ParticleSystem::computeBound() const
|
||||
inline bool ParticleSystem::computeBound() const
|
||||
{
|
||||
if (!bounds_computed_) {
|
||||
_bbox = def_bbox_;
|
||||
|
@ -61,7 +61,7 @@ namespace osgParticle
|
||||
virtual ~ParticleSystemUpdater() {}
|
||||
ParticleSystemUpdater &operator=(const ParticleSystemUpdater &) { return *this; }
|
||||
|
||||
inline virtual const bool computeBound() const;
|
||||
inline virtual bool computeBound() const;
|
||||
|
||||
private:
|
||||
typedef std::vector<osg::ref_ptr<ParticleSystem> > ParticleSystem_Vector;
|
||||
@ -72,7 +72,7 @@ namespace osgParticle
|
||||
|
||||
// INLINE FUNCTIONS
|
||||
|
||||
inline const bool ParticleSystemUpdater::computeBound() const
|
||||
inline bool ParticleSystemUpdater::computeBound() const
|
||||
{
|
||||
_bsphere.init();
|
||||
_bsphere_computed = true;
|
||||
|
@ -71,7 +71,7 @@ class OSGTEXT_EXPORT Font : public osg::Object
|
||||
bool open(const char* font);
|
||||
bool open(const std::string& font);
|
||||
|
||||
virtual bool create(osg::State& state,int pointSize, const unsigned int res = 72 );
|
||||
virtual bool create(osg::State& state,int pointSize, unsigned int res = 72 );
|
||||
virtual bool create(osg::State& state);
|
||||
virtual void output(osg::State& state,const char* text);
|
||||
|
||||
|
@ -26,7 +26,7 @@ class OSGTEXT_EXPORT Paragraph : public osg::Geode
|
||||
const osgText::Font* getFont() const { return _font.get(); }
|
||||
|
||||
void setMaximumNoCharactersPerLine(unsigned int maxCharsPerLine);
|
||||
const unsigned int getMaximumNoCharactersPerLine() const { return _maxCharsPerLine; }
|
||||
unsigned int getMaximumNoCharactersPerLine() const { return _maxCharsPerLine; }
|
||||
|
||||
void setText(const std::string& text);
|
||||
std::string& getText() { return _text; }
|
||||
|
@ -123,7 +123,7 @@ class OSGTEXT_EXPORT Text : public osg::Drawable
|
||||
virtual ~Text();
|
||||
|
||||
virtual void setDefaults(void);
|
||||
virtual const bool computeBound(void) const;
|
||||
virtual bool computeBound(void) const;
|
||||
virtual void calcBounds(osg::Vec3* min,osg::Vec3* max) const;
|
||||
void initAlignment(osg::Vec3* min,osg::Vec3* max);
|
||||
bool initAlignment(void);
|
||||
|
@ -72,31 +72,31 @@ class OSGUTIL_EXPORT CullVisitor : public osg::NodeVisitor, public osg::CullStac
|
||||
* LOD children for rendering. Setting active to true forces the
|
||||
* CullVisitor to create the appropriate pre-rendering stages which
|
||||
* render to the ImpostorSprite's texture.*/
|
||||
void setImpostorsActive(const bool active) { _impostorActive = active; }
|
||||
void setImpostorsActive(bool active) { _impostorActive = active; }
|
||||
|
||||
/** Get whether impostors are active or not. */
|
||||
const bool getImpostorsActive() const { return _impostorActive; }
|
||||
bool getImpostorsActive() const { return _impostorActive; }
|
||||
|
||||
/** Set the impostor error threshold.
|
||||
* Used in calculation of whether impostors remain valid.*/
|
||||
void setImpostorPixelErrorThreshold(const float numPixels) { _impostorPixelErrorThreshold=numPixels; }
|
||||
void setImpostorPixelErrorThreshold(float numPixels) { _impostorPixelErrorThreshold=numPixels; }
|
||||
|
||||
/** Get the impostor error threshold.*/
|
||||
const float getImpostorPixelErrorThreshold() const { return _impostorPixelErrorThreshold; }
|
||||
float getImpostorPixelErrorThreshold() const { return _impostorPixelErrorThreshold; }
|
||||
|
||||
/** Set whether ImpsotorSprite's should be placed in a depth sorted bin for rendering.*/
|
||||
void setDepthSortImpostorSprites(const bool doDepthSort) { _depthSortImpostorSprites = doDepthSort; }
|
||||
void setDepthSortImpostorSprites(bool doDepthSort) { _depthSortImpostorSprites = doDepthSort; }
|
||||
|
||||
/** Get whether ImpsotorSprite's are depth sorted bin for rendering.*/
|
||||
const bool setDepthSortImpostorSprites() const { return _depthSortImpostorSprites; }
|
||||
bool setDepthSortImpostorSprites() const { return _depthSortImpostorSprites; }
|
||||
|
||||
/** Set the number of frames that an ImpsotorSprite's is kept whilst not being beyond,
|
||||
* before being recycled.*/
|
||||
void setNumberOfFrameToKeepImpostorSprites(const int numFrames) { _numFramesToKeepImpostorSprites = numFrames; }
|
||||
void setNumberOfFrameToKeepImpostorSprites(int numFrames) { _numFramesToKeepImpostorSprites = numFrames; }
|
||||
|
||||
/** Get the number of frames that an ImpsotorSprite's is kept whilst not being beyond,
|
||||
* before being recycled.*/
|
||||
const int getNumberOfFrameToKeepImpostorSprites() const { return _numFramesToKeepImpostorSprites; }
|
||||
int getNumberOfFrameToKeepImpostorSprites() const { return _numFramesToKeepImpostorSprites; }
|
||||
|
||||
enum ComputeNearFarMode
|
||||
{
|
||||
@ -181,9 +181,9 @@ class OSGUTIL_EXPORT CullVisitor : public osg::NodeVisitor, public osg::CullStac
|
||||
_currentRenderBin = rb;
|
||||
}
|
||||
|
||||
inline const float getCalculatedNearPlane() const { return _computed_znear; }
|
||||
inline float getCalculatedNearPlane() const { return _computed_znear; }
|
||||
|
||||
inline const float getCalculatedFarPlane() const { return _computed_zfar; }
|
||||
inline float getCalculatedFarPlane() const { return _computed_zfar; }
|
||||
|
||||
void updateCalculatedNearFar(const osg::Matrix& matrix,const osg::Drawable& drawable) { updateCalculatedNearFar(matrix,drawable.getBound()); }
|
||||
void updateCalculatedNearFar(const osg::Matrix& matrix,const osg::BoundingBox& bb);
|
||||
@ -193,7 +193,7 @@ class OSGUTIL_EXPORT CullVisitor : public osg::NodeVisitor, public osg::CullStac
|
||||
inline void addDrawable(osg::Drawable* drawable,osg::Matrix* matrix);
|
||||
|
||||
/** Add a drawable and depth to current render graph.*/
|
||||
inline void addDrawableAndDepth(osg::Drawable* drawable,osg::Matrix* matrix,const float depth);
|
||||
inline void addDrawableAndDepth(osg::Drawable* drawable,osg::Matrix* matrix,float depth);
|
||||
|
||||
/** Add an attribute which is positioned related to the modelview matrix.*/
|
||||
inline void addPositionedAttribute(osg::Matrix* matrix,const osg::StateAttribute* attr);
|
||||
@ -279,7 +279,7 @@ inline void CullVisitor::addDrawable(osg::Drawable* drawable,osg::Matrix* matrix
|
||||
}
|
||||
|
||||
/** Add a drawable and depth to current render graph.*/
|
||||
inline void CullVisitor::addDrawableAndDepth(osg::Drawable* drawable,osg::Matrix* matrix,const float depth)
|
||||
inline void CullVisitor::addDrawableAndDepth(osg::Drawable* drawable,osg::Matrix* matrix,float depth)
|
||||
{
|
||||
if (_currentRenderGraph->leaves_empty())
|
||||
{
|
||||
|
@ -22,11 +22,11 @@ class OSGUTIL_EXPORT InsertImpostorsVisitor : public osg::NodeVisitor
|
||||
/// default to traversing all children.
|
||||
InsertImpostorsVisitor();
|
||||
|
||||
void setImpostorThresholdRatio(const float ratio) { _impostorThresholdRatio = ratio; }
|
||||
const float getImpostorThresholdRatio() const { return _impostorThresholdRatio; }
|
||||
void setImpostorThresholdRatio(float ratio) { _impostorThresholdRatio = ratio; }
|
||||
float getImpostorThresholdRatio() const { return _impostorThresholdRatio; }
|
||||
|
||||
void setMaximumNumberOfNestedImpostors(const unsigned int num) { _maximumNumNestedImpostors = num; }
|
||||
const unsigned int getMaximumNumberOfNestedImpostors() const { return _maximumNumNestedImpostors; }
|
||||
void setMaximumNumberOfNestedImpostors(unsigned int num) { _maximumNumNestedImpostors = num; }
|
||||
unsigned int getMaximumNumberOfNestedImpostors() const { return _maximumNumNestedImpostors; }
|
||||
|
||||
/** empty visitor, make it ready for next traversal.*/
|
||||
void reset();
|
||||
|
@ -87,7 +87,7 @@ class OSGUTIL_EXPORT RenderBin : public osg::Object
|
||||
/** extract stats for current draw list. */
|
||||
bool getStats(osg::Statistics* primStats);
|
||||
void getPrims(osg::Statistics* primStats);
|
||||
bool getPrims(osg::Statistics* primStats, const int nbin);
|
||||
bool getPrims(osg::Statistics* primStats, int nbin);
|
||||
|
||||
|
||||
public:
|
||||
|
@ -21,7 +21,7 @@ namespace osgUtil {
|
||||
|
||||
struct LeafDepthSortFunctor
|
||||
{
|
||||
const bool operator() (const osg::ref_ptr<RenderLeaf>& lhs,const osg::ref_ptr<RenderLeaf>& rhs)
|
||||
bool operator() (const osg::ref_ptr<RenderLeaf>& lhs,const osg::ref_ptr<RenderLeaf>& rhs)
|
||||
{
|
||||
return (lhs->_depth>rhs->_depth);
|
||||
}
|
||||
@ -76,18 +76,18 @@ class OSGUTIL_EXPORT RenderGraph : public osg::Referenced
|
||||
|
||||
|
||||
/** return true if all of drawables, lights and children are empty.*/
|
||||
inline const bool empty() const
|
||||
inline bool empty() const
|
||||
{
|
||||
return _leaves.empty() && _children.empty();
|
||||
}
|
||||
|
||||
inline const bool leaves_empty() const
|
||||
inline bool leaves_empty() const
|
||||
{
|
||||
return _leaves.empty();
|
||||
}
|
||||
|
||||
|
||||
inline const float getAverageDistance() const
|
||||
inline float getAverageDistance() const
|
||||
{
|
||||
if (_averageDistance==FLT_MAX && !_leaves.empty())
|
||||
{
|
||||
|
@ -49,10 +49,10 @@ class OSGUTIL_EXPORT RenderStage : public RenderBin
|
||||
|
||||
/** Set the clear mask used in glClear(..).
|
||||
* Defaults to GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT. */
|
||||
void setClearMask(const GLbitfield mask) { _clearMask = mask; }
|
||||
void setClearMask(GLbitfield mask) { _clearMask = mask; }
|
||||
|
||||
/** Get the clear mask.*/
|
||||
const GLbitfield getClearMask() const { return _clearMask; }
|
||||
GLbitfield getClearMask() const { return _clearMask; }
|
||||
|
||||
|
||||
void setColorMask(osg::ColorMask* cm) { _colorMask = cm; }
|
||||
@ -79,18 +79,18 @@ class OSGUTIL_EXPORT RenderStage : public RenderBin
|
||||
|
||||
/** Set the clear depth used in glClearDepth(..). Defaults to 1.0
|
||||
* glClearDepth is only called if mask & GL_DEPTH_BUFFER_BIT is true*/
|
||||
void setClearDepth(const double depth) { _clearDepth=depth; }
|
||||
void setClearDepth(double depth) { _clearDepth=depth; }
|
||||
|
||||
/** Get the clear depth.*/
|
||||
const double getClearDepth() const { return _clearDepth; }
|
||||
double getClearDepth() const { return _clearDepth; }
|
||||
|
||||
|
||||
/** Set the clear stencil value used in glClearStencil(). Defaults to 1.0
|
||||
* glClearStencil is only called if mask & GL_STENCIL_BUFFER_BIT is true*/
|
||||
void setClearStencil(const int stencil) { _clearStencil=stencil; }
|
||||
void setClearStencil(int stencil) { _clearStencil=stencil; }
|
||||
|
||||
/** Get the clear color.*/
|
||||
const int getClearStencil() const { return _clearStencil; }
|
||||
int getClearStencil() const { return _clearStencil; }
|
||||
|
||||
void setRenderStageLighting(RenderStageLighting* rsl) { _renderStageLighting = rsl; }
|
||||
|
||||
|
@ -83,7 +83,7 @@ class DrawableDrawCallback : public osg::Drawable::DrawCallback
|
||||
struct LODCallback : public osg::LOD::EvaluateLODCallback
|
||||
{
|
||||
/** Compute the child to select.*/
|
||||
virtual const int evaluateLODChild(const osg::LOD* lod, const osg::Vec3& eye_local, const float bias) const
|
||||
virtual int evaluateLODChild(const osg::LOD* lod, const osg::Vec3& eye_local, const float bias) const
|
||||
{
|
||||
std::cout<<"evaluateLODChild callback - pre lod->evaluateLODChild"<<std::endl;
|
||||
int result = lod->evaluateLODChild(eye_local,bias);
|
||||
@ -95,7 +95,7 @@ struct LODCallback : public osg::LOD::EvaluateLODCallback
|
||||
struct TransformCallback : public osg::Transform::ComputeTransformCallback
|
||||
{
|
||||
/** Get the transformation matrix which moves from local coords to world coords.*/
|
||||
virtual const bool computeLocalToWorldMatrix(osg::Matrix& matrix,const osg::Transform* transform, osg::NodeVisitor* nv) const
|
||||
virtual bool computeLocalToWorldMatrix(osg::Matrix& matrix,const osg::Transform* transform, osg::NodeVisitor* nv) const
|
||||
{
|
||||
std::cout<<"computeLocalToWorldMatrix - pre transform->computeLocalToWorldMatrix"<<std::endl;
|
||||
bool result = transform->computeLocalToWorldMatrix(matrix,nv);
|
||||
@ -104,7 +104,7 @@ struct TransformCallback : public osg::Transform::ComputeTransformCallback
|
||||
}
|
||||
|
||||
/** Get the transformation matrix which moves from world coords to local coords.*/
|
||||
virtual const bool computeWorldToLocalMatrix(osg::Matrix& matrix,const osg::Transform* transform, osg::NodeVisitor* nv) const
|
||||
virtual bool computeWorldToLocalMatrix(osg::Matrix& matrix,const osg::Transform* transform, osg::NodeVisitor* nv) const
|
||||
{
|
||||
std::cout<<"computeWorldToLocalMatrix - pre transform->computeWorldToLocalMatrix"<<std::endl;
|
||||
bool result = transform->computeWorldToLocalMatrix(matrix,nv);
|
||||
|
@ -28,7 +28,7 @@ extern osg::Node *makeClouds( void );
|
||||
struct MoveEarthySkyWithEyePointCallback : public osg::Transform::ComputeTransformCallback
|
||||
{
|
||||
/** Get the transformation matrix which moves from local coords to world coords.*/
|
||||
virtual const bool computeLocalToWorldMatrix(osg::Matrix& matrix,const osg::Transform*, osg::NodeVisitor* nv) const
|
||||
virtual bool computeLocalToWorldMatrix(osg::Matrix& matrix,const osg::Transform*, osg::NodeVisitor* nv) const
|
||||
{
|
||||
osgUtil::CullVisitor* cv = dynamic_cast<osgUtil::CullVisitor*>(nv);
|
||||
if (cv)
|
||||
@ -40,7 +40,7 @@ struct MoveEarthySkyWithEyePointCallback : public osg::Transform::ComputeTransfo
|
||||
}
|
||||
|
||||
/** Get the transformation matrix which moves from world coords to local coords.*/
|
||||
virtual const bool computeWorldToLocalMatrix(osg::Matrix& matrix,const osg::Transform*, osg::NodeVisitor* nv) const
|
||||
virtual bool computeWorldToLocalMatrix(osg::Matrix& matrix,const osg::Transform*, osg::NodeVisitor* nv) const
|
||||
{
|
||||
osgUtil::CullVisitor* cv = dynamic_cast<osgUtil::CullVisitor*>(nv);
|
||||
if (cv)
|
||||
|
@ -28,7 +28,7 @@ Billboard::~Billboard()
|
||||
{
|
||||
}
|
||||
|
||||
void Billboard::setMode(const Mode mode)
|
||||
void Billboard::setMode(Mode mode)
|
||||
{
|
||||
_mode = mode;
|
||||
_cachedMode = CACHE_DIRTY;
|
||||
@ -64,7 +64,7 @@ void Billboard::updateCache()
|
||||
_side.normalize();
|
||||
}
|
||||
|
||||
const bool Billboard::addDrawable(Drawable *gset)
|
||||
bool Billboard::addDrawable(Drawable *gset)
|
||||
{
|
||||
if (Geode::addDrawable(gset))
|
||||
{
|
||||
@ -79,7 +79,7 @@ const bool Billboard::addDrawable(Drawable *gset)
|
||||
}
|
||||
|
||||
|
||||
const bool Billboard::addDrawable(Drawable *gset,const Vec3& pos)
|
||||
bool Billboard::addDrawable(Drawable *gset,const Vec3& pos)
|
||||
{
|
||||
if (Geode::addDrawable(gset))
|
||||
{
|
||||
@ -93,7 +93,7 @@ const bool Billboard::addDrawable(Drawable *gset,const Vec3& pos)
|
||||
}
|
||||
|
||||
|
||||
const bool Billboard::removeDrawable( Drawable *gset )
|
||||
bool Billboard::removeDrawable( Drawable *gset )
|
||||
{
|
||||
PositionList::iterator pitr = _positionList.begin();
|
||||
for (DrawableList::iterator itr=_drawables.begin();
|
||||
@ -112,7 +112,7 @@ const bool Billboard::removeDrawable( Drawable *gset )
|
||||
return false;
|
||||
}
|
||||
|
||||
const bool Billboard::computeMatrix(Matrix& modelview, const Vec3& eye_local, const Vec3& pos_local) const
|
||||
bool Billboard::computeMatrix(Matrix& modelview, const Vec3& eye_local, const Vec3& pos_local) const
|
||||
{
|
||||
//Vec3 up_local(matrix(0,1),matrix(1,1),matrix(2,1));
|
||||
|
||||
@ -222,7 +222,7 @@ const bool Billboard::computeMatrix(Matrix& modelview, const Vec3& eye_local, co
|
||||
|
||||
}
|
||||
|
||||
const bool Billboard::computeBound() const
|
||||
bool Billboard::computeBound() const
|
||||
{
|
||||
int i;
|
||||
int ngsets = _drawables.size();
|
||||
|
@ -15,5 +15,5 @@ BlendFunc::~BlendFunc()
|
||||
|
||||
void BlendFunc::apply(State&) const
|
||||
{
|
||||
glBlendFunc( (GLenum)_source_factor, (GLenum)_destination_factor );
|
||||
glBlendFunc( _source_factor, _destination_factor );
|
||||
}
|
||||
|
@ -94,9 +94,9 @@ Camera::~Camera()
|
||||
|
||||
|
||||
/** Set a orthographics projection. See glOrtho for further details.*/
|
||||
void Camera::setOrtho(const double left, const double right,
|
||||
const double bottom, const double top,
|
||||
const double zNear, const double zFar)
|
||||
void Camera::setOrtho(double left, double right,
|
||||
double bottom, double top,
|
||||
double zNear, double zFar)
|
||||
{
|
||||
_projectionType = ORTHO;
|
||||
_left = left;
|
||||
@ -109,8 +109,8 @@ void Camera::setOrtho(const double left, const double right,
|
||||
|
||||
|
||||
/** Set a 2D orthographics projection. See gluOrtho2D for further details.*/
|
||||
void Camera::setOrtho2D(const double left, const double right,
|
||||
const double bottom, const double top)
|
||||
void Camera::setOrtho2D(double left, double right,
|
||||
double bottom, double top)
|
||||
{
|
||||
_projectionType = ORTHO2D;
|
||||
_left = left;
|
||||
@ -123,9 +123,9 @@ void Camera::setOrtho2D(const double left, const double right,
|
||||
|
||||
|
||||
/** Set a perspective projection. See glFrustum for further details.*/
|
||||
void Camera::setFrustum(const double left, const double right,
|
||||
const double bottom, const double top,
|
||||
const double zNear, const double zFar)
|
||||
void Camera::setFrustum(double left, double right,
|
||||
double bottom, double top,
|
||||
double zNear, double zFar)
|
||||
{
|
||||
_projectionType = FRUSTUM;
|
||||
// note, in Frustum/Perspective mode these values are scaled
|
||||
@ -142,8 +142,8 @@ void Camera::setFrustum(const double left, const double right,
|
||||
|
||||
|
||||
/** Set a sysmetical perspective projection, See gluPerspective for further details.*/
|
||||
void Camera::setPerspective(const double fovy,const double aspectRatio,
|
||||
const double zNear, const double zFar)
|
||||
void Camera::setPerspective(double fovy,double aspectRatio,
|
||||
double zNear, double zFar)
|
||||
{
|
||||
_projectionType = PERSPECTIVE;
|
||||
|
||||
@ -163,8 +163,8 @@ void Camera::setPerspective(const double fovy,const double aspectRatio,
|
||||
}
|
||||
|
||||
/** Set a sysmetical perspective projection using field of view.*/
|
||||
void Camera::setFOV(const double fovx,const double fovy,
|
||||
const double zNear, const double zFar)
|
||||
void Camera::setFOV(double fovx,double fovy,
|
||||
double zNear, double zFar)
|
||||
{
|
||||
_projectionType = PERSPECTIVE;
|
||||
|
||||
@ -185,7 +185,7 @@ void Camera::setFOV(const double fovx,const double fovy,
|
||||
}
|
||||
|
||||
/** Set the near and far clipping planes.*/
|
||||
void Camera::setNearFar(const double zNear, const double zFar)
|
||||
void Camera::setNearFar(double zNear, double zFar)
|
||||
{
|
||||
if (_projectionType==FRUSTUM || _projectionType==PERSPECTIVE)
|
||||
{
|
||||
@ -208,7 +208,7 @@ void Camera::setNearFar(const double zNear, const double zFar)
|
||||
|
||||
/** Adjust the clipping planes to account for a new window aspcect ratio.
|
||||
* Typicall used after resizeing a window.*/
|
||||
void Camera::adjustAspectRatio(const double newAspectRatio, const AdjustAspectRatioMode aa)
|
||||
void Camera::adjustAspectRatio(double newAspectRatio, const AdjustAspectRatioMode aa)
|
||||
{
|
||||
if (newAspectRatio<0.01f || newAspectRatio>100.0f)
|
||||
{
|
||||
@ -236,7 +236,7 @@ void Camera::adjustAspectRatio(const double newAspectRatio, const AdjustAspectRa
|
||||
/** Calculate and return the equivilant fovx for the current project setting.
|
||||
* This value is only valid for when a symetric persepctive projection exists.
|
||||
* i.e. getProjectionType()==PERSPECTIVE.*/
|
||||
const double Camera::calc_fovy() const
|
||||
double Camera::calc_fovy() const
|
||||
{
|
||||
// note, _right & _left are prescaled by znear so
|
||||
// no need to account for it.
|
||||
@ -247,7 +247,7 @@ const double Camera::calc_fovy() const
|
||||
/** Calculate and return the equivilant fovy for the current project setting.
|
||||
* This value is only valid for when a symetric persepctive projection exists.
|
||||
* i.e. getProjectionType()==PERSPECTIVE.*/
|
||||
const double Camera::calc_fovx() const
|
||||
double Camera::calc_fovx() const
|
||||
{
|
||||
// note, _right & _left are prescaled by znear so
|
||||
// no need to account for it.
|
||||
@ -256,14 +256,14 @@ const double Camera::calc_fovx() const
|
||||
|
||||
|
||||
/** Calculate and return the projection aspect ratio.*/
|
||||
const double Camera::calc_aspectRatio() const
|
||||
double Camera::calc_aspectRatio() const
|
||||
{
|
||||
double delta_x = _right-_left;
|
||||
double delta_y = _top-_bottom;
|
||||
return delta_x/delta_y;
|
||||
}
|
||||
|
||||
const Matrix Camera::getProjectionMatrix() const
|
||||
Matrix Camera::getProjectionMatrix() const
|
||||
{
|
||||
// set up the projection matrix.
|
||||
switch(_projectionType)
|
||||
@ -316,9 +316,9 @@ void Camera::setLookAt(const Vec3& eye,
|
||||
}
|
||||
|
||||
|
||||
void Camera::setLookAt(const double eyeX, const double eyeY, const double eyeZ,
|
||||
const double centerX, const double centerY, const double centerZ,
|
||||
const double upX, const double upY, const double upZ)
|
||||
void Camera::setLookAt(double eyeX, double eyeY, double eyeZ,
|
||||
double centerX, double centerY, double centerZ,
|
||||
double upX, double upY, double upZ)
|
||||
{
|
||||
_lookAtType = USE_EYE_CENTER_AND_UP;
|
||||
_eye.set(eyeX,eyeY,eyeZ);
|
||||
@ -342,14 +342,14 @@ void Camera::transformLookAt(const Matrix& matrix)
|
||||
_lookAtType=USE_EYE_CENTER_AND_UP;
|
||||
}
|
||||
|
||||
const Vec3 Camera::getLookVector() const
|
||||
Vec3 Camera::getLookVector() const
|
||||
{
|
||||
osg::Vec3 lv(_center-_eye);
|
||||
lv.normalize();
|
||||
return lv;
|
||||
}
|
||||
|
||||
const Vec3 Camera::getSideVector() const
|
||||
Vec3 Camera::getSideVector() const
|
||||
{
|
||||
osg::Vec3 lv(_center-_eye);
|
||||
lv.normalize();
|
||||
@ -359,7 +359,7 @@ const Vec3 Camera::getSideVector() const
|
||||
}
|
||||
|
||||
|
||||
void Camera::attachTransform(const TransformMode mode, Matrix* matrix)
|
||||
void Camera::attachTransform(TransformMode mode, Matrix* matrix)
|
||||
{
|
||||
switch(mode)
|
||||
{
|
||||
@ -414,7 +414,7 @@ void Camera::attachTransform(const TransformMode mode, Matrix* matrix)
|
||||
}
|
||||
}
|
||||
|
||||
Matrix* Camera::getTransform(const TransformMode mode)
|
||||
Matrix* Camera::getTransform(TransformMode mode)
|
||||
{
|
||||
switch(mode)
|
||||
{
|
||||
@ -435,7 +435,7 @@ const Matrix* Camera::getTransform(const TransformMode mode) const
|
||||
}
|
||||
|
||||
|
||||
const Matrix Camera::getModelViewMatrix() const
|
||||
Matrix Camera::getModelViewMatrix() const
|
||||
{
|
||||
Matrix modelViewMatrix;
|
||||
|
||||
@ -475,7 +475,7 @@ const Matrix Camera::getModelViewMatrix() const
|
||||
return modelViewMatrix;
|
||||
}
|
||||
|
||||
const float Camera::getFusionDistance() const
|
||||
float Camera::getFusionDistance() const
|
||||
{
|
||||
switch(_fusionDistanceMode)
|
||||
{
|
||||
|
@ -5,7 +5,7 @@ using namespace osg;
|
||||
ClipNode::ClipNode()
|
||||
{
|
||||
_value = StateAttribute::ON;
|
||||
_dstate = osgNew StateSet;
|
||||
_stateset = osgNew StateSet;
|
||||
}
|
||||
|
||||
ClipNode::ClipNode(const ClipNode& cn, const CopyOp& copyop):Group(cn,copyop)
|
||||
@ -42,7 +42,7 @@ void ClipNode::createClipBox(const BoundingBox& bb,unsigned int clipPlaneNumberB
|
||||
|
||||
// Add a ClipPlane to a ClipNode. Return true if plane is added,
|
||||
// return false if plane already exists in ClipNode, or clipplane is false.
|
||||
const bool ClipNode::addClipPlane(ClipPlane* clipplane)
|
||||
bool ClipNode::addClipPlane(ClipPlane* clipplane)
|
||||
{
|
||||
if (!clipplane) return false;
|
||||
|
||||
@ -61,7 +61,7 @@ const bool ClipNode::addClipPlane(ClipPlane* clipplane)
|
||||
|
||||
// Remove ClipPlane from a ClipNode. Return true if plane is removed,
|
||||
// return false if plane does not exists in ClipNode.
|
||||
const bool ClipNode::removeClipPlane(ClipPlane* clipplane)
|
||||
bool ClipNode::removeClipPlane(ClipPlane* clipplane)
|
||||
{
|
||||
if (!clipplane) return false;
|
||||
|
||||
@ -81,7 +81,7 @@ const bool ClipNode::removeClipPlane(ClipPlane* clipplane)
|
||||
|
||||
// Remove ClipPlane, at specified index, from a ClipNode. Return true if plane is removed,
|
||||
// return false if plane does not exists in ClipNode.
|
||||
const bool ClipNode::removeClipPlane(unsigned int pos)
|
||||
bool ClipNode::removeClipPlane(unsigned int pos)
|
||||
{
|
||||
if (pos<_planes.size())
|
||||
{
|
||||
@ -108,12 +108,12 @@ void ClipNode::setStateSetModes(StateSet& stateset,const StateAttribute::GLModeV
|
||||
|
||||
void ClipNode::setLocalStateSetModes(const StateAttribute::GLModeValue value)
|
||||
{
|
||||
if (!_dstate) _dstate = osgNew StateSet;
|
||||
_dstate->setAllToInherit();
|
||||
setStateSetModes(*_dstate,value);
|
||||
if (!_stateset) _stateset = osgNew StateSet;
|
||||
_stateset->setAllToInherit();
|
||||
setStateSetModes(*_stateset,value);
|
||||
}
|
||||
|
||||
const bool ClipNode::computeBound() const
|
||||
bool ClipNode::computeBound() const
|
||||
{
|
||||
return Group::computeBound();
|
||||
}
|
||||
|
@ -72,12 +72,12 @@ void ClipPlane::getClipPlane(double* plane) const
|
||||
plane[3] = _clipPlane[3];
|
||||
}
|
||||
|
||||
void ClipPlane::setClipPlaneNum(const unsigned int num)
|
||||
void ClipPlane::setClipPlaneNum(unsigned int num)
|
||||
{
|
||||
_clipPlaneNum = num;
|
||||
}
|
||||
|
||||
const unsigned int ClipPlane::getClipPlaneNum() const
|
||||
unsigned int ClipPlane::getClipPlaneNum() const
|
||||
{
|
||||
return _clipPlaneNum;
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ void DOFTransform::traverse(NodeVisitor& nv)
|
||||
Transform::traverse(nv);
|
||||
}
|
||||
|
||||
const bool DOFTransform::computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const
|
||||
bool DOFTransform::computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const
|
||||
{
|
||||
//put the PUT matrix first:
|
||||
Matrix l2w(getPutMatrix());
|
||||
@ -55,7 +55,7 @@ const bool DOFTransform::computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*)
|
||||
}
|
||||
|
||||
|
||||
const bool DOFTransform::computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor*) const
|
||||
bool DOFTransform::computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor*) const
|
||||
{
|
||||
//put the PUT matrix first:
|
||||
Matrix w2l(getInversePutMatrix());
|
||||
|
@ -57,7 +57,7 @@ void DrawPixels::getSubImageDimensions(unsigned int& offsetX,unsigned int& offse
|
||||
}
|
||||
|
||||
|
||||
const bool DrawPixels::computeBound() const
|
||||
bool DrawPixels::computeBound() const
|
||||
{
|
||||
// really needs to be dependant of view poistion and projection... will implement simple version right now.
|
||||
_bbox.init();
|
||||
@ -83,11 +83,13 @@ void DrawPixels::drawImmediateMode(State&)
|
||||
|
||||
if (_useSubImage)
|
||||
{
|
||||
const GLvoid* pixels = _image->data();
|
||||
const GLvoid* pixels = _image->data(_offsetX,_offsetY);
|
||||
glPixelStorei(GL_PACK_ROW_LENGTH,_image->s());
|
||||
glDrawPixels(_width,_height,
|
||||
(GLenum)_image->getPixelFormat(),
|
||||
(GLenum)_image->getDataType(),
|
||||
pixels);
|
||||
glPixelStorei(GL_PACK_ROW_LENGTH,0);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -32,7 +32,7 @@ Drawable::Drawable()
|
||||
Drawable::Drawable(const Drawable& drawable,const CopyOp& copyop):
|
||||
Object(drawable,copyop),
|
||||
_parents(), // leave empty as parentList is managed by Geode
|
||||
_dstate(copyop(drawable._dstate.get())),
|
||||
_stateset(copyop(drawable._stateset.get())),
|
||||
_supportsDisplayList(drawable._supportsDisplayList),
|
||||
_useDisplayList(drawable._useDisplayList),
|
||||
_globjList(drawable._globjList),
|
||||
@ -58,6 +58,12 @@ void Drawable::removeParent(osg::Node* node)
|
||||
if (pitr!=_parents.end()) _parents.erase(pitr);
|
||||
}
|
||||
|
||||
osg::StateSet* Drawable::getOrCreateStateSet()
|
||||
{
|
||||
if (!_stateset) _stateset = osgNew StateSet;
|
||||
return _stateset.get();
|
||||
}
|
||||
|
||||
void Drawable::dirtyBound()
|
||||
{
|
||||
if (_bbox_computed)
|
||||
@ -96,9 +102,9 @@ void Drawable::compile(State& state)
|
||||
}
|
||||
|
||||
|
||||
if (_dstate.valid())
|
||||
if (_stateset.valid())
|
||||
{
|
||||
_dstate->compile(state);
|
||||
_stateset->compile(state);
|
||||
}
|
||||
|
||||
globj = glGenLists( 1 );
|
||||
@ -113,7 +119,7 @@ void Drawable::compile(State& state)
|
||||
|
||||
}
|
||||
|
||||
void Drawable::setSupportsDisplayList(const bool flag)
|
||||
void Drawable::setSupportsDisplayList(bool flag)
|
||||
{
|
||||
// if value unchanged simply return.
|
||||
if (_supportsDisplayList==flag) return;
|
||||
@ -134,7 +140,7 @@ void Drawable::setSupportsDisplayList(const bool flag)
|
||||
_supportsDisplayList=flag;
|
||||
}
|
||||
|
||||
void Drawable::setUseDisplayList(const bool flag)
|
||||
void Drawable::setUseDisplayList(bool flag)
|
||||
{
|
||||
// if value unchanged simply return.
|
||||
if (_useDisplayList==flag) return;
|
||||
@ -288,7 +294,7 @@ struct ComputeBound : public Drawable::PrimitiveFunctor
|
||||
BoundingBox _bb;
|
||||
};
|
||||
|
||||
const bool Drawable::computeBound() const
|
||||
bool Drawable::computeBound() const
|
||||
{
|
||||
ComputeBound cb;
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include <vector>
|
||||
#include <set>
|
||||
|
||||
const bool osg::isGLExtensionSupported(const char *extension)
|
||||
bool osg::isGLExtensionSupported(const char *extension)
|
||||
{
|
||||
typedef std::set<std::string> ExtensionSet;
|
||||
static ExtensionSet s_extensionSet;
|
||||
@ -52,7 +52,7 @@ const bool osg::isGLExtensionSupported(const char *extension)
|
||||
return result;
|
||||
}
|
||||
|
||||
const bool osg::isGLUExtensionSupported(const char *extension)
|
||||
bool osg::isGLUExtensionSupported(const char *extension)
|
||||
{
|
||||
typedef std::set<std::string> ExtensionSet;
|
||||
static ExtensionSet s_extensionSet;
|
||||
|
@ -423,7 +423,7 @@ void GeoSet::computeNumVerts() const
|
||||
|
||||
|
||||
// just use the base Drawable's PrimitiveFunctor based implementation.
|
||||
const bool GeoSet::computeBound() const
|
||||
bool GeoSet::computeBound() const
|
||||
{
|
||||
_bbox.init();
|
||||
|
||||
@ -536,7 +536,7 @@ const bool GeoSet::computeBound() const
|
||||
return true;
|
||||
}
|
||||
|
||||
const bool GeoSet::check() const
|
||||
bool GeoSet::check() const
|
||||
{
|
||||
if( _coords == (Vec3 *)0 ) return false;
|
||||
|
||||
|
@ -33,7 +33,7 @@ Geode::~Geode()
|
||||
}
|
||||
}
|
||||
|
||||
const bool Geode::addDrawable( Drawable *drawable )
|
||||
bool Geode::addDrawable( Drawable *drawable )
|
||||
{
|
||||
if (drawable && !containsDrawable(drawable))
|
||||
{
|
||||
@ -56,7 +56,7 @@ const bool Geode::addDrawable( Drawable *drawable )
|
||||
}
|
||||
|
||||
|
||||
const bool Geode::removeDrawable( Drawable *drawable )
|
||||
bool Geode::removeDrawable( Drawable *drawable )
|
||||
{
|
||||
DrawableList::iterator itr = findDrawable(drawable);
|
||||
if (itr!=_drawables.end())
|
||||
@ -80,7 +80,7 @@ const bool Geode::removeDrawable( Drawable *drawable )
|
||||
}
|
||||
|
||||
|
||||
const bool Geode::replaceDrawable( Drawable *origDrawable, Drawable *newDrawable )
|
||||
bool Geode::replaceDrawable( Drawable *origDrawable, Drawable *newDrawable )
|
||||
{
|
||||
if (newDrawable==NULL || origDrawable==newDrawable) return false;
|
||||
|
||||
@ -115,7 +115,7 @@ const bool Geode::replaceDrawable( Drawable *origDrawable, Drawable *newDrawable
|
||||
}
|
||||
|
||||
|
||||
const bool Geode::computeBound() const
|
||||
bool Geode::computeBound() const
|
||||
{
|
||||
_bsphere.init();
|
||||
|
||||
|
@ -210,7 +210,7 @@ bool Group::replaceChild( Node *origNode, Node *newNode )
|
||||
|
||||
}
|
||||
|
||||
const bool Group::computeBound() const
|
||||
bool Group::computeBound() const
|
||||
{
|
||||
|
||||
_bsphere_computed = true;
|
||||
|
@ -66,7 +66,7 @@ void Image::setFileName(const std::string& fileName)
|
||||
}
|
||||
|
||||
|
||||
const bool Image::isPackedType(GLenum type)
|
||||
bool Image::isPackedType(GLenum type)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
@ -86,7 +86,7 @@ const bool Image::isPackedType(GLenum type)
|
||||
}
|
||||
}
|
||||
|
||||
const unsigned int Image::computeNumComponents(GLenum format)
|
||||
unsigned int Image::computeNumComponents(GLenum format)
|
||||
{
|
||||
switch(format)
|
||||
{
|
||||
@ -108,7 +108,7 @@ const unsigned int Image::computeNumComponents(GLenum format)
|
||||
}
|
||||
|
||||
|
||||
const unsigned int Image::computePixelSizeInBits(GLenum format,GLenum type)
|
||||
unsigned int Image::computePixelSizeInBits(GLenum format,GLenum type)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
@ -144,7 +144,7 @@ const unsigned int Image::computePixelSizeInBits(GLenum format,GLenum type)
|
||||
|
||||
}
|
||||
|
||||
const unsigned int Image::computeRowWidthInBytes(int width,GLenum format,GLenum type,int packing)
|
||||
unsigned int Image::computeRowWidthInBytes(int width,GLenum format,GLenum type,int packing)
|
||||
{
|
||||
unsigned int pixelSize = computePixelSizeInBits(format,type);
|
||||
int widthInBits = width*pixelSize;
|
||||
@ -152,7 +152,7 @@ const unsigned int Image::computeRowWidthInBytes(int width,GLenum format,GLenum
|
||||
return (widthInBits/packingInBits + ((widthInBits%packingInBits)?1:0))*packing;
|
||||
}
|
||||
|
||||
const unsigned int Image::computeNearestPowerOfTwo(unsigned int s,float bias)
|
||||
unsigned int Image::computeNearestPowerOfTwo(unsigned int s,float bias)
|
||||
{
|
||||
if ((s & (s-1))!=0)
|
||||
{
|
||||
@ -174,7 +174,7 @@ void Image::setInternalTextureFormat(GLint internalFormat)
|
||||
_internalTextureFormat = internalFormat;
|
||||
}
|
||||
|
||||
void Image::setPixelFormat(const GLenum format)
|
||||
void Image::setPixelFormat(GLenum format)
|
||||
{
|
||||
if (_pixelFormat==format) return; // do nothing if the same.
|
||||
|
||||
@ -272,7 +272,7 @@ void Image::readPixels(int x,int y,int width,int height,
|
||||
}
|
||||
|
||||
|
||||
void Image::scaleImage(const int s,const int t,const int r)
|
||||
void Image::scaleImage(int s,int t,int r)
|
||||
{
|
||||
if (_s==s && _t==t && _r==r) return;
|
||||
|
||||
@ -486,7 +486,7 @@ Geode* osg::createGeodeForImage(osg::Image* image)
|
||||
}
|
||||
|
||||
|
||||
Geode* osg::createGeodeForImage(osg::Image* image,const float s,const float t)
|
||||
Geode* osg::createGeodeForImage(osg::Image* image,float s,float t)
|
||||
{
|
||||
if (image)
|
||||
{
|
||||
|
@ -58,7 +58,7 @@ void Impostor::addImpostorSprite(ImpostorSprite* is)
|
||||
}
|
||||
}
|
||||
|
||||
const bool Impostor::computeBound() const
|
||||
bool Impostor::computeBound() const
|
||||
{
|
||||
return LOD::computeBound();
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ ImpostorSprite::~ImpostorSprite()
|
||||
}
|
||||
}
|
||||
|
||||
const float ImpostorSprite::calcPixelError(const Matrix& MVPW) const
|
||||
float ImpostorSprite::calcPixelError(const Matrix& MVPW) const
|
||||
{
|
||||
// find the maximum screen space pixel error between the control coords and the quad coners.
|
||||
float max_error_sqrd = 0.0f;
|
||||
@ -85,7 +85,7 @@ void ImpostorSprite::drawImmediateMode(State&)
|
||||
|
||||
}
|
||||
|
||||
const bool ImpostorSprite::computeBound() const
|
||||
bool ImpostorSprite::computeBound() const
|
||||
{
|
||||
_bbox.init();
|
||||
_bbox.expandBy(_coords[0]);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user