Panda3D
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
LVecBase3i Class Reference

This is the base class for all three-component vectors and points. More...

Inheritance diagram for LVecBase3i:
LPoint3i LVector3i

Public Types

enum  { num_components = 3, is_int = 1 }
 

Public Member Functions

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

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
 

Detailed Description

This is the base class for all three-component vectors and points.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
num_components 
is_int 

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)

◆ __init__() [4/5]

__init__ ( int  fill_value)

◆ __init__() [5/5]

__init__ ( int  x,
int  y,
int  z 
)

◆ __ipow__()

object __ipow__ ( int  exponent)

◆ __pow__()

LVecBase3i __pow__ ( int  exponent)

◆ __reduce__()

object __reduce__ ( )

◆ __repr__()

str __repr__ ( )

◆ __setattr__()

int __setattr__ ( str  attr_name,
object  assign 
)

◆ addHash()

int addHash ( int  hash)

Adds the vector into the running hash.

◆ addToCell()

addToCell ( int  i,
int  value 
)

◆ addX()

addX ( int  value)

◆ addY()

addY ( int  value)

◆ addZ()

addZ ( int  value)

◆ almostEqual() [1/2]

bool almostEqual ( const LVecBase3i  other)

Returns true if two vectors are memberwise equal within a default tolerance based on the numeric type.

◆ almostEqual() [2/2]

bool almostEqual ( const LVecBase3i  other,
int  threshold 
)

Returns true if two vectors are memberwise equal within a specified tolerance.

◆ compareTo()

int compareTo ( const LVecBase3i  other)

This flavor of compare_to uses a default threshold value based on the numeric type.

◆ componentwiseMult()

componentwiseMult ( const LVecBase3i  other)

◆ cross()

LVecBase3i cross ( const LVecBase3i  other)

◆ crossInto()

crossInto ( const LVecBase3i  other)

◆ dot()

int dot ( const LVecBase3i  other)

◆ fill()

fill ( int  fill_value)

Sets each element of the vector to the indicated fill_value.

This is particularly useful for initializing to zero.

◆ fmax()

LVecBase3i fmax ( const LVecBase3i  other)

◆ fmin()

LVecBase3i fmin ( const LVecBase3i  other)

◆ generateHash()

generateHash ( ChecksumHashGenerator  hashgen)

Adds the vector to the indicated hash generator.

◆ getCell()

int getCell ( int  i)

◆ getClassType()

static TypeHandle getClassType ( )
static

◆ getData()

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.

◆ getHash()

int getHash ( )

Returns a suitable hash for phash_map.

◆ getNumComponents()

static int getNumComponents ( )
static

◆ getX()

int getX ( )

◆ getXy()

LVecBase2i getXy ( )

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

◆ getXz()

LVecBase2i getXz ( )

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

◆ getY()

int getY ( )

◆ getYz()

LVecBase2i getYz ( )

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

◆ getZ()

int getZ ( )

◆ isNan()

bool isNan ( )

Returns true if any component of the vector is not-a-number, false otherwise.

◆ lengthSquared()

int lengthSquared ( )

Returns the square of the vector's length, cheap and easy.

◆ operator !=()

bool operator != ( const LVecBase3i  other)

◆ operator *()

LVecBase3i operator * ( int  scalar)

◆ operator *=()

LVecBase3i operator *= ( int  scalar)

◆ operator -() [1/2]

LVecBase3i operator - ( )

◆ operator -() [2/2]

LVecBase3i operator - ( const LVecBase3i  other)

◆ operator -=()

LVecBase3i operator -= ( const LVecBase3i  other)

◆ operator []() [1/2]

operator [] ( int  i,
int  assign_val 
)

◆ operator []() [2/2]

int operator [] ( int  i)

◆ operator new()

operator new ( int  size)

◆ operator+()

LVecBase3i operator+ ( const LVecBase3i  other)

◆ operator+=()

LVecBase3i operator+= ( const LVecBase3i  other)

◆ operator/()

LVecBase3i operator/ ( int  scalar)

◆ operator/=()

LVecBase3i operator/= ( int  scalar)

◆ operator<()

bool operator< ( const LVecBase3i  other)

◆ operator=() [1/2]

LVecBase3i operator= ( const LVecBase3i  copy)

◆ operator=() [2/2]

LVecBase3i operator= ( int  fill_value)

◆ operator==()

bool operator== ( const LVecBase3i  other)

◆ output()

output ( Ostream  out)

◆ readDatagram()

readDatagram ( DatagramIterator  source)

Reads the vector from the Datagram using get_stdfloat().

◆ readDatagramFixed()

readDatagramFixed ( DatagramIterator  source)

Reads the vector from the Datagram using get_float32() or get_float64().

See write_datagram_fixed().

◆ set()

set ( int  x,
int  y,
int  z 
)

◆ setCell()

setCell ( int  i,
int  value 
)

◆ setX()

setX ( int  value)

◆ setY()

setY ( int  value)

◆ setZ()

setZ ( int  value)

◆ size()

static int size ( )
static

◆ unitX()

static const LVecBase3i unitX ( )
static

Returns a unit X vector.

◆ unitY()

static const LVecBase3i unitY ( )
static

Returns a unit Y vector.

◆ unitZ()

static const LVecBase3i unitZ ( )
static

Returns a unit Z vector.

◆ writeDatagram()

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.

◆ writeDatagramFixed()

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.

◆ zero()

static const LVecBase3i zero ( )
static

Returns a zero-length vector.

Member Data Documentation

◆ x

int x

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

◆ y

int y

◆ yz

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

◆ z

int z