A plane in Hessian Normal Format.
More...
#include <CesiumGeometry/Plane.h>
|
| Plane () noexcept |
| Constructs a new plane with a +Z normal and a distance of 0.0.
|
|
| Plane (const glm::dvec3 &normal, double distance) |
| Constructs a new plane from a normal and a distance from the origin.
|
|
| Plane (const glm::dvec3 &point, const glm::dvec3 &normal) |
| Construct a new plane from a point in the plane and the plane's normal.
|
|
const glm::dvec3 & | getNormal () const noexcept |
| Gets the plane's normal.
|
|
double | getDistance () const noexcept |
| Gets the signed shortest distance from the origin to the plane. The sign of distance determines which side of the plane the origin is on. If distance is positive, the origin is in the half-space in the direction of the normal; if negative, the origin is in the half-space opposite to the normal; if zero, the plane passes through the origin.
|
|
double | getPointDistance (const glm::dvec3 &point) const noexcept |
| Computes the signed shortest distance of a point to this plane. The sign of the distance determines which side of the plane the point is on. If the distance is positive, the point is in the half-space in the direction of the normal; if negative, the point is in the half-space opposite to the normal; if zero, the plane passes through the point.
|
|
glm::dvec3 | projectPointOntoPlane (const glm::dvec3 &point) const noexcept |
| Projects a point onto this plane.
|
|
|
static const Plane | ORIGIN_XY_PLANE |
| The XY plane passing through the origin, with normal in positive Z.
|
|
static const Plane | ORIGIN_YZ_PLANE |
| The YZ plane passing through the origin, with normal in positive X.
|
|
static const Plane | ORIGIN_ZX_PLANE |
| The ZX plane passing through the origin, with normal in positive Y.
|
|
A plane in Hessian Normal Format.
Definition at line 12 of file Plane.h.
◆ Plane() [1/2]
CesiumGeometry::Plane::Plane |
( |
const glm::dvec3 & | normal, |
|
|
double | distance ) |
Constructs a new plane from a normal and a distance from the origin.
The plane is defined by:
where (a, b, c) is the plane's normal
, d is the signed distance
to the plane, and (x, y, z) is any point on the plane.
- Parameters
-
normal | The plane's normal (normalized). |
distance | The shortest distance from the origin to the plane. The sign of distance determines which side of the plane the origin is on. If distance is positive, the origin is in the half-space in the direction of the normal; if negative, the origin is in the half-space opposite to the normal; if zero, the plane passes through the origin. |
- Exceptions
-
std::exception | `normal` must be normalized. |
Example:
Plane plane(glm::dvec3(1.0, 0.0, 0.0), 0.0);
◆ Plane() [2/2]
CesiumGeometry::Plane::Plane |
( |
const glm::dvec3 & | point, |
|
|
const glm::dvec3 & | normal ) |
Construct a new plane from a point in the plane and the plane's normal.
- Parameters
-
point | The point on the plane. |
normal | The plane's normal (normalized). |
- Exceptions
-
std::exception | `normal` must be normalized. |
Example:
Plane tangentPlane(point, normal);
◆ getDistance()
double CesiumGeometry::Plane::getDistance |
( |
| ) |
const |
|
inlinenoexcept |
Gets the signed shortest distance from the origin to the plane. The sign of distance
determines which side of the plane the origin is on. If distance
is positive, the origin is in the half-space in the direction of the normal; if negative, the origin is in the half-space opposite to the normal; if zero, the plane passes through the origin.
Definition at line 86 of file Plane.h.
◆ getNormal()
const glm::dvec3 & CesiumGeometry::Plane::getNormal |
( |
| ) |
const |
|
inlinenoexcept |
Gets the plane's normal.
Definition at line 76 of file Plane.h.
◆ getPointDistance()
double CesiumGeometry::Plane::getPointDistance |
( |
const glm::dvec3 & | point | ) |
const |
|
noexcept |
Computes the signed shortest distance of a point to this plane. The sign of the distance determines which side of the plane the point is on. If the distance is positive, the point is in the half-space in the direction of the normal; if negative, the point is in the half-space opposite to the normal; if zero, the plane passes through the point.
- Parameters
-
- Returns
- The signed shortest distance of the point to the plane.
◆ projectPointOntoPlane()
glm::dvec3 CesiumGeometry::Plane::projectPointOntoPlane |
( |
const glm::dvec3 & | point | ) |
const |
|
noexcept |
Projects a point onto this plane.
- Parameters
-
point | The point to project onto the plane. |
- Returns
- The projected point.
◆ ORIGIN_XY_PLANE
const Plane CesiumGeometry::Plane::ORIGIN_XY_PLANE |
|
static |
The XY plane passing through the origin, with normal in positive Z.
Definition at line 17 of file Plane.h.
◆ ORIGIN_YZ_PLANE
const Plane CesiumGeometry::Plane::ORIGIN_YZ_PLANE |
|
static |
The YZ plane passing through the origin, with normal in positive X.
Definition at line 22 of file Plane.h.
◆ ORIGIN_ZX_PLANE
const Plane CesiumGeometry::Plane::ORIGIN_ZX_PLANE |
|
static |
The ZX plane passing through the origin, with normal in positive Y.
Definition at line 27 of file Plane.h.
The documentation for this class was generated from the following file:
- /home/runner/work/cesium-native/cesium-native/CesiumGeometry/include/CesiumGeometry/Plane.h