Panda3D

- Main Page
- Packages
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions

# Vec3 Class Reference

This is a three-component vector distance (as opposed to a three-component point, which represents a particular point in space). More...

Inheritance diagram for Vec3:

List of all members.

## Public Member Functions
| Vec3 ()
| Vec3 (VBase3 const copy)
| Vec3 (float x, float y, float z)
| Vec3 (float fill_value)
float | angleDeg (Vec3 const other)
| Returns the angle between this vector and the other one, expressed in degrees.
float | angleRad (Vec3 const other)
| Returns the unsigned angle between this vector and the other one, expressed in radians.
Vec3 | cross (VBase3 const other)
PyObject | getattr (string attr_name)
Vec2 | getXy ()
| Returns a 2-component vector that shares just the first two components of this vector.
Vec2 | getXz ()
| Returns a 2-component vector that shares just the first and last components of this vector.
Vec2 | getYz ()
| Returns a 2-component vector that shares just the last two components of this vector.
Vec3 | operator* (float scalar)
VBase3 | operator+ (VBase3 const other)
Vec3 | operator+ (Vec3 const other)
Vec3 | operator- (Vec3 const other)
Vec3 | operator- ()
VBase3 | operator- (VBase3 const other)
Vec3 | operator/ (float scalar)
Vec3 | operator= (VBase3 const copy)
Vec3 | operator= (float fill_value)
Vec3 | project (VBase3 const onto)
| Returns a new vector representing the projection of this vector onto another one.
| pythonRepr (ostream out, string class_name)
float | relativeAngleDeg (Vec3 const other)
| This method is deprecated.
float | relativeAngleRad (Vec3 const other)
| This method is deprecated.
int | setattr (PyObject self, string attr_name, PyObject assign)
float | signedAngleDeg (Vec3 const other, Vec3 const ref)
| Returns the signed angle between two vectors.
float | signedAngleRad (Vec3 const other, Vec3 const ref)
| returns the signed angle between two vectors.
## Static Public Member Functions
static Vec3 | back (CoordinateSystem cs)
| Returns the back vector for the given coordinate system.
static Vec3 | back ()
| Returns the back vector for the given coordinate system.
static Vec3 | down (CoordinateSystem cs)
| Returns the down vector for the given coordinate system.
static Vec3 | down ()
| Returns the down vector for the given coordinate system.
static Vec3 | forward (CoordinateSystem cs)
| Returns the forward vector for the given coordinate system.
static Vec3 | forward ()
| Returns the forward vector for the given coordinate system.
static TypeHandle | getClassType ()
static Vec3 | left (CoordinateSystem cs)
| Returns the left vector for the given coordinate system.
static Vec3 | left ()
| Returns the left vector for the given coordinate system.
static Vec3 | rfu (float right, float fwd, float up, CoordinateSystem cs)
| Returns a vector that is described by its right, forward, and up components, in whatever way the coordinate system represents that vector.
static Vec3 | rfu (float right, float fwd, float up)
| Returns a vector that is described by its right, forward, and up components, in whatever way the coordinate system represents that vector.
static Vec3 | right (CoordinateSystem cs)
| Returns the right vector for the given coordinate system.
static Vec3 | right ()
| Returns the right vector for the given coordinate system.
static Vec3 const | unitX ()
| Returns a unit X vector.
static Vec3 const | unitY ()
| Returns a unit Y vector.
static Vec3 const | unitZ ()
| Returns a unit Z vector.
static Vec3 | up (CoordinateSystem cs)
| Returns the up vector for the given coordinate system.
static Vec3 | up ()
| Returns the up vector for the given coordinate system.
static Vec3 const | zero ()
| Returns a zero-length vector.

## Detailed Description

This is a three-component vector distance (as opposed to a three-component point, which represents a particular point in space).

Some of the methods are slightly different between LPoint3 and LVector3; in particular, subtraction of two points yields a vector, while addition of a vector and a point yields a point.

## Constructor & Destructor Documentation

Vec3 | ( |  | ) |

Vec3 | ( | VBase3 const | copy | ) |

Vec3 | ( | float | fill_value | ) |

Vec3 | ( | float | x,
|  | float | y,
|  | float | z
| ) |  |

## Member Function Documentation

float angleDeg | ( | Vec3 const | other | ) |

Returns the angle between this vector and the other one, expressed in degrees.

Both vectors should be initially normalized.

float angleRad | ( | Vec3 const | other | ) |

Returns the unsigned angle between this vector and the other one, expressed in radians.

Both vectors should be initially normalized.

static Vec3 back | ( | CoordinateSystem | cs | ) | `[static]`

Returns the back vector for the given coordinate system.

static Vec3 back | ( |  | ) | `[static]`

Returns the back vector for the given coordinate system.

Vec3 cross | ( | VBase3 const | other | ) |

Reimplemented from VBase3.

static Vec3 down | ( |  | ) | `[static]`

Returns the down vector for the given coordinate system.

static Vec3 down | ( | CoordinateSystem | cs | ) | `[static]`

Returns the down vector for the given coordinate system.

static Vec3 forward | ( |  | ) | `[static]`

Returns the forward vector for the given coordinate system.

static Vec3 forward | ( | CoordinateSystem | cs | ) | `[static]`

Returns the forward vector for the given coordinate system.

PyObject getattr | ( | string | attr_name | ) |

Reimplemented from VBase3.

static TypeHandle getClassType | ( |  | ) | `[static]`

Reimplemented from VBase3.

Vec2 getXy | ( |  | ) |

Returns a 2-component vector that shares just the first two components of this vector.

Reimplemented from VBase3.

Vec2 getXz | ( |  | ) |

Returns a 2-component vector that shares just the first and last components of this vector.

Reimplemented from VBase3.

Vec2 getYz | ( |  | ) |

Returns a 2-component vector that shares just the last two components of this vector.

Reimplemented from VBase3.

static Vec3 left | ( | CoordinateSystem | cs | ) | `[static]`

Returns the left vector for the given coordinate system.

static Vec3 left | ( |  | ) | `[static]`

Returns the left vector for the given coordinate system.

Vec3 operator* | ( | float | scalar | ) |

Reimplemented from VBase3.

VBase3 operator+ | ( | VBase3 const | other | ) |

Reimplemented from VBase3.

Vec3 operator+ | ( | Vec3 const | other | ) |

Vec3 operator- | ( | Vec3 const | other | ) |

Vec3 operator- | ( |  | ) |

Reimplemented from VBase3.

VBase3 operator- | ( | VBase3 const | other | ) |

Reimplemented from VBase3.

Vec3 operator/ | ( | float | scalar | ) |

Reimplemented from VBase3.

Vec3 operator= | ( | float | fill_value | ) |

Reimplemented from VBase3.

Vec3 operator= | ( | VBase3 const | copy | ) |

Reimplemented from VBase3.

Vec3 project | ( | VBase3 const | onto | ) |

Returns a new vector representing the projection of this vector onto another one.

The resulting vector will be a scalar multiple of onto.

Reimplemented from VBase3.

pythonRepr | ( | ostream | out,
|  | string | class_name
| ) |  |

Reimplemented from VBase3.

float relativeAngleDeg | ( | Vec3 const | other | ) |

This method is deprecated.

Do not use.

float relativeAngleRad | ( | Vec3 const | other | ) |

This method is deprecated.

Do not use.

static Vec3 rfu | ( | float | right,
|  | float | fwd,
|  | float | up,
|  | CoordinateSystem | cs
| ) |  | `[static]`

Returns a vector that is described by its right, forward, and up components, in whatever way the coordinate system represents that vector.

INLINE_LINMATH FLOATNAME(LVector3) & FLOATNAME(LVector3)::

static Vec3 rfu | ( | float | right,
|  | float | fwd,
|  | float | up
| ) |  | `[static]`

Returns a vector that is described by its right, forward, and up components, in whatever way the coordinate system represents that vector.

INLINE_LINMATH FLOATNAME(LVector3) & FLOATNAME(LVector3)::

static Vec3 right | ( |  | ) | `[static]`

Returns the right vector for the given coordinate system.

static Vec3 right | ( | CoordinateSystem | cs | ) | `[static]`

Returns the right vector for the given coordinate system.

int setattr | ( | PyObject | self,
|  | string | attr_name,
|  | PyObject | assign
| ) |  |

Reimplemented from VBase3.

float signedAngleDeg | ( | Vec3 const | other,
|  | Vec3 const | ref
| ) |  |

Returns the signed angle between two vectors.

The angle is positive if the rotation from this vector to other is clockwise when looking in the direction of the ref vector.

Vectors (except the ref vector) should be initially normalized.

float signedAngleRad | ( | Vec3 const | other,
|  | Vec3 const | ref
| ) |  |

returns the signed angle between two vectors.

The angle is positive if the rotation from this vector to other is clockwise when looking in the direction of the ref vector.

Vectors (except the ref vector) should be initially normalized.

static Vec3 const unitX | ( |  | ) | `[static]`

Returns a unit X vector.

Reimplemented from VBase3.

static Vec3 const unitY | ( |  | ) | `[static]`

Returns a unit Y vector.

Reimplemented from VBase3.

static Vec3 const unitZ | ( |  | ) | `[static]`

Returns a unit Z vector.

Reimplemented from VBase3.

static Vec3 up | ( |  | ) | `[static]`

Returns the up vector for the given coordinate system.

static Vec3 up | ( | CoordinateSystem | cs | ) | `[static]`

Returns the up vector for the given coordinate system.

static Vec3 const zero | ( |  | ) | `[static]`

Returns a zero-length vector.

Reimplemented from VBase3.

All Classes Namespaces Functions Variables Enumerations Enumerator Properties