|
| | Vec3 (T m_x, T m_y, T m_z) |
| | Ensure that T is an arithmetic type (float, double, int, etc.).
|
| | Vec3 ()=default |
| | Default constructor (initializes components to zero).
|
| | ~Vec3 ()=default |
| | Destructor.
|
| T | x () const |
| | Returns the x-component.
|
| T | y () const |
| | Returns the y-component.
|
| T | z () const |
| | Returns the z-component.
|
| void | SetX (T newX) |
| | Sets the x-component.
|
| void | SetY (T newY) |
| | Sets the y-component.
|
| void | SetZ (T newZ) |
| | Sets the z-component.
|
| void | Set (T newX, T newY, T newZ) |
| | Sets all three components.
|
| Vec3 | Normalized () const |
| | Returns a normalized vector (unit length).
|
| T | SqrtMagnitude () const |
| | Returns the squared magnitude of the vector.
|
| T | Magnitude () const |
| | Returns the magnitude (length) of the vector.
|
| T | This (int i) const |
| | Returns the component at index i (0=x, 1=y, 2=z).
|
| bool | Equal (const Vec3 &other) const |
| | Checks if this vector is equal to another vector.
|
| std::string | ToString () const |
| | Converts the vector to a string representation.
|
| void | Normalize () |
| | Normalizes the vector in place.
|
| Vec3 | operator- (const Vec3 &other) const |
| | Subtracts another vector from this vector.
|
| Vec3 | operator+ (const Vec3 &other) const |
| | Adds another vector to this vector.
|
| Vec3 | operator* (const Vec3 &other) const |
| | Component-wise multiplication.
|
| Vec3 | operator* (T scalar) const |
| | Multiplies the vector by a scalar.
|
| Vec3 | operator/ (const Vec3 &other) const |
| | Component-wise division.
|
| Vec3 | operator/ (T scalar) const |
| | Divides the vector by a scalar.
|
| bool | operator== (const Vec3 &other) const |
| | Checks equality between two vectors.
|
| bool | operator!= (const Vec3 &other) const |
| | Checks inequality between two vectors.
|
|
| static Vec3 | Down () |
| | Returns a vector pointing down (0, -1, 0).
|
| static Vec3 | Up () |
| | Returns a vector pointing up (0, 1, 0).
|
| static Vec3 | Left () |
| | Returns a vector pointing left (-1, 0, 0).
|
| static Vec3 | Right () |
| | Returns a vector pointing right (1, 0, 0).
|
| static Vec3 | Back () |
| | Returns a vector pointing back (0, 0, -1).
|
| static Vec3 | Forward () |
| | Returns a vector pointing forward (0, 0, 1).
|
| static Vec3 | One () |
| | Returns a vector with all components equal to 1.
|
| static Vec3 | Zero () |
| | Returns a zero vector (0, 0, 0).
|
| static Vec3 | PositiveInfinity () |
| | Returns a vector with all components set to positive infinity.
|
| static Vec3 | NegativeInfinity () |
| | Returns a vector with all components set to negative infinity.
|
| static Vec3 | RotateTowards (const Vec3 ¤t, const Vec3 &target, const T maxRadiansDelta, const T maxMagnitudeDelta) |
| | Rotates a vector towards a target vector by a maximum radians delta and magnitude delta.
|
| static Vec3 | MoveTowards (const Vec3 ¤t, const Vec3 &target, const T maxDistanceDelta) |
| | Moves a vector towards a target vector by a maximum distance.
|
| static Vec3 | ProjectOnPlane (const Vec3 &vector, const Vec3 &planeNormal) |
| | Projects a vector onto a plane defined by its normal.
|
| static Vec3 | Reflect (const Vec3 &inDirection, const Vec3 &inNormal) |
| | Reflects a vector off a plane defined by a normal.
|
| static Vec3 | ClampMagnitude (const Vec3 &a, const T MaxLength) |
| | Clamps the magnitude of a vector to a maximum length.
|
| static Vec3 | SlerpUnclamped (const Vec3 &a, const Vec3 &b, const T t) |
| | Spherical linear interpolation (unclamped) between two vectors.
|
| static Vec3 | Project (const Vec3 &vector, const Vec3 &onNormal) |
| | Projects a vector onto another vector.
|
| static Vec3 | LerpUnclamped (const Vec3 &a, const Vec3 &b, const T t) |
| | Linear interpolation (unclamped) between two vectors.
|
| static Vec3 | Slerp (const Vec3 &a, const Vec3 &b, const T t) |
| | Spherical linear interpolation (clamped) between two vectors.
|
| static Vec3 | Lerp (const Vec3 &a, const Vec3 &b, const T t) |
| | Linear interpolation (clamped) between two vectors.
|
| static Vec3 | Scale (const Vec3 &a, const Vec3 &b) |
| | Component-wise multiplication of two vectors.
|
| static Vec3 | Cross (const Vec3 &a, const Vec3 &b) |
| | Cross product of two vectors.
|
| static Vec3 | Min (const Vec3 &a, const Vec3 &b) |
| | Component-wise minimum of two vectors.
|
| static Vec3 | Max (const Vec3 &a, const Vec3 &b) |
| | Component-wise maximum of two vectors.
|
| static T | SignedAngle (const Vec3 &from, const Vec3 &to, const Vec3 &axis) |
| | Computes the signed angle between two vectors around a specified axis.
|
| static T | Distance (const Vec3 &a, const Vec3 &b) |
| | Calculates distance between two vectors.
|
| static T | Angle (const Vec3 &a, const Vec3 &b) |
| | Calculates angle between two vectors.
|
| static T | Dot (const Vec3 &a, const Vec3 &b) |
| | Dot product of two vectors.
|
| static void | OrthoNormalize (Vec3 &normal, Vec3 &tangent) |
| | Orthonormalizes two vectors (normal and tangent).
|
template<typename T = float>
class Maths::Vec3< T >
A 3D vector class template for mathematical operations.
- Template Parameters
-
| T | The numeric type (e.g., float, double, int). |