LPlaned
from panda3d.core import LPlaned
- class LPlaned
Bases:
Bases:
LVecBase4d
An abstract mathematical description of a plane. A plane is defined by the equation Ax + By + Cz + D = 0.
Inheritance diagram
- __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.
- __init__(param0: LPlaned)
- __init__(a: LPoint3d, b: LPoint3d, c: LPoint3d)
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__(copy: LVecBase4d)
- __init__(normal: LVector3d, point: LPoint3d)
Constructs a plane given a surface normal vector and a point within the plane.
- __init__(a: float, b: float, c: float, d: float)
Constructs a plane given the four terms of the plane equation.
- dist_to_plane(point: LPoint3d) float
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.
- get_point() LPoint3d
Returns an arbitrary point in the plane. This can be used along with the normal returned by
get_normal()
to reconstruct the plane.
- get_reflection_mat() LMatrix4d
This computes a transform matrix that reflects the universe to the other side of the plane, as in a mirror.
- intersects_line(intersection_point: LPoint3d, p1: LPoint3d, p2: LPoint3d) bool
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.
- intersects_plane(from: LPoint3d, delta: LVector3d, other: LPlaned) bool
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.
- normalize() bool
Normalizes the plane in place. Returns true if the plane was normalized, false if the plane had a zero-length normal vector.
- normalized() LPlaned
Normalizes the plane and returns the normalized plane as a copy. If the plane’s normal was a zero-length vector, the same plane is returned.