# LVecBase3d

from pandac.PandaModules import LVecBase3d

Filename: lvecBase3_src.h Created by: drose (08Mar00)
PANDA 3D SOFTWARE Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
All use of this software is subject to the terms of the Panda 3d Software license. You should have received a copy of this license along with this source code; you will also find a current copy of the license at http://etc.cmu.edu/panda3d/docs/license/ .
To contact the maintainers of this program write to panda3d-general@lists.sourceforge.net .
Class : LVecBase3
Description : This is the base class for all three-component vectors and points.

## Inheritance:

LVecBase3d:

## Methods of LVecBase3d:

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

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

addToCell void LVecBase3d::add_to_cell(int i, double 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 LVecBase3d::add_x(double 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 LVecBase3d::add_y(double value); Description:

addZ void LVecBase3d::add_z(double value); Description:

almostEqual bool LVecBase3d::almost_equal(LVecBase3d const &other, double 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 LVecBase3d::compare_to(LVecBase3d 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 LVecBase3d LVecBase3d::cross(LVecBase3d const &other) const; Description:

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

dot double LVecBase3d::dot(LVecBase3d const &other) const; Description:

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

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

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

getCell double LVecBase3d::get_cell(int i) const; Description:

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

getData double const *LVecBase3d::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 LVecBase3d::get_hash(void) const; Description: Returns a suitable hash for phash_map.

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

getStandardizedHpr LVecBase3d LVecBase3d::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 double LVecBase3d::get_x(void) const; Description:

getY double LVecBase3d::get_y(void) const; Description:

getZ double LVecBase3d::get_z(void) const; Description:

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

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

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

normalize bool LVecBase3d::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 LVecBase3d::operator !=(LVecBase3d const &other) const; Description:

operator * LVecBase3d LVecBase3d::operator *(double scalar) const; Description:

operator *= void LVecBase3d::operator *=(double scalar); Description:

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

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

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

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

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

operator / LVecBase3d LVecBase3d::operator /(double scalar) const; Description:

operator /= void LVecBase3d::operator /=(double scalar); Description:

operator < bool LVecBase3d::operator <(LVecBase3d 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 = LVecBase3d &LVecBase3d::operator =(LVecBase3d const &copy); Description:

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

operator [] double LVecBase3d::operator [](int i) const; Description:

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

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

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

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

set void LVecBase3d::set(double x, double y, double z); Description:

setCell void LVecBase3d::set_cell(int i, double value); Description:

setX void LVecBase3d::set_x(double value); Description:

setY void LVecBase3d::set_y(double value); Description:

setZ void LVecBase3d::set_z(double value); Description:

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

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

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

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

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