3Gear Systems SDK  v0.9.34
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | Public Attributes | List of all members
HandTrackingClient::Vector3< T > Class Template Reference

A minimal 3-vector class. More...

#include <VecMath.h>

Public Member Functions

 Vector3 ()
 The default constructor initializes to (0, 0, 0).
 
 Vector3 (T x_in, T y_in, T z_in)
 Initialize from the passed-in values.
 
template<typename T2 >
Vector3< T2 > cast () const
 Convert to a vector with a different base type.
 
Vector3< T > & operator+= (const Vector3< T > &rhs)
 Adds the passed-in vector to this vector.
 
Vector3< T > & operator-= (const Vector3< T > &rhs)
 Subtracts the passed-in vector to this vector.
 
Vector3< T > operator- () const
 Unary minus operator.
 
Vector3< T > & operator*= (const T rhs)
 Multiplies this vector (in place) by the scalar.
 
Vector3< T > & operator/= (const T rhs)
 Divides this vector (in place) by the scalar.
 
dot (const Vector3< T > &rhs) const
 Computes the dot product of this vector with another.
 
Vector3< T > cross (const Vector3< T > &rhs) const
 Computes the cross product of this vector with another.
 
bool operator== (const Vector3< T > &rhs) const
 Tests for equality (no floating point slop).
 
bool operator!= (const Vector3< T > &rhs) const
 Tests for inequality (no floating point slop).
 
squaredNorm () const
 Returns the L2 squared norm (x^2 + y^2 + z^2).
 
lInfNorm () const
 Returns the l_infinity norm (the supremum over the absolute values of the elements).
 
norm () const
 Returns the L2 norm sqrt(x^2 + y^2 + z^2).
 
void normalize ()
 
Vector3< T > normalized () const
 Returns a normalized version of this vector.
 

Public Attributes

x
 The x component.
 
y
 The y component.
 
z
 The z component.
 

Detailed Description

template<typename T>
class HandTrackingClient::Vector3< T >

A minimal 3-vector class.

We have provided this simple vector class to avoid a dependence on an external math library (like Eigen).

Member Function Documentation

template<typename T >
void HandTrackingClient::Vector3< T >::normalize ( )

Normalize this vector. Note that it avoids the divide by zero in cases where the vector is equal to (0, 0, 0).


The documentation for this class was generated from the following files: