Bottle 2D - Lua API 1.0.0
All you need to create games using bottle2D.
|
A simple vector in three dimentions. More...
#include <header.hpp>
Public Member Functions | |
Vector3D (number x, number y, number z) | |
Vector3D () | |
Vector3D | operator+ (Vector3D vect) |
Add two vectors. | |
Vector3D | operator- (Vector3D vect) |
Subtract two vectors. | |
bool | operator== (Vector3D vect) |
Check equality between two vectors. | |
Vector3D | operator* (number nb) |
Multiply a Vector by a number. | |
Vector3D | operator/ (number nb) |
Divide a Vector by a number. | |
number | GetSquareSum () |
Get the sum of the squares of x and y (basicaly, x² + y² + z²). | |
number | GetSize () |
Get the size of the Vector. | |
Vector3D | GetDirection () |
Get the normalised vector (direction). | |
number | GetDotProduct (Vector3D vector2) |
Get the dot product / scalar product of this vector with another one. | |
Public Attributes | |
float | x |
Access the x componant. | |
float | y |
Access the y componant. | |
float | z |
Access the z componant. |
A simple vector in three dimentions.
Vector3D::Vector3D | ( | number | x, |
number | y, | ||
number | z | ||
) |
Vector3D::Vector3D | ( | ) |
Vector3D Vector3D::GetDirection | ( | ) |
Get the normalised vector (direction).
number Vector3D::GetDotProduct | ( | Vector3D | vector2 | ) |
Get the dot product / scalar product of this vector with another one.
number Vector3D::GetSize | ( | ) |
Get the size of the Vector.
number Vector3D::GetSquareSum | ( | ) |
Get the sum of the squares of x and y (basicaly, x² + y² + z²).
This is useful to compare the vectors size without using a square root (which is more time consuming).
Vector3D Vector3D::operator* | ( | number | nb | ) |
Multiply a Vector by a number.
Vector3D Vector3D::operator/ | ( | number | nb | ) |
Divide a Vector by a number.
bool Vector3D::operator== | ( | Vector3D | vect | ) |
Check equality between two vectors.
float Vector3D::x |
Access the x componant.
float Vector3D::y |
Access the y componant.
float Vector3D::z |
Access the z componant.