67 if (
_v[0]<v.
_v[0])
return true;
68 else if (
_v[0]>v.
_v[0])
return false;
69 else if (
_v[1]<v.
_v[1])
return true;
70 else if (
_v[1]>v.
_v[1])
return false;
71 else if (
_v[2]<v.
_v[2])
return true;
72 else if (
_v[2]>v.
_v[2])
return false;
73 else return (
_v[3]<v.
_v[3]);
109 return (
unsigned int)
clampTo((
_v[0]*255.0f),0.0f,255.0f)<<24 |
110 (
unsigned int)
clampTo((
_v[1]*255.0f),0.0f,255.0f)<<16 |
111 (
unsigned int)
clampTo((
_v[2]*255.0f),0.0f,255.0f)<<8 |
112 (
unsigned int)
clampTo((
_v[3]*255.0f),0.0f,255.0f);
117 return (
unsigned int)
clampTo((
_v[3]*255.0f),0.0f,255.0f)<<24 |
118 (
unsigned int)
clampTo((
_v[2]*255.0f),0.0f,255.0f)<<16 |
119 (
unsigned int)
clampTo((
_v[1]*255.0f),0.0f,255.0f)<<8 |
120 (
unsigned int)
clampTo((
_v[0]*255.0f),0.0f,255.0f);
131 return _v[0]*rhs.
_v[0]+
245 return lhs[0]*rhs[0]+lhs[1]*rhs[1]+lhs[2]*rhs[2]+rhs[3];
251 return lhs[0]*rhs[0]+lhs[1]*rhs[1]+lhs[2]*rhs[2]+lhs[3];
257 return Vec4f(lhs[0]*rhs[0], lhs[1]*rhs[1], lhs[2]*rhs[2], lhs[3]*rhs[3]);
263 return Vec4f(lhs[0]/rhs[0], lhs[1]/rhs[1], lhs[2]/rhs[2], lhs[3]/rhs[3]);
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
Vec3f operator*(const Vec3f &v, const Matrixd &m)
Definition Matrixd:793
Vec2d componentDivide(const Vec2d &lhs, const Vec2d &rhs)
divide rhs components by rhs vector components.
Definition Vec2d:187
bool isNaN(float v)
Definition Math:133
T clampTo(T v, T minimum, T maximum)
Definition Math:88
Vec2d componentMultiply(const Vec2d &lhs, const Vec2d &rhs)
multiply by vector components.
Definition Vec2d:181
General purpose float triple for use as vertices, vectors and normals.
Definition Vec3f:29
General purpose float quad.
Definition Vec4f:28
void set(value_type x, value_type y, value_type z, value_type w)
Definition Vec4f:79
Vec4f & operator/=(value_type rhs)
Unary divide by scalar.
Definition Vec4f:160
value_type g() const
Definition Vec4f:103
Vec4f operator+(const Vec4f &rhs) const
Binary vector add.
Definition Vec4f:170
unsigned int asABGR() const
Definition Vec4f:107
Vec4f operator/(value_type rhs) const
Divide by scalar.
Definition Vec4f:154
bool isNaN() const
Returns true if at least one component has value NaN.
Definition Vec4f:126
Vec4f & operator-=(const Vec4f &rhs)
Unary vector subtract.
Definition Vec4f:196
Vec4f & operator+=(const Vec4f &rhs)
Unary vector add.
Definition Vec4f:179
bool operator==(const Vec4f &v) const
Definition Vec4f:61
value_type _v[4]
Vec member variable.
Definition Vec4f:38
bool operator<(const Vec4f &v) const
Definition Vec4f:65
value_type normalize()
Normalize the vector so that it has length unity.
Definition Vec4f:226
value_type & r()
Definition Vec4f:97
const Vec4f operator-() const
Negation operator.
Definition Vec4f:206
value_type x() const
Definition Vec4f:92
value_type y() const
Definition Vec4f:93
Vec4f & operator*=(value_type rhs)
Unary multiply by scalar.
Definition Vec4f:144
value_type r() const
Definition Vec4f:102
value_type & y()
Definition Vec4f:88
bool valid() const
Returns true if all components have values that are not NaN.
Definition Vec4f:124
bool operator!=(const Vec4f &v) const
Definition Vec4f:63
value_type & g()
Definition Vec4f:98
value_type length() const
Length of the vector = sqrt( vec .
Definition Vec4f:212
value_type & a()
Definition Vec4f:100
value_type & x()
Definition Vec4f:87
Vec4f()
Constructor that sets all components of the vector to zero.
Definition Vec4f:43
Vec4f(value_type x, value_type y, value_type z, value_type w)
Definition Vec4f:45
unsigned int asRGBA() const
Definition Vec4f:115
value_type & operator[](unsigned int i)
Definition Vec4f:84
value_type w() const
Definition Vec4f:95
value_type operator*(const Vec4f &rhs) const
Dot product.
Definition Vec4f:129
value_type & z()
Definition Vec4f:89
value_type * ptr()
Definition Vec4f:76
value_type b() const
Definition Vec4f:104
Vec4f(const Vec3f &v3, value_type w)
Definition Vec4f:53
value_type & w()
Definition Vec4f:90
value_type a() const
Definition Vec4f:105
float value_type
Data type of vector components.
Definition Vec4f:32
value_type & b()
Definition Vec4f:99
const value_type * ptr() const
Definition Vec4f:77
value_type length2() const
Length squared of the vector = vec .
Definition Vec4f:218
value_type z() const
Definition Vec4f:94
@ num_components
Definition Vec4f:35