Appearance
KBE3D / KBCore / Cesium / Plane
类: Plane
A plane in Hessian Normal Form defined by <pre> ax + by + cz + d = 0 </pre> where (a, b, c) is the plane's <code>normal</code>, d is the signed <code>distance</code> to the plane, and (x, y, z) is any point on the plane.
示例
ts
// The plane x=0
const plane = new Cesium.Plane(Cesium.Cartesian3.UNIT_X, 0.0);参数
The plane's normal (normalized).
参数
The shortest distance from the origin to the plane. The sign of <code>distance</code> determines which side of the plane the origin is on. If <code>distance</code> 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.
属性
ORIGIN_XY_PLANE
readonlystaticORIGIN_XY_PLANE:Plane
A constant initialized to the XY plane passing through the origin, with normal in positive Z.
ORIGIN_YZ_PLANE
readonlystaticORIGIN_YZ_PLANE:Plane
A constant initialized to the YZ plane passing through the origin, with normal in positive X.
ORIGIN_ZX_PLANE
readonlystaticORIGIN_ZX_PLANE:Plane
A constant initialized to the ZX plane passing through the origin, with normal in positive Y.
normal
normal:
Cartesian3
The plane's normal.
distance
distance:
number
The shortest distance from the origin to the plane. The sign of <code>distance</code> determines which side of the plane the origin is on. If <code>distance</code> 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.
方法
fromPointNormal()
staticfromPointNormal(point:Cartesian3,normal:Cartesian3,result?:Plane):Plane
Creates a plane from a normal and a point on the plane.
参数
point
The point on the plane.
normal
The plane's normal (normalized).
result?
Plane
The object onto which to store the result.
返回
Plane
A new plane instance or the modified result parameter.
示例
ts
const point = Cesium.Cartesian3.fromDegrees(-72.0, 40.0);
const normal = ellipsoid.geodeticSurfaceNormal(point);
const tangentPlane = Cesium.Plane.fromPointNormal(point, normal);fromCartesian4()
staticfromCartesian4(coefficients:Cartesian4,result?:Plane):Plane
Creates a plane from the general equation
参数
coefficients
The plane's normal (normalized).
result?
Plane
The object onto which to store the result.
返回
Plane
A new plane instance or the modified result parameter.
getPointDistance()
staticgetPointDistance(plane:Plane,point:Cartesian3):number
Computes the signed shortest distance of a point to a 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.
参数
plane
Plane
The plane.
point
The point.
返回
number
The signed shortest distance of the point to the plane.
projectPointOntoPlane()
staticprojectPointOntoPlane(plane:Plane,point:Cartesian3,result?:Cartesian3):Cartesian3
Projects a point onto the plane.
参数
plane
Plane
The plane to project the point onto
point
The point to project onto the plane
result?
The result point. If undefined, a new Cartesian3 will be created.
返回
The modified result parameter or a new Cartesian3 instance if one was not provided.
transform()
statictransform(plane:Plane,transform:Matrix4,result?:Plane):Plane
Transforms the plane by the given transformation matrix.
参数
plane
Plane
The plane.
transform
The transformation matrix.
result?
Plane
The object into which to store the result.
返回
Plane
The plane transformed by the given transformation matrix.
clone()
staticclone(plane:Plane,result?:Plane):Plane
Duplicates a Plane instance.
参数
plane
Plane
The plane to duplicate.
result?
Plane
The object onto which to store the result.
返回
Plane
The modified result parameter or a new Plane instance if one was not provided.
equals()
staticequals(left:Plane,right:Plane):boolean
Compares the provided Planes by normal and distance and returns <code>true</code> if they are equal, <code>false</code> otherwise.
参数
left
Plane
The first plane.
right
Plane
The second plane.
返回
boolean
true if left and right are equal, false otherwise.
构造函数
构造函数
new Plane(
normal:Cartesian3,distance:number):Plane
参数
normal
distance
number
返回
Plane
