#include <Vector3.h>
This class is part of the basic Tools namespace and contains a couple of methods for initialization and computing various 3-element vectors (3 dimensional vectors). Espacially the inner (see Vector3.DotProd) and outer (see Vector3.CrossProd) product methods.
For using vector with more or less elements (e.g. 2 or 4 elements) please see the following classes Vector2 and Vector4.
Vector4 the four dimensional vector.
Public Member Functions | |
Vector3 (void) | |
This is the standard constructor. | |
Vector3 (double n_X, double n_Y, double n_Z) | |
Constructor initialization by three parameters. | |
Vector3 (double n_Value __gc[]) | |
Constructor initialization by an array parameters. | |
Vector3 (Vector3 *n_Vector3) | |
Constructor initialization by an already existing Vector3 object. | |
__property double | get_X (void) |
Returns the x element of the specific vector. | |
__property double | get_Y (void) |
Returns the y element of the specific vector. | |
__property double | get_Z (void) |
Returns the z element of the specific vector. | |
__property void | set_X (double n_X) |
Sets the x element of the existing vector. | |
__property void | set_Y (double n_Y) |
Sets the y element of the existing vector. | |
__property void | set_Z (double n_Z) |
Sets the z element of the existing vector. | |
double | dotProd (Vector3 *v) |
This function returns the dot product (inner product) of the current Vector3 object and the specified vector parameter. | |
Vector3 * | multSkalar (double d) |
This function returns the skalar product as a new Vector3 object of the current Vector3 object and the specified skalar parameter. | |
double | magnitude (void) |
Returns the magnitude of the specific vector. | |
void | normalize (void) |
This function normalizes the current vector. | |
double | getItem (int index) |
This function returns the specific element of the current vector. | |
Vector3 * | getNegativeVector (void) |
This function returns the negative vector of the current Vector3 object. | |
float | getFloatArrayOfVector (void) __gc[] |
This function returns the all vector elements as an three element float array. | |
double | getDoubleArrayOfVector (void) __gc[] |
This function returns the all vector elements as an three element double array. | |
Vector3 * | convertToOpenGLAlignedVector (void) |
This function converts the current vector to an OpenGL compatible vector form. | |
Static Public Member Functions | |
static Vector3 * | CreateNormalizedVector (Vector3 *v) |
This static function created a normalized vector of the specified vector parameter. | |
static Vector3 * | Addition (Vector3 *v1, Vector3 *v2) |
This static function returns the sum vector of the two specified vector parameters. | |
static Vector3 * | Subtraction (Vector3 *v1, Vector3 *v2) |
This static function returns the subtraction vector of the two specified vector parameters. | |
static Vector3 * | CrossProd (Vector3 *v1, Vector3 *v2) |
This static function returns the cross product (outer product) vector of the two specified vector parameters. | |
static double | DotProd (Vector3 *v1, Vector3 *v2) |
This static function returns the dot product (inner product) of the two specified vector parameters. | |
Public Attributes | |
double | m_X |
The x element of the vector. | |
double | m_Y |
The y element of the vector. | |
double | m_Z |
The z element of the vector. |
|
This is the standard constructor. This standard constructor initialzed all three elements with zero. |
|
Constructor initialization by three parameters. This constructor initialized all three element of the vector with the specified parameters.
|
|
Constructor initialization by an array parameters. This constructor initialized all three element of the vector with the specified array parameter.
|
|
Constructor initialization by an already existing Vector3 object. This constructor initialized all three element of the vector with the values of the specified Vector3 object.
|
|
This static function returns the sum vector of the two specified vector parameters.
|
|
This function converts the current vector to an OpenGL compatible vector form. For correct drawing in OpenGL the x and y elements of an existing Vector3 object must be inverted, only after this invertion a correct drawing in OpenGL is guaranteed (is basically a reflextion about the y and z axis).
|
|
This static function created a normalized vector of the specified vector parameter.
|
|
This static function returns the cross product (outer product) vector of the two specified vector parameters.
|
|
This static function returns the dot product (inner product) of the two specified vector parameters.
|
|
This function returns the dot product (inner product) of the current Vector3 object and the specified vector parameter.
|
|
Returns the x element of the specific vector.
|
|
Returns the y element of the specific vector.
|
|
Returns the z element of the specific vector.
|
|
This function returns the all vector elements as an three element double array.
|
|
This function returns the all vector elements as an three element float array.
|
|
This function returns the specific element of the current vector.
This element is specified by the specified parameter whereas the following index enumeration is valid:
|
|
This function returns the negative vector of the current Vector3 object. This means that the current vector is multiplied with -1 which is actually a skalar product.
|
|
Returns the magnitude of the specific vector.
|
|
This function returns the skalar product as a new Vector3 object of the current Vector3 object and the specified skalar parameter.
|
|
This function normalizes the current vector.
|
|
Sets the x element of the existing vector.
|
|
Sets the y element of the existing vector.
|
|
Sets the z element of the existing vector.
|
|
This static function returns the subtraction vector of the two specified vector parameters.
|
|
The x element of the vector. The x element is the first element and is based on a double variable. |
|
The y element of the vector. The y element is the second element and is based on a double variable. |
|
The z element of the vector. The z element is the third element and is based on a double variable. |