11 #ifndef PXR_BASE_GF_VEC2F_H 
   12 #define PXR_BASE_GF_VEC2F_H 
   57         : _data{ 
value, value }
 
  114         return Set(a[0], a[1]);
 
  118     float const *
data()
 const { 
return _data; }
 
  119     float *
data() { 
return _data; }
 
  133         return _data[0] == other[0] &&
 
  134                _data[1] == other[1];
 
  137         return !(*
this == other);
 
  153         return GfVec2f(-_data[0], -_data[1]);
 
  158         _data[0] += other[0];
 
  159         _data[1] += other[1];
 
  168         _data[0] -= other[0];
 
  169         _data[1] -= other[1];
 
  195         return *
this *= (1.0 / 
s);
 
  198         return *
this * (1.0 / 
s);
 
  203         return _data[0] * v[0] + _data[1] * v[1];
 
  211         return v * (*
this * 
v);
 
  225         return *
this * *
this;
 
  245         *
this /= (length > eps) ? length : eps;
 
  368     return delta.
GetLengthSq() <= tolerance * tolerance;
 
  375 #endif // PXR_BASE_GF_VEC2F_H 
bool operator==(GfVec2f const &other) const 
Equality comparison. 
 
float GetLength() const 
Length. 
 
float const & operator[](size_t i) const 
Indexing. 
 
*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
 
static GfVec2f YAxis()
Create a unit vector along the Y-axis. 
 
GLsizei const GLfloat * value
 
GfVec2f & operator-=(GfVec2f const &other)
Subtraction. 
 
float operator*(GfVec2f const &v) const 
See GfDot(). 
 
GfVec2f GfGetComplement(GfVec2f const &a, GfVec2f const &b)
 
float const * GetArray() const 
 
GLboolean GLboolean GLboolean GLboolean a
 
GLuint GLsizei GLsizei * length
 
float & operator[](size_t i)
 
GfVec2f GetComplement(GfVec2f const &b) const 
 
bool GfIsClose(GfVec2f const &v1, GfVec2f const &v2, double tolerance)
 
float GfGetLength(GfVec2f const &v)
Returns the geometric length of v. 
 
**But if you need a result
 
GLfloat GLfloat GLfloat v2
 
GfVec2f & Set(float const *a)
Set all elements with a pointer to data. 
 
static const size_t dimension
 
GfVec2f GfCompDiv(GfVec2f const &v1, GfVec2f const &v2)
Returns component-wise quotient of vectors v1 and v2. 
 
GfVec2f & operator*=(double s)
Multiplication by scalar. 
 
float Normalize(float eps=GF_MIN_VECTOR_LENGTH)
 
GfVec2f GetProjection(GfVec2f const &v) const 
 
GfVec2f operator-() const 
Create a vec with negated elements. 
 
float GetLengthSq() const 
Squared length. 
 
constexpr GfVec2f(Scl const *p)
Construct with pointer to values. 
 
bool operator!=(GfVec2f const &other) const 
 
friend size_t hash_value(GfVec2f const &vec)
Hash. 
 
float const * data() const 
Direct data access. 
 
GfVec2f operator/(double s) const 
 
constexpr GfVec2f(float value)
Initialize all elements to a single value. 
 
GLint GLenum GLboolean normalized
 
float ScalarType
Scalar element type and dimension. 
 
GLboolean GLboolean GLboolean b
 
GfVec2f GfGetProjection(GfVec2f const &a, GfVec2f const &b)
 
GfVec2f GfCompMult(GfVec2f const &v1, GfVec2f const &v2)
Returns component-wise multiplication of vectors v1 and v2. 
 
GF_API std::ostream & operator<<(std::ostream &, GfVec2f const &)
 
constexpr GfVec2f(float s0, float s1)
Initialize all elements with explicit arguments. 
 
static size_t Combine(Args &&...args)
Produce a hash code by combining the hash codes of several objects. 
 
static GfVec2f Axis(size_t i)
 
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
 
GfVec2f()=default
Default constructor does no initialization. 
 
GfVec2f & operator/=(double s)
Division by scalar. 
 
friend GfVec2f operator+(GfVec2f const &l, GfVec2f const &r)
 
GfVec2f operator*(double s) const 
 
friend GfVec2f operator-(GfVec2f const &l, GfVec2f const &r)
 
#define PXR_NAMESPACE_CLOSE_SCOPE
 
GfVec2f GetNormalized(float eps=GF_MIN_VECTOR_LENGTH) const 
 
GfVec2f & Set(float s0, float s1)
Set all elements with passed arguments. 
 
friend GfVec2f operator*(double s, GfVec2f const &v)
 
#define GF_MIN_VECTOR_LENGTH
 
float GfNormalize(GfVec2f *v, float eps=GF_MIN_VECTOR_LENGTH)
 
GfVec2f & operator+=(GfVec2f const &other)
Addition. 
 
float GfDot(GfVec2f const &v1, GfVec2f const &v2)
Returns the dot (inner) product of two vectors. 
 
static GfVec2f XAxis()
Create a unit vector along the X-axis. 
 
GfVec2f GfGetNormalized(GfVec2f const &v, float eps=GF_MIN_VECTOR_LENGTH)