Panda3D
Public Member Functions | Static Public Member Functions | Public Attributes | 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). 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__ (const LVector3i)
 
 __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)
 
LVector3i operator - ()
 
LVecBase3i operator - (const LVecBase3i other)
 
LVector3i operator - (const LVector3i other)
 
LVecBase3i operator+ (const LVecBase3i other)
 
LVector3i operator+ (const LVector3i other)
 
LVector3i operator/ (int scalar)
 
- Public Member Functions inherited from LVecBase3i
object __getattr__ (str attr_name)
 
 __init__ ()
 
 __init__ (const LVecBase2i copy, int z)
 
 __init__ (const LVecBase3i)
 
 __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)
 
int addHash (int 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. 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. More...
 
int getHash ()
 Returns a suitable hash for phash_map. 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...
 
bool operator != (const LVecBase3i other)
 
LVecBase3i operator * (int scalar)
 
LVecBase3i operator *= (int scalar)
 
LVecBase3i operator - ()
 
LVecBase3i operator - (const LVecBase3i other)
 
LVecBase3i operator -= (const LVecBase3i other)
 
 operator [] (int i, int assign_val)
 
int operator [] (int i)
 
 operator new (int size)
 
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)
 
 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(). 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(). 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(). 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. 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 getNumComponents ()
 
static int size ()
 
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...
 

Public Attributes

LVector2i xy
 Returns a 2-component vector that shares just the first two components of this vector. More...
 
LVector2i xz
 Returns a 2-component vector that shares just the first and last components of this vector. More...
 
LVector2i yz
 Returns a 2-component vector that shares just the last two components of this vector. More...
 
- Public Attributes inherited from LVecBase3i
int x
 
LVecBase2i xy
 Returns a 2-component vector that shares just the first two components of this vector. More...
 
LVecBase2i xz
 Returns a 2-component vector that shares just the first and last components of this vector. More...
 
int y
 
LVecBase2i yz
 Returns a 2-component vector that shares just the last two components of this vector. More...
 
int z
 

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/6]

__init__ ( )

◆ __init__() [2/6]

__init__ ( const LVecBase2i  copy,
int  z 
)

◆ __init__() [3/6]

__init__ ( const LVecBase3i  copy)

◆ __init__() [4/6]

__init__ ( const  LVector3i)

◆ __init__() [5/6]

__init__ ( int  fill_value)

◆ __init__() [6/6]

__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/3]

LVector3i operator - ( )

◆ operator -() [2/3]

LVecBase3i operator - ( const LVecBase3i  other)

◆ operator -() [3/3]

LVector3i operator - ( const LVector3i  other)

◆ operator+() [1/2]

LVecBase3i operator+ ( const LVecBase3i  other)

◆ operator+() [2/2]

LVector3i operator+ ( const LVector3i  other)

◆ operator/()

LVector3i operator/ ( int  scalar)

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

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

Member Data Documentation

◆ xy

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

◆ xz

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

◆ yz

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