Panda3D
Public Member Functions | Static Public Member Functions
LVector3f Class Reference

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

#include "lvector3.h"

Inheritance diagram for LVector3f:
LVecBase3f

List of all members.

Public Member Functions

 LVector3f (const LVecBase3f &copy)
 LVector3f (float fill_value)
 LVector3f (float x, float y, float z)
float angle_deg (const LVector3f &other) const
 Returns the angle between this vector and the other one, expressed in degrees.
float angle_rad (const LVector3f &other) const
 Returns the unsigned angle between this vector and the other one, expressed in radians.
LVector3f cross (const LVecBase3f &other) const
LVector2f get_xy () const
 Returns a 2-component vector that shares just the first two components of this vector.
LVector2f get_xz () const
 Returns a 2-component vector that shares just the first and last components of this vector.
LVector2f get_yz () const
 Returns a 2-component vector that shares just the last two components of this vector.
LVector3f operator* (float scalar) const
LVecBase3f operator+ (const LVecBase3f &other) const
LVector3f operator+ (const LVector3f &other) const
LVector3f operator- () const
LVecBase3f operator- (const LVecBase3f &other) const
LVector3f operator- (const LVector3f &other) const
LVector3f operator/ (float scalar) const
LVector3foperator= (const LVecBase3f &copy)
LVector3foperator= (float fill_value)
LVector3f project (const LVecBase3f &onto) const
 Returns a new vector representing the projection of this vector onto another one.
float relative_angle_deg (const LVector3f &other) const
 This method is deprecated.
float relative_angle_rad (const LVector3f &other) const
 This method is deprecated.
float signed_angle_deg (const LVector3f &other, const LVector3f &ref) const
 Returns the signed angle between two vectors.
float signed_angle_rad (const LVector3f &other, const LVector3f &ref) const
 returns the signed angle between two vectors.

Static Public Member Functions

static LVector3f back (CoordinateSystem cs=CS_default)
 Returns the back vector for the given coordinate system.
static LVector3f down (CoordinateSystem cs=CS_default)
 Returns the down vector for the given coordinate system.
static LVector3f forward (CoordinateSystem cs=CS_default)
 Returns the forward vector for the given coordinate system.
static TypeHandle get_class_type ()
static void init_type ()
static LVector3f left (CoordinateSystem cs=CS_default)
 Returns the left vector for the given coordinate system.
static LVector3f rfu (float right, float fwd, float up, CoordinateSystem cs=CS_default)
 Returns a vector that is described by its right, forward, and up components, in whatever way the coordinate system represents that vector.
static LVector3f right (CoordinateSystem cs=CS_default)
 Returns the right vector for the given coordinate system.
static const LVector3funit_x ()
 Returns a unit X vector.
static const LVector3funit_y ()
 Returns a unit Y vector.
static const LVector3funit_z ()
 Returns a unit Z vector.
static LVector3f up (CoordinateSystem cs=CS_default)
 Returns the up vector for the given coordinate system.
static const LVector3fzero ()
 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.

Definition at line 94 of file lvector3.h.


Member Function Documentation

float LVector3f::angle_deg ( const LVector3f other) const [inline]

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

Both vectors should be initially normalized.

Definition at line 416 of file lvector3.h.

Referenced by GeoMipTerrain::make_slope_image().

float LVector3f::angle_rad ( const LVector3f other) const [inline]

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

Both vectors should be initially normalized.

Definition at line 396 of file lvector3.h.

LVector3f LVector3f::back ( CoordinateSystem  cs = CS_default) [inline, static]

Returns the back vector for the given coordinate system.

Definition at line 597 of file lvector3.h.

LVector3f LVector3f::down ( CoordinateSystem  cs = CS_default) [inline, static]

Returns the down vector for the given coordinate system.

Definition at line 575 of file lvector3.h.

LVector3f LVector3f::forward ( CoordinateSystem  cs = CS_default) [inline, static]
LVector2f LVector3f::get_xy ( ) const [inline]

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

Reimplemented from LVecBase3f.

Definition at line 290 of file lvector3.h.

LVector2f LVector3f::get_xz ( ) const [inline]

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

Reimplemented from LVecBase3f.

Definition at line 301 of file lvector3.h.

LVector2f LVector3f::get_yz ( ) const [inline]

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

Reimplemented from LVecBase3f.

Definition at line 312 of file lvector3.h.

LVector3f LVector3f::left ( CoordinateSystem  cs = CS_default) [inline, static]

Returns the left vector for the given coordinate system.

Definition at line 586 of file lvector3.h.

Referenced by PerspectiveLens::do_compute_projection_mat().

LVector3f LVector3f::project ( const LVecBase3f onto) const [inline]

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 LVecBase3f.

Definition at line 384 of file lvector3.h.

float LVector3f::relative_angle_deg ( const LVector3f other) const [inline]

This method is deprecated.

Do not use.

Definition at line 474 of file lvector3.h.

float LVector3f::relative_angle_rad ( const LVector3f other) const [inline]

This method is deprecated.

Do not use.

Definition at line 464 of file lvector3.h.

LVector3f LVector3f::rfu ( float  right,
float  fwd,
float  up,
CoordinateSystem  cs = CS_default 
) [inline, static]

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

Definition at line 611 of file lvector3.h.

Referenced by PGItem::mouse_to_local(), PGSliderBar::recompute(), PGSliderBar::remanage(), CardMaker::set_frame(), PGScrollFrame::setup(), PGSliderBar::setup_scroll_bar(), and PGSliderBar::setup_slider().

LVector3f LVector3f::right ( CoordinateSystem  cs = CS_default) [inline, static]

Returns the right vector for the given coordinate system.

Definition at line 533 of file lvector3.h.

Referenced by PGItem::activate_region(), TextPropertiesManager::set_graphic(), and PGEntry::setup().

float LVector3f::signed_angle_deg ( const LVector3f other,
const LVector3f ref 
) const [inline]

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.

Definition at line 453 of file lvector3.h.

float LVector3f::signed_angle_rad ( const LVector3f other,
const LVector3f ref 
) const [inline]

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.

Definition at line 432 of file lvector3.h.

const LVector3f & LVector3f::unit_x ( ) [inline, static]

Returns a unit X vector.

Reimplemented from LVecBase3f.

Definition at line 259 of file lvector3.h.

const LVector3f & LVector3f::unit_y ( ) [inline, static]

Returns a unit Y vector.

Reimplemented from LVecBase3f.

Definition at line 269 of file lvector3.h.

const LVector3f & LVector3f::unit_z ( ) [inline, static]

Returns a unit Z vector.

Reimplemented from LVecBase3f.

Definition at line 279 of file lvector3.h.

LVector3f LVector3f::up ( CoordinateSystem  cs = CS_default) [inline, static]
const LVector3f & LVector3f::zero ( ) [inline, static]

The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations