Plane3¶
The Plane3
class template represents a plane in 3D space, with
predefined typedefs for planes of type float
and double
.
Example:
#include <Imath/ImathPlane.h>
void
plane3_example()
{
Imath::V3f a (1.0f, 0.0f, 0.0f);
Imath::V3f b (0.0f, 1.0f, 0.0f);
Imath::V3f c (0.0f, 0.0f, 1.0f);
Imath::Plane3f p (a, b, c);
Imath::V3f n (1.0f, 1.0f, 1.0f);
n.normalize();
assert (p.normal == n);
Imath::V3f o (0.0f, 0.0f, 0.0f);
float d = p.distanceTo (o);
assert (Imath::equalWithAbsError (d, -0.57735f, 1e-6f));
}
-
template <class T>
classPlane3
¶ The
Plane3
class represents a half space in 3D, so the normal may point either towards or away from origin.The plane
P
can be represented by Plane3 as eitherp
or-p
corresponding to the two half-spaces on either side of the plane. Any function which computes a distance will return either negative or positive values for the distance indicating which half-space the point is in. Note that reflection, and intersection functions will operate as expected.Direct access to member fields
-
T
distance
¶ The distance from the origin to the plane.
Constructors
-
Plane3
()¶ Uninitialized by default.
Manipulation
Utility Methods
-
constexpr bool
intersect
(const Line3<T> &line, Vec3<T> &intersection) const¶ Determine if a line intersects the plane.
- Return
- True if the line intersects the plane.
- Parameters
line
: The lineintersection
: The point of intersection
-
constexpr bool
intersectT
(const Line3<T> &line, T ¶meter) const¶ Determine if a line intersects the plane.
- Return
- True if the line intersects the plane.
- Parameters
line
: The lineparameter
: The parametric value of the point of intersection
-
T
Warning
doxygenfunction: Unable to resolve multiple matches for function “operator<<” with arguments (std::ostream& s, const Plane3<T>& plane) in doxygen xml output for project “Imath” from directory: doxyxml/. Potential matches:
- std::ostream &operator<<(std::ostream&, Imath::half)
- template <class T>
std::ostream &Imath::operator<<(std::ostream&, const Color4<T>&)
- template <class T>
std::ostream &Imath::operator<<(std::ostream&, const Euler<T>&)
- template <class T>
std::ostream &Imath::operator<<(std::ostream&, const Interval<T>&)
- template <class T>
std::ostream &Imath::operator<<(std::ostream&, const Line3<T>&)
- template <class T>
std::ostream &Imath::operator<<(std::ostream&, const Matrix22<T>&)
- template <class T>
std::ostream &Imath::operator<<(std::ostream&, const Matrix33<T>&)
- template <class T>
std::ostream &Imath::operator<<(std::ostream&, const Matrix44<T>&)
- template <class T>
std::ostream &Imath::operator<<(std::ostream&, const Plane3<T>&)
- template <class T>
std::ostream &Imath::operator<<(std::ostream&, const Quat<T>&)
- template <class T>
std::ostream &Imath::operator<<(std::ostream&, const Shear6<T>&)
- template <class T>
std::ostream &Imath::operator<<(std::ostream&, const Vec2<T>&)
- template <class T>
std::ostream &Imath::operator<<(std::ostream&, const Vec3<T>&)
- template <class T>
std::ostream &Imath::operator<<(std::ostream&, const Vec4<T>&)