Panda3D
|
This is the base class for all three-component vectors and points. More...
#include <pandadoc.hpp>
Public Types | |
enum | { num_components = 4 , is_int = 1 } |
Public Member Functions | |
object | __ceil__ () |
object | __floor__ () |
object | __floordiv__ (int scalar) |
object | __getattr__ (str attr_name) |
object | __ifloordiv__ (int scalar) |
__init__ () | |
__init__ (const LPoint3i point) | |
Constructs an LVecBase4 from an LPoint3. More... | |
__init__ (const LVecBase3i copy, int w) | |
__init__ (const LVecBase4i) | |
__init__ (const LVector3i vector) | |
Constructs an LVecBase4 from an LVector3. More... | |
__init__ (const UnalignedLVecBase4i copy) | |
__init__ (int fill_value) | |
__init__ (int x, int y, int z, int w) | |
object | __ipow__ (int exponent) |
object | __pow__ (int exponent) |
object | __reduce__ () |
str | __repr__ () |
object | __round__ () |
int | __setattr__ (str attr_name, object assign) |
int | addHash (int hash) |
Adds the vector into the running hash. More... | |
addToCell (int i, int value) | |
addW (int value) | |
addX (int value) | |
addY (int value) | |
addZ (int value) | |
bool | almostEqual (const LVecBase4i other) |
Returns true if two vectors are memberwise equal within a default tolerance based on the numeric type. More... | |
bool | almostEqual (const LVecBase4i other, int threshold) |
Returns true if two vectors are memberwise equal within a specified tolerance. More... | |
int | compareTo (const LVecBase4i other) |
This flavor of compare_to uses a default threshold value based on the numeric type. More... | |
componentwiseMult (const LVecBase4i other) | |
int | dot (const LVecBase4i other) |
fill (int fill_value) | |
Sets each element of the vector to the indicated fill_value. More... | |
LVecBase4i | fmax (const LVecBase4i other) |
LVecBase4i | fmin (const LVecBase4i 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 four data elements in the vector. More... | |
int | getHash () |
Returns a suitable hash for phash_map. More... | |
int | getW () |
int | getX () |
LVecBase2i | getXy () |
Returns the x and y component of this vector. More... | |
LVecBase3i | getXyz () |
Returns the x, y and z component of this vector. More... | |
int | getY () |
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 (int size) | |
bool | operator!= (const LVecBase4i other) |
LVecBase4i | operator* (int scalar) |
LVecBase4i | operator*= (int scalar) |
LVecBase4i | operator+ (const LVecBase4i other) |
LVecBase4i | operator+= (const LVecBase4i other) |
LVecBase4i | operator- () |
LVecBase4i | operator- (const LVecBase4i other) |
LVecBase4i | operator-= (const LVecBase4i other) |
LVecBase4i | operator/ (int scalar) |
LVecBase4i | operator/= (int scalar) |
bool | operator< (const LVecBase4i other) |
LVecBase4i | operator= (const LVecBase4i copy) |
LVecBase4i | operator= (int fill_value) |
bool | operator== (const LVecBase4i 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, int z, int w) | |
setCell (int i, int value) | |
setW (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 LVecBase4i | unitW () |
Returns a unit W vector. More... | |
static const LVecBase4i | unitX () |
Returns a unit X vector. More... | |
static const LVecBase4i | unitY () |
Returns a unit Y vector. More... | |
static const LVecBase4i | unitZ () |
Returns a unit Z vector. More... | |
static const LVecBase4i | zero () |
Returns a zero-length vector. More... | |
Public Attributes | |
int | x |
LVecBase2i | xy |
Returns the x and y component of this vector. More... | |
LVecBase3i | xyz |
Returns the x, y and z component of this vector. More... | |
int | y |
int | z |
This is the base class for all three-component vectors and points.
object __ceil__ | ( | ) |
object __floor__ | ( | ) |
object __floordiv__ | ( | int | scalar | ) |
object __getattr__ | ( | str | attr_name | ) |
object __ifloordiv__ | ( | int | scalar | ) |
__init__ | ( | ) |
__init__ | ( | const LPoint3i | point | ) |
Constructs an LVecBase4 from an LPoint3.
The w coordinate is set to 1.0.
__init__ | ( | const LVecBase3i | copy, |
int | w | ||
) |
__init__ | ( | const | LVecBase4i | ) |
__init__ | ( | const LVector3i | vector | ) |
Constructs an LVecBase4 from an LVector3.
The w coordinate is set to 0.0.
__init__ | ( | const UnalignedLVecBase4i | copy | ) |
__init__ | ( | int | fill_value | ) |
__init__ | ( | int | x, |
int | y, | ||
int | z, | ||
int | w | ||
) |
object __ipow__ | ( | int | exponent | ) |
object __pow__ | ( | int | exponent | ) |
object __reduce__ | ( | ) |
str __repr__ | ( | ) |
object __round__ | ( | ) |
int __setattr__ | ( | str | attr_name, |
object | assign | ||
) |
int addHash | ( | int | hash | ) |
Adds the vector into the running hash.
addToCell | ( | int | i, |
int | value | ||
) |
addW | ( | int | value | ) |
addX | ( | int | value | ) |
addY | ( | int | value | ) |
addZ | ( | int | value | ) |
bool almostEqual | ( | const LVecBase4i | other | ) |
Returns true if two vectors are memberwise equal within a default tolerance based on the numeric type.
bool almostEqual | ( | const LVecBase4i | other, |
int | threshold | ||
) |
Returns true if two vectors are memberwise equal within a specified tolerance.
int compareTo | ( | const LVecBase4i | other | ) |
This flavor of compare_to uses a default threshold value based on the numeric type.
componentwiseMult | ( | const LVecBase4i | other | ) |
int dot | ( | const LVecBase4i | other | ) |
fill | ( | int | fill_value | ) |
Sets each element of the vector to the indicated fill_value.
This is particularly useful for initializing to zero.
LVecBase4i fmax | ( | const LVecBase4i | other | ) |
LVecBase4i fmin | ( | const LVecBase4i | 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 four data elements in the vector.
The remaining elements occupy the next positions consecutively in memory.
int getHash | ( | ) |
Returns a suitable hash for phash_map.
|
static |
int getW | ( | ) |
int getX | ( | ) |
LVecBase2i getXy | ( | ) |
Returns the x and y component of this vector.
LVecBase3i getXyz | ( | ) |
Returns the x, y and z component of this vector.
int getY | ( | ) |
int getZ | ( | ) |
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 LVecBase4i | other | ) |
LVecBase4i operator* | ( | int | scalar | ) |
LVecBase4i operator*= | ( | int | scalar | ) |
LVecBase4i operator+ | ( | const LVecBase4i | other | ) |
LVecBase4i operator+= | ( | const LVecBase4i | other | ) |
LVecBase4i operator- | ( | ) |
LVecBase4i operator- | ( | const LVecBase4i | other | ) |
LVecBase4i operator-= | ( | const LVecBase4i | other | ) |
LVecBase4i operator/ | ( | int | scalar | ) |
LVecBase4i operator/= | ( | int | scalar | ) |
bool operator< | ( | const LVecBase4i | other | ) |
LVecBase4i operator= | ( | const LVecBase4i | copy | ) |
LVecBase4i operator= | ( | int | fill_value | ) |
bool operator== | ( | const LVecBase4i | 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, | ||
int | z, | ||
int | w | ||
) |
setCell | ( | int | i, |
int | value | ||
) |
setW | ( | int | value | ) |
setX | ( | int | value | ) |
setY | ( | int | value | ) |
setZ | ( | int | value | ) |
|
static |
|
static |
Returns a unit W vector.
|
static |
Returns a unit X vector.
|
static |
Returns a unit Y vector.
|
static |
Returns a unit Z 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 |
LVecBase2i xy |
Returns the x and y component of this vector.
LVecBase3i xyz |
Returns the x, y and z component of this vector.
int y |
int z |