Appearance
KBE3D / KBCore / Cesium / OrthographicFrustum
类: OrthographicFrustum
The viewing frustum is defined by 6 planes. Each plane is represented by a Cartesian4 object, where the x, y, and z components define the unit vector normal to the plane, and the w component is the distance of the plane from the origin/camera position.
示例
ts
const maxRadii = ellipsoid.maximumRadius;
const frustum = new Cesium.OrthographicFrustum();
frustum.near = 0.01 * maxRadii;
frustum.far = 50.0 * maxRadii;参数
An object with the following properties:
参数
The width of the frustum in meters.
参数
The aspect ratio of the frustum's width to it's height.
参数
The distance of the near plane.
参数
The distance of the far plane.
属性
packedLength
staticpackedLength:number
The number of elements used to pack the object into an array.
width
width:
number|undefined
The horizontal width of the frustum in meters.
aspectRatio
aspectRatio:
number|undefined
The aspect ratio of the frustum's width to it's height.
near
near:
number
The distance of the near plane.
far
far:
number
The distance of the far plane.
projectionMatrix
readonlyprojectionMatrix:Matrix4
Gets the orthographic projection matrix computed from the view frustum.
方法
pack()
staticpack(value:OrthographicFrustum,array:number[],startingIndex?:number):number[]
Stores the provided instance into the provided array.
参数
value
OrthographicFrustum
The value to pack.
array
number[]
The array to pack into.
startingIndex?
number
The index into the array at which to start packing the elements.
返回
number[]
The array that was packed into
unpack()
staticunpack(array:number[],startingIndex?:number,result?:OrthographicFrustum):OrthographicFrustum
Retrieves an instance from a packed array.
参数
array
number[]
The packed array.
startingIndex?
number
The starting index of the element to be unpacked.
result?
OrthographicFrustum
The object into which to store the result.
返回
OrthographicFrustum
The modified result parameter or a new OrthographicFrustum instance if one was not provided.
computeCullingVolume()
computeCullingVolume(
position:Cartesian3,direction:Cartesian3,up:Cartesian3):CullingVolume
Creates a culling volume for this frustum.
参数
position
The eye position.
direction
The view direction.
up
The up direction.
返回
A culling volume at the given position and orientation.
示例
ts
// Check if a bounding volume intersects the frustum.
const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
const intersect = cullingVolume.computeVisibility(boundingVolume);getPixelDimensions()
getPixelDimensions(
drawingBufferWidth:number,drawingBufferHeight:number,distance:number,pixelRatio:number,result:Cartesian2):Cartesian2
Returns the pixel's width and height in meters.
参数
drawingBufferWidth
number
The width of the drawing buffer.
drawingBufferHeight
number
The height of the drawing buffer.
distance
number
The distance to the near plane in meters.
pixelRatio
number
The scaling factor from pixel space to coordinate space.
result
The object onto which to store the result.
返回
The modified result parameter or a new instance of Cartesian2 with the pixel's width and height in the x and y properties, respectively.
示例
ts
// Example 1
// Get the width and height of a pixel.
const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 0.0, scene.pixelRatio, new Cesium.Cartesian2());clone()
clone(
result?:OrthographicFrustum):OrthographicFrustum
Returns a duplicate of a OrthographicFrustum instance.
参数
result?
OrthographicFrustum
The object onto which to store the result.
返回
OrthographicFrustum
The modified result parameter or a new OrthographicFrustum instance if one was not provided.
equals()
equals(
other?:OrthographicFrustum):boolean
Compares the provided OrthographicFrustum componentwise and returns <code>true</code> if they are equal, <code>false</code> otherwise.
参数
other?
OrthographicFrustum
The right hand side OrthographicFrustum.
返回
boolean
true if they are equal, false otherwise.
equalsEpsilon()
equalsEpsilon(
other:OrthographicFrustum,relativeEpsilon:number,absoluteEpsilon?:number):boolean
Compares the provided OrthographicFrustum componentwise and returns <code>true</code> if they pass an absolute or relative tolerance test, <code>false</code> otherwise.
参数
other
OrthographicFrustum
The right hand side OrthographicFrustum.
relativeEpsilon
number
The relative epsilon tolerance to use for equality testing.
absoluteEpsilon?
number
The absolute epsilon tolerance to use for equality testing.
返回
boolean
true if this and other are within the provided epsilon, false otherwise.
构造函数
构造函数
new OrthographicFrustum(
options?: {width?:number;aspectRatio?:number;near?:number;far?:number; }):OrthographicFrustum
参数
options?
width?
number
aspectRatio?
number
near?
number
far?
number
返回
OrthographicFrustum
