Panda3D
Public Member Functions | Static Public Member Functions | List of all members
LPoint4d Class Reference

This is a four-component point in space. More...

Inheritance diagram for LPoint4d:
LVecBase4d

Public Member Functions

object __getattr__ (str attr_name)
 
 __init__ ()
 
 __init__ (const LVecBase3d copy, double w)
 
 __init__ (const LVecBase4d copy)
 
 __init__ (double fill_value)
 
 __init__ (double x, double y, double z, double w)
 
str __repr__ ()
 
int __setattr__ (str attr_name, object assign)
 
LPoint4d normalized ()
 Normalizes the vector and returns the normalized vector as a copy. If the vector was a zero-length vector, a zero length vector will be returned. More...
 
LPoint4d operator* (double scalar)
 
LVecBase4d operator+ (const LVecBase4d other)
 
LPoint4d operator+ (const LVector4d other)
 
LPoint4d operator- ()
 
LVector4d operator- (const LPoint4d other)
 
LVecBase4d operator- (const LVecBase4d other)
 
LPoint4d operator- (const LVector4d other)
 
LPoint4d operator/ (double scalar)
 
LPoint4d operator= (const LVecBase4d copy)
 
LPoint4d operator= (double fill_value)
 
LPoint4d project (const LVecBase4d onto)
 Returns a new vector representing the projection of this vector onto another one. The resulting vector will be a scalar multiple of onto. More...
 
- Public Member Functions inherited from LVecBase4d
object __getattr__ (str attr_name)
 
 __init__ ()
 
 __init__ (const LPoint3d point)
 Constructs an LVecBase4 from an LPoint3. The w coordinate is set to 1.0. More...
 
 __init__ (const LVecBase3d copy, double w)
 
 __init__ (const LVecBase4d copy)
 
 __init__ (const LVector3d vector)
 Constructs an LVecBase4 from an LVector3. The w coordinate is set to 0.0. More...
 
 __init__ (const UnalignedLVecBase4d copy)
 
 __init__ (double fill_value)
 
 __init__ (double x, double y, double z, double w)
 
object __ipow__ (double exponent)
 
LVecBase4d __pow__ (double exponent)
 
object __reduce__ ()
 
str __repr__ ()
 
int __setattr__ (str attr_name, object assign)
 
size_t addHash (size_t hash)
 Adds the vector into the running hash. More...
 
size_t addHash (size_t hash, double threshold)
 Adds the vector into the running hash. More...
 
 addToCell (int i, double value)
 
 addW (double value)
 
 addX (double value)
 
 addY (double value)
 
 addZ (double value)
 
bool almostEqual (const LVecBase4d other)
 Returns true if two vectors are memberwise equal within a default tolerance based on the numeric type. More...
 
bool almostEqual (const LVecBase4d other, double threshold)
 Returns true if two vectors are memberwise equal within a specified tolerance. More...
 
int compareTo (const LVecBase4d other)
 This flavor of compare_to uses a default threshold value based on the numeric type. More...
 
int compareTo (const LVecBase4d other, double threshold)
 Sorts vectors lexicographically, componentwise. Returns a number less than 0 if this vector sorts before the other one, greater than zero if it sorts after, 0 if they are equivalent (within the indicated tolerance). More...
 
 componentwiseMult (const LVecBase4d other)
 
double dot (const LVecBase4d other)
 
 fill (double fill_value)
 Sets each element of the vector to the indicated fill_value. This is particularly useful for initializing to zero. More...
 
LVecBase4d fmax (const LVecBase4d other)
 
LVecBase4d fmin (const LVecBase4d other)
 
 generateHash (ChecksumHashGenerator hashgen)
 Adds the vector to the indicated hash generator. More...
 
 generateHash (ChecksumHashGenerator hashgen, double threshold)
 Adds the vector to the indicated hash generator. More...
 
double getCell (int i)
 
 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. More...
 
size_t getHash ()
 Returns a suitable hash for phash_map. More...
 
size_t getHash (double threshold)
 Returns a suitable hash for phash_map. More...
 
int getNumComponents ()
 Returns the number of elements in the vector, four. More...
 
double getW ()
 
double getX ()
 
double getY ()
 
double getZ ()
 
bool isNan ()
 Returns true if any component of the vector is not-a-number, false otherwise. More...
 
double length ()
 Returns the length of the vector, by the Pythagorean theorem. More...
 
double lengthSquared ()
 Returns the square of the vector's length, cheap and easy. More...
 
bool normalize ()
 Normalizes the vector in place. Returns true if the vector was normalized, false if it was a zero-length vector. More...
 
LVecBase4d normalized ()
 Normalizes the vector and returns the normalized vector as a copy. If the vector was a zero-length vector, a zero length vector will be returned. More...
 
 operator new (size_t size)
 
bool operator!= (const LVecBase4d other)
 
LVecBase4d operator* (double scalar)
 
LVecBase4d operator*= (double scalar)
 
LVecBase4d operator+ (const LVecBase4d other)
 
LVecBase4d operator+= (const LVecBase4d other)
 
LVecBase4d operator- ()
 
LVecBase4d operator- (const LVecBase4d other)
 
LVecBase4d operator-= (const LVecBase4d other)
 
LVecBase4d operator/ (double scalar)
 
LVecBase4d operator/= (double scalar)
 
bool operator< (const LVecBase4d other)
 
LVecBase4d operator= (const LVecBase4d copy)
 
LVecBase4d operator= (const UnalignedLVecBase4d copy)
 
LVecBase4d operator= (double fill_value)
 
bool operator== (const LVecBase4d other)
 
 operator[] (int i, double assign_val)
 
double operator[] (int i)
 
 output (Ostream out)
 
LVecBase4d project (const LVecBase4d onto)
 Returns a new vector representing the projection of this vector onto another one. The resulting vector will be a scalar multiple of onto. More...
 
 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(). See write_datagram_fixed(). More...
 
 set (double x, double y, double z, double w)
 
 setCell (int i, double value)
 
 setW (double value)
 
 setX (double value)
 
 setY (double value)
 
 setZ (double value)
 
 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. 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(). This is appropriate when you want to write a fixed-width value to the datagram, especially when you are not writing a bam file. More...
 

Static Public Member Functions

static TypeHandle getClassType ()
 
static const LPoint4d unitW ()
 Returns a unit W point. More...
 
static const LPoint4d unitX ()
 Returns a unit X point. More...
 
static const LPoint4d unitY ()
 Returns a unit Y point. More...
 
static const LPoint4d unitZ ()
 Returns a unit Z point. More...
 
static const LPoint4d zero ()
 Returns a zero-length point. More...
 
- Static Public Member Functions inherited from LVecBase4d
static TypeHandle getClassType ()
 
static int size ()
 Returns 4: the number of components of a LVecBase4. More...
 
static const LVecBase4d unitW ()
 Returns a unit W vector. More...
 
static const LVecBase4d unitX ()
 Returns a unit X vector. More...
 
static const LVecBase4d unitY ()
 Returns a unit Y vector. More...
 
static const LVecBase4d unitZ ()
 Returns a unit Z vector. More...
 
static const LVecBase4d zero ()
 Returns a zero-length vector. More...
 

Additional Inherited Members

- Public Types inherited from LVecBase4d
enum  { num_components = 4, is_int = 0 }
 

Detailed Description

This is a four-component point in space.

Member Function Documentation

◆ __getattr__()

object __getattr__ ( str  attr_name)

◆ __init__() [1/5]

__init__ ( )

◆ __init__() [2/5]

__init__ ( const LVecBase3d  copy,
double  w 
)

◆ __init__() [3/5]

__init__ ( const LVecBase4d  copy)

◆ __init__() [4/5]

__init__ ( double  fill_value)

◆ __init__() [5/5]

__init__ ( double  x,
double  y,
double  z,
double  w 
)

◆ __repr__()

str __repr__ ( )

◆ __setattr__()

int __setattr__ ( str  attr_name,
object  assign 
)

◆ getClassType()

static TypeHandle getClassType ( )
static

◆ normalized()

LPoint4d normalized ( )

Normalizes the vector and returns the normalized vector as a copy. If the vector was a zero-length vector, a zero length vector will be returned.

◆ operator*()

LPoint4d operator* ( double  scalar)

◆ operator+() [1/2]

LVecBase4d operator+ ( const LVecBase4d  other)

◆ operator+() [2/2]

LPoint4d operator+ ( const LVector4d  other)

◆ operator-() [1/4]

LPoint4d operator- ( )

◆ operator-() [2/4]

LVector4d operator- ( const LPoint4d  other)

◆ operator-() [3/4]

LVecBase4d operator- ( const LVecBase4d  other)

◆ operator-() [4/4]

LPoint4d operator- ( const LVector4d  other)

◆ operator/()

LPoint4d operator/ ( double  scalar)

◆ operator=() [1/2]

LPoint4d operator= ( const LVecBase4d  copy)

◆ operator=() [2/2]

LPoint4d operator= ( double  fill_value)

◆ project()

LPoint4d project ( const LVecBase4d  onto)

Returns a new vector representing the projection of this vector onto another one. The resulting vector will be a scalar multiple of onto.

◆ unitW()

static const LPoint4d unitW ( )
static

Returns a unit W point.

◆ unitX()

static const LPoint4d unitX ( )
static

Returns a unit X point.

◆ unitY()

static const LPoint4d unitY ( )
static

Returns a unit Y point.

◆ unitZ()

static const LPoint4d unitZ ( )
static

Returns a unit Z point.

◆ zero()

static const LPoint4d zero ( )
static

Returns a zero-length point.