@JsType(isNative=true, namespace="Cesium", name="PerspectiveFrustum") public class PerspectiveFrustum extends Frustum
Modifier and Type | Field and Description |
---|---|
double |
aspectRatio
The aspect ratio of the frustum's width to it's height.
|
double |
fov
The angle of the field of view (FOV), in radians.
|
double |
xOffset
Offsets the frustum in the x direction.
|
double |
yOffset
Offsets the frustum in the y direction.
|
Constructor and Description |
---|
PerspectiveFrustum()
The viewing frustum is defined by 6 planes.
|
Modifier and Type | Method and Description |
---|---|
PerspectiveFrustum |
clone()
Returns a duplicate of a PerspectiveFrustum instance.
|
PerspectiveFrustum |
clone(PerspectiveFrustum result)
Returns a duplicate of a PerspectiveFrustum instance.
|
CullingVolume |
computeCullingVolume(Cartesian3 position,
Cartesian3 direction,
Cartesian3 up)
Creates a culling volume for this frustum.
|
boolean |
equals(PerspectiveFrustum other)
Compares the provided PerspectiveFrustum componentwise and returns true if they are equal, false otherwise.
|
boolean |
equalsEpsilon(PerspectiveFrustum other,
double relativeEpsilon)
Compares the provided PerspectiveFrustum componentwise and returns true if they pass an absolute or
relative tolerance test, false otherwise.
|
boolean |
equalsEpsilon(PerspectiveFrustum other,
double relativeEpsilon,
double absoluteEpsilon)
Compares the provided PerspectiveFrustum componentwise and returns true if they pass an absolute or
relative tolerance test, false otherwise.
|
double |
fovy()
Gets the angle of the vertical field of view, in radians.
|
Cartesian2 |
getPixelDimensions(double drawingBufferWidth,
double drawingBufferHeight,
double distance,
Cartesian2 result)
Returns the pixel's width and height in meters.
|
Matrix4 |
infiniteProjectionMatrix()
The perspective projection matrix computed from the view frustum with an infinite far plane.
|
projectionMatrix
@JsProperty public double aspectRatio
@JsProperty public double fov
@JsProperty public double xOffset
@JsProperty public double yOffset
@JsConstructor public PerspectiveFrustum()
Example:
PerspectiveFrustum frustum = new PerspectiveFrustum();
frustum.aspectRatio = canvas.clientWidth / canvas.clientHeight;
frustum.fov = Math.PI_OVER_THREE;
frustum.near = 1.0;
frustum.far = 2.0;
PerspectiveOffCenterFrustum
@JsProperty(name="fovy") public double fovy()
@JsProperty(name="infiniteProjectionMatrix") public Matrix4 infiniteProjectionMatrix()
Frustum.projectionMatrix()
@JsMethod public PerspectiveFrustum clone()
@JsMethod public PerspectiveFrustum clone(PerspectiveFrustum result)
result
- The object onto which to store the result.@JsMethod public CullingVolume computeCullingVolume(Cartesian3 position, Cartesian3 direction, Cartesian3 up)
Example:
// Check if a bounding volume intersects the frustum.
CullingVolume cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
Cartesian3 intersect = cullingVolume.computeVisibility(boundingVolume);
position
- The eye position.direction
- The view direction.up
- The up direction.@JsMethod public boolean equals(PerspectiveFrustum other)
other
- The right hand side PerspectiveFrustum.@JsMethod public boolean equalsEpsilon(PerspectiveFrustum other, double relativeEpsilon)
other
- The right hand side PerspectiveFrustum.relativeEpsilon
- The relative epsilon tolerance to use for equality testing.@JsMethod public boolean equalsEpsilon(PerspectiveFrustum other, double relativeEpsilon, double absoluteEpsilon)
other
- The right hand side PerspectiveFrustum.relativeEpsilon
- The relative epsilon tolerance to use for equality testing.absoluteEpsilon
- The absolute epsilon tolerance to use for equality testing.@JsMethod public Cartesian2 getPixelDimensions(double drawingBufferWidth, double drawingBufferHeight, double distance, Cartesian2 result)
drawingBufferWidth
- The width of the drawing buffer.drawingBufferHeight
- The height of the drawing buffer.distance
- The distance to the near plane in meters.result
- The object onto which to store the result.Copyright © 2019. All rights reserved.