Panda3D
|
This is the base class for all two-component vectors and points. More...
Public Types | |
enum | { num_components = 2, is_int = 1 } |
Public Member Functions | |
object | __getattr__ (str attr_name) |
__init__ () | |
__init__ (const LVecBase2i) | |
__init__ (int fill_value) | |
__init__ (int x, int y) | |
object | __ipow__ (int exponent) |
LVecBase2i | __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) | |
bool | almostEqual (const LVecBase2i other) |
Returns true if two vectors are memberwise equal within a default tolerance based on the numeric type. More... | |
bool | almostEqual (const LVecBase2i other, int threshold) |
Returns true if two vectors are memberwise equal within a specified tolerance. More... | |
int | compareTo (const LVecBase2i other) |
This flavor of compare_to uses a default threshold value based on the numeric type. More... | |
componentwiseMult (const LVecBase2i other) | |
int | dot (const LVecBase2i other) |
fill (int fill_value) | |
Sets each element of the vector to the indicated fill_value. More... | |
LVecBase2i | fmax (const LVecBase2i other) |
LVecBase2i | fmin (const LVecBase2i 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 two data elements in the vector. More... | |
int | getHash () |
Returns a suitable hash for phash_map. More... | |
int | getX () |
int | getY () |
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 (int size) | |
bool | operator!= (const LVecBase2i other) |
LVecBase2i | operator* (int scalar) |
LVecBase2i | operator*= (int scalar) |
LVecBase2i | operator+ (const LVecBase2i other) |
LVecBase2i | operator+= (const LVecBase2i other) |
LVecBase2i | operator- () |
LVecBase2i | operator- (const LVecBase2i other) |
LVecBase2i | operator-= (const LVecBase2i other) |
LVecBase2i | operator/ (int scalar) |
LVecBase2i | operator/= (int scalar) |
bool | operator< (const LVecBase2i other) |
LVecBase2i | operator= (const LVecBase2i copy) |
LVecBase2i | operator= (int fill_value) |
bool | operator== (const LVecBase2i other) |
int | operator[] (int i) |
operator[] (int i, int assign_val) | |
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) | |
setCell (int i, int value) | |
setX (int value) | |
setY (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 LVecBase2i | unitX () |
Returns a unit X vector. More... | |
static const LVecBase2i | unitY () |
Returns a unit Y vector. More... | |
static const LVecBase2i | zero () |
Returns a zero-length vector. More... | |
Public Attributes | |
int | x |
int | y |
This is the base class for all two-component vectors and points.
object __getattr__ | ( | str | attr_name | ) |
__init__ | ( | ) |
__init__ | ( | const | LVecBase2i | ) |
__init__ | ( | int | fill_value | ) |
__init__ | ( | int | x, |
int | y | ||
) |
object __ipow__ | ( | int | exponent | ) |
LVecBase2i __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.
addToCell | ( | int | i, |
int | value | ||
) |
addX | ( | int | value | ) |
addY | ( | int | value | ) |
bool almostEqual | ( | const LVecBase2i | other | ) |
Returns true if two vectors are memberwise equal within a default tolerance based on the numeric type.
bool almostEqual | ( | const LVecBase2i | other, |
int | threshold | ||
) |
Returns true if two vectors are memberwise equal within a specified tolerance.
int compareTo | ( | const LVecBase2i | other | ) |
This flavor of compare_to uses a default threshold value based on the numeric type.
componentwiseMult | ( | const LVecBase2i | other | ) |
int dot | ( | const LVecBase2i | other | ) |
fill | ( | int | fill_value | ) |
Sets each element of the vector to the indicated fill_value.
This is particularly useful for initializing to zero.
LVecBase2i fmax | ( | const LVecBase2i | other | ) |
LVecBase2i fmin | ( | const LVecBase2i | other | ) |
generateHash | ( | ChecksumHashGenerator | hashgen | ) |
Adds the vector to the indicated hash generator.
int getCell | ( | int | i | ) |
|
static |
getData | ( | ) |
Returns the address of the first of the two data elements in the vector.
The next element occupies the next position consecutively in memory.
int getHash | ( | ) |
Returns a suitable hash for phash_map.
|
static |
int getX | ( | ) |
int getY | ( | ) |
bool isNan | ( | ) |
Returns true if any component of the vector is not-a-number, false otherwise.
int lengthSquared | ( | ) |
Returns the square of the vector's length, cheap and easy.
operator new | ( | int | size | ) |
bool operator!= | ( | const LVecBase2i | other | ) |
LVecBase2i operator* | ( | int | scalar | ) |
LVecBase2i operator*= | ( | int | scalar | ) |
LVecBase2i operator+ | ( | const LVecBase2i | other | ) |
LVecBase2i operator+= | ( | const LVecBase2i | other | ) |
LVecBase2i operator- | ( | ) |
LVecBase2i operator- | ( | const LVecBase2i | other | ) |
LVecBase2i operator-= | ( | const LVecBase2i | other | ) |
LVecBase2i operator/ | ( | int | scalar | ) |
LVecBase2i operator/= | ( | int | scalar | ) |
bool operator< | ( | const LVecBase2i | other | ) |
LVecBase2i operator= | ( | const LVecBase2i | copy | ) |
LVecBase2i operator= | ( | int | fill_value | ) |
bool operator== | ( | const LVecBase2i | other | ) |
int operator[] | ( | int | i | ) |
operator[] | ( | int | i, |
int | assign_val | ||
) |
output | ( | Ostream | out | ) |
readDatagram | ( | DatagramIterator | source | ) |
Reads the vector from the Datagram using get_stdfloat().
readDatagramFixed | ( | DatagramIterator | source | ) |
Reads the vector from the Datagram using get_float32() or get_float64().
See write_datagram_fixed().
set | ( | int | x, |
int | y | ||
) |
setCell | ( | int | i, |
int | value | ||
) |
setX | ( | int | value | ) |
setY | ( | int | value | ) |
|
static |
|
static |
Returns a unit X vector.
|
static |
Returns a unit Y vector.
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 | ( | 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.
|
static |
Returns a zero-length vector.
int x |
int y |