From Paul Martz, typos and spelling fixes

This commit is contained in:
Robert Osfield
2004-09-07 10:07:11 +00:00
parent 46c830cc12
commit 767b397534
10 changed files with 175 additions and 170 deletions

View File

@@ -22,10 +22,10 @@ namespace osg {
class BoundingBox;
/** General purpose bounding sphere class for enclosing nodes/objects/vertices.
Used to bound internal osg::Node's in the scene,
to assist in view frustum culling etc. Similar in function to BoundingBox
but is quicker for evaluating culling, but generally encloses a greater volume
than a BoundingBox so will not cull so aggressively.
* Bounds internal osg::Nodes in the scene, assists in view frustum culling,
* etc. Similar in function to BoundingBox, it's quicker for evaluating
* culling but generally will not cull as aggressively because it encloses a
* greater volume.
*/
class SG_EXPORT BoundingSphere
{
@@ -34,87 +34,81 @@ class SG_EXPORT BoundingSphere
Vec3 _center;
float _radius;
/** construct to invalid values to represent an unset bounding sphere.*/
/** Construct a default bounding sphere with radius to -1.0f, representing an invalid/unset bounding sphere.*/
BoundingSphere() : _center(0.0f,0.0f,0.0f),_radius(-1.0f) {}
/** construct to specified bounding sphere.*/
/** Creates a bounding sphere initialized to the given extents. */
BoundingSphere(const Vec3& center,float radius) : _center(center),_radius(radius) {}
/** initialize to invalid values to represent an unset bounding sphere.*/
/** Clear the bounding sphere. Reset to default values. */
inline void init()
{
_center.set(0.0f,0.0f,0.0f);
_radius = -1.0f;
}
/** return true if the bounding sphere contains valid values,
false if the bounding sphere is effectively unset.*/
/** Returns true of the bounding sphere extents are valid, false
* otherwise. */
inline bool valid() const { return _radius>=0.0f; }
/** set bounding sphere.*/
/** Set the bounding sphere to the given center/radius. */
inline void set(const Vec3& center,float radius)
{
_center = center;
_radius = radius;
}
/** return the center of the bounding sphere.*/
/** Returns the center of the bounding sphere. */
inline Vec3& center() { return _center; }
/** return the const center of the bounding sphere.*/
/** Returns the const center of the bounding sphere. */
inline const Vec3& center() const { return _center; }
/** return the radius of the bounding sphere.*/
/** Returns the radius of the bounding sphere. */
inline float& radius() { return _radius; }
/** return the const radius of the bounding sphere.*/
/** Returns the const radius of the bounding sphere. */
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.*/
/** Returns the squared length of the radius. Note, For performance
* reasons, the calling method is responsible for checking to make
* sure the sphere is valid. */
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
minimizes the radius increase. If this sphere is empty then
move the center to v and set radius to 0.*/
/** Expands the sphere to encompass the given point. Repositions the
* sphere center to minimize the radius increase. If the sphere is
* uninitialized, set its center to v and radius to zero. */
void expandBy(const Vec3& v);
/** If the vertex is outwith the sphere expand radius to ecompass vertex.
Unlike update, does not move the center, just increasing the radius.
If this sphere is empty then move the centrer to v and set radius to 0 */
/** Expands the sphere to encompass the given point. Does not
* reposition the sphere center. If the sphere is
* uninitialized, set its center to v and radius to zero. */
void expandRadiusBy(const Vec3& v);
/** If incomming sphere is outwith the sphere expand to ecompass incomming sphere.
calculates the combination of movement of center and radius which
minimizes the radius increase. If this sphere is empty then
move the centrer to v and set radius to 0.*/
/** Expands the sphere to encompass the given sphere. Repositions the
* sphere center to minimize the radius increase. If the sphere is
* uninitialized, set its center and radius to match sh. */
void expandBy(const BoundingSphere& sh);
/** If incomming sphere is outwith the sphere expand radius to ecompass incomming sphere.
Unlike update, does not move the center, just increasing the radius.
If this sphere is empty then move the centrer to v and set radius to 0. */
/** Expands the sphere to encompass the given sphere. Does not
* repositions the sphere center. If the sphere is
* uninitialized, set its center and radius to match sh. */
void expandRadiusBy(const BoundingSphere& sh);
/** If incomming box is outwith the sphere expand to ecompass incomming box.
calculates the combination of movement of center and radius which
minimizes the radius increase. If this boz is empty then
move the centrer to v and set radius to 0.*/
/** Expands the sphere to encompass the given box. Repositions the
* sphere center to minimize the radius increase. */
void expandBy(const BoundingBox& bb);
/** If incomming box is outwith the sphere expand radius to ecompass incomming box.
Unlike update, does not move the center, just increasing the radius.
If this sphere is empty then move the centrer to v and set radius to 0. */
/** Expands the sphere to encompass the given box. Does not
* repositions the sphere center. */
void expandRadiusBy(const BoundingBox& bb);
/** return true is vertex v is within the sphere.*/
/** Returns true if v is within the sphere. */
inline bool contains(const Vec3& v) const
{
return valid() && ((v-_center).length2()<=radius2());
}
/** return true if bounding sphere's intersect each other.*/
/** Returns true if there is a non-empty intersection with the given
* bounding sphere. */
inline bool intersects( const BoundingSphere& bs ) const
{
return valid() && bs.valid() &&

View File

@@ -19,9 +19,9 @@
namespace osg {
/** if value is greater than or equal to minValue do nothing - legal value,
* otherwise clamp value to specified maximum value and return warning
* with valueName specifying which variable was clamped.*/
/** If value is greater than or equal to minValue do nothing - legal value,
* Otherwise set value to minValue, and warn that valueName was clamped.
* Note this is effectively A=max(A,B). */
template <class T>
inline void clampGEQUAL(T& value,const T minValue,const char* valueName)
{
@@ -32,9 +32,9 @@ inline void clampGEQUAL(T& value,const T minValue,const char* valueName)
}
}
/** if value is less than or equal to maxValue do nothing - legal value,
* otherwise clamp value to specified maximum value and return warning
* with valueName specifying which variable was clamped.*/
/** If value is less than or equal to maxValue do nothing - legal value,
* Otherwise set value to maxValue, and warn that valueName was clamped.
* Note this is effectively A=min(A,B). */
template <class T>
inline void clampLEQUAL(T& value,const T maxValue,const char* valueName)
{
@@ -45,10 +45,11 @@ inline void clampLEQUAL(T& value,const T maxValue,const char* valueName)
}
}
/** if value is between or equal to minValue and maxValue do nothing - legal value,
* otherwise clamp value to specified to range and return warning
* with valueName specifying which variable was clamped. Equivilant to
* calling clampGEQUAL(value,minValue,valueName); clampLEQUAL(value,maxValue,valueName); */
/** If value is between or equal to minValue and maxValue do nothing - legal
* value, Otherwise clamp value to specified range and warn that valueName
* was clamped. Equivilant to calling
* clampGEQUAL( value, minValue, valueName );
* clampLEQUAL( value, maxValue, valueName ); */
template <class T>
inline void clampBetweenRange(T& value,const T minValue,const T maxValue,const char* valueName)
{
@@ -66,9 +67,9 @@ inline void clampBetweenRange(T& value,const T minValue,const T maxValue,const c
}
/** if array element value[i] is greater than or equal to minValue do nothing - legal value,
* otherwise clamp value to specified maximum value and return warning
* with valueName specifying which variable was clamped.*/
/** If value[i] is greater than or equal to minValue do nothing - legal value,
* Otherwise set value[i] to minValue, and warn that valueName[i] was clamped.
* Note this is effectively A[i]=max(A[i],B). */
template <class A, class T>
inline void clampArrayElementGEQUAL(A& value,unsigned int i,const T minValue,const char* valueName)
{
@@ -79,9 +80,9 @@ inline void clampArrayElementGEQUAL(A& value,unsigned int i,const T minValue,con
}
}
/** if array element value[i] is less than or equal to maxValue do nothing - legal value,
* otherwise clamp value to specified maximum value and return warning
* with valueName specifying which variable was clamped.*/
/** If value[i] is less than or equal to maxValue do nothing - legal value,
* Otherwise set value[i] to maxValue, and warn that valueName[i] was clamped.
* Note this is effectively A[i]=min(A[i],B). */
template <class A, class T>
inline void clampArrayElementLEQUAL(A& value,unsigned int i,const T maxValue,const char* valueName)
{
@@ -92,10 +93,11 @@ inline void clampArrayElementLEQUAL(A& value,unsigned int i,const T maxValue,con
}
}
/** if array element value[i] is between or equal to minValue and maxValue do nothing - legal value,
* otherwise clamp value to specified to range and return warning
* with valueName specifying which variable was clamped. Equivilant to
* calling clampGEQUAL(value,minValue,valueName); clampLEQUAL(value,maxValue,valueName); */
/** If value[i] is between or equal to minValue and maxValue do nothing - legal
* value, Otherwise clamp value[i] to specified range and warn that
* valueName[i] was clamped. Equivilant to calling
* clampArrayElementGEQUAL( value, i, minValue, valueName );
* clampArrayElementLEQUAL( value, i, maxValue, valueName ); */
template <class A, class T>
inline void clampArrayElementBetweenRange(A& value,unsigned int i,const T minValue,const T maxValue,const char* valueName)
{
@@ -113,9 +115,9 @@ inline void clampArrayElementBetweenRange(A& value,unsigned int i,const T minVal
}
/** if array elements are greater than or equal to minValue do nothing - legal value,
* otherwise clamp value to specified maximum value and return warning
* with valueName specifying which variable was clamped.*/
/** For each element of value[] in the range (first,last), if the element is
* greater than or equal to minValue do nothing - legal value, Otherwise
* clamp the element to minValue, and warn that valueName[i] was clamped. */
template <class A, class T>
inline void clampArrayElementsGEQUAL(A& value,unsigned int first,unsigned int last,const T minValue,const char* valueName)
{
@@ -123,9 +125,9 @@ inline void clampArrayElementsGEQUAL(A& value,unsigned int first,unsigned int la
clampArrayElementGEQUAL(value,i,minValue,valueName);
}
/** if array elements are less than or equal to maxValue do nothing - legal value,
* otherwise clamp value to specified maximum value and return warning
* with valueName specifying which variable was clamped.*/
/** For each element of value[] in the range (first,last), if the element is
* less than or equal to maxValue do nothing - legal value, Otherwise clamp
* the element to maxValue, and warn that valueName[i] was clamped. */
template <class A, class T>
inline void clampArrayElementsLEQUAL(A& value,unsigned int first,unsigned int last,const T maxValue,const char* valueName)
{
@@ -133,10 +135,12 @@ inline void clampArrayElementsLEQUAL(A& value,unsigned int first,unsigned int la
clampArrayElementLEQUAL(value,i,maxValue,valueName);
}
/** if array elements are between or equal to minValue and maxValue do nothing - legal value,
* otherwise clamp value to specified to range and return warning
* with valueName specifying which variable was clamped. Equivalent to
* calling clampGEQUAL(value,minValue,valueName); clampLEQUAL(value,maxValue,valueName); */
/** For each element of value[] in the range (first,last), if the element is
* between or equal to minValue and maxValue do nothing - legal value,
* Otherwise clamp the element to the range and warn that valueName[i] was
* clamped. Equivalent to calling
* clampArrayElementsGEQUAL( value, first, last, minValue, valueName);
* clampArrayElementsLEQUAL( value, first, last, maxValue, valueName); */
template <class A, class T>
inline void clampArrayElementsBetweenRange(A& value,unsigned int first,unsigned int last,const T minValue,const T maxValue,const char* valueName)
{
@@ -145,28 +149,30 @@ inline void clampArrayElementsBetweenRange(A& value,unsigned int first,unsigned
}
/** if array4 elements are greater than or equal to minValue do nothing - legal value,
* otherwise clamp value to specified maximum value and return warning
* with valueName specifying which variable was clamped.*/
/** For each element of the three-element array value[], if the element is
* greater than or equal to minValue do nothing - legal value, Otherwise
* clamp the element to minValue, and warn that valueName[i] was clamped. */
template <class A, class T>
inline void clampArray3GEQUAL(A& value,const T minValue,const char* valueName)
{
clampArrayElementsGEQUAL(value,0u,2u,minValue,valueName);
}
/** if array4 elements are is less than or equal to maxValue do nothing - legal value,
* otherwise clamp value to specified maximum value and return warning
* with valueName specifying which variable was clamped.*/
/** For each element of the three-element array value[], if the element is
* less than or equal to maxValue do nothing - legal value, Otherwise clamp
* the element to maxValue, and warn that valueName[i] was clamped. */
template <class A, class T>
inline void clampArray3LEQUAL(A& value,const T maxValue,const char* valueName)
{
clampArrayElementsLEQUAL(value,0u,2u,maxValue,valueName);
}
/** if array4 elements are between or equal to minValue and maxValue do nothing - legal value,
* otherwise clamp value to specified to range and return warning
* with valueName specifying which variable was clamped. Equivilant to
* calling clampGEQUAL(value,minValue,valueName); clampLEQUAL(value,maxValue,valueName); */
/** For each element of the three-element array value[], if the element is
* between or equal to minValue and maxValue do nothing - legal value,
* Otherwise clamp the element to the range and warn that valueName[i] was
* clamped. Equivalent to calling
* clampArray3GEQUAL( value, minValue, valueName);
* clampArray3LEQUAL( value, maxValue, valueName); */
template <class A, class T>
inline void clampArray3BetweenRange(A& value,const T minValue,const T maxValue,const char* valueName)
{
@@ -175,28 +181,30 @@ inline void clampArray3BetweenRange(A& value,const T minValue,const T maxValue,c
/** if array4 elements are greater than or equal to minValue do nothing - legal value,
* otherwise clamp value to specified maximum value and return warning
* with valueName specifying which variable was clamped.*/
/** For each element of the four-element array value[], if the element is
* greater than or equal to minValue do nothing - legal value, Otherwise
* clamp the element to minValue, and warn that valueName[i] was clamped. */
template <class A, class T>
inline void clampArray4GEQUAL(A& value,const T minValue,const char* valueName)
{
clampArrayElementsGEQUAL(value,0u,3u,minValue,valueName);
}
/** if array4 elements are is less than or equal to maxValue do nothing - legal value,
* otherwise clamp value to specified maximum value and return warning
* with valueName specifying which variable was clamped.*/
/** For each element of the four-element array value[], if the element is
* less than or equal to maxValue do nothing - legal value, Otherwise clamp
* the element to maxValue, and warn that valueName[i] was clamped. */
template <class A, class T>
inline void clampArray4LEQUAL(A& value,unsigned int first,unsigned int last,const T maxValue,const char* valueName)
{
clampArrayElementsLEQUAL(value,0u,3u,maxValue,valueName);
}
/** if array4 elements are between or equal to minValue and maxValue do nothing - legal value,
* otherwise clamp value to specified to range and return warning
* with valueName specifying which variable was clamped. Equivilant to
* calling clampGEQUAL(value,minValue,valueName); clampLEQUAL(value,maxValue,valueName); */
/** For each element of the four-element array value[], if the element is
* between or equal to minValue and maxValue do nothing - legal value,
* Otherwise clamp the element to the range and warn that valueName[i] was
* clamped. Equivalent to calling
* clampArray4GEQUAL( value, minValue, valueName);
* clampArray4LEQUAL( value, maxValue, valueName); */
template <class A, class T>
inline void clampArray4BetweenRange(A& value,const T minValue,const T maxValue,const char* valueName)
{

View File

@@ -19,15 +19,13 @@
namespace osg {
/** ClearNode is a Group node which controls the clearing of the color and depth
* buffers at the start of each frame.
* The earth sky by default is empty and simply holds the clear color of
* the background. However, if the uses wants to add their own clearing of
* the color and depth buffers then the children can be added, and the
* background clear turned off. The ClearNode by default has StateSet attached
* to it which sets the default ClearNode bin number to -1, so that all drawables
* below it are placed in a separate bin from the rest of the scene graph, and
* are rendered prior to standard opaque and transparent drawables.
/** A Group node for clearing the color and depth buffers. Use setClearColor
* to change the clear color, and setRequiresClear to disable/enable the call
* clearing. You might want to disable clearing if you perform your clear by
* drawing fullscreen geometry. If you do this, add child nodes to perform
* such drawing. The default StateSet associated with this node places
* children in render bin -1 to ensure that children are rendered prior to
* the rest of the scene graph.
*/
class SG_EXPORT ClearNode : public Group
{
@@ -43,16 +41,16 @@ 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. */
/** Enable/disable clearing via glClear. */
inline void setRequiresClear(bool requiresClear) { _requiresClear = requiresClear; }
/** Gets the flag which control whether a glClear is required at the beginning of each frame. */
/** Gets whether clearing is enabled or disabled. */
inline bool getRequiresClear() const { return _requiresClear; }
/** Sets the clear color. */
/** Sets the clear color. */
inline void setClearColor(const Vec4& color) { _clearColor = color; }
/** Returns the clear color. */
/** Returns the clear color. */
inline const Vec4& getClearColor() const { return _clearColor; }
protected :

View File

@@ -34,42 +34,42 @@ class SG_EXPORT ClipNode : public Group
META_Node(osg, ClipNode);
/** Create a 6 clip planes to create a clip box.*/
void createClipBox(const BoundingBox& bb,unsigned int clipPlaneNumberBase=0);
/** Creates six clip planes corresponding to the given BoundingBox. */
void createClipBox(const BoundingBox& bb,unsigned int clipPlaneNumberBase=0);
/** Add a ClipPlane to a ClipNode. Return true if plane is added,
* return false if plane already exists in ClipNode, or clipplane is false.*/
/** Adds the clipplane. Returns true on success, and false if the plane
* has already been added, or if clipplane is NULL. */
bool addClipPlane(ClipPlane* clipplane);
/** Remove ClipPlane from a ClipNode. Return true if plane is removed,
* return false if plane does not exists in ClipNode.*/
/** Removes the clipplane. Returns true on success, false if clipplane
* isn't in this ClipNode.*/
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.*/
/** Remove the ClipPlane with the given index. Returns true on success,
* false if pos is not a valid plane index. */
bool removeClipPlane(unsigned int pos);
/** return the number of ClipPlanes.*/
/** Returns the number of ClipPlanes. */
inline unsigned int getNumClipPlanes() const { return _planes.size(); }
/** Get ClipPlane at specificed index position.*/
/** Get ClipPlane at the given index position. */
inline ClipPlane* getClipPlane(unsigned int pos) { return _planes[pos].get(); }
/** Get const ClipPlane at specificed index position.*/
/** Get const ClipPlane at the given index position. */
inline const ClipPlane* getClipPlane(unsigned int pos) const { return _planes[pos].get(); }
/** Get the ClipPlaneList.*/
/** Get the ClipPlaneList. */
inline ClipPlaneList& getClipPlaneList() { return _planes; }
/** Get the const ClipPlaneList.*/
/** Get the const ClipPlaneList. */
inline const ClipPlaneList& getClipPlaneList() const { return _planes; }
/** Set the GLModes on StateSet associated with the ClipPlanes.*/
/** Set the GLModes for all ClipPlanes, on the StateSet. */
void setStateSetModes(StateSet&,StateAttribute::GLModeValue) const;
/** Set up the local StateSet */
/** Set up the local StateSet. */
void setLocalStateSetModes(StateAttribute::GLModeValue=StateAttribute::ON);
protected:

View File

@@ -19,7 +19,8 @@
namespace osg {
/** ClipPlane state class which encapsulates OpenGL glClipPlane() functionality.*/
/** Encapsulates OpenGL glClipPlane().
*/
class SG_EXPORT ClipPlane : public StateAttribute
{
public :
@@ -29,7 +30,7 @@ class SG_EXPORT ClipPlane : public StateAttribute
inline ClipPlane(unsigned int no,const Plane& plane) { setClipPlaneNum(no); setClipPlane(plane); }
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.*/
/** Copy constructor using CopyOp to manage deep vs shallow copy. */
ClipPlane(const ClipPlane& cp,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
StateAttribute(cp,copyop)
{
@@ -42,21 +43,21 @@ class SG_EXPORT ClipPlane : public StateAttribute
META_StateAttribute(osg, ClipPlane, (Type)(CLIPPLANE+_clipPlaneNum));
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
/** Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. */
virtual int compare(const StateAttribute& sa) const
{
// check the types are equal and then create the rhs variable
// used by the COMPARE_StateAttribute_Paramter macro's below.
// Check for equal types, then create the rhs variable
// used by the COMPARE_StateAttribute_Paramter macros below.
COMPARE_StateAttribute_Types(ClipPlane,sa)
// compare each paramter in turn against the rhs.
// Compare each parameter in turn against the rhs.
COMPARE_StateAttribute_Parameter(_clipPlaneNum)
COMPARE_StateAttribute_Parameter(_clipPlane[0])
COMPARE_StateAttribute_Parameter(_clipPlane[1])
COMPARE_StateAttribute_Parameter(_clipPlane[2])
COMPARE_StateAttribute_Parameter(_clipPlane[3])
return 0; // passed all the above comparison macro's, must be equal.
return 0; // Passed all the above comparison macros, so must be equal.
}
virtual bool getModeUsage(ModeUsage& usage) const
@@ -66,37 +67,37 @@ class SG_EXPORT ClipPlane : public StateAttribute
}
/** Set the clip plane, using a Vec4 to define plane. */
/** Defines the clip plane with the given Vec4. */
void setClipPlane(const Vec4& plane);
/** Set the clip plane, using a Plane to define plane. */
/** Defines this plane with the given Plane. */
void setClipPlane(const Plane& plane);
/** Set the clip plane, using a double[4] to define plane. */
/** Defines the clip plane with the given double[4]. */
void setClipPlane(const double* plane);
/** Set the clip plane, using a a to define plane. */
/** Defines the plane as [ a b c d ]. */
void setClipPlane(double a,double b,double c,double d)
{
_clipPlane[0]=a;_clipPlane[1]=b;_clipPlane[2]=c;_clipPlane[3]=d;
}
/** Get the clip plane, values entered into a Vec4 passed to the getClipPlane. */
/** Gets the clip plane as a Vec4. */
void getClipPlane(Vec4& plane) const;
/** Get the clip plane, values entered into a Plane passed to the getClipPlane. */
/** Gets the clip plane as a Plane. */
void getClipPlane(Plane& plane) const;
/** Get the clip plane, values entered into a double[4] passed to the getClipPlane. */
/** Gets the clip plane as an array of doubles. */
void getClipPlane(double* plane) const;
/** Set the clip plane number. */
/** Sets the clip plane number. */
void setClipPlaneNum(unsigned int num);
/** Get the clip plane number. */
/** Gets the clip plane number. */
unsigned int getClipPlaneNum() const;
/** Apply the clip plane's state to the OpenGL state machine. */
/** Applies the clip plane's state to the OpenGL state machine. */
virtual void apply(State& state) const;
protected :

View File

@@ -18,8 +18,9 @@
namespace osg {
/** Drawable CullCallback for adding cluster culling to cull back facing
* drawables.*/
/** Implements cluster culling to cull back facing drawables. Derived from
* Drawable::CullCallback.
*/
class SG_EXPORT ClusterCullingCallback : public Drawable::CullCallback
{
public:
@@ -31,7 +32,8 @@ class SG_EXPORT ClusterCullingCallback : public Drawable::CullCallback
META_Object(osg,ClusterCullingCallback)
/** compute the control point, normal and deviation from the contents of the drawable.*/
/** Computes the control point, normal, and deviation from the
* given drawable contents. */
void computeFrom(const osg::Drawable* drawable);
void set(const osg::Vec3& controlPoint, const osg::Vec3& normal, float deviation, float radius);

View File

@@ -46,12 +46,14 @@ class SG_EXPORT CollectOccludersVisitor : public osg::NodeVisitor, public osg::C
virtual void apply(osg::LOD& node);
virtual void apply(osg::OccluderNode& node);
/** Set the minimum shadow occluder volume that an active occluder must have.
* volume is units relative the clip space volume where 1.0 is the whole clip space.*/
/** Sets the minimum shadow occluder volume that an active occluder
* must have. vol is units relative the clip space volume where 1.0
* is the whole clip space. */
void setMinimumShadowOccluderVolume(float vol) { _minimumShadowOccluderVolume = vol; }
float getMinimumShadowOccluderVolume() const { return _minimumShadowOccluderVolume; }
/** Set the maximum number of occluders to have active for culling purposes.*/
/** Sets the maximum number of occluders to have active for culling
* purposes. */
void setMaximumNumberOfActiveOccluders(unsigned int num) { _maximumNumberOfActiveOccluders = num; }
unsigned int getMaximumNumberOfActiveOccluders() const { return _maximumNumberOfActiveOccluders; }
@@ -62,18 +64,18 @@ class SG_EXPORT CollectOccludersVisitor : public osg::NodeVisitor, public osg::C
ShadowVolumeOccluderSet& getCollectedOccluderSet() { return _occluderSet; }
const ShadowVolumeOccluderSet& getCollectedOccluderSet() const { return _occluderSet; }
/** remove occluded occluders for the collected occluders list,
* and then discard of all but MaximumNumberOfActiveOccluders of occluders,
* discarding the occluders with the lowests shadow occluder volume .*/
/** Removes occluded occluders for the collected occluders list, then
* discards all but MaximumNumberOfActiveOccluders of occluders,
* discarding the occluders with the lowests shadow occluder volume. */
void removeOccludedOccluders();
protected:
/** prevent unwanted copy construction.*/
/** Prevents unwanted copy construction. */
//CollectOccludersVisitor(const CollectOccludersVisitor&):osg::NodeVisitor(),osg::CullStack() {}
/** prevent unwanted copy operator.*/
/** Prevents unwanted copy operator. */
CollectOccludersVisitor& operator = (const CollectOccludersVisitor&) { return *this; }
inline void handle_cull_callbacks_and_traverse(osg::Node& node)

View File

@@ -19,7 +19,7 @@
namespace osg {
/** Encapsulate OpenGL glColorMaskFunc/Op/Mask functions.
/** Encapsulates OpenGL glColorMaskFunc/Op/Mask functions.
*/
class SG_EXPORT ColorMask : public StateAttribute
{
@@ -35,7 +35,7 @@ class SG_EXPORT ColorMask : public StateAttribute
_alpha(alpha) {}
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
/** Copy constructor using CopyOp to manage deep vs shallow copy. */
ColorMask(const ColorMask& cm,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
StateAttribute(cm,copyop),
_red(cm._red),
@@ -45,20 +45,20 @@ class SG_EXPORT ColorMask : public StateAttribute
META_StateAttribute(osg, ColorMask, COLORMASK);
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
/** Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. */
virtual int compare(const StateAttribute& sa) const
{
// check the types are equal and then create the rhs variable
// used by the COMPARE_StateAttribute_Paramter macro's below.
// Check for equal types, then create the rhs variable
// used by the COMPARE_StateAttribute_Paramter macros below.
COMPARE_StateAttribute_Types(ColorMask,sa)
// compare each paramter in turn against the rhs.
// Compare each parameter in turn against the rhs.
COMPARE_StateAttribute_Parameter(_red)
COMPARE_StateAttribute_Parameter(_green)
COMPARE_StateAttribute_Parameter(_blue)
COMPARE_StateAttribute_Parameter(_alpha)
return 0; // passed all the above comparison macro's, must be equal.
return 0; // Passed all the above comparison macros, so must be equal.
}
inline void setMask(bool red,bool green,bool blue,bool alpha)

View File

@@ -19,43 +19,43 @@
namespace osg {
/** Texture Matrix state class for encapsulating OpenGL texture matrix functionality.*/
/** Encapsulates OpenGL color matrix functionality. */
class SG_EXPORT ColorMatrix : public StateAttribute
{
public :
ColorMatrix();
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
/** Copy constructor using CopyOp to manage deep vs shallow copy. */
ColorMatrix(const ColorMatrix& cm,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
StateAttribute(cm,copyop),
_matrix(cm._matrix) {}
META_StateAttribute(osg, ColorMatrix, COLORMATRIX);
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
/** Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. */
virtual int compare(const StateAttribute& sa) const
{
// check the types are equal and then create the rhs variable
// used by the COMPARE_StateAttribute_Paramter macro's below.
// Check for equal types, then create the rhs variable
// used by the COMPARE_StateAttribute_Paramter macros below.
COMPARE_StateAttribute_Types(ColorMatrix,sa)
// compare each paramter in turn against the rhs.
// Compare each parameter in turn against the rhs.
COMPARE_StateAttribute_Parameter(_matrix)
return 0; // passed all the above comparison macro's, must be equal.
return 0; // Passed all the above comparison macros, so must be equal.
}
/** Set the color matrix */
/** Sets the color matrix. */
inline void setMatrix(const Matrix& matrix) { _matrix = matrix; }
/** Get the color matrix */
/** Gets the color matrix. */
inline Matrix& getMatrix() { return _matrix; }
/** Get the const color matrix */
/** Gets the const color matrix. */
inline const Matrix& getMatrix() const { return _matrix; }
/** apply as OpenGL texture matrix.*/
/** Applies as OpenGL texture matrix. */
virtual void apply(State& state) const;
protected:

View File

@@ -19,9 +19,9 @@
namespace osg {
/** Simple buffered value array which is used for values that need to multibuffered on
* one per graphics context basis.*/
/** Implements a simple buffered value for values that need to be buffered on
* a per graphics context basis.
*/
template<class T>
class buffered_value
{