cesium-native  0.41.0
CesiumGeometry::Plane Class Referencefinal

A plane in Hessian Normal Format. More...

#include <CesiumGeometry/Plane.h>

Public Member Functions

 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 Public Attributes

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.
 

Detailed Description

A plane in Hessian Normal Format.

Definition at line 12 of file Plane.h.

Constructor & Destructor Documentation

◆ 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:

ax + by + cz + d = 0

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
normalThe plane's normal (normalized).
distanceThe 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::exceptionnormal must be normalized.

Example:

// The plane x=0
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
pointThe point on the plane.
normalThe plane's normal (normalized).
Exceptions
std::exceptionnormal must be normalized.

Example:

const CesiumGeospatial::Ellipsoid& ellipsoid =
glm::dvec3 point = ellipsoid.cartographicToCartesian(
glm::dvec3 normal = ellipsoid.geodeticSurfaceNormal(point);
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...
Definition: Cartographic.h:39
A quadratic surface defined in Cartesian coordinates.
Definition: Ellipsoid.h:38
static const Ellipsoid WGS84
An Ellipsoid instance initialized to the WGS84 standard.
Definition: Ellipsoid.h:47
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.

Member Function Documentation

◆ 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
pointThe point.
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
pointThe point to project onto the plane.
Returns
The projected point.

The documentation for this class was generated from the following file: