# Planef

from pandac.PandaModules import Planef

Filename: plane_src.h Created by: mike (09Jan97)
PANDA 3D SOFTWARE Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
All use of this software is subject to the terms of the Panda 3d Software license. You should have received a copy of this license along with this source code; you will also find a current copy of the license at http://etc.cmu.edu/panda3d/docs/license/ .
To contact the maintainers of this program write to panda3d-general@lists.sourceforge.net .
Class : Plane
Description : An abstract mathematical description of a plane. A plane is defined by the equation Ax + By + Cz + D = 0.

## Inheritance:

Planef: LVecBase4f
LVecBase4f:

## Methods of Planef:

distToPlane
getNormal
getPoint
getReflectionMat
intersectsLine
intersectsPlane
operator *
operator *=
operator -
output
project
write
xform

## Methods of LVecBase4f:

addHash
addToCell
addW
addX
addY
addZ
almostEqual
compareTo
dot
fill
fmax
fmin
getCell
getClassType
getData
getHash
getNumComponents
getW
getX
getY
getZ
isNan
operator !=
operator *
operator *=
operator +
operator +=
operator -
operator -
operator -=
operator /
operator /=
operator <
operator =
operator ==
operator []
operator delete
operator new
output
pythonRepr
set
setCell
setW
setX
setY
setZ
unitW
unitX
unitY
unitZ
validatePtr
zero

distToPlane float Planef::dist_to_plane(LPoint3f const &point) const; Description: 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.

getNormal LVector3f Planef::get_normal(void) const; Description: Returns the surface normal of the plane.

getPoint LPoint3f Planef::get_point(void) const; Description: Returns an arbitrary point in the plane. This can be used along with the normal returned by get_normal() to reconstruct the plane.

getReflectionMat LMatrix4f Planef::get_reflection_mat(void) const; Filename: plane_src.cxx Created by: drose (03Apr01) PANDA 3D SOFTWARE Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved All use of this software is subject to the terms of the Panda 3d Software license. You should have received a copy of this license along with this source code; you will also find a current copy of the license at http://etc.cmu.edu/panda3d/docs/license/ . To contact the maintainers of this program write to panda3d-general@lists.sourceforge.net . Description: This computes a transform matrix that reflects the universe to the other side of the plane, as in a mirror.

intersectsLine bool Planef::intersects_line(LPoint3f &intersection_point, LPoint3f const &p1, LPoint3f const &p2) const; Description: 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. Description: This flavor of intersects_line() returns a bit more information about the nature of the intersecting point. The line is defined via the parametric equation from + t * delta for all real values of t. If there is no intersection with the plane, the function returns false and leaves t undefined. If there is an intersection with the plane, the function returns true and sets t to the parametric value that defines the point of intersection. That is, t == 0.0f implies that the intersection occurred exactly at point from, and t == 1.0f implies at point from + delta, with other values of t accordingly.

intersectsPlane bool Planef::intersects_plane(LPoint3f &from, LVector3f &delta, Planef const &other) const; Description: 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.

operator * Planef Planef::operator *(LMatrix3f const &mat) const; Description: Transforms the plane by the indicated matrix.

operator *= void Planef::operator *=(LMatrix4f const &mat); Description: Transforms the plane by the indicated matrix.

operator - Planef Planef::operator -(void) const; Undocumented function.

output void Planef::output(ostream &out) const; Description:

project LPoint3f Planef::project(LPoint3f const &point) const; Description: Returns the point within the plane nearest to the indicated point in space.

write void Planef::write(ostream &out, int indent_level = (0)) const; Description:

xform void Planef::xform(LMatrix4f const &mat); Description: Transforms the plane by the indicated matrix.

addHash unsigned int LVecBase4f::add_hash(unsigned int hash) const; Description: Adds the vector into the running hash.

addToCell void LVecBase4f::add_to_cell(int i, float value); These next functions add to an existing value. i.e. foo.set_x(foo.get_x() + value) These are useful to reduce overhead in scripting languages: Description:

addW void LVecBase4f::add_w(float value); Description:

addX void LVecBase4f::add_x(float value); These next functions add to an existing value. i.e. foo.set_x(foo.get_x() + value) These are useful to reduce overhead in scripting languages: Description:

addY void LVecBase4f::add_y(float value); Description:

addZ void LVecBase4f::add_z(float value); Description:

almostEqual bool LVecBase4f::almost_equal(LVecBase4f const &other, float threshold) const; Description: Returns true if two vectors are memberwise equal within a specified tolerance. Description: Returns true if two vectors are memberwise equal within a default tolerance based on the numeric type.

compareTo int LVecBase4f::compare_to(LVecBase4f const &other) const; Description: This flavor of compare_to uses a default threshold value based on the numeric type. Description: 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).

dot float LVecBase4f::dot(LVecBase4f const &other) const; Description:

fill void LVecBase4f::fill(float fill_value); Description: Sets each element of the vector to the indicated fill_value. This is particularly useful for initializing to zero.

fmax LVecBase4f LVecBase4f::fmax(LVecBase4f const &other); Description:

fmin LVecBase4f LVecBase4f::fmin(LVecBase4f const &other); Description:

getCell float LVecBase4f::get_cell(int i) const; Description:

getClassType static TypeHandle LVecBase4f::get_class_type(void); Undocumented function.

getData float const *LVecBase4f::get_data(void) const; Description: Returns the address of the first of the four data elements in the vector. The remaining elements occupy the next positions consecutively in memory.

getHash unsigned int LVecBase4f::get_hash(void) const; Description: Returns a suitable hash for phash_map.

getNumComponents int LVecBase4f::get_num_components(void) const; Description: Returns the number of elements in the vector, four.

getW float LVecBase4f::get_w(void) const; Description:

getX float LVecBase4f::get_x(void) const; Description:

getY float LVecBase4f::get_y(void) const; Description:

getZ float LVecBase4f::get_z(void) const; Description:

isNan bool LVecBase4f::is_nan(void) const; Description: Returns true if any component of the vector is not-a-number, false otherwise.

operator != bool LVecBase4f::operator !=(LVecBase4f const &other) const; Description:

operator * LVecBase4f LVecBase4f::operator *(float scalar) const; Description:

operator *= void LVecBase4f::operator *=(float scalar); Description:

operator + LVecBase4f LVecBase4f::operator +(LVecBase4f const &other) const; Description:

operator += void LVecBase4f::operator +=(LVecBase4f const &other); Description:

operator - LVecBase4f LVecBase4f::operator -(LVecBase4f const &other) const; Description:

operator - LVecBase4f LVecBase4f::operator -(LVecBase4f const &other) const; Description:

operator -= void LVecBase4f::operator -=(LVecBase4f const &other); Description:

operator / LVecBase4f LVecBase4f::operator /(float scalar) const; Description:

operator /= void LVecBase4f::operator /=(float scalar); Description:

operator < bool LVecBase4f::operator <(LVecBase4f const &other) const; Description: This performs a lexicographical comparison. It's of questionable mathematical meaning, but sometimes has a practical purpose for sorting unique vectors, especially in an STL container. Also see compare_to().

operator = LVecBase4f &LVecBase4f::operator =(LVecBase4f const &copy); Description:

operator == bool LVecBase4f::operator ==(LVecBase4f const &other) const; Description:

operator [] float LVecBase4f::operator [](int i) const; Description:

operator delete void LVecBase4f::operator delete(void *ptr); Undocumented function.

operator new void *LVecBase4f::operator new(unsigned int size); Undocumented function.

output void LVecBase4f::output(ostream &out) const; Description:

pythonRepr void LVecBase4f::python_repr(ostream &out, string const &class_name) const; Description:

set void LVecBase4f::set(float x, float y, float z, float w); Description:

setCell void LVecBase4f::set_cell(int i, float value); Description:

setW void LVecBase4f::set_w(float value); Description:

setX void LVecBase4f::set_x(float value); Description:

setY void LVecBase4f::set_y(float value); Description:

setZ void LVecBase4f::set_z(float value); Description:

unitW static LVecBase4f const &LVecBase4f::unit_w(void); Description: Returns a unit W vector.

unitX static LVecBase4f const &LVecBase4f::unit_x(void); Description: Returns a unit X vector.

unitY static LVecBase4f const &LVecBase4f::unit_y(void); Description: Returns a unit Y vector.

unitZ static LVecBase4f const &LVecBase4f::unit_z(void); Description: Returns a unit Z vector.

validatePtr static bool LVecBase4f::validate_ptr(void const *ptr); Undocumented function.

zero static LVecBase4f const &LVecBase4f::zero(void); Description: Returns a zero-length vector.