28 #ifndef PXR_BASE_GF_VEC3I_H
29 #define PXR_BASE_GF_VEC3I_H
85 : _data{ p[0], p[1], p[2] }
127 return Set(a[0], a[1], a[2]);
131 int const *
data()
const {
return _data; }
146 return _data[0] == other[0] &&
147 _data[1] == other[1] &&
148 _data[2] == other[2];
151 return !(*
this == other);
167 return GfVec3i(-_data[0], -_data[1], -_data[2]);
172 _data[0] += other[0];
173 _data[1] += other[1];
174 _data[2] += other[2];
183 _data[0] -= other[0];
184 _data[1] -= other[1];
185 _data[2] -= other[2];
219 return _data[0] * v[0] + _data[1] * v[1] + _data[2] * v[2];
227 return v * (*
this *
v);
241 return *
this * *
this;
283 #endif // PXR_BASE_GF_VEC3I_H
GfVec3i & operator/=(int s)
Division by scalar.
static GfVec3i YAxis()
Create a unit vector along the Y-axis.
int GetLengthSq() const
Squared length.
constexpr GfVec3i(int s0, int s1, int s2)
Initialize all elements with explicit arguments.
static GfVec3i Axis(size_t i)
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
friend size_t hash_value(GfVec3i const &vec)
Hash.
GfVec3i & Set(int s0, int s1, int s2)
Set all elements with passed arguments.
static GfVec3i ZAxis()
Create a unit vector along the Z-axis.
GLsizei const GLfloat * value
GfVec3i & operator-=(GfVec3i const &other)
Subtraction.
GLboolean GLboolean GLboolean GLboolean a
int & operator[](size_t i)
**But if you need a result
GLfloat GLfloat GLfloat v2
GfVec3i GetComplement(GfVec3i const &b) const
constexpr GfVec3i(int value)
Initialize all elements to a single value.
GfVec3i GfCompMult(GfVec3i const &v1, GfVec3i const &v2)
Returns component-wise multiplication of vectors v1 and v2.
bool operator!=(GfVec3i const &other) const
GfVec3i & Set(int const *a)
Set all elements with a pointer to data.
int ScalarType
Scalar element type and dimension.
int operator*(GfVec3i const &v) const
See GfDot().
static GfVec3i XAxis()
Create a unit vector along the X-axis.
int const * data() const
Direct data access.
GfVec3i & operator*=(double s)
Multiplication by scalar.
GfVec3i GfCompDiv(GfVec3i const &v1, GfVec3i const &v2)
Returns component-wise quotient of vectors v1 and v2.
GLboolean GLboolean GLboolean b
GF_API std::ostream & operator<<(std::ostream &, GfVec3i const &)
GfVec3i()=default
Default constructor does no initialization.
static const size_t dimension
friend GfVec3i operator-(GfVec3i const &l, GfVec3i const &r)
GfVec3i operator*(double s) const
static size_t Combine(Args &&...args)
Produce a hash code by combining the hash codes of several objects.
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
friend GfVec3i operator*(double s, GfVec3i const &v)
GfVec3i operator-() const
Create a vec with negated elements.
#define PXR_NAMESPACE_CLOSE_SCOPE
int GfDot(GfVec3i const &v1, GfVec3i const &v2)
Returns the dot (inner) product of two vectors.
bool operator==(GfVec3i const &other) const
Equality comparison.
constexpr GfVec3i(Scl const *p)
Construct with pointer to values.
friend GfVec3i operator+(GfVec3i const &l, GfVec3i const &r)
GfVec3i GetProjection(GfVec3i const &v) const
GfVec3i & operator+=(GfVec3i const &other)
Addition.
int const * GetArray() const
int const & operator[](size_t i) const
Indexing.
GfVec3i operator/(int s) const