cesium-native 0.43.0
Loading...
Searching...
No Matches
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.
 
 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 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::exception`normal` must be normalized.

Example:

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

Example:

const CesiumGeospatial::Ellipsoid& ellipsoid =
glm::dvec3 point = ellipsoid.cartographicToCartesian(
glm::dvec3 normal = ellipsoid.geodeticSurfaceNormal(point);
Plane tangentPlane(point, normal);

Member Function Documentation

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

Member Data Documentation

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