|
def | __add__ (self, other) |
|
def | __div__ (self, scalar) |
|
def | __eq__ (self, other) |
|
def | __getitem__ (self, index) |
|
def | __iadd__ (self, other) |
|
def | __idiv__ (self, scalar) |
|
def | __imul__ (self, scalar) |
|
def | __init__ (self, args) |
|
def | __isub__ (self, other) |
|
def | __mul__ (self, scalar) |
|
def | __ne__ (self, other) |
|
def | __neg__ (self) |
|
def | __str__ (self) |
|
def | __sub__ (self, other) |
|
def | angle_to (self, other) |
|
float | angleTo (const Vector &other) const |
|
def | cross (self, other) |
|
Vector | cross (const Vector &other) const |
|
def | distance_to (self, other) |
|
float | distanceTo (const Vector &other) const |
|
def | dot (self, other) |
|
float | dot (const Vector &other) const |
|
def | is_valid (self) |
|
bool | isValid () const |
|
float | magnitude () const |
|
float | magnitudeSquared () const |
|
Vector | normalized () const |
|
bool | operator!= (const Vector &other) const |
|
Vector | operator* (float scalar) const |
|
Vector & | operator*= (float scalar) |
|
Vector | operator+ (const Vector &other) const |
|
Vector & | operator+= (const Vector &other) |
|
Vector | operator- () const |
|
Vector | operator- (const Vector &other) const |
|
Vector & | operator-= (const Vector &other) |
|
Vector | operator/ (float scalar) const |
|
Vector & | operator/= (float scalar) |
|
bool | operator== (const Vector &other) const |
|
float | operator[] (unsigned int index) const |
|
float | pitch () const |
|
float | roll () const |
|
def | to_float_array (self) |
|
def | to_tuple (self) |
|
const float * | toFloatPointer () const |
|
std::string | toString () const |
|
template<typename Vector3Type > |
const Vector3Type | toVector3 () const |
|
template<typename Vector4Type > |
const Vector4Type | toVector4 (float w=0.0f) const |
|
| Vector () |
|
| Vector (float _x, float _y, float _z) |
|
| Vector (const Vector &vector) |
|
float | yaw () const |
|
The Vector struct represents a three-component mathematical vector or point such as a direction or position in three-dimensional space.
The Leap Motion software employs a right-handed Cartesian coordinate system. Values given are in units of real-world millimeters. The origin is centered at the center of the Leap Motion Controller. The x- and z-axes lie in the horizontal plane, with the x-axis running parallel to the long edge of the device. The y-axis is vertical, with positive values increasing upwards (in contrast to the downward orientation of most computer graphics coordinate systems). The z-axis has positive values increasing away from the computer screen.
- Since
- 1.0
Definition at line 60 of file LeapMath.h.
float Leap::Vector::angleTo |
( |
const Vector & |
other | ) |
const |
|
inline |
The angle between this vector and the specified vector in radians.
The angle is measured in the plane formed by the two vectors. The angle returned is always the smaller of the two conjugate angles. Thus A.angleTo(B) == B.angleTo(A)
and is always a positive value less than or equal to pi radians (180 degrees).
If either vector has zero length, then this function returns zero.
- Parameters
-
- Returns
- The angle between this vector and the specified vector in radians.
- Since
- 1.0
Definition at line 247 of file LeapMath.h.
float Leap::Vector::magnitude |
( |
| ) |
const |
|
inline |
The magnitude, or length, of this vector.
The magnitude is the L2 norm, or Euclidean distance between the origin and the point represented by the (x, y, z) components of this Vector object.
- Returns
- The length of this vector.
- Since
- 1.0
Definition at line 197 of file LeapMath.h.
float Leap::Vector::pitch |
( |
| ) |
const |
|
inline |
The pitch angle in radians.
Pitch is the angle between the negative z-axis and the projection of the vector onto the y-z plane. In other words, pitch represents rotation around the x-axis. If the vector points upward, the returned angle is between 0 and pi radians (180 degrees); if it points downward, the angle is between 0 and -pi radians.
- Returns
- The angle of this vector above or below the horizon (x-z plane).
- Since
- 1.0
Definition at line 277 of file LeapMath.h.
float Leap::Vector::roll |
( |
| ) |
const |
|
inline |
The roll angle in radians.
Roll is the angle between the y-axis and the projection of the vector onto the x-y plane. In other words, roll represents rotation around the z-axis. If the vector points to the left of the y-axis, then the returned angle is between 0 and pi radians (180 degrees); if it points to the right, the angle is between 0 and -pi radians.
Use this function to get roll angle of the plane to which this vector is a normal. For example, if this vector represents the normal to the palm, then this function returns the tilt or roll of the palm plane compared to the horizontal (x-z) plane.
- Returns
- The angle of this vector to the right or left of the y-axis.
- Since
- 1.0
Definition at line 322 of file LeapMath.h.
template<typename Vector3Type >
const Vector3Type Leap::Vector::toVector3 |
( |
| ) |
const |
|
inline |
Convert a Leap::Vector to another 3-component Vector type.
The specified type must define a constructor that takes the x, y, and z components as separate parameters.
- Since
- 1.0
Definition at line 575 of file LeapMath.h.
template<typename Vector4Type >
const Vector4Type Leap::Vector::toVector4 |
( |
float |
w = 0.0f | ) |
const |
|
inline |
Convert a Leap::Vector to another 4-component Vector type.
The specified type must define a constructor that takes the x, y, z, and w components as separate parameters. (The homogeneous coordinate, w, is set to zero by default, but you should typically set it to one for vectors representing a position.)
- Since
- 1.0
Definition at line 589 of file LeapMath.h.
float Leap::Vector::yaw |
( |
| ) |
const |
|
inline |
The yaw angle in radians.
Yaw is the angle between the negative z-axis and the projection of the vector onto the x-z plane. In other words, yaw represents rotation around the y-axis. If the vector points to the right of the negative z-axis, then the returned angle is between 0 and pi radians (180 degrees); if it points to the left, the angle is between 0 and -pi radians.
- Returns
- The angle of this vector to the right or left of the negative z-axis.
- Since
- 1.0
Definition at line 297 of file LeapMath.h.