46 inline operator Vec3f()
const {
return Vec3f(
static_cast<float>(
_v[0]),
static_cast<float>(
_v[1]),
static_cast<float>(
_v[2]));}
62 if (
_v[0]<v.
_v[0])
return true;
63 else if (
_v[0]>v.
_v[0])
return false;
64 else if (
_v[1]<v.
_v[1])
return true;
65 else if (
_v[1]>v.
_v[1])
return false;
66 else return (
_v[2]<v.
_v[2]);
214 return Vec3d(lhs[0]*rhs[0], lhs[1]*rhs[1], lhs[2]*rhs[2]);
220 return Vec3d(lhs[0]/rhs[0], lhs[1]/rhs[1], lhs[2]/rhs[2]);
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
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
Vec2d componentMultiply(const Vec2d &lhs, const Vec2d &rhs)
multiply by vector components.
Definition Vec2d:181
General purpose double pair, uses include representation of texture coordinates.
Definition Vec2d:29
General purpose double triple for use as vertices, vectors and normals.
Definition Vec3d:30
@ num_components
Definition Vec3d:37
double value_type
Data type of vector components.
Definition Vec3d:34
value_type z() const
Definition Vec3d:91
value_type & z()
Definition Vec3d:87
bool operator==(const Vec3d &v) const
Definition Vec3d:56
Vec3d(const Vec3f &vec)
Definition Vec3d:44
bool isNaN() const
Returns true if at least one component has value NaN.
Definition Vec3d:96
bool valid() const
Returns true if all components have values that are not NaN.
Definition Vec3d:94
value_type _v[3]
Definition Vec3d:39
Vec3d & operator-=(const Vec3d &rhs)
Unary vector subtract.
Definition Vec3d:166
Vec3d(value_type x, value_type y, value_type z)
Definition Vec3d:48
value_type operator*(const Vec3d &rhs) const
Dot product.
Definition Vec3d:99
const Vec3d operator+(const Vec3d &rhs) const
Binary vector add.
Definition Vec3d:143
value_type normalize()
Normalize the vector so that it has length unity.
Definition Vec3d:196
value_type length2() const
Length squared of the vector = vec .
Definition Vec3d:187
const value_type * ptr() const
Definition Vec3d:70
Vec3d()
Constructor that sets all components of the vector to zero.
Definition Vec3d:42
const Vec3d operator-() const
Negation operator.
Definition Vec3d:175
void set(value_type x, value_type y, value_type z)
Definition Vec3d:72
const Vec3d operator^(const Vec3d &rhs) const
Cross product.
Definition Vec3d:105
value_type & operator[](int i)
Definition Vec3d:82
value_type * ptr()
Definition Vec3d:69
void set(const Vec3d &rhs)
Definition Vec3d:77
value_type & x()
Definition Vec3d:85
value_type & y()
Definition Vec3d:86
bool operator!=(const Vec3d &v) const
Definition Vec3d:58
Vec3d & operator/=(value_type rhs)
Unary divide by scalar.
Definition Vec3d:134
value_type y() const
Definition Vec3d:90
bool operator<(const Vec3d &v) const
Definition Vec3d:60
value_type x() const
Definition Vec3d:89
Vec3d & operator+=(const Vec3d &rhs)
Unary vector add.
Definition Vec3d:151
Vec3d & operator*=(value_type rhs)
Unary multiply by scalar.
Definition Vec3d:119
const Vec3d operator/(value_type rhs) const
Divide by scalar.
Definition Vec3d:128
Vec3d(const Vec2d &v2, value_type zz)
Definition Vec3d:49
value_type length() const
Length of the vector = sqrt( vec .
Definition Vec3d:181
General purpose float triple for use as vertices, vectors and normals.
Definition Vec3f:29
value_type _v[3]
Definition Vec3f:38