| Home | Download | Screen shots | Discussion | Documentation |
|---|
#include <openvrml/basetypes.h>
Public Member Functions | |
| vec3d () throw () | |
| Construct. | |
| vec3d (const double(&vec)[3]) throw () | |
| Construct from an array. | |
| vec3d (double x, double y, double z) throw () | |
Construct from x, y, and z components. | |
| vec3d & | operator *= (const vec3d &vec) throw () |
| Cross multiply. | |
| vec3d & | operator *= (const mat4f &mat) throw () |
| Multiply by a matrix. | |
| vec3d & | operator *= (double scalar) throw () |
| Multiply by a scalar. | |
| vec3d & | operator/= (double scalar) throw () |
| Divide by a scalar. | |
| vec3d & | operator+= (const vec3d &vec) throw () |
| Add a vector. | |
| vec3d & | operator-= (const vec3d &vec) throw () |
| Subtract a vector. | |
| const vec3d | operator- () const throw () |
| Negate. | |
| const double & | operator[] (size_t index) const throw () |
| Index-based component access. | |
| double | x () const throw () |
| Get the x component. | |
| void | x (double value) throw () |
| Set the x component. | |
| double | y () const throw () |
| Get the y component. | |
| void | y (double value) throw () |
| Set the y component. | |
| double | z () const throw () |
| Get the z component. | |
| void | z (double value) throw () |
| Set the z component. | |
| double | dot (const vec3d &vec) const throw () |
| Dot product. | |
| double | length () const throw () |
| Geometric length. | |
| const vec3d | normalize () const throw () |
| Normalize. | |
Private Attributes | |
| double | vec [3] |
| Vector components. | |
Friends | |
| std::istream & | operator>> (std::istream &in, vec3d &v) |
| Stream input. | |
Related Functions | |
| (Note that these are not member functions.) | |
| const openvrml::vec3d | operator * (const vec3d &lhs, const vec3d &rhs) throw() |
| Cross multiply two vectors. | |
| const openvrml::vec3d | operator * (const vec3d &vec, const mat4f &mat) throw() |
| Multiply a vector by a matrix. | |
| const openvrml::vec3d | operator * (const mat4f &mat, const vec3d &vec) throw() |
| Multiply a matrix by a vector. | |
| const openvrml::vec3d | operator * (const vec3d &lhs, const double rhs) throw() |
| Multiply a vector by a scalar. | |
| const openvrml::vec3d | operator * (const double lhs, const vec3d &rhs) throw() |
| Multiply a vector by a scalar. | |
| const openvrml::vec3d | operator/ (const vec3d &lhs, const double rhs) throw() |
| Divide a vector by a scalar. | |
| const openvrml::vec3d | operator+ (const vec3d &lhs, const vec3d &rhs) throw() |
| Add two vectors. | |
| const openvrml::vec3d | operator- (const vec3d &lhs, const vec3d &rhs) throw() |
| Subtract two vectors. | |
| bool | operator== (const vec3d &lhs, const vec3d &rhs) throw() |
| Compare for equality. | |
| bool | operator!= (const vec3d &lhs, const vec3d &rhs) throw() |
| Compare for inequality. | |
| std::ostream & | operator<< (std::ostream &out, const vec3d &v) |
| Stream output. | |
| openvrml::vec3d::vec3d | ( | ) | throw () |
Construct.
| openvrml::vec3d::vec3d | ( | const double & | vec[3] | ) | throw () [explicit] |
Construct from an array.
vec are valid numeric values (i.e., not NaN).| [in] | vec | an array comprising the vector components. |
| openvrml::vec3d::vec3d | ( | double | x, | |
| double | y, | |||
| double | z | |||
| ) | throw () |
Construct from x, y, and z components.
x, y, and z are valid numeric values (i.e., not NaN).| [in] | x | x component. |
| [in] | y | y component. |
| [in] | z | z component. |
| openvrml::vec3d & openvrml::vec3d::operator *= | ( | const vec3d & | vec | ) | throw () |
Cross multiply.
| [in] | vec | vector by which to multiply. |
| openvrml::vec3d & openvrml::vec3d::operator *= | ( | const mat4f & | mat | ) | throw () |
Multiply by a matrix.
| [in] | mat | matrix by which to multiply. |
| openvrml::vec3d & openvrml::vec3d::operator *= | ( | double | scalar | ) | throw () |
Multiply by a scalar.
| [in] | scalar | factor by which to multiply. |
| openvrml::vec3d & openvrml::vec3d::operator/= | ( | double | scalar | ) | throw () |
Divide by a scalar.
scalar is nonzero.| [in] | scalar | divisor. |
| openvrml::vec3d & openvrml::vec3d::operator+= | ( | const vec3d & | vec | ) | throw () |
Add a vector.
| [in] | vec | the vector to add. |
| openvrml::vec3d & openvrml::vec3d::operator-= | ( | const vec3d & | vec | ) | throw () |
Subtract a vector.
| [in] | vec | the vector to subtract. |
| const openvrml::vec3d openvrml::vec3d::operator- | ( | ) | const throw () |
Negate.
| const double & openvrml::vec3d::operator[] | ( | size_t | index | ) | const throw () [inline] |
Index-based component access.
| [in] | index | 0 corresponds to the x component; 1 corresponds to the y component; 2 corresponds to the z component. |
index.index is less than 3. | double openvrml::vec3d::x | ( | ) | const throw () [inline] |
Get the x component.
| void openvrml::vec3d::x | ( | double | value | ) | throw () [inline] |
Set the x component.
value is a valid numeric value (i.e., not NaN).| [in] | value | new x component value. |
| double openvrml::vec3d::y | ( | ) | const throw () [inline] |
Get the y component.
| void openvrml::vec3d::y | ( | double | value | ) | throw () [inline] |
Set the y component.
value is a valid numeric value (i.e., not NaN).| [in] | value | new y component value. |
| double openvrml::vec3d::z | ( | ) | const throw () [inline] |
Get the z component.
| void openvrml::vec3d::z | ( | double | value | ) | throw () [inline] |
Set the z component.
value is a valid numeric value (i.e., not NaN).| [in] | value | new z component value. |
| double openvrml::vec3d::dot | ( | const vec3d & | vec | ) | const throw () |
Dot product.
| [in] | vec |
vec. | double openvrml::vec3d::length | ( | ) | const throw () |
Geometric length.
| const openvrml::vec3d openvrml::vec3d::normalize | ( | ) | const throw () |
Normalize.
| std::istream& operator>> | ( | std::istream & | in, | |
| vec3d & | v | |||
| ) | [friend] |
Stream input.
Consistent with the VRML97 convention, commas (“,”) in the input are treated as whitespace.
| [in,out] | in | input stream. |
| [out] | v | a vec3d. |
in. | const openvrml::vec3d operator * | ( | const vec3d & | lhs, | |
| const vec3d & | rhs | |||
| ) | throw() [related] |
Cross multiply two vectors.
| [in] | lhs | left-hand operand. |
| [in] | rhs | right-hand operand. |
| const openvrml::vec3d operator * | ( | const vec3d & | vec, | |
| const mat4f & | mat | |||
| ) | throw() [related] |
Multiply a vector by a matrix.
| [in] | vec | a vector. |
| [in] | mat | a matrix. |
| const openvrml::vec3d operator * | ( | const mat4f & | mat, | |
| const vec3d & | vec | |||
| ) | throw() [related] |
Multiply a matrix by a vector.
| [in] | mat | a matrix. |
| [in] | vec | a 3-component vector. |
| const openvrml::vec3d operator * | ( | const vec3d & | lhs, | |
| const double | rhs | |||
| ) | throw() [related] |
Multiply a vector by a scalar.
| [in] | lhs | left-hand operand (the vector). |
| [in] | rhs | right-hand operand (the scalar). |
| const openvrml::vec3d operator * | ( | const double | lhs, | |
| const vec3d & | rhs | |||
| ) | throw() [related] |
Multiply a vector by a scalar.
| [in] | lhs | left-hand operand (the scalar). |
| [in] | rhs | right-hand operand (the vector). |
| const openvrml::vec3d operator/ | ( | const vec3d & | lhs, | |
| const double | rhs | |||
| ) | throw() [related] |
Divide a vector by a scalar.
rhs is nonzero.| [in] | lhs | left-hand operand (the vector). |
| [in] | rhs | right-hand operand (the scalar). |
| const openvrml::vec3d operator+ | ( | const vec3d & | lhs, | |
| const vec3d & | rhs | |||
| ) | throw() [related] |
Add two vectors.
| [in] | lhs | left-hand operand. |
| [in] | rhs | right-hand operand. |
| const openvrml::vec3d operator- | ( | const vec3d & | lhs, | |
| const vec3d & | rhs | |||
| ) | throw() [related] |
Subtract two vectors.
| [in] | lhs | left-hand operand. |
| [in] | rhs | right-hand operand. |
Compare for equality.
| [in] | lhs | left-hand operand. |
| [in] | rhs | right-hand operand. |
true if lhs and rhs have the same value; false otherwise. Compare for inequality.
| [in] | lhs | left-hand operand. |
| [in] | rhs | right-hand operand. |
true if lhs and rhs dot not have the same value; false otherwise. | std::ostream & operator<< | ( | std::ostream & | out, | |
| const vec3d & | v | |||
| ) | [related] |
Stream output.
| [in,out] | out | output stream. |
| [in] | v | a 3-component vector. |
out.
double openvrml::vec3d::vec[3] [private] |
Vector components.
For internal use only.