![]() |
|
Basic type for a vector of 3 int components. More...
#include <vec3i.h>
Public Types | |
| typedef int | ScalarType |
| Scalar element type and dimension. | |
Public Member Functions | |
| GfVec3i ()=default | |
| GfVec3i value-initializes to zero and performs no default initialization, like float or double. | |
| constexpr | GfVec3i (int value) |
| Initialize all elements to a single value. | |
| constexpr | GfVec3i (int s0, int s1, int s2) |
| Initialize all elements with explicit arguments. | |
| template<class Scl > | |
| constexpr | GfVec3i (Scl const *p) |
| Construct with pointer to values. | |
| GfVec3i & | Set (int s0, int s1, int s2) |
| Set all elements with passed arguments. | |
| GfVec3i & | Set (int const *a) |
| Set all elements with a pointer to data. | |
| int const * | data () const |
| Direct data access. | |
| int * | data () |
| int const * | GetArray () const |
| int const & | operator[] (size_t i) const |
| Indexing. | |
| int & | operator[] (size_t i) |
| bool | operator== (GfVec3i const &other) const |
| Equality comparison. | |
| bool | operator!= (GfVec3i const &other) const |
| GF_API bool | operator== (class GfVec3d const &other) const |
| Equality comparison. | |
| GF_API bool | operator== (class GfVec3f const &other) const |
| Equality comparison. | |
| GF_API bool | operator== (class GfVec3h const &other) const |
| Equality comparison. | |
| GfVec3i | operator- () const |
| Create a vec with negated elements. | |
| GfVec3i & | operator+= (GfVec3i const &other) |
| Addition. | |
| GfVec3i & | operator-= (GfVec3i const &other) |
| Subtraction. | |
| GfVec3i & | operator*= (double s) |
| Multiplication by scalar. | |
| GfVec3i | operator* (double s) const |
| GfVec3i & | operator/= (int s) |
| Division by scalar. | |
| GfVec3i | operator/ (int s) const |
| int | operator* (GfVec3i const &v) const |
| See GfDot(). | |
| GfVec3i | GetProjection (GfVec3i const &v) const |
Returns the projection of this onto v. | |
| GfVec3i | GetComplement (GfVec3i const &b) const |
Returns the orthogonal complement of this->GetProjection(b). | |
| int | GetLengthSq () const |
| Squared length. | |
Swizzles | |
Each accessor returns a new vector built from this one's components, in the order named. For example zyx() returns GfVec3i(z, y, x). Every permutation of 2 to 3 of the 3 components is available. Repeated components ( The results are ordinary GfVecs, so all the usual operators, GfDot() and so on apply to them. They are values, not references into this vector, so they cannot be assigned through. | |
| constexpr GfVec2i | xy () const |
| constexpr GfVec2i | xz () const |
| constexpr GfVec2i | yx () const |
| constexpr GfVec2i | yz () const |
| constexpr GfVec2i | zx () const |
| constexpr GfVec2i | zy () const |
| constexpr GfVec3i | xyz () const |
| constexpr GfVec3i | xzy () const |
| constexpr GfVec3i | yxz () const |
| constexpr GfVec3i | yzx () const |
| constexpr GfVec3i | zxy () const |
| constexpr GfVec3i | zyx () const |
Static Public Member Functions | |
| static GfVec3i | XAxis () |
| Create a unit vector along the X-axis. | |
| static GfVec3i | YAxis () |
| Create a unit vector along the Y-axis. | |
| static GfVec3i | ZAxis () |
| Create a unit vector along the Z-axis. | |
| static GfVec3i | Axis (size_t i) |
| Create a unit vector along the i-th axis, zero-based. | |
Public Attributes | |
Vector Components | |
The vector's components, which are also its storage. These are public and directly readable and writable. The components are contiguous and in declaration order, so For multi-component access see the swizzle accessors below, which return a new vector by value. | |
| int | x |
| int | y |
| int | z |
Static Public Attributes | |
| static const size_t | dimension = 3 |
Friends | |
| size_t | hash_value (GfVec3i const &vec) |
| Hash. | |
| GfVec3i | operator+ (GfVec3i const &l, GfVec3i const &r) |
| GfVec3i | operator- (GfVec3i const &l, GfVec3i const &r) |
| GfVec3i | operator* (double s, GfVec3i const &v) |
Basic type for a vector of 3 int components.
Represents a vector of 3 components of type int. It is intended to be fast and simple.
| int ScalarType |
|
default |
GfVec3i value-initializes to zero and performs no default initialization, like float or double.
|
inlineexplicitconstexpr |
|
inlineconstexpr |
|
inlineexplicitconstexpr |
|
inlinestatic |
|
inline |
Returns the orthogonal complement of this->GetProjection(b).
That is:
|
inline |
|
inline |
|
inline |
| GF_API bool operator== | ( | class GfVec3d const & | other | ) | const |
Equality comparison.
| GF_API bool operator== | ( | class GfVec3f const & | other | ) | const |
Equality comparison.
| GF_API bool operator== | ( | class GfVec3h const & | other | ) | const |
Equality comparison.
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |