|
Momentum Scripting v1
|
#include <Vec3.h>
Public Types | |
| typedef double | Type |
Public Member Functions | |
| Vec3 () | |
| Vec3 (const double v[3]) | |
| Vec3 (const Vec3 ©) | |
| Vec3 (const Vec3 ©, double length) | |
| Vec3 (const Vec3 ©, double value, int i) | |
| Vec3 (double r) | |
| Vec3 (double x, double y, double z) | |
| void | clamp (const Vec3 &min, const Vec3 &max) |
| const Vec3 | cross (const Vec3 &rhs) const |
| double | distance (const Vec3 &v2) const |
| double | distance2 (const Vec3 &v2) const |
| bool | equalsZero () const |
| bool | isFinite () const |
| bool | isNaN () const |
| bool | isValid () const |
| double | length () const |
| double | length2 () const |
| double | maxComponent () const |
| int | maxElement () const |
| double | minComponent () const |
| int | minElement () const |
| Vec3 | normal () const |
| double | normalize () |
| bool | operator!= (const Vec3 &v) const |
| double | operator* (const Vec3 &rhs) const |
| const Vec3 | operator* (double rhs) const |
| Vec3 & | operator*= (double rhs) |
| const Vec3 | operator+ (const double rhs) const |
| const Vec3 | operator+ (const Vec3 &rhs) const |
| Vec3 & | operator+= (const double rhs) |
| Vec3 & | operator+= (const Vec3 &rhs) |
| const Vec3 | operator- () const |
| const Vec3 | operator- (const double rhs) const |
| const Vec3 | operator- (const Vec3 &rhs) const |
| Vec3 & | operator-= (const double rhs) |
| Vec3 & | operator-= (const Vec3 &rhs) |
| const Vec3 | operator/ (double rhs) const |
| Vec3 & | operator/= (double rhs) |
| bool | operator== (const Vec3 &v) const |
| double & | operator[] (int i) |
| const double | operator[] (int i) const |
| const Vec3 | operator^ (const Vec3 &rhs) const |
| void | set (const Vec3 &rhs) |
| void | set (double value) |
| void | set (double x, double y, double z) |
| double | setLength (double l) |
| void | setX (double value) |
| void | setY (double value) |
| void | setZ (double value) |
| double | x () const |
| double | y () const |
| double | z () const |
Static Public Member Functions | |
| static Vec3 | AXIS (int i) |
| static Vec3 | componentMax (const Vec3 &v1, const Vec3 &v2) |
| static Vec3 | componentMin (const Vec3 &v1, const Vec3 &v2) |
| static Vec3 | div (const Vec3 &lhs, const Vec3 &rhs) |
| static Vec3 | mul (const Vec3 &lhs, const Vec3 &rhs) |
| static Vec3 | random (const Vec3 &min, const Vec3 &max) |
| static Vec3 | random (double min=double(0), double max=double(1)) |
| static Vec3 | X_AXIS () |
| static Vec3 | Y_AXIS () |
| static Vec3 | Z_AXIS () |
A 3 dimensional vector which can be used to define a point or a vector and contains basic arithmetic.
| typedef double MOMENTUM_NAMESPACE::Vec3::Type |
| MOMENTUM_NAMESPACE::Vec3::Vec3 | ( | const Vec3 & | copy | ) |
Copy constructor.
| MOMENTUM_NAMESPACE::Vec3::Vec3 | ( | const Vec3 & | copy, |
| double | length | ||
| ) |
| MOMENTUM_NAMESPACE::Vec3::Vec3 | ( | const Vec3 & | copy, |
| double | value, | ||
| int | i | ||
| ) |
| MOMENTUM_NAMESPACE::Vec3::Vec3 | ( | ) |
Default constructor.
|
explicit |
Initialize from another vector.
| MOMENTUM_NAMESPACE::Vec3::Vec3 | ( | double | x, |
| double | y, | ||
| double | z | ||
| ) |
|
explicit |
|
static |
| i | The axis to choose. 0, 1 or 2. |
Clamp a vector between a lower and upper bound (per component).
Creates a new vector where each component is the maximum of this and the other vector.
Creates a new vector where each component is the minimum of this and the other vector.
rhs | double MOMENTUM_NAMESPACE::Vec3::distance | ( | const Vec3 & | v2 | ) | const |
| double MOMENTUM_NAMESPACE::Vec3::distance2 | ( | const Vec3 & | v2 | ) | const |
Element-wise-division.
| bool MOMENTUM_NAMESPACE::Vec3::equalsZero | ( | ) | const |
| bool MOMENTUM_NAMESPACE::Vec3::isFinite | ( | ) | const |
| bool MOMENTUM_NAMESPACE::Vec3::isNaN | ( | ) | const |
| bool MOMENTUM_NAMESPACE::Vec3::isValid | ( | ) | const |
| double MOMENTUM_NAMESPACE::Vec3::length | ( | ) | const |
| double MOMENTUM_NAMESPACE::Vec3::length2 | ( | ) | const |
| double MOMENTUM_NAMESPACE::Vec3::maxComponent | ( | ) | const |
| int MOMENTUM_NAMESPACE::Vec3::maxElement | ( | ) | const |
| double MOMENTUM_NAMESPACE::Vec3::minComponent | ( | ) | const |
| int MOMENTUM_NAMESPACE::Vec3::minElement | ( | ) | const |
Element-wise-multiplication.
| Vec3 MOMENTUM_NAMESPACE::Vec3::normal | ( | ) | const |
| double MOMENTUM_NAMESPACE::Vec3::normalize | ( | ) |
Normalize the vector so that it has length unity.
| bool MOMENTUM_NAMESPACE::Vec3::operator!= | ( | const Vec3 & | v | ) | const |
In-equality test.
| double MOMENTUM_NAMESPACE::Vec3::operator* | ( | const Vec3 & | rhs | ) | const |
rhs | const Vec3 MOMENTUM_NAMESPACE::Vec3::operator* | ( | double | rhs | ) | const |
return this vector multiplied by a scalar rhs
| Vec3 & MOMENTUM_NAMESPACE::Vec3::operator*= | ( | double | rhs | ) |
Unary multiply by scalar.
| const Vec3 MOMENTUM_NAMESPACE::Vec3::operator+ | ( | const double | rhs | ) | const |
Binary vector add.
| Vec3 & MOMENTUM_NAMESPACE::Vec3::operator+= | ( | const double | rhs | ) |
Unary vector add.
Slightly more efficient because no temporary intermediate object.
Unary vector add.
Slightly more efficient because no temporary intermediate object.
| const Vec3 MOMENTUM_NAMESPACE::Vec3::operator- | ( | ) | const |
Negation operator.
| const Vec3 MOMENTUM_NAMESPACE::Vec3::operator- | ( | const double | rhs | ) | const |
Binary vector subtract.
| Vec3 & MOMENTUM_NAMESPACE::Vec3::operator-= | ( | const double | rhs | ) |
Unary vector subtract.
| const Vec3 MOMENTUM_NAMESPACE::Vec3::operator/ | ( | double | rhs | ) | const |
Divide by scalar.
| Vec3 & MOMENTUM_NAMESPACE::Vec3::operator/= | ( | double | rhs | ) |
Unary divide by scalar.
| bool MOMENTUM_NAMESPACE::Vec3::operator== | ( | const Vec3 & | v | ) | const |
Equality test.
| double & MOMENTUM_NAMESPACE::Vec3::operator[] | ( | int | i | ) |
\access the ith element of this vector
| const double MOMENTUM_NAMESPACE::Vec3::operator[] | ( | int | i | ) | const |
\access the ith element of this vector
rhs | min | - each element define a lower range of the generate random value (default 0) |
| max | - each element define a upper range of the generate random value (default 1) |
|
static |
| min | - lower range of the generate random value (default 0) |
| max | - upper range of the generate random value (default 1) |
| void MOMENTUM_NAMESPACE::Vec3::set | ( | const Vec3 & | rhs | ) |
| void MOMENTUM_NAMESPACE::Vec3::set | ( | double | value | ) |
Set the value of this vector with the vector.
| void MOMENTUM_NAMESPACE::Vec3::set | ( | double | x, |
| double | y, | ||
| double | z | ||
| ) |
Set the value of this vector with the specified elements.
| double MOMENTUM_NAMESPACE::Vec3::setLength | ( | double | l | ) |
Scale the vector so that is has the specified length.
| void MOMENTUM_NAMESPACE::Vec3::setX | ( | double | value | ) |
set the x element of this vector
| void MOMENTUM_NAMESPACE::Vec3::setY | ( | double | value | ) |
set the y element of this vector
| void MOMENTUM_NAMESPACE::Vec3::setZ | ( | double | value | ) |
set the z element of this vector
| double MOMENTUM_NAMESPACE::Vec3::x | ( | ) | const |
|
static |
| double MOMENTUM_NAMESPACE::Vec3::y | ( | ) | const |
|
static |
| double MOMENTUM_NAMESPACE::Vec3::z | ( | ) | const |
|
static |