|
|
| Point () |
| | Default constructor. Initializes all values to zero.
|
| |
|
| Point (const Array< T, NumValues > &val) |
| | Constructs a Point from an Array.
|
| |
|
template<typename... Args> |
| | Point (Args... args) |
| | Constructs a Point from individual component values.
|
| |
|
| Point (const String &str) |
| | Constructs a Point by parsing a comma-separated string.
|
| |
|
virtual | ~Point () |
| | Destructor.
|
| |
|
| operator String () const |
| | Converts the Point to a comma-separated String.
|
| |
|
| operator const Array< T, NumValues > & () const |
| | Converts the Point to a const Array reference.
|
| |
|
bool | operator== (const Array< T, NumValues > &val) const |
| | Returns true if this Point equals the given Array.
|
| |
|
bool | operator!= (const Array< T, NumValues > &val) const |
| | Returns true if this Point does not equal the given Array.
|
| |
|
Point & | operator+= (const Array< T, NumValues > &val) |
| | Adds the given Array component-wise to this Point.
|
| |
|
Point & | operator-= (const Array< T, NumValues > &val) |
| | Subtracts the given Array component-wise from this Point.
|
| |
|
Point & | operator*= (const Array< T, NumValues > &val) |
| | Multiplies this Point component-wise by the given Array.
|
| |
|
Point & | operator/= (const Array< T, NumValues > &val) |
| | Divides this Point component-wise by the given Array.
|
| |
|
NumValues | lerp (const Point< T, NumValues > &other, double t) const |
| |
| template<typename U > |
| Point< T, NumValues > | clamp (const Point< U, NumValues > &minVal, const Point< U, NumValues > &maxVal) const |
| | Clamps each component of the Point to the given min and max bounds.
|
| |
| bool | isWithinBounds (const Point< T, NumValues > &min, const Point< T, NumValues > &max) const |
| | Returns true if all components are within the given min and max bounds (inclusive).
|
| |
|
|
Point | operator+ (const Array< T, NumValues > &lh, const Array< T, NumValues > &rh) |
| | Returns the component-wise sum of two Arrays as a Point.
|
| |
|
Point | operator- (const Array< T, NumValues > &lh, const Array< T, NumValues > &rh) |
| | Returns the component-wise difference of two Arrays as a Point.
|
| |
|
Point | operator* (const Array< T, NumValues > &lh, const Array< T, NumValues > &rh) |
| | Returns the component-wise product of two Arrays as a Point.
|
| |
|
Point | operator/ (const Array< T, NumValues > &lh, const Array< T, NumValues > &rh) |
| | Returns the component-wise quotient of two Arrays as a Point.
|
| |
N-dimensional point with arithmetic, interpolation, and serialization.
A generic point class that stores NumValues components of type T, backed by an Array. Named accessors (x, y, z) are conditionally available depending
- Example
Dynamic array container wrapping std::vector.
Definition list.h:40
on the number of dimensions. Supports parsing from and formatting to comma-separated strings.
- Template Parameters
-
| T | The component value type (e.g. int, float, double). |
| NumValues | The number of dimensions. |