# LVector2f

from pandac.PandaModules import LVector2f

Filename: lvector2_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 : LVector2
Description : This is a two-component vector offset.

## Inheritance:

LVector2f: LVecBase2f
LVecBase2f:

## Methods of LVector2f:

getClassType
length
lengthSquared
normalize
operator *
operator +
operator -
operator -
operator /
operator =
pythonRepr
unitX
unitY
zero

## Methods of LVecBase2f:

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

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

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

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

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

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

operator + LVecBase2f LVector2f::operator +(LVecBase2f const &other) const; Description:

operator - LVecBase2f LVector2f::operator -(LVecBase2f const &other) const; Description:

operator - LVecBase2f LVector2f::operator -(LVecBase2f const &other) const; Description:

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

operator = LVector2f &LVector2f::operator =(LVecBase2f const &copy); Description:

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

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

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

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

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

addToCell void LVecBase2f::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 LVecBase2f::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 LVecBase2f::add_y(float value); Description:

almostEqual bool LVecBase2f::almost_equal(LVecBase2f 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 LVecBase2f::compare_to(LVecBase2f 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).

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

fill void LVecBase2f::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 LVecBase2f LVecBase2f::fmax(LVecBase2f const &other); Description:

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

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

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

getData float const *LVecBase2f::get_data(void) const; Description: Returns the address of the first of the two data elements in the vector. The next element occupies the next position consecutively in memory.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

set void LVecBase2f::set(float x, float y); Description:

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

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

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

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

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

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

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