struct
Vector3DA vector 3d.
Contents
Constructors, destructors, conversion operators
Public functions
- auto getLength(Vector3D& vector) const -> float
- Gets length of vector.
- auto getLength() const -> float
- Gets length of this vector.
- auto getVector2D() -> Vector2D
- Return a Vector2D containing the x and y values from this Vector3D respectively.
- auto add(const Vector3D& other) -> Vector3D&
- Adds other.
- auto subtract(const Vector3D& other) -> Vector3D&
- Subtracts the given other.
- auto multiply(const Vector3D& other) -> Vector3D&
- Multiplies the given other.
- auto multiplyDot(const Vector3D& other) -> float
- Multiplies the given other (Dot product).
- auto multiplyCross(const Vector3D& other) -> Vector3D&
- Multiplies the given other (Cross product).
- auto multiplyFloat(const float& other) -> Vector3D&
- Multiplies the given float with this (Scaling).
- auto divide(const Vector3D& other) -> Vector3D&
- Divides the given other. Returns [a/x , b/y , c/z] if [a , b , c] is divided by [x , y , z].
- auto maxComponent() -> float
- Return the maximum coordinate across all axes.
- auto toUnitVector() -> Vector3D&
- Convert this vector to a unit vector.
- auto abs() -> Vector3D&
- Take modulus of all coordinates.
- auto operator==(const Vector3D& other) -> bool
- Equality operator.
- auto operator!=(const Vector3D& other) -> bool
- Inequality operator.
- auto operator+=(const Vector3D& other) -> Vector3D&
- Addition assignment operator.
- auto operator-=(const Vector3D& other) -> Vector3D&
- Subtraction assignment operator.
- auto operator*=(const Vector3D& other) -> Vector3D&
- Multiplication assignment operator.
- auto operator/=(const Vector3D& other) -> Vector3D&
- Division assignment operator.
Public variables
Friends
- auto operator<<(std::ostream& stream, const Vector3D& vector) -> std::ostream&
- Put to operator.
- auto operator+(Vector3D left, const Vector3D& right) -> Vector3D&
- Addition operator.
- auto operator-(Vector3D left, const Vector3D& right) -> Vector3D&
- Subtraction operator.
- auto operator*(Vector3D left, const Vector3D& right) -> Vector3D&
- Multiplication operator.
- auto operator*(const Vector3D vector, const float& other) -> Vector3D&
- Float multiplication operator. (Scaling)
- auto operator/(Vector3D left, const Vector3D& right) -> Vector3D&
- Division operator.
- auto operator/(const Vector3D vector, const float& other) -> Vector3D&
- Float division operator. (Down scaling)
Function documentation
RML:: Vector3D:: Vector3D(const float& x,
const float& y,
const float& z)
Constructor.
Parameters | |
---|---|
x | The x coordinate. |
y | The y coordinate. |
z | The z coordinate. |
Vector2D RML:: Vector3D:: getVector2D()
Return a Vector2D containing the x and y values from this Vector3D respectively.
Returns | The length. |
---|
float RML:: Vector3D:: multiplyDot(const Vector3D& other)
Multiplies the given other (Dot product).
Parameters | |
---|---|
other | The other. |
Returns | A result of the operation. |
Vector3D& RML:: Vector3D:: multiplyCross(const Vector3D& other)
Multiplies the given other (Cross product).
Parameters | |
---|---|
other | The other. |
Returns | A result of the operation. |
Vector3D& RML:: Vector3D:: multiplyFloat(const float& other)
Multiplies the given float with this (Scaling).
Parameters | |
---|---|
other | The other. |
Returns | A result of the operation. |
float RML:: Vector3D:: maxComponent()
Return the maximum coordinate across all axes.
Returns | The maximum coordinate. |
---|
Vector3D& RML:: Vector3D:: toUnitVector()
Convert this vector to a unit vector.
Returns | The unit vector. |
---|
bool RML:: Vector3D:: operator==(const Vector3D& other)
Equality operator.
Parameters | |
---|---|
other | The other. |
Returns | True if the parameters are considered equivalent. |
Int equality operator.
bool RML:: Vector3D:: operator!=(const Vector3D& other)
Inequality operator.
Parameters | |
---|---|
other | The other. |
Returns | True if the parameters are not considered equivalent. |
Vector3D& RML:: Vector3D:: operator+=(const Vector3D& other)
Addition assignment operator.
Parameters | |
---|---|
other | The other. |
Returns | The result of the operation. |
Vector3D& RML:: Vector3D:: operator-=(const Vector3D& other)
Subtraction assignment operator.
Parameters | |
---|---|
other | The other. |
Returns | The result of the operation. |
Vector3D& RML:: Vector3D:: operator*=(const Vector3D& other)
Multiplication assignment operator.
Parameters | |
---|---|
other | The other. |
Returns | The result of the operation. |
Vector3D& RML:: Vector3D:: operator/=(const Vector3D& other)
Division assignment operator.
Parameters | |
---|---|
other | The other. |
Returns | The result of the operation. |
std::ostream& operator<<(std::ostream& stream, const Vector3D& vector)
Put to operator.
Parameters | |
---|---|
stream | Reference to the stream to be put to. |
vector | Vector3D to be put to stream object. |
Returns | Reference to the stream been put to. |