Panda3D
|
This is the base class for all three-component vectors and points. More...
#include <pandadoc.hpp>
Public Types | |
enum | { num_components = 3 , 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 LVecBase2i copy, int z) | |
__init__ (const LVecBase3i) | |
__init__ (int fill_value) | |
__init__ (int x, int y, int z) | |
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) | |
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. | |
bool | almostEqual (const LVecBase3i other, int threshold) |
Returns true if two vectors are memberwise equal within a specified tolerance. | |
int | compareTo (const LVecBase3i other) |
This flavor of compare_to uses a default threshold value based on the numeric type. | |
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. | |
LVecBase3i | fmax (const LVecBase3i other) |
LVecBase3i | fmin (const LVecBase3i other) |
generateHash (ChecksumHashGenerator hashgen) | |
Adds the vector to the indicated hash generator. | |
int | getCell (int i) |
getData () | |
Returns the address of the first of the three data elements in the vector. | |
int | getHash () |
Returns a suitable hash for phash_map. | |
int | getX () |
LVecBase2i | getXy () |
Returns a 2-component vector that shares just the first two components of this vector. | |
LVecBase2i | getXz () |
Returns a 2-component vector that shares just the first and last components of this vector. | |
int | getY () |
LVecBase2i | getYz () |
Returns a 2-component vector that shares just the last two components of this vector. | |
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 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) |
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(). | |
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(). | |
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(). | |
Static Public Member Functions | |
static TypeHandle | getClassType () |
static int | getNumComponents () |
static int | size () |
static const LVecBase3i | unitX () |
Returns a unit X vector. | |
static const LVecBase3i | unitY () |
Returns a unit Y vector. | |
static const LVecBase3i | unitZ () |
Returns a unit Z vector. | |
static const LVecBase3i | zero () |
Returns a zero-length vector. | |
Public Attributes | |
int | x |
LVecBase2i | xy |
Returns a 2-component vector that shares just the first two components of this vector. | |
LVecBase2i | xz |
Returns a 2-component vector that shares just the first and last components of this vector. | |
int | y |
LVecBase2i | yz |
Returns a 2-component vector that shares just the last two components of this vector. | |
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 LVecBase2i | copy, |
int | z ) |
__init__ | ( | const LVecBase3i | ) |
__init__ | ( | int | fill_value | ) |
__init__ | ( | int | x, |
int | y, | ||
int | z ) |
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 ) |
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.
bool almostEqual | ( | const LVecBase3i | other, |
int | threshold ) |
Returns true if two vectors are memberwise equal within a specified tolerance.
int compareTo | ( | const LVecBase3i | other | ) |
This flavor of compare_to uses a default threshold value based on the numeric type.
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.
LVecBase3i fmax | ( | const LVecBase3i | other | ) |
LVecBase3i fmin | ( | const LVecBase3i | 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 three 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 getX | ( | ) |
LVecBase2i getXy | ( | ) |
Returns a 2-component vector that shares just the first two components of this vector.
LVecBase2i getXz | ( | ) |
Returns a 2-component vector that shares just the first and last components of this vector.
int getY | ( | ) |
LVecBase2i getYz | ( | ) |
Returns a 2-component vector that shares just the last two components of this vector.
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 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 | ) |
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 ) |
setCell | ( | int | i, |
int | value ) |
setX | ( | int | value | ) |
setY | ( | int | value | ) |
setZ | ( | int | value | ) |
|
static |
|
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 a 2-component vector that shares just the first two components of this vector.
LVecBase2i xz |
Returns a 2-component vector that shares just the first and last components of this vector.
int y |
LVecBase2i yz |
Returns a 2-component vector that shares just the last two components of this vector.
int z |