Panda3D
Public Member Functions | Static Public Member Functions | List of all members
LVector3i Class Reference

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

Inheritance diagram for LVector3i:
LVecBase3i

Public Member Functions

object __getattr__ (str attr_name)
 
 __init__ ()
 
 __init__ (const LVecBase2i copy, int z)
 
 __init__ (const LVecBase3i copy)
 
 __init__ (int fill_value)
 
 __init__ (int x, int y, int z)
 
str __repr__ ()
 
int __setattr__ (str attr_name, object assign)
 
LVector3i cross (const LVecBase3i other)
 
LVector2i getXy ()
 Returns a 2-component vector that shares just the first two components of this vector. More...
 
LVector2i getXz ()
 Returns a 2-component vector that shares just the first and last components of this vector. More...
 
LVector2i getYz ()
 Returns a 2-component vector that shares just the last two components of this vector. More...
 
LVector3i operator* (int scalar)
 
LVecBase3i operator+ (const LVecBase3i other)
 
LVector3i operator+ (const LVector3i other)
 
LVector3i operator- ()
 
LVecBase3i operator- (const LVecBase3i other)
 
LVector3i operator- (const LVector3i other)
 
LVector3i operator/ (int scalar)
 
LVector3i operator= (const LVecBase3i copy)
 
LVector3i operator= (int fill_value)
 
- Public Member Functions inherited from LVecBase3i
object __getattr__ (str attr_name)
 
 __init__ ()
 
 __init__ (const LVecBase2i copy, int z)
 
 __init__ (const LVecBase3i copy)
 
 __init__ (int fill_value)
 
 __init__ (int x, int y, int z)
 
object __ipow__ (int exponent)
 
LVecBase3i __pow__ (int exponent)
 
object __reduce__ ()
 
str __repr__ ()
 
int __setattr__ (str attr_name, object assign)
 
size_t addHash (size_t hash)
 Adds the vector into the running hash. More...
 
 addToCell (int i, int value)
 
 addX (int value)
 
 addY (int value)
 
 addZ (int value)
 
bool almostEqual (const LVecBase3i other)
 Returns true if two vectors are memberwise equal within a default tolerance based on the numeric type. More...
 
bool almostEqual (const LVecBase3i other, int threshold)
 Returns true if two vectors are memberwise equal within a specified tolerance. More...
 
int compareTo (const LVecBase3i other)
 This flavor of compare_to uses a default threshold value based on the numeric type. More...
 
 componentwiseMult (const LVecBase3i other)
 
LVecBase3i cross (const LVecBase3i other)
 
 crossInto (const LVecBase3i other)
 
int dot (const LVecBase3i other)
 
 fill (int fill_value)
 Sets each element of the vector to the indicated fill_value. This is particularly useful for initializing to zero. More...
 
LVecBase3i fmax (const LVecBase3i other)
 
LVecBase3i fmin (const LVecBase3i other)
 
 generateHash (ChecksumHashGenerator hashgen)
 Adds the vector to the indicated hash generator. More...
 
int getCell (int i)
 
 getData ()
 Returns the address of the first of the three data elements in the vector. The remaining elements occupy the next positions consecutively in memory. More...
 
size_t getHash ()
 Returns a suitable hash for phash_map. More...
 
int getNumComponents ()
 Returns the number of elements in the vector, three. More...
 
LVecBase3i getStandardizedHpr ()
 Try to un-spin the hpr to a standard form. Like all standards, someone decides between many arbitrary possible 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. More...
 
int getX ()
 
LVecBase2i getXy ()
 Returns a 2-component vector that shares just the first two components of this vector. More...
 
LVecBase2i getXz ()
 Returns a 2-component vector that shares just the first and last components of this vector. More...
 
int getY ()
 
LVecBase2i getYz ()
 Returns a 2-component vector that shares just the last two components of this vector. More...
 
int getZ ()
 
bool isNan ()
 Returns true if any component of the vector is not-a-number, false otherwise. More...
 
int lengthSquared ()
 Returns the square of the vector's length, cheap and easy. More...
 
 operator new (size_t size)
 
bool operator!= (const LVecBase3i other)
 
LVecBase3i operator* (int scalar)
 
LVecBase3i operator*= (int scalar)
 
LVecBase3i operator+ (const LVecBase3i other)
 
LVecBase3i operator+= (const LVecBase3i other)
 
LVecBase3i operator- ()
 
LVecBase3i operator- (const LVecBase3i other)
 
LVecBase3i operator-= (const LVecBase3i other)
 
LVecBase3i operator/ (int scalar)
 
LVecBase3i operator/= (int scalar)
 
bool operator< (const LVecBase3i other)
 
LVecBase3i operator= (const LVecBase3i copy)
 
LVecBase3i operator= (int fill_value)
 
bool operator== (const LVecBase3i other)
 
 operator[] (int i, int assign_val)
 
int operator[] (int i)
 
 output (Ostream out)
 
 readDatagram (DatagramIterator source)
 Reads the vector from the Datagram using get_stdfloat(). More...
 
 readDatagramFixed (DatagramIterator source)
 Reads the vector from the Datagram using get_float32() or get_float64(). See write_datagram_fixed(). More...
 
 set (int x, int y, int z)
 
 setCell (int i, int value)
 
 setX (int value)
 
 setY (int value)
 
 setZ (int value)
 
 writeDatagram (Datagram destination)
 Writes the vector to the Datagram using add_stdfloat(). This is appropriate when you want to write the vector using the standard width setting, especially when you are writing a bam file. More...
 
 writeDatagramFixed (Datagram destination)
 Writes the vector to the Datagram using add_float32() or add_float64(), depending on the type of floats in the vector, regardless of the setting of Datagram::set_stdfloat_double(). This is appropriate when you want to write a fixed-width value to the datagram, especially when you are not writing a bam file. More...
 

Static Public Member Functions

static LVector3i back (CoordinateSystem cs)
 Returns the back vector for the given coordinate system. More...
 
static LVector3i down (CoordinateSystem cs)
 Returns the down vector for the given coordinate system. More...
 
static LVector3i forward (CoordinateSystem cs)
 Returns the forward vector for the given coordinate system. More...
 
static TypeHandle getClassType ()
 
static LVector3i left (CoordinateSystem cs)
 Returns the left vector for the given coordinate system. More...
 
static LVector3i rfu (int right, int fwd, int 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. INLINE_LINMATH FLOATNAME(LVector3) &FLOATNAME(LVector3):: More...
 
static LVector3i right (CoordinateSystem cs)
 Returns the right vector for the given coordinate system. More...
 
static const LVector3i unitX ()
 Returns a unit X vector. More...
 
static const LVector3i unitY ()
 Returns a unit Y vector. More...
 
static const LVector3i unitZ ()
 Returns a unit Z vector. More...
 
static LVector3i up (CoordinateSystem cs)
 Returns the up vector for the given coordinate system. More...
 
static const LVector3i zero ()
 Returns a zero-length vector. More...
 
- Static Public Member Functions inherited from LVecBase3i
static TypeHandle getClassType ()
 
static int size ()
 Returns 3: the number of components of a LVecBase3. More...
 
static const LVecBase3i unitX ()
 Returns a unit X vector. More...
 
static const LVecBase3i unitY ()
 Returns a unit Y vector. More...
 
static const LVecBase3i unitZ ()
 Returns a unit Z vector. More...
 
static const LVecBase3i zero ()
 Returns a zero-length vector. More...
 

Additional Inherited Members

- Public Types inherited from LVecBase3i
enum  { num_components = 3, is_int = 1 }
 

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.

Member Function Documentation

◆ __getattr__()

object __getattr__ ( str  attr_name)

◆ __init__() [1/5]

__init__ ( )

◆ __init__() [2/5]

__init__ ( const LVecBase2i  copy,
int  z 
)

◆ __init__() [3/5]

__init__ ( const LVecBase3i  copy)

◆ __init__() [4/5]

__init__ ( int  fill_value)

◆ __init__() [5/5]

__init__ ( int  x,
int  y,
int  z 
)

◆ __repr__()

str __repr__ ( )

◆ __setattr__()

int __setattr__ ( str  attr_name,
object  assign 
)

◆ back()

static LVector3i back ( CoordinateSystem  cs)
static

Returns the back vector for the given coordinate system.

◆ cross()

LVector3i cross ( const LVecBase3i  other)

◆ down()

static LVector3i down ( CoordinateSystem  cs)
static

Returns the down vector for the given coordinate system.

◆ forward()

static LVector3i forward ( CoordinateSystem  cs)
static

Returns the forward vector for the given coordinate system.

◆ getClassType()

static TypeHandle getClassType ( )
static

◆ getXy()

LVector2i getXy ( )

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

◆ getXz()

LVector2i getXz ( )

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

◆ getYz()

LVector2i getYz ( )

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

◆ left()

static LVector3i left ( CoordinateSystem  cs)
static

Returns the left vector for the given coordinate system.

◆ operator*()

LVector3i operator* ( int  scalar)

◆ operator+() [1/2]

LVecBase3i operator+ ( const LVecBase3i  other)

◆ operator+() [2/2]

LVector3i operator+ ( const LVector3i  other)

◆ operator-() [1/3]

LVector3i operator- ( )

◆ operator-() [2/3]

LVecBase3i operator- ( const LVecBase3i  other)

◆ operator-() [3/3]

LVector3i operator- ( const LVector3i  other)

◆ operator/()

LVector3i operator/ ( int  scalar)

◆ operator=() [1/2]

LVector3i operator= ( const LVecBase3i  copy)

◆ operator=() [2/2]

LVector3i operator= ( int  fill_value)

◆ rfu()

static LVector3i rfu ( int  right,
int  fwd,
int  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)::

◆ right()

static LVector3i right ( CoordinateSystem  cs)
static

Returns the right vector for the given coordinate system.

◆ unitX()

static const LVector3i unitX ( )
static

Returns a unit X vector.

◆ unitY()

static const LVector3i unitY ( )
static

Returns a unit Y vector.

◆ unitZ()

static const LVector3i unitZ ( )
static

Returns a unit Z vector.

◆ up()

static LVector3i up ( CoordinateSystem  cs)
static

Returns the up vector for the given coordinate system.

◆ zero()

static const LVector3i zero ( )
static

Returns a zero-length vector.