Hermes
|
Geometric 2-dimensional vector (x, y) More...
Public Member Functions | |
HERMES_DEVICE_CALLABLE | Vector2 () |
Default constructor. | |
HERMES_DEVICE_CALLABLE | Vector2 (T _x, T _y) |
Constructs from component values. More... | |
HERMES_DEVICE_CALLABLE | Vector2 (const Point2< T > &p) |
Constructs from geometric point. More... | |
HERMES_DEVICE_CALLABLE | Vector2 (T f) |
Constructs from single component value. More... | |
HERMES_DEVICE_CALLABLE | Vector2 (T *f) |
Constructs from component array. More... | |
HERMES_DEVICE_CALLABLE T | operator[] (size_t i) const |
Get i-th component. More... | |
HERMES_DEVICE_CALLABLE T & | operator[] (size_t i) |
Get i-th component reference. More... | |
HERMES_DEVICE_CALLABLE Vector2 | operator- () const |
HERMES_DEVICE_CALLABLE bool | operator== (const Vector2< T > &b) const |
HERMES_DEVICE_CALLABLE T | length2 () const |
Computes squared magnitude. More... | |
HERMES_DEVICE_CALLABLE T | length () const |
Computes magnitude. More... | |
HERMES_DEVICE_CALLABLE Vector2 | right () const |
Gets orthogonal vector in right direction. More... | |
HERMES_DEVICE_CALLABLE Vector2 | left () const |
Gets orthogonal vector in left direction. More... | |
Vector2 | xy () const |
Gets swizzle form (x, y) More... | |
Vector2 | yx () const |
Gets swizzle form (y, x) More... | |
Vector2 | xx () const |
Gets swizzle form (x, x) More... | |
Vector2 | yy () const |
Gets swizzle form (y, y) More... | |
Public Attributes | |
T | x = T(0.0) |
0-th component | |
T | y = T(0.0) |
1-th component | |
Additional Inherited Members | |
Static Public Member Functions inherited from hermes::MathElement< T, 2u > | |
static constexpr u64 | componentCount () |
Gets the number of dimensional components. More... | |
static constexpr u64 | numericTypeSizeInBytes () |
Gets the size in bytes of underlying data type. More... | |
static MemoryDumper::RegionLayout | memoryDumpLayout () |
Gets memory layout. More... | |
Static Public Attributes inherited from hermes::MathElement< T, 2u > | |
static T | numeric_data |
Underlying data type. | |
Geometric 2-dimensional vector (x, y)
T |
|
inline |
Constructs from component values.
_x | |
_y |
|
inlineexplicit |
Constructs from geometric point.
p |
|
inlineexplicit |
Constructs from single component value.
f |
|
inlineexplicit |
Constructs from component array.
f |
|
inline |
Gets orthogonal vector in left direction.
|
inline |
Computes magnitude.
|
inline |
Computes squared magnitude.
|
inline |
Get i-th component reference.
i
is not checked i | component index in [0, 1] |
|
inline |
Get i-th component.
i
is not checked i | component index in [0, 1] |
|
inline |
Gets orthogonal vector in right direction.
|
inline |
Gets swizzle form (x, x)
|
inline |
Gets swizzle form (x, y)
|
inline |
Gets swizzle form (y, x)
|
inline |
Gets swizzle form (y, y)