diff --git a/include/osg/AlphaFunc b/include/osg/AlphaFunc index d8bfc290f..781cd90ac 100644 --- a/include/osg/AlphaFunc +++ b/include/osg/AlphaFunc @@ -56,13 +56,13 @@ class SG_EXPORT AlphaFunc : public StateAttribute ALWAYS = GL_ALWAYS }; - inline void setFunction(const ComparisonFunction func,float ref) + inline void setFunction(ComparisonFunction func,float ref) { _comparisonFunc = func; _referenceValue = ref; } - inline const ComparisonFunction getFunction() const { return _comparisonFunc; } + inline ComparisonFunction getFunction() const { return _comparisonFunc; } inline float getReferenceValue() const { return _referenceValue; } diff --git a/include/osg/Camera b/include/osg/Camera index 02531ad80..43a0c872c 100644 --- a/include/osg/Camera +++ b/include/osg/Camera @@ -47,7 +47,7 @@ class SG_EXPORT Camera: public osg::Referenced /** Get the projection type set by setOtho,setOtho2D,setFrustum, * and set perspective methods.*/ - const ProjectionType getProjectionType() const { return _projectionType; } + ProjectionType getProjectionType() const { return _projectionType; } /** Set a orthographic projection. See glOrtho for further details.*/ void setOrtho(double left, double right, @@ -87,11 +87,11 @@ class SG_EXPORT Camera: public osg::Referenced /** Set the way that the vertical or horizontal dimensions of the window * are adjusted on a resize. */ - void setAdjustAspectRatioMode(const AdjustAspectRatioMode aam) { _adjustAspectRatioMode = aam; } + void setAdjustAspectRatioMode(AdjustAspectRatioMode aam) { _adjustAspectRatioMode = aam; } /** Get the way that the vertical or horizontal dimensions of the window * are adjusted on a resize. */ - const AdjustAspectRatioMode getAdjustAspectRatioMode() const { return _adjustAspectRatioMode; } + AdjustAspectRatioMode getAdjustAspectRatioMode() const { return _adjustAspectRatioMode; } /** Adjust the clipping planes to account for a new window aspect ratio. * Typically used after resizing a window. Aspect ratio is defined as @@ -104,7 +104,7 @@ 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(double newAspectRatio, const AdjustAspectRatioMode aa); + void adjustAspectRatio(double newAspectRatio, AdjustAspectRatioMode aa); double left() const { return _left; } double right() const { return _right; } @@ -139,7 +139,7 @@ class SG_EXPORT Camera: public osg::Referenced USE_EYE_CENTER_AND_UP }; - const LookAtType getLookAtType() const { return _lookAtType; } + LookAtType getLookAtType() const { return _lookAtType; } /** * hardwired home view for now, looking straight down the @@ -217,11 +217,11 @@ class SG_EXPORT Camera: public osg::Referenced * basic LookAt values. * note: Camera internals maintains the both EYE_TO_MODEL and MODEL_TO_EYE * internally and ensures that they are the inverse of one another.*/ - void attachTransform(const TransformMode mode, Matrix* modelTransform=0); + void attachTransform(TransformMode mode, Matrix* modelTransform=0); - Matrix* getTransform(const TransformMode mode); + Matrix* getTransform(TransformMode mode); - const Matrix* getTransform(const TransformMode mode) const; + const Matrix* getTransform(TransformMode mode) const; diff --git a/include/osg/ClipPlane b/include/osg/ClipPlane index f7e66fca5..fcfaf8290 100644 --- a/include/osg/ClipPlane +++ b/include/osg/ClipPlane @@ -18,7 +18,7 @@ class SG_EXPORT ClipPlane : public StateAttribute ClipPlane(); inline ClipPlane(unsigned int no,const Vec4& plane) { setClipPlaneNum(no); setClipPlane(plane); } inline ClipPlane(unsigned int no,const Plane& plane) { setClipPlaneNum(no); setClipPlane(plane); } - inline ClipPlane(unsigned int no,const double a,const double b,const double c,const double d) { setClipPlaneNum(no); setClipPlane(a,b,c,d); } + inline ClipPlane(unsigned int no,double a,double b,double c,double d) { setClipPlaneNum(no); setClipPlane(a,b,c,d); } /** Copy constructor using CopyOp to manage deep vs shallow copy.*/ ClipPlane(const ClipPlane& cp,const CopyOp& copyop=CopyOp::SHALLOW_COPY): @@ -66,7 +66,7 @@ class SG_EXPORT ClipPlane : public StateAttribute void setClipPlane(const double* plane); /** Set the clip plane, using a a to define plane. */ - void setClipPlane(const double a,const double b,const double c,const double d) + void setClipPlane(double a,double b,double c,double d) { _clipPlane[0]=a;_clipPlane[1]=b;_clipPlane[2]=c;_clipPlane[3]=d; } diff --git a/include/osg/FrontFace b/include/osg/FrontFace index 9d6e8cce8..7af9d39c5 100644 --- a/include/osg/FrontFace +++ b/include/osg/FrontFace @@ -43,7 +43,7 @@ class SG_EXPORT FrontFace : public StateAttribute COUNTER_CLOCKWISE = GL_CCW }; - inline void setMode(const Mode mode) { _mode = mode; } + inline void setMode(Mode mode) { _mode = mode; } inline const Mode getMode() const { return _mode; } virtual void apply(State& state) const; diff --git a/include/osg/Quat b/include/osg/Quat index cf3d8e553..dc843a819 100644 --- a/include/osg/Quat +++ b/include/osg/Quat @@ -86,6 +86,10 @@ class SG_EXPORT Quat inline float z() const { return _fv[2]; } inline float w() const { return _fv[3]; } + /** return true if the Quat represents a zero rotation, and therefore can be ignored in computations.*/ + bool zeroRotation() const { return _fv[0]==0.0f && _fv[1]==0.0f && _fv[2]==0.0f && _fv[3]==1.0f; } + + /* ------------------------------------------------------------- BASIC ARITHMETIC METHODS Implemented in terms of Vec4s. Some Vec4 operators, e.g. diff --git a/include/osgText/Text b/include/osgText/Text index 56f1ac737..eaa768be2 100644 --- a/include/osgText/Text +++ b/include/osgText/Text @@ -97,8 +97,8 @@ class OSGTEXT_EXPORT Text : public osg::Drawable Font* getFont() { return _font.get(); } const Font* getFont() const { return _font.get(); } - void setText(const char* text) { _text=text; } - void setText(const std::string& text) { _text=text; } + void setText(const char* text) { _text=text; _initAlignment=false; } + void setText(const std::string& text) { _text=text; _initAlignment=false; } const std::string& getText() const { return _text; } virtual void drawImmediateMode(osg::State& state); diff --git a/src/osg/Camera.cpp b/src/osg/Camera.cpp index 17558c5af..c1a0f110b 100644 --- a/src/osg/Camera.cpp +++ b/src/osg/Camera.cpp @@ -208,7 +208,7 @@ void Camera::setNearFar(double zNear, double zFar) /** Adjust the clipping planes to account for a new window aspcect ratio. * Typicall used after resizeing a window.*/ -void Camera::adjustAspectRatio(double newAspectRatio, const AdjustAspectRatioMode aa) +void Camera::adjustAspectRatio(double newAspectRatio, AdjustAspectRatioMode aa) { if (newAspectRatio<0.01f || newAspectRatio>100.0f) { @@ -424,7 +424,7 @@ Matrix* Camera::getTransform(TransformMode mode) } } -const Matrix* Camera::getTransform(const TransformMode mode) const +const Matrix* Camera::getTransform(TransformMode mode) const { switch(mode) {