@JsType(isNative=true, namespace="Cesium", name="Plane") public class Plane extends Object
Modifier and Type | Field and Description |
---|---|
double |
distance
The shortest distance from the origin to the plane.
|
Cartesian3 |
normal
The plane's normal.
|
Constructor and Description |
---|
Plane(Cartesian3 normal,
double distance)
A plane in Hessian Normal Form 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.
|
Modifier and Type | Method and Description |
---|---|
static Plane |
clone(Plane plane)
Duplicates a Plane instance.
|
static Plane |
clone(Plane plane,
Plane result)
Duplicates a Plane instance.
|
static Plane |
equals(Plane left,
Plane right)
Compares the provided Planes by normal and distance and returns true if they are equal, false otherwise.
|
static Plane |
fromCartesian4(Cartesian4 coefficients)
Creates a plane from the general equation
|
static Plane |
fromCartesian4(Cartesian4 coefficients,
Plane result)
Creates a plane from the general equation
|
static Plane |
fromPointNormal(Cartesian3 point,
Cartesian3 normal)
Creates a plane from a normal and a point on the plane.
|
static Plane |
fromPointNormal(Cartesian3 point,
Cartesian3 normal,
Plane result)
Creates a plane from a normal and a point on the plane.
|
static double |
getPointDistance(Plane plane,
Cartesian3 point)
Computes the signed shortest distance of a point to a plane.
|
static Plane |
ORIGIN_XY_PLANE()
A constant initialized to the XY plane passing through the origin, with normal in positive Z.
|
static Plane |
ORIGIN_YZ_PLANE()
A constant initialized to the YZ plane passing through the origin, with normal in positive X.
|
static Plane |
ORIGIN_ZX_PLANE()
A constant initialized to the ZX plane passing through the origin, with normal in positive Y.
|
static Cartesian3 |
projectPointOntoPlane(Plane plane,
Cartesian3 point)
Projects a point onto the plane.
|
static Cartesian3 |
projectPointOntoPlane(Plane plane,
Cartesian3 point,
Cartesian3 result)
Projects a point onto the plane.
|
static Plane |
transform(Plane plane,
Matrix4 transform)
Transforms the plane by the given transformation matrix.
|
static Plane |
transform(Plane plane,
Matrix4 transform,
Plane result)
Transforms the plane by the given transformation matrix.
|
@JsProperty public double distance
@JsProperty public Cartesian3 normal
@JsConstructor public Plane(Cartesian3 normal, double distance)
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.@JsProperty(name="ORIGIN_XY_PLANE") public static Plane ORIGIN_XY_PLANE()
@JsProperty(name="ORIGIN_YZ_PLANE") public static Plane ORIGIN_YZ_PLANE()
@JsProperty(name="ORIGIN_ZX_PLANE") public static Plane ORIGIN_ZX_PLANE()
@JsMethod public static Plane clone(Plane plane)
plane
- The plane to duplicate.@JsMethod public static Plane clone(Plane plane, Plane result)
plane
- The plane to duplicate.result
- The object onto which to store the result.@JsMethod public static Plane equals(Plane left, Plane right)
left
- The first plane.right
- The second plane.@JsMethod public static Plane fromCartesian4(Cartesian4 coefficients)
coefficients
- The plane's normal (normalized).@JsMethod public static Plane fromCartesian4(Cartesian4 coefficients, Plane result)
coefficients
- The plane's normal (normalized).result
- The object onto which to store the result.@JsMethod public static Plane fromPointNormal(Cartesian3 point, Cartesian3 normal)
Example:
Cartesian3 point = Cartesian3.fromDegrees(-72.0, 40.0);
Cartesian3 normal = ellipsoid.geodeticSurfaceNormal(point);
Plane tangentPlane = Plane.fromPointNormal(point, normal);
point
- The point on the plane.normal
- The plane's normal (normalized).@JsMethod public static Plane fromPointNormal(Cartesian3 point, Cartesian3 normal, Plane result)
Example:
Cartesian3 point = Cartesian3.fromDegrees(-72.0, 40.0);
Cartesian3 normal = ellipsoid.geodeticSurfaceNormal(point);
Plane tangentPlane = Plane.fromPointNormal(point, normal);
point
- The point on the plane.normal
- The plane's normal (normalized).result
- The object onto which to store the result.@JsMethod public static double getPointDistance(Plane plane, Cartesian3 point)
plane
- The plane.point
- The point.@JsMethod public static Cartesian3 projectPointOntoPlane(Plane plane, Cartesian3 point)
plane
- The plane to project the point ontopoint
- The point to project onto the plane@JsMethod public static Cartesian3 projectPointOntoPlane(Plane plane, Cartesian3 point, Cartesian3 result)
plane
- The plane to project the point ontopoint
- The point to project onto the planeresult
- The result point. If undefined, a new Cartesian3 will be created.@JsMethod public static Plane transform(Plane plane, Matrix4 transform)
plane
- The plane.transform
- The transformation matrix.@JsMethod public static Plane transform(Plane plane, Matrix4 transform, Plane result)
plane
- The plane.transform
- The transformation matrix.result
- The object into which to store the result.Copyright © 2019. All rights reserved.