# LVector3f

from pandac.PandaModules import LVector3f

Filename: lvector3_src.h Created by: drose (24Sep99)
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University. All rights reserved.
All use of this software is subject to the terms of the revised BSD license. You should have received a copy of this license along with this source code in a file named "LICENSE."
Class : LVector3
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.

## Inheritance:

LVector3f: LVecBase3f
LVecBase3f:

## Methods of LVector3f:

LVector3f (Constructor)
angleDeg
angleRad
back
cross
down
forward
getClassType
getXy
getXz
getYz
left
operator *
operator +
operator -
operator -
operator /
operator =
project
pythonRepr
relativeAngleDeg
relativeAngleRad
rfu
right
signedAngleDeg
signedAngleRad
unitX
unitY
unitZ
up
zero

## Methods of LVecBase3f:

LVecBase3f (Constructor)
addHash
addToCell
addX
addY
addZ
almostEqual
compareTo
cross
crossInto
dot
fill
fmax
fmin
getCell
getClassType
getData
getHash
getNumComponents
getStandardizedHpr
getX
getXy
getXz
getY
getYz
getZ
isNan
length
lengthSquared
normalize
operator !=
operator *
operator *=
operator +
operator +=
operator -
operator -
operator -=
operator /
operator /=
operator <
operator =
operator ==
operator []
operator delete
operator new
output
project
pythonRepr
set
setCell
Setitem
setX
setY
setZ
size
unitX
unitY
unitZ
validatePtr
zero

LVector3f LVector3f::LVector3f(void); Filename: lvector3_src.I Created by: drose (24Sep99) PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University. All rights reserved. All use of this software is subject to the terms of the revised BSD license. You should have received a copy of this license along with this source code in a file named "LICENSE." Description:

angleDeg float LVector3f::angle_deg(LVector3f const &other) const; Description: Returns the angle between this vector and the other one, expressed in degrees. Both vectors should be initially normalized.

angleRad float LVector3f::angle_rad(LVector3f const &other) const; Description: Returns the unsigned angle between this vector and the other one, expressed in radians. Both vectors should be initially normalized.

back static LVector3f LVector3f::back(CoordinateSystem cs = (CS_default)); Description: Returns the back vector for the given coordinate system.

cross LVector3f LVector3f::cross(LVecBase3f const &other) const; Description:

down static LVector3f LVector3f::down(CoordinateSystem cs = (CS_default)); Description: Returns the down vector for the given coordinate system.

forward static LVector3f LVector3f::forward(CoordinateSystem cs = (CS_default)); Description: Returns the forward vector for the given coordinate system.

getClassType static TypeHandle LVector3f::get_class_type(void); Undocumented function.

getXy LVector2f LVector3f::get_xy(void) const; Description: Returns a 2-component vector that shares just the first two components of this vector.

getXz LVector2f LVector3f::get_xz(void) const; Description: Returns a 2-component vector that shares just the first and last components of this vector.

getYz LVector2f LVector3f::get_yz(void) const; Description: Returns a 2-component vector that shares just the last two components of this vector.

left static LVector3f LVector3f::left(CoordinateSystem cs = (CS_default)); Description: Returns the left vector for the given coordinate system.

operator * LVector3f LVector3f::operator *(float scalar) const; Description:

operator + LVecBase3f LVector3f::operator +(LVecBase3f const &other) const; Description:

operator - LVecBase3f LVector3f::operator -(LVecBase3f const &other) const; Description:

operator - LVecBase3f LVector3f::operator -(LVecBase3f const &other) const; Description:

operator / LVector3f LVector3f::operator /(float scalar) const; Description:

operator = LVector3f &LVector3f::operator =(LVecBase3f const &copy); Description:

project LVector3f LVector3f::project(LVecBase3f const &onto) const; Description: Returns a new vector representing the projection of this vector onto another one. The resulting vector will be a scalar multiple of onto.

pythonRepr void LVector3f::python_repr(ostream &out, string const &class_name) const; Description:

relativeAngleDeg float LVector3f::relative_angle_deg(LVector3f const &other) const; Description: This method is deprecated. Do not use.

relativeAngleRad float LVector3f::relative_angle_rad(LVector3f const &other) const; Description: This method is deprecated. Do not use.

rfu static LVector3f LVector3f::rfu(float right, float fwd, float up, CoordinateSystem cs = (CS_default)); INLINE_LINMATH static FLOATNAME(LVector3) & rfu(FLOATTYPE right, Description: 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)::

right static LVector3f LVector3f::right(CoordinateSystem cs = (CS_default)); Description: Returns the right vector for the given coordinate system.

signedAngleDeg float LVector3f::signed_angle_deg(LVector3f const &other, LVector3f const &ref) const; Description: 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.

signedAngleRad float LVector3f::signed_angle_rad(LVector3f const &other, LVector3f const &ref) const; Description: 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.

unitX static LVector3f const &LVector3f::unit_x(void); Description: Returns a unit X vector.

unitY static LVector3f const &LVector3f::unit_y(void); Description: Returns a unit Y vector.

unitZ static LVector3f const &LVector3f::unit_z(void); Description: Returns a unit Z vector.

up static LVector3f LVector3f::up(CoordinateSystem cs = (CS_default)); Some special named constructors for LVector3. Description: Returns the up vector for the given coordinate system.

zero static LVector3f const &LVector3f::zero(void); Description: Returns a zero-length vector.

LVecBase3f LVecBase3f::LVecBase3f(void); Filename: lvecBase3_src.I Created by: drose (08Mar00) PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University. All rights reserved. All use of this software is subject to the terms of the revised BSD license. You should have received a copy of this license along with this source code in a file named "LICENSE." Description:

addHash unsigned int LVecBase3f::add_hash(unsigned int hash) const; Description: Adds the vector into the running hash.

addToCell void LVecBase3f::add_to_cell(int i, float value); These next functions add to an existing value. i.e. foo.set_x(foo.get_x() + value) These are useful to reduce overhead in scripting languages: Description:

addX void LVecBase3f::add_x(float value); These next functions add to an existing value. i.e. foo.set_x(foo.get_x() + value) These are useful to reduce overhead in scripting languages: Description:

addY void LVecBase3f::add_y(float value); Description:

addZ void LVecBase3f::add_z(float value); Description:

almostEqual bool LVecBase3f::almost_equal(LVecBase3f const &other, float threshold) const; Description: Returns true if two vectors are memberwise equal within a specified tolerance. Description: Returns true if two vectors are memberwise equal within a default tolerance based on the numeric type.

compareTo int LVecBase3f::compare_to(LVecBase3f const &other) const; Description: This flavor of compare_to uses a default threshold value based on the numeric type. Description: Sorts vectors lexicographically, componentwise. Returns a number less than 0 if this vector sorts before the other one, greater than zero if it sorts after, 0 if they are equivalent (within the indicated tolerance).

cross LVecBase3f LVecBase3f::cross(LVecBase3f const &other) const; Description:

crossInto void LVecBase3f::cross_into(LVecBase3f const &other); Description:

dot float LVecBase3f::dot(LVecBase3f const &other) const; Description:

fill void LVecBase3f::fill(float fill_value); Description: Sets each element of the vector to the indicated fill_value. This is particularly useful for initializing to zero.

fmax LVecBase3f LVecBase3f::fmax(LVecBase3f const &other); Description:

fmin LVecBase3f LVecBase3f::fmin(LVecBase3f const &other); Description:

getCell float LVecBase3f::get_cell(int i) const; Description:

getClassType static TypeHandle LVecBase3f::get_class_type(void); Undocumented function.

getData float const *LVecBase3f::get_data(void) const; Description: Returns the address of the first of the three data elements in the vector. The remaining elements occupy the next positions consecutively in memory.

getHash unsigned int LVecBase3f::get_hash(void) const; Description: Returns a suitable hash for phash_map.

getNumComponents int LVecBase3f::get_num_components(void) const; Description: Returns the number of elements in the vector, three.

getStandardizedHpr LVecBase3f LVecBase3f::get_standardized_hpr(void) const; Description: Try to un-spin the hpr to a standard form. Like all standards, someone decides between many arbitrary posible standards. This function assumes that 0 and 360 are the same, as is 720 and -360. Also 180 and -180 are the same. Another example is -90 and 270. Each element will be in the range -180.0 to 179.99999. The original usage of this function is for human readable output. It doesn't work so well for asserting that foo_hpr is roughly equal to bar_hpr. Try using LQuaternionf::is_same_direction() for that. See Also: get_standardized_rotation, LQuaternion::is_same_direction

getX float LVecBase3f::get_x(void) const; Description:

getXy LVecBase2f LVecBase3f::get_xy(void) const; Description: Returns a 2-component vector that shares just the first two components of this vector.

getXz LVecBase2f LVecBase3f::get_xz(void) const; Description: Returns a 2-component vector that shares just the first and last components of this vector.

getY float LVecBase3f::get_y(void) const; Description:

getYz LVecBase2f LVecBase3f::get_yz(void) const; Description: Returns a 2-component vector that shares just the last two components of this vector.

getZ float LVecBase3f::get_z(void) const; Description:

isNan bool LVecBase3f::is_nan(void) const; Description: Returns true if any component of the vector is not-a-number, false otherwise.

length float LVecBase3f::length(void) const; Description: Returns the length of the vector, by the Pythagorean theorem.

lengthSquared float LVecBase3f::length_squared(void) const; Description: Returns the square of the vector's length, cheap and easy.

normalize bool LVecBase3f::normalize(void); Description: Normalizes the vector in place. Returns true if the vector was normalized, false if it was a zero-length vector.

operator != bool LVecBase3f::operator !=(LVecBase3f const &other) const; Description:

operator * LVecBase3f LVecBase3f::operator *(float scalar) const; Description:

operator *= void LVecBase3f::operator *=(float scalar); Description:

operator + LVecBase3f LVecBase3f::operator +(LVecBase3f const &other) const; Description:

operator += void LVecBase3f::operator +=(LVecBase3f const &other); Description:

operator - LVecBase3f LVecBase3f::operator -(LVecBase3f const &other) const; Description:

operator - LVecBase3f LVecBase3f::operator -(LVecBase3f const &other) const; Description:

operator -= void LVecBase3f::operator -=(LVecBase3f const &other); Description:

operator / LVecBase3f LVecBase3f::operator /(float scalar) const; Description:

operator /= void LVecBase3f::operator /=(float scalar); Description:

operator < bool LVecBase3f::operator <(LVecBase3f const &other) const; Description: This performs a lexicographical comparison. It's of questionable mathematical meaning, but sometimes has a practical purpose for sorting unique vectors, especially in an STL container. Also see compare_to().

operator = LVecBase3f &LVecBase3f::operator =(LVecBase3f const &copy); Description:

operator == bool LVecBase3f::operator ==(LVecBase3f const &other) const; Description:

operator [] float LVecBase3f::operator [](int i) const; Description:

operator delete void LVecBase3f::operator delete(void *ptr); Undocumented function.

operator new void *LVecBase3f::operator new(unsigned int size); Undocumented function.

output void LVecBase3f::output(ostream &out) const; Description:

project LVecBase3f LVecBase3f::project(LVecBase3f const &onto) const; Description: Returns a new vector representing the projection of this vector onto another one. The resulting vector will be a scalar multiple of onto.

pythonRepr void LVecBase3f::python_repr(ostream &out, string const &class_name) const; Description:

set void LVecBase3f::set(float x, float y, float z); Description:

setCell void LVecBase3f::set_cell(int i, float value); Description:

Setitem void LVecBase3f::__setitem__(int i, float v); Description:

setX void LVecBase3f::set_x(float value); Description:

setY void LVecBase3f::set_y(float value); Description:

setZ void LVecBase3f::set_z(float value); Description:

size static int LVecBase3f::size(void); HAVE_PYTHON Description: Returns 3: the number of components of a LVecBase3.

unitX static LVecBase3f const &LVecBase3f::unit_x(void); Description: Returns a unit X vector.

unitY static LVecBase3f const &LVecBase3f::unit_y(void); Description: Returns a unit Y vector.

unitZ static LVecBase3f const &LVecBase3f::unit_z(void); Description: Returns a unit Z vector.

validatePtr static bool LVecBase3f::validate_ptr(void const *ptr); Undocumented function.

zero static LVecBase3f const &LVecBase3f::zero(void); Description: Returns a zero-length vector.