| Support Forum G3D Web Page |
An infinite 2D plane in 3D space.
More...
Public Member Functions | |
| Plane () | |
| Plane (const class Any &a) | |
| Format is: More... | |
| Plane (const Point3 &point0, const Point3 &point1, const Point3 &point2) | |
Constructs a plane from three points. More... | |
| Plane (Vector4 point0, Vector4 point1, Vector4 point2) | |
Constructs a plane from three points, where at most two are at infinity (w = 0, not xyz = inf). More... | |
| Plane (const Vector3 &normal, const Point3 &point) | |
The normal will be unitized. More... | |
| Plane (class BinaryInput &b) | |
| virtual | ~Plane () |
| Vector3 | center () const |
| Returns normal * distance from origin. More... | |
| Point3 | closestPoint (const Point3 &x) const |
| void | deserialize (class BinaryInput &b) |
| float | distance (const Vector3 &x) const |
| Returns distance from point to plane. More... | |
| void | flip () |
Inverts the facing direction of the plane so the new normal is the inverse of the old normal. More... | |
| bool | fuzzyContains (const Point3 &point) const |
Returns true if the point is nearly in the plane. More... | |
| void | getEquation (Vector3 &normal, double &d) const |
| Returns the equation in the form: More... | |
| void | getEquation (Vector3 &normal, float &d) const |
| void | getEquation (double &a, double &b, double &c, double &d) const |
| ax + by + cz + d = 0 More... | |
| void | getEquation (float &a, float &b, float &c, float &d) const |
| bool | halfSpaceContains (Point3 point) const |
Returns true if point is on the side the normal points to or is in the plane. More... | |
| bool | halfSpaceContains (const Vector4 &point) const |
Returns true if point is on the side the normal points to or is in the plane. More... | |
| bool | halfSpaceContainsFinite (const Point3 &point) const |
Returns true if point is on the side the normal points to or is in the plane. More... | |
| const Vector3 & | normal () const |
| void | serialize (class BinaryOutput &b) const |
| Any | toAny () const |
| String | toString () const |
Static Public Member Functions | |
| static Plane | fromEquation (float a, float b, float c, float d) |
An infinite 2D plane in 3D space.
|
inline |
|
explicit |
Format is:
Constructs a plane from three points.
Counterclockwise winding direction
Constructs a plane from three points, where at most two are at infinity (w = 0, not xyz = inf).
| G3D::Plane::Plane | ( | class BinaryInput & | b | ) |
|
inlinevirtual |
|
inline |
Returns normal * distance from origin.
Referenced by G3D::PlaneShape::boundingSphere(), and G3D::PlaneShape::center().
| void G3D::Plane::deserialize | ( | class BinaryInput & | b | ) |
|
inline |
Returns distance from point to plane.
Distance is negative if point is behind (not in plane in direction opposite normal) the plane.
Referenced by closestPoint().
| void G3D::Plane::flip | ( | ) |
Inverts the facing direction of the plane so the new normal is the inverse of the old normal.
|
static |
|
inline |
Returns true if the point is nearly in the plane.
| void G3D::Plane::getEquation | ( | Vector3 & | normal, |
| double & | d | ||
| ) | const |
Returns the equation in the form:
normal.Dot(Vector3(x, y, z)) + d = 0
| void G3D::Plane::getEquation | ( | Vector3 & | normal, |
| float & | d | ||
| ) | const |
| void G3D::Plane::getEquation | ( | double & | a, |
| double & | b, | ||
| double & | c, | ||
| double & | d | ||
| ) | const |
ax + by + cz + d = 0
| void G3D::Plane::getEquation | ( | float & | a, |
| float & | b, | ||
| float & | c, | ||
| float & | d | ||
| ) | const |
|
inline |
Returns true if point is on the side the normal points to or is in the plane.
Referenced by halfSpaceContains().
|
inline |
Returns true if point is on the side the normal points to or is in the plane.
|
inline |
Returns true if point is on the side the normal points to or is in the plane.
Only call on finite points. Faster than halfSpaceContains.
|
inline |
Referenced by G3D::PlaneShape::getRandomSurfacePoint().
| void G3D::Plane::serialize | ( | class BinaryOutput & | b | ) | const |
| Any G3D::Plane::toAny | ( | ) | const |
| String G3D::Plane::toString | ( | ) | const |
1.8.15