From Alexander Wiebel, "I came across some functions in Vec* that I thought could benefit from some
doxygen documentation. Additionally, I made the comment on value_type more meaningful (in my opinion)."
This commit is contained in:
parent
c6a1b7e97f
commit
93ad63405f
@ -28,7 +28,7 @@ class Vec2b
|
||||
|
||||
// Methods are defined here so that they are implicitly inlined
|
||||
|
||||
/** Type of Vec class.*/
|
||||
/** Data type of vector components.*/
|
||||
typedef signed char value_type;
|
||||
|
||||
/** Number of vector components. */
|
||||
@ -37,6 +37,7 @@ class Vec2b
|
||||
/** Vec member variable. */
|
||||
value_type _v[2];
|
||||
|
||||
/** Constructor that sets all components of the vector to zero */
|
||||
Vec2b() { _v[0]=0; _v[1]=0; }
|
||||
|
||||
Vec2b(value_type r, value_type g)
|
||||
|
@ -29,7 +29,7 @@ class Vec2d
|
||||
{
|
||||
public:
|
||||
|
||||
/** Type of Vec class.*/
|
||||
/** Data type of vector components.*/
|
||||
typedef double value_type;
|
||||
|
||||
/** Number of vector components. */
|
||||
@ -37,6 +37,7 @@ class Vec2d
|
||||
|
||||
value_type _v[2];
|
||||
|
||||
/** Constructor that sets all components of the vector to zero */
|
||||
Vec2d() {_v[0]=0.0; _v[1]=0.0;}
|
||||
|
||||
Vec2d(value_type x,value_type y) { _v[0]=x; _v[1]=y; }
|
||||
@ -71,7 +72,9 @@ class Vec2d
|
||||
inline value_type x() const { return _v[0]; }
|
||||
inline value_type y() const { return _v[1]; }
|
||||
|
||||
/** Returns true if all components have values that are not NaN. */
|
||||
inline bool valid() const { return !isNaN(); }
|
||||
/** Returns true if at least one component has value NaN. */
|
||||
inline bool isNaN() const { return osg::isNaN(_v[0]) || osg::isNaN(_v[1]); }
|
||||
|
||||
/** Dot product. */
|
||||
|
@ -29,7 +29,7 @@ class Vec2f
|
||||
{
|
||||
public:
|
||||
|
||||
/** Type of Vec class.*/
|
||||
/** Data type of vector components.*/
|
||||
typedef float value_type;
|
||||
|
||||
/** Number of vector components. */
|
||||
@ -39,6 +39,7 @@ class Vec2f
|
||||
value_type _v[2];
|
||||
|
||||
|
||||
/** Constructor that sets all components of the vector to zero */
|
||||
Vec2f() {_v[0]=0.0; _v[1]=0.0;}
|
||||
Vec2f(value_type x,value_type y) { _v[0]=x; _v[1]=y; }
|
||||
|
||||
@ -68,7 +69,9 @@ class Vec2f
|
||||
inline value_type x() const { return _v[0]; }
|
||||
inline value_type y() const { return _v[1]; }
|
||||
|
||||
/** Returns true if all components have values that are not NaN. */
|
||||
inline bool valid() const { return !isNaN(); }
|
||||
/** Returns true if at least one component has value NaN. */
|
||||
inline bool isNaN() const { return osg::isNaN(_v[0]) || osg::isNaN(_v[1]); }
|
||||
|
||||
/** Dot product. */
|
||||
|
@ -20,7 +20,7 @@ class Vec2s
|
||||
{
|
||||
public:
|
||||
|
||||
/** Type of Vec class.*/
|
||||
/** Data type of vector components.*/
|
||||
typedef short value_type;
|
||||
|
||||
/** Number of vector components. */
|
||||
@ -28,6 +28,7 @@ class Vec2s
|
||||
|
||||
value_type _v[2];
|
||||
|
||||
/** Constructor that sets all components of the vector to zero */
|
||||
Vec2s() { _v[0]=0; _v[1]=0; }
|
||||
|
||||
Vec2s(value_type x, value_type y) { _v[0] = x; _v[1] = y; }
|
||||
|
@ -26,7 +26,7 @@ class Vec3b
|
||||
{
|
||||
public:
|
||||
|
||||
/** Type of Vec class.*/
|
||||
/** Data type of vector components.*/
|
||||
typedef signed char value_type;
|
||||
|
||||
/** Number of vector components. */
|
||||
@ -34,6 +34,7 @@ class Vec3b
|
||||
|
||||
value_type _v[3];
|
||||
|
||||
/** Constructor that sets all components of the vector to zero */
|
||||
Vec3b() { _v[0]=0; _v[1]=0; _v[2]=0; }
|
||||
|
||||
Vec3b(value_type r, value_type g, value_type b) { _v[0]=r; _v[1]=g; _v[2]=b; }
|
||||
|
@ -30,7 +30,7 @@ class Vec3d
|
||||
{
|
||||
public:
|
||||
|
||||
/** Type of Vec class.*/
|
||||
/** Data type of vector components.*/
|
||||
typedef double value_type;
|
||||
|
||||
/** Number of vector components. */
|
||||
@ -38,6 +38,7 @@ class Vec3d
|
||||
|
||||
value_type _v[3];
|
||||
|
||||
/** Constructor that sets all components of the vector to zero */
|
||||
Vec3d() { _v[0]=0.0; _v[1]=0.0; _v[2]=0.0;}
|
||||
|
||||
inline Vec3d(const Vec3f& vec) { _v[0]=vec._v[0]; _v[1]=vec._v[1]; _v[2]=vec._v[2];}
|
||||
@ -89,7 +90,9 @@ class Vec3d
|
||||
inline value_type y() const { return _v[1]; }
|
||||
inline value_type z() const { return _v[2]; }
|
||||
|
||||
/** Returns true if all components have values that are not NaN. */
|
||||
inline bool valid() const { return !isNaN(); }
|
||||
/** Returns true if at least one component has value NaN. */
|
||||
inline bool isNaN() const { return osg::isNaN(_v[0]) || osg::isNaN(_v[1]) || osg::isNaN(_v[2]); }
|
||||
|
||||
/** Dot product. */
|
||||
|
@ -29,7 +29,7 @@ class Vec3f
|
||||
{
|
||||
public:
|
||||
|
||||
/** Type of Vec class.*/
|
||||
/** Data type of vector components.*/
|
||||
typedef float value_type;
|
||||
|
||||
/** Number of vector components. */
|
||||
@ -37,6 +37,7 @@ class Vec3f
|
||||
|
||||
value_type _v[3];
|
||||
|
||||
/** Constructor that sets all components of the vector to zero */
|
||||
Vec3f() { _v[0]=0.0f; _v[1]=0.0f; _v[2]=0.0f;}
|
||||
Vec3f(value_type x,value_type y,value_type z) { _v[0]=x; _v[1]=y; _v[2]=z; }
|
||||
Vec3f(const Vec2f& v2,value_type zz)
|
||||
@ -84,7 +85,9 @@ class Vec3f
|
||||
inline value_type y() const { return _v[1]; }
|
||||
inline value_type z() const { return _v[2]; }
|
||||
|
||||
/** Returns true if all components have values that are not NaN. */
|
||||
inline bool valid() const { return !isNaN(); }
|
||||
/** Returns true if at least one component has value NaN. */
|
||||
inline bool isNaN() const { return osg::isNaN(_v[0]) || osg::isNaN(_v[1]) || osg::isNaN(_v[2]); }
|
||||
|
||||
/** Dot product. */
|
||||
|
@ -20,7 +20,7 @@ class Vec3s
|
||||
{
|
||||
public:
|
||||
|
||||
/** Type of Vec class.*/
|
||||
/** Data type of vector components.*/
|
||||
typedef short value_type;
|
||||
|
||||
/** Number of vector components. */
|
||||
@ -28,6 +28,7 @@ class Vec3s
|
||||
|
||||
value_type _v[3];
|
||||
|
||||
/** Constructor that sets all components of the vector to zero */
|
||||
Vec3s() { _v[0]=0; _v[1]=0; _v[2]=0; }
|
||||
|
||||
Vec3s(value_type r, value_type g, value_type b) { _v[0]=r; _v[1]=g; _v[2]=b; }
|
||||
|
@ -26,7 +26,7 @@ class Vec4b
|
||||
{
|
||||
public:
|
||||
|
||||
/** Type of Vec class.*/
|
||||
/** Data type of vector components.*/
|
||||
typedef signed char value_type;
|
||||
|
||||
/** Number of vector components. */
|
||||
@ -34,6 +34,7 @@ class Vec4b
|
||||
|
||||
value_type _v[4];
|
||||
|
||||
/** Constructor that sets all components of the vector to zero */
|
||||
Vec4b() { _v[0]=0; _v[1]=0; _v[2]=0; _v[3]=0; }
|
||||
|
||||
Vec4b(value_type x, value_type y, value_type z, value_type w)
|
||||
|
@ -29,7 +29,7 @@ class Vec4d
|
||||
{
|
||||
public:
|
||||
|
||||
/** Type of Vec class.*/
|
||||
/** Data type of vector components.*/
|
||||
typedef double value_type;
|
||||
|
||||
/** Number of vector components. */
|
||||
@ -37,6 +37,7 @@ class Vec4d
|
||||
|
||||
value_type _v[4];
|
||||
|
||||
/** Constructor that sets all components of the vector to zero */
|
||||
Vec4d() { _v[0]=0.0; _v[1]=0.0; _v[2]=0.0; _v[3]=0.0; }
|
||||
|
||||
Vec4d(value_type x, value_type y, value_type z, value_type w)
|
||||
@ -123,7 +124,9 @@ class Vec4d
|
||||
(unsigned int)clampTo((_v[0]*255.0),0.0,255.0);
|
||||
}
|
||||
|
||||
/** Returns true if all components have values that are not NaN. */
|
||||
inline bool valid() const { return !isNaN(); }
|
||||
/** Returns true if at least one component has value NaN. */
|
||||
inline bool isNaN() const { return osg::isNaN(_v[0]) || osg::isNaN(_v[1]) || osg::isNaN(_v[2]) || osg::isNaN(_v[3]); }
|
||||
|
||||
/** Dot product. */
|
||||
|
@ -28,7 +28,7 @@ class Vec4f
|
||||
{
|
||||
public:
|
||||
|
||||
/** Type of Vec class.*/
|
||||
/** Data type of vector components.*/
|
||||
typedef float value_type;
|
||||
|
||||
/** Number of vector components. */
|
||||
@ -39,6 +39,7 @@ class Vec4f
|
||||
|
||||
// Methods are defined here so that they are implicitly inlined
|
||||
|
||||
/** Constructor that sets all components of the vector to zero */
|
||||
Vec4f() { _v[0]=0.0f; _v[1]=0.0f; _v[2]=0.0f; _v[3]=0.0f;}
|
||||
|
||||
Vec4f(value_type x, value_type y, value_type z, value_type w)
|
||||
@ -119,7 +120,9 @@ class Vec4f
|
||||
(unsigned int)clampTo((_v[0]*255.0f),0.0f,255.0f);
|
||||
}
|
||||
|
||||
/** Returns true if all components have values that are not NaN. */
|
||||
inline bool valid() const { return !isNaN(); }
|
||||
/** Returns true if at least one component has value NaN. */
|
||||
inline bool isNaN() const { return osg::isNaN(_v[0]) || osg::isNaN(_v[1]) || osg::isNaN(_v[2]) || osg::isNaN(_v[3]); }
|
||||
|
||||
/** Dot product. */
|
||||
|
@ -26,7 +26,7 @@ class Vec4s
|
||||
{
|
||||
public:
|
||||
|
||||
/** Type of Vec class.*/
|
||||
/** Data type of vector components.*/
|
||||
typedef short value_type;
|
||||
|
||||
/** Number of vector components. */
|
||||
@ -35,6 +35,7 @@ class Vec4s
|
||||
/** Vec member variable. */
|
||||
value_type _v[4];
|
||||
|
||||
/** Constructor that sets all components of the vector to zero */
|
||||
Vec4s() { _v[0]=0; _v[1]=0; _v[2]=0; _v[3]=0; }
|
||||
|
||||
Vec4s(value_type x, value_type y, value_type z, value_type w)
|
||||
|
@ -28,7 +28,7 @@ class Vec4ub
|
||||
{
|
||||
public:
|
||||
|
||||
/** Type of Vec class.*/
|
||||
/** Data type of vector components.*/
|
||||
typedef unsigned char value_type;
|
||||
|
||||
/** Number of vector components. */
|
||||
@ -36,7 +36,8 @@ class Vec4ub
|
||||
|
||||
/** Vec member variable. */
|
||||
value_type _v[4];
|
||||
|
||||
|
||||
/** Constructor that sets all components of the vector to zero */
|
||||
Vec4ub() { _v[0]=0; _v[1]=0; _v[2]=0; _v[3]=0; }
|
||||
|
||||
Vec4ub(value_type x, value_type y, value_type z, value_type w)
|
||||
|
Loading…
Reference in New Issue
Block a user