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. More...
|
|
| Plane (const glm::dvec3 &point, const glm::dvec3 &normal) |
| Construct a new plane from a point in the plane and the plane's normal. More...
|
|
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. More...
|
|
glm::dvec3 | projectPointOntoPlane (const glm::dvec3 &point) const noexcept |
| Projects a point onto this plane. More...
|
|
|
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() noexcept
Constructs a new plane with a +Z normal and a distance of 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);
static constexpr Cartographic fromDegrees(double longitudeDegrees, double latitudeDegrees, double heightMeters=0.0) noexcept
Creates a new instance from a longitude and latitude specified in degrees, and a height given in mete...
A quadratic surface defined in Cartesian coordinates.
static const Ellipsoid WGS84
An Ellipsoid instance initialized to the WGS84 standard.
glm::dvec3 cartographicToCartesian(const Cartographic &cartographic) const noexcept
Converts the provided Cartographic to cartesian representation.
glm::dvec3 geodeticSurfaceNormal(const glm::dvec3 &position) const noexcept
Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.
◆ 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.
The documentation for this class was generated from the following file:
- /home/runner/work/cesium-native/cesium-native/CesiumGeometry/include/CesiumGeometry/Plane.h