Panda3D
|
An abstract mathematical description of a plane. A plane is defined by the equation Ax + By + Cz + D = 0. More...
Public Member Functions | |
__init__ () | |
Creates a default plane. This plane happens to intersect the origin, perpendicular to the Z axis. It's not clear how useful a default plane is. More... | |
__init__ (const LPoint3f a, const LPoint3f b, const LPoint3f c) | |
Constructs a plane given three counter-clockwise points, as seen from the front of the plane (that is, viewed from the end of the normal vector, looking down). More... | |
__init__ (const LVecBase4f copy) | |
__init__ (const LVector3f normal, const LPoint3f point) | |
Constructs a plane given a surface normal vector and a point within the plane. More... | |
__init__ (float a, float b, float c, float d) | |
Constructs a plane given the four terms of the plane equation. More... | |
float | distToPlane (const LPoint3f point) |
Returns the straight-line shortest distance from the point to the plane. The returned value is positive if the point is in front of the plane (on the side with the normal), or negative in the point is behind the plane (on the opposite side from the normal). It's zero if the point is exactly in the plane. More... | |
flip () | |
Convenience method that flips the plane in-place. This is done by simply flipping the normal vector. More... | |
LVector3f | getNormal () |
Returns the surface normal of the plane. More... | |
LPoint3f | getPoint () |
Returns an arbitrary point in the plane. This can be used along with the normal returned by get_normal() to reconstruct the plane. More... | |
LMatrix4f | getReflectionMat () |
This computes a transform matrix that reflects the universe to the other side of the plane, as in a mirror. More... | |
bool | intersectsLine (LPoint3f intersection_point, const LPoint3f p1, const LPoint3f p2) |
Returns true if the plane intersects the infinite line passing through points p1 and p2, false if the line is parallel. The points p1 and p2 are used only to define the Euclidean line; they have no other bearing on the intersection test. If true, sets intersection_point to the point of intersection. More... | |
bool | intersectsPlane (LPoint3f from, LVector3f delta, const LPlanef other) |
Returns true if the two planes intersect, false if they do not. If they do intersect, then from and delta are filled in with the parametric representation of the line of intersection: that is, from is a point on that line, and delta is a vector showing the direction of the line. More... | |
LPlanef | operator* (const LMatrix3f mat) |
LPlanef | operator* (const LMatrix4f mat) |
LPlanef | operator*= (const LMatrix4f mat) |
LPlanef | operator- () |
output (Ostream out) | |
LPoint3f | project (const LPoint3f point) |
Returns the point within the plane nearest to the indicated point in space. More... | |
write (Ostream out, int indent_level) | |
xform (const LMatrix4f mat) | |
Transforms the plane by the indicated matrix. More... | |
![]() | |
object | __getattr__ (str attr_name) |
__init__ () | |
__init__ (const LPoint3f point) | |
Constructs an LVecBase4 from an LPoint3. The w coordinate is set to 1.0. More... | |
__init__ (const LVecBase3f copy, float w) | |
__init__ (const LVecBase4f copy) | |
__init__ (const LVector3f vector) | |
Constructs an LVecBase4 from an LVector3. The w coordinate is set to 0.0. 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) |
size_t | addHash (size_t hash) |
Adds the vector into the running hash. More... | |
size_t | addHash (size_t 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. 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 LVecBase4f other) | |
float | dot (const LVecBase4f other) |
fill (float fill_value) | |
Sets each element of the vector to the indicated fill_value. This is particularly useful for initializing to zero. 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. 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 (float threshold) |
Returns a suitable hash for phash_map. More... | |
int | getNumComponents () |
Returns the number of elements in the vector, four. More... | |
float | getW () |
float | getX () |
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. Returns true if the vector was normalized, false if it was a zero-length vector. More... | |
LVecBase4f | 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 LVecBase4f other) |
LVecBase4f | operator* (float scalar) |
LVecBase4f | operator*= (float scalar) |
LVecBase4f | operator+ (const LVecBase4f other) |
LVecBase4f | operator+= (const LVecBase4f other) |
LVecBase4f | operator- () |
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= (const UnalignedLVecBase4f copy) |
LVecBase4f | operator= (float fill_value) |
bool | operator== (const LVecBase4f other) |
operator[] (int i, float assign_val) | |
float | operator[] (int i) |
output (Ostream out) | |
LVecBase4f | 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. 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 (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(). 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... | |
Additional Inherited Members | |
![]() | |
enum | { num_components = 4, is_int = 0 } |
![]() | |
static TypeHandle | getClassType () |
static int | size () |
Returns 4: the number of components of a LVecBase4. More... | |
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... | |
An abstract mathematical description of a plane. A plane is defined by the equation Ax + By + Cz + D = 0.
__init__ | ( | ) |
Creates a default plane. This plane happens to intersect the origin, perpendicular to the Z axis. It's not clear how useful a default plane is.
Constructs a plane given three counter-clockwise points, as seen from the front of the plane (that is, viewed from the end of the normal vector, looking down).
__init__ | ( | const LVecBase4f | copy | ) |
Constructs a plane given a surface normal vector and a point within the plane.
__init__ | ( | float | a, |
float | b, | ||
float | c, | ||
float | d | ||
) |
Constructs a plane given the four terms of the plane equation.
float distToPlane | ( | const LPoint3f | point | ) |
Returns the straight-line shortest distance from the point to the plane. The returned value is positive if the point is in front of the plane (on the side with the normal), or negative in the point is behind the plane (on the opposite side from the normal). It's zero if the point is exactly in the plane.
flip | ( | ) |
Convenience method that flips the plane in-place. This is done by simply flipping the normal vector.
LVector3f getNormal | ( | ) |
Returns the surface normal of the plane.
LPoint3f getPoint | ( | ) |
Returns an arbitrary point in the plane. This can be used along with the normal returned by get_normal() to reconstruct the plane.
LMatrix4f getReflectionMat | ( | ) |
This computes a transform matrix that reflects the universe to the other side of the plane, as in a mirror.
Returns true if the plane intersects the infinite line passing through points p1 and p2, false if the line is parallel. The points p1 and p2 are used only to define the Euclidean line; they have no other bearing on the intersection test. If true, sets intersection_point to the point of intersection.
Returns true if the two planes intersect, false if they do not. If they do intersect, then from and delta are filled in with the parametric representation of the line of intersection: that is, from is a point on that line, and delta is a vector showing the direction of the line.
LPlanef operator- | ( | ) |
output | ( | Ostream | out | ) |
Returns the point within the plane nearest to the indicated point in space.
write | ( | Ostream | out, |
int | indent_level | ||
) |
xform | ( | const LMatrix4f | mat | ) |
Transforms the plane by the indicated matrix.