Panda3D
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
Public Member Functions | Static Public Member Functions
Vec3D 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 Vec3D:
VBase3D

List of all members.

Public Member Functions

 Vec3D ()
 Vec3D (VBase3D const copy)
 Vec3D (double fill_value)
 Vec3D (double x, double y, double z)
double angleDeg (Vec3D const other)
 Returns the angle between this vector and the other one, expressed in degrees.
double angleRad (Vec3D const other)
 Returns the unsigned angle between this vector and the other one, expressed in radians.
Vec3D cross (VBase3D const other)
PyObject getattr (string attr_name)
Vec2D getXy ()
 Returns a 2-component vector that shares just the first two components of this vector.
Vec2D getXz ()
 Returns a 2-component vector that shares just the first and last components of this vector.
Vec2D getYz ()
 Returns a 2-component vector that shares just the last two components of this vector.
Vec3D operator* (double scalar)
VBase3D operator+ (VBase3D const other)
Vec3D operator+ (Vec3D const other)
Vec3D operator- ()
VBase3D operator- (VBase3D const other)
Vec3D operator- (Vec3D const other)
Vec3D operator/ (double scalar)
Vec3D operator= (VBase3D const copy)
Vec3D operator= (double fill_value)
Vec3D project (VBase3D const onto)
 Returns a new vector representing the projection of this vector onto another one.
 pythonRepr (ostream out, string class_name)
double relativeAngleDeg (Vec3D const other)
 This method is deprecated.
double relativeAngleRad (Vec3D const other)
 This method is deprecated.
int setattr (PyObject self, string attr_name, PyObject assign)
double signedAngleDeg (Vec3D const other, Vec3D const ref)
 Returns the signed angle between two vectors.
double signedAngleRad (Vec3D const other, Vec3D const ref)
 returns the signed angle between two vectors.

Static Public Member Functions

static Vec3D back (CoordinateSystem cs)
 Returns the back vector for the given coordinate system.
static Vec3D back ()
 Returns the back vector for the given coordinate system.
static Vec3D down (CoordinateSystem cs)
 Returns the down vector for the given coordinate system.
static Vec3D down ()
 Returns the down vector for the given coordinate system.
static Vec3D forward (CoordinateSystem cs)
 Returns the forward vector for the given coordinate system.
static Vec3D forward ()
 Returns the forward vector for the given coordinate system.
static TypeHandle getClassType ()
static Vec3D left (CoordinateSystem cs)
 Returns the left vector for the given coordinate system.
static Vec3D left ()
 Returns the left vector for the given coordinate system.
static Vec3D rfu (double right, double fwd, double 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 Vec3D rfu (double right, double fwd, double up)
 Returns a vector that is described by its right, forward, and up components, in whatever way the coordinate system represents that vector.
static Vec3D right (CoordinateSystem cs)
 Returns the right vector for the given coordinate system.
static Vec3D right ()
 Returns the right vector for the given coordinate system.
static Vec3D const unitX ()
 Returns a unit X vector.
static Vec3D const unitY ()
 Returns a unit Y vector.
static Vec3D const unitZ ()
 Returns a unit Z vector.
static Vec3D up (CoordinateSystem cs)
 Returns the up vector for the given coordinate system.
static Vec3D up ()
 Returns the up vector for the given coordinate system.
static Vec3D 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

Vec3D ( )
Vec3D ( VBase3D const  copy)
Vec3D ( double  fill_value)
Vec3D ( double  x,
double  y,
double  z 
)

Member Function Documentation

double angleDeg ( Vec3D const  other)

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

Both vectors should be initially normalized.

double angleRad ( Vec3D const  other)

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

Both vectors should be initially normalized.

static Vec3D back ( CoordinateSystem  cs) [static]

Returns the back vector for the given coordinate system.

static Vec3D back ( ) [static]

Returns the back vector for the given coordinate system.

Vec3D cross ( VBase3D const  other)

Reimplemented from VBase3D.

static Vec3D down ( CoordinateSystem  cs) [static]

Returns the down vector for the given coordinate system.

static Vec3D down ( ) [static]

Returns the down vector for the given coordinate system.

static Vec3D forward ( CoordinateSystem  cs) [static]

Returns the forward vector for the given coordinate system.

static Vec3D forward ( ) [static]

Returns the forward vector for the given coordinate system.

PyObject getattr ( string  attr_name)

Reimplemented from VBase3D.

static TypeHandle getClassType ( ) [static]

Reimplemented from VBase3D.

Vec2D getXy ( )

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

Reimplemented from VBase3D.

Vec2D getXz ( )

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

Reimplemented from VBase3D.

Vec2D getYz ( )

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

Reimplemented from VBase3D.

static Vec3D left ( CoordinateSystem  cs) [static]

Returns the left vector for the given coordinate system.

static Vec3D left ( ) [static]

Returns the left vector for the given coordinate system.

Vec3D operator* ( double  scalar)

Reimplemented from VBase3D.

VBase3D operator+ ( VBase3D const  other)

Reimplemented from VBase3D.

Vec3D operator+ ( Vec3D const  other)
Vec3D operator- ( )

Reimplemented from VBase3D.

VBase3D operator- ( VBase3D const  other)

Reimplemented from VBase3D.

Vec3D operator- ( Vec3D const  other)
Vec3D operator/ ( double  scalar)

Reimplemented from VBase3D.

Vec3D operator= ( VBase3D const  copy)

Reimplemented from VBase3D.

Vec3D operator= ( double  fill_value)

Reimplemented from VBase3D.

Vec3D project ( VBase3D 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 VBase3D.

pythonRepr ( ostream  out,
string  class_name 
)

Reimplemented from VBase3D.

double relativeAngleDeg ( Vec3D const  other)

This method is deprecated.

Do not use.

double relativeAngleRad ( Vec3D const  other)

This method is deprecated.

Do not use.

static Vec3D rfu ( double  right,
double  fwd,
double  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 Vec3D rfu ( double  right,
double  fwd,
double  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 Vec3D right ( CoordinateSystem  cs) [static]

Returns the right vector for the given coordinate system.

static Vec3D right ( ) [static]

Returns the right vector for the given coordinate system.

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

Reimplemented from VBase3D.

double signedAngleDeg ( Vec3D const  other,
Vec3D 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.

double signedAngleRad ( Vec3D const  other,
Vec3D 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 Vec3D const unitX ( ) [static]

Returns a unit X vector.

Reimplemented from VBase3D.

static Vec3D const unitY ( ) [static]

Returns a unit Y vector.

Reimplemented from VBase3D.

static Vec3D const unitZ ( ) [static]

Returns a unit Z vector.

Reimplemented from VBase3D.

static Vec3D up ( CoordinateSystem  cs) [static]

Returns the up vector for the given coordinate system.

static Vec3D up ( ) [static]

Returns the up vector for the given coordinate system.

static Vec3D const zero ( ) [static]

Returns a zero-length vector.

Reimplemented from VBase3D.

 All Classes Namespaces Functions Variables Enumerations Enumerator Properties