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

This is a four-component vector distance. More...

Inheritance diagram for LVector4f:
LVecBase4f

Public Member Functions

object __getattr__ (str attr_name)
 
 __init__ ()
 
 __init__ (const LVecBase3f copy, float w)
 
 __init__ (const LVecBase4f copy)
 
 __init__ (const LVector4f)
 
 __init__ (float fill_value)
 
 __init__ (float x, float y, float z, float w)
 
str __repr__ ()
 
int __setattr__ (str attr_name, object assign)
 
LVector2f getXy ()
 Returns the x and y component of this vector. More...
 
LVector3f getXyz ()
 Returns the x, y and z component of this vector. More...
 
LVector4f normalized ()
 Normalizes the vector and returns the normalized vector as a copy. More...
 
LVector4f operator * (float scalar)
 
LVector4f operator - ()
 
LVecBase4f operator - (const LVecBase4f other)
 
LVector4f operator - (const LVector4f other)
 
LVecBase4f operator+ (const LVecBase4f other)
 
LVector4f operator+ (const LVector4f other)
 
LVector4f operator/ (float scalar)
 
LVector4f project (const LVecBase4f onto)
 Returns a new vector representing the projection of this vector onto another one. More...
 
- Public Member Functions inherited from LVecBase4f
object __getattr__ (str attr_name)
 
 __init__ ()
 
 __init__ (const LPoint3f point)
 Constructs an LVecBase4 from an LPoint3. More...
 
 __init__ (const LVecBase3f copy, float w)
 
 __init__ (const LVecBase4f)
 
 __init__ (const LVector3f vector)
 Constructs an LVecBase4 from an LVector3. More...
 
 __init__ (const UnalignedLVecBase4f copy)
 
 __init__ (float fill_value)
 
 __init__ (float x, float y, float z, float w)
 
object __ipow__ (float exponent)
 
LVecBase4f __pow__ (float exponent)
 
object __reduce__ ()
 
str __repr__ ()
 
int __setattr__ (str attr_name, object assign)
 
int addHash (int hash)
 Adds the vector into the running hash. More...
 
int addHash (int hash, float threshold)
 Adds the vector into the running hash. More...
 
 addToCell (int i, float value)
 
 addW (float value)
 
 addX (float value)
 
 addY (float value)
 
 addZ (float value)
 
bool almostEqual (const LVecBase4f other)
 Returns true if two vectors are memberwise equal within a default tolerance based on the numeric type. More...
 
bool almostEqual (const LVecBase4f other, float threshold)
 Returns true if two vectors are memberwise equal within a specified tolerance. More...
 
int compareTo (const LVecBase4f other)
 This flavor of compare_to uses a default threshold value based on the numeric type. More...
 
int compareTo (const LVecBase4f other, float threshold)
 Sorts vectors lexicographically, componentwise. More...
 
 componentwiseMult (const LVecBase4f other)
 
float dot (const LVecBase4f other)
 
 fill (float fill_value)
 Sets each element of the vector to the indicated fill_value. More...
 
LVecBase4f fmax (const LVecBase4f other)
 
LVecBase4f fmin (const LVecBase4f other)
 
 generateHash (ChecksumHashGenerator hashgen)
 Adds the vector to the indicated hash generator. More...
 
 generateHash (ChecksumHashGenerator hashgen, float threshold)
 Adds the vector to the indicated hash generator. More...
 
float 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 getHash (float threshold)
 Returns a suitable hash for phash_map. More...
 
float getW ()
 
float getX ()
 
LVecBase2f getXy ()
 Returns the x and y component of this vector. More...
 
LVecBase3f getXyz ()
 Returns the x, y and z component of this vector. More...
 
float getY ()
 
float getZ ()
 
bool isNan ()
 Returns true if any component of the vector is not-a-number, false otherwise. More...
 
float length ()
 Returns the length of the vector, by the Pythagorean theorem. More...
 
float lengthSquared ()
 Returns the square of the vector's length, cheap and easy. More...
 
bool normalize ()
 Normalizes the vector in place. More...
 
LVecBase4f normalized ()
 Normalizes the vector and returns the normalized vector as a copy. More...
 
bool operator != (const LVecBase4f other)
 
LVecBase4f operator * (float scalar)
 
LVecBase4f operator *= (float scalar)
 
LVecBase4f operator - ()
 
LVecBase4f operator - (const LVecBase4f other)
 
LVecBase4f operator -= (const LVecBase4f other)
 
 operator [] (int i, float assign_val)
 
float operator [] (int i)
 
 operator new (int size)
 
LVecBase4f operator+ (const LVecBase4f other)
 
LVecBase4f operator+= (const LVecBase4f other)
 
LVecBase4f operator/ (float scalar)
 
LVecBase4f operator/= (float scalar)
 
bool operator< (const LVecBase4f other)
 
LVecBase4f operator= (const LVecBase4f copy)
 
LVecBase4f operator= (float fill_value)
 
bool operator== (const LVecBase4f other)
 
 output (Ostream out)
 
LVecBase4f project (const LVecBase4f onto)
 Returns a new vector representing the projection of this vector onto another one. 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(). More...
 
 set (float x, float y, float z, float w)
 
 setCell (int i, float value)
 
 setW (float value)
 
 setX (float value)
 
 setY (float value)
 
 setZ (float 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 const LVector4f unitW ()
 Returns a unit W vector. More...
 
static const LVector4f unitX ()
 Returns a unit X vector. More...
 
static const LVector4f unitY ()
 Returns a unit Y vector. More...
 
static const LVector4f unitZ ()
 Returns a unit Z vector. More...
 
static const LVector4f zero ()
 Returns a zero-length vector. More...
 
- Static Public Member Functions inherited from LVecBase4f
static TypeHandle getClassType ()
 
static int getNumComponents ()
 
static int size ()
 
static const LVecBase4f unitW ()
 Returns a unit W vector. More...
 
static const LVecBase4f unitX ()
 Returns a unit X vector. More...
 
static const LVecBase4f unitY ()
 Returns a unit Y vector. More...
 
static const LVecBase4f unitZ ()
 Returns a unit Z vector. More...
 
static const LVecBase4f zero ()
 Returns a zero-length vector. More...
 

Public Attributes

LVector2f xy
 Returns the x and y component of this vector. More...
 
LVector3f xyz
 Returns the x, y and z component of this vector. More...
 
- Public Attributes inherited from LVecBase4f
float x
 
LVecBase2f xy
 Returns the x and y component of this vector. More...
 
LVecBase3f xyz
 Returns the x, y and z component of this vector. More...
 
float y
 
float z
 

Additional Inherited Members

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

Detailed Description

This is a four-component vector distance.

Member Function Documentation

◆ __getattr__()

object __getattr__ ( str  attr_name)

◆ __init__() [1/6]

__init__ ( )

◆ __init__() [2/6]

__init__ ( const LVecBase3f  copy,
float  w 
)

◆ __init__() [3/6]

__init__ ( const LVecBase4f  copy)

◆ __init__() [4/6]

__init__ ( const  LVector4f)

◆ __init__() [5/6]

__init__ ( float  fill_value)

◆ __init__() [6/6]

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

◆ __repr__()

str __repr__ ( )

◆ __setattr__()

int __setattr__ ( str  attr_name,
object  assign 
)

◆ getClassType()

static TypeHandle getClassType ( )
static

◆ getXy()

LVector2f getXy ( )

Returns the x and y component of this vector.

◆ getXyz()

LVector3f getXyz ( )

Returns the x, y and z component of this vector.

◆ normalized()

LVector4f 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 *()

LVector4f operator * ( float  scalar)

◆ operator -() [1/3]

LVector4f operator - ( )

◆ operator -() [2/3]

LVecBase4f operator - ( const LVecBase4f  other)

◆ operator -() [3/3]

LVector4f operator - ( const LVector4f  other)

◆ operator+() [1/2]

LVecBase4f operator+ ( const LVecBase4f  other)

◆ operator+() [2/2]

LVector4f operator+ ( const LVector4f  other)

◆ operator/()

LVector4f operator/ ( float  scalar)

◆ project()

LVector4f project ( const LVecBase4f  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 LVector4f unitW ( )
static

Returns a unit W vector.

◆ unitX()

static const LVector4f unitX ( )
static

Returns a unit X vector.

◆ unitY()

static const LVector4f unitY ( )
static

Returns a unit Y vector.

◆ unitZ()

static const LVector4f unitZ ( )
static

Returns a unit Z vector.

◆ zero()

static const LVector4f zero ( )
static

Returns a zero-length vector.

Member Data Documentation

◆ xy

Returns the x and y component of this vector.

◆ xyz

LVector3f xyz

Returns the x, y and z component of this vector.