61 inline operator Vec4f()
const {
return Vec4f(
static_cast<float>(
_v[0]),
static_cast<float>(
_v[1]),
static_cast<float>(
_v[2]),
static_cast<float>(
_v[3]));}
70 if (
_v[0]<v.
_v[0])
return true;
71 else if (
_v[0]>v.
_v[0])
return false;
72 else if (
_v[1]<v.
_v[1])
return true;
73 else if (
_v[1]>v.
_v[1])
return false;
74 else if (
_v[2]<v.
_v[2])
return true;
75 else if (
_v[2]>v.
_v[2])
return false;
76 else return (
_v[3]<v.
_v[3]);
113 return (
unsigned int)
clampTo((
_v[0]*255.0),0.0,255.0)<<24 |
114 (
unsigned int)
clampTo((
_v[1]*255.0),0.0,255.0)<<16 |
115 (
unsigned int)
clampTo((
_v[2]*255.0),0.0,255.0)<<8 |
116 (
unsigned int)
clampTo((
_v[3]*255.0),0.0,255.0);
121 return (
unsigned int)
clampTo((
_v[3]*255.0),0.0,255.0)<<24 |
122 (
unsigned int)
clampTo((
_v[2]*255.0),0.0,255.0)<<16 |
123 (
unsigned int)
clampTo((
_v[1]*255.0),0.0,255.0)<<8 |
124 (
unsigned int)
clampTo((
_v[0]*255.0),0.0,255.0);
135 return _v[0]*rhs.
_v[0]+
251 return lhs[0]*rhs[0]+lhs[1]*rhs[1]+lhs[2]*rhs[2]+rhs[3];
257 return lhs[0]*rhs[0]+lhs[1]*rhs[1]+lhs[2]*rhs[2]+rhs[3];
263 return lhs[0]*rhs[0]+lhs[1]*rhs[1]+lhs[2]*rhs[2]+rhs[3];
270 return lhs[0]*rhs[0]+lhs[1]*rhs[1]+lhs[2]*rhs[2]+lhs[3];
276 return lhs[0]*rhs[0]+lhs[1]*rhs[1]+lhs[2]*rhs[2]+lhs[3];
282 return lhs[0]*rhs[0]+lhs[1]*rhs[1]+lhs[2]*rhs[2]+lhs[3];
288 return Vec4d(lhs[0]*rhs[0], lhs[1]*rhs[1], lhs[2]*rhs[2], lhs[3]*rhs[3]);
294 return Vec4d(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 double triple for use as vertices, vectors and normals.
Definition Vec3d:30
General purpose float triple for use as vertices, vectors and normals.
Definition Vec3f:29
General purpose double quad.
Definition Vec4d:29
bool operator==(const Vec4d &v) const
Definition Vec4d:64
Vec4d operator/(value_type rhs) const
Divide by scalar.
Definition Vec4d:158
value_type & x()
Definition Vec4d:90
bool valid() const
Returns true if all components have values that are not NaN.
Definition Vec4d:128
bool isNaN() const
Returns true if at least one component has value NaN.
Definition Vec4d:130
value_type & b()
Definition Vec4d:102
Vec4d & operator/=(value_type rhs)
Unary divide by scalar.
Definition Vec4d:164
value_type normalize()
Normalize the vector so that it has length unity.
Definition Vec4d:230
Vec4d & operator+=(const Vec4d &rhs)
Unary vector add.
Definition Vec4d:183
value_type & y()
Definition Vec4d:91
value_type _v[4]
Definition Vec4d:38
unsigned int asRGBA() const
Definition Vec4d:119
value_type g() const
Definition Vec4d:106
Vec4d(value_type x, value_type y, value_type z, value_type w)
Definition Vec4d:43
Vec4d(const Vec3d &v3, value_type w)
Definition Vec4d:51
value_type & z()
Definition Vec4d:92
const Vec4d operator-() const
Negation operator.
Definition Vec4d:210
const value_type * ptr() const
Definition Vec4d:80
unsigned int asABGR() const
Definition Vec4d:111
value_type r() const
Definition Vec4d:105
value_type a() const
Definition Vec4d:108
value_type & r()
Definition Vec4d:100
double value_type
Data type of vector components.
Definition Vec4d:33
value_type length() const
Length of the vector = sqrt( vec .
Definition Vec4d:216
value_type & operator[](unsigned int i)
Definition Vec4d:87
Vec4d()
Constructor that sets all components of the vector to zero.
Definition Vec4d:41
bool operator<(const Vec4d &v) const
Definition Vec4d:68
value_type length2() const
Length squared of the vector = vec .
Definition Vec4d:222
bool operator!=(const Vec4d &v) const
Definition Vec4d:66
value_type operator*(const Vec4d &rhs) const
Dot product.
Definition Vec4d:133
Vec4d(const Vec4f &vec)
Definition Vec4d:59
value_type & g()
Definition Vec4d:101
Vec4d & operator-=(const Vec4d &rhs)
Unary vector subtract.
Definition Vec4d:200
value_type b() const
Definition Vec4d:107
value_type & a()
Definition Vec4d:103
Vec4d & operator*=(value_type rhs)
Unary multiply by scalar.
Definition Vec4d:148
void set(value_type x, value_type y, value_type z, value_type w)
Definition Vec4d:82
value_type x() const
Definition Vec4d:95
value_type * ptr()
Definition Vec4d:79
@ num_components
Definition Vec4d:36
value_type z() const
Definition Vec4d:97
Vec4d operator+(const Vec4d &rhs) const
Binary vector add.
Definition Vec4d:174
value_type w() const
Definition Vec4d:98
value_type y() const
Definition Vec4d:96
value_type & w()
Definition Vec4d:93
General purpose float quad.
Definition Vec4f:28
value_type _v[4]
Vec member variable.
Definition Vec4f:38