@JsType(isNative=true, namespace="Cesium", name="Occluder") public class Occluder extends Object
Modifier and Type | Field and Description |
---|---|
Cartesian3 |
cameraPosition
The position of the camera.
|
Cartesian3 |
position
The position of the occluder.
|
double |
radius
The radius of the occluder.
|
Constructor and Description |
---|
Occluder(BoundingSphere occluderBoundingSphere,
Cartesian3 cameraPosition)
Creates an Occluder derived from an object's position and radius, as well as the camera position.
|
Modifier and Type | Method and Description |
---|---|
static Object |
computeOccludeePoint(BoundingSphere occluderBoundingSphere,
Cartesian3 occludeePosition,
Cartesian3[] positions)
Computes a point that can be used as the occludee position to the visibility functions.
|
static Object |
computeOccludeePointFromRectangle(Rectangle rectangle)
Computes a point that can be used as the occludee position to the visibility functions from an rectangle.
|
static Object |
computeOccludeePointFromRectangle(Rectangle rectangle,
Ellipsoid ellipsoid)
Computes a point that can be used as the occludee position to the visibility functions from an rectangle.
|
Number |
computeVisibility(BoundingSphere occludeeBS)
Determine to what extent an occludee is visible (not visible, partially visible, or fully visible).
|
static Occluder |
fromBoundingSphere(BoundingSphere occluderBoundingSphere,
Cartesian3 cameraPosition)
Creates an occluder from a bounding sphere and the camera position.
|
static Occluder |
fromBoundingSphere(BoundingSphere occluderBoundingSphere,
Cartesian3 cameraPosition,
Occluder result)
Creates an occluder from a bounding sphere and the camera position.
|
boolean |
isBoundingSphereVisible(BoundingSphere occludee)
Determines whether or not a sphere, the occludee, is hidden from view by the occluder.
|
boolean |
isPointVisible(Cartesian3 occludee)
etermines whether or not a point, the occludee, is hidden from view by the occluder.
|
@JsProperty public Cartesian3 cameraPosition
@JsProperty public Cartesian3 position
@JsProperty public double radius
@JsConstructor public Occluder(BoundingSphere occluderBoundingSphere, Cartesian3 cameraPosition)
Example:
// Construct an occluder one unit away from the origin with a radius of one.
Cartesian3 cameraPosition = Cartesian3.ZERO();
BoundingSphere occluderBoundingSphere = new BoundingSphere(new Cartesian3(0, 0, -1), 1);
Occluder occluder = new Occluder(occluderBoundingSphere, cameraPosition);
occluderBoundingSphere
- The bounding sphere surrounding the occluder.cameraPosition
- The coordinate of the viewer/camera.@JsMethod public static Object computeOccludeePoint(BoundingSphere occluderBoundingSphere, Cartesian3 occludeePosition, Cartesian3[] positions)
Cartesian3 cameraPosition = new Cartesian3(0, 0, 0);
BoundingSphere occluderBoundingSphere = new BoundingSphere(new Cartesian3(0, 0, -8), 2);
Occluder occluder = new Occluder(occluderBoundingSphere, cameraPosition);
Cartesian3[] positions = {new Cartesian3(-0.25, 0, -5.3), new Cartesian3(0.25, 0, -5.3)};
BoundingSphere tileOccluderSphere = BoundingSphere.fromPoints(positions);
Cartesian3 occludeePosition = tileOccluderSphere.center;
Object occludeePt = Occluder.computeOccludeePoint(occluderBoundingSphere, occludeePosition, positions);
occluderBoundingSphere
- The bounding sphere surrounding the occluder.occludeePosition
- List of altitude points on the horizon near the surface of the occluder.positions
- An object containing two attributes: occludeePoint and valid which is a boolean value.@JsMethod public static Object computeOccludeePointFromRectangle(Rectangle rectangle)
rectangle
- The rectangle used to create a bounding sphere.@JsMethod public static Object computeOccludeePointFromRectangle(Rectangle rectangle, Ellipsoid ellipsoid)
rectangle
- The rectangle used to create a bounding sphere.ellipsoid
- The ellipsoid used to determine positions of the rectangle. Default: Ellipsoid.WGS84()
@JsMethod public static Occluder fromBoundingSphere(BoundingSphere occluderBoundingSphere, Cartesian3 cameraPosition)
occluderBoundingSphere
- The bounding sphere surrounding the occluder.cameraPosition
- The coordinate of the viewer/camera.@JsMethod public static Occluder fromBoundingSphere(BoundingSphere occluderBoundingSphere, Cartesian3 cameraPosition, Occluder result)
occluderBoundingSphere
- The bounding sphere surrounding the occluder.cameraPosition
- The coordinate of the viewer/camera.result
- The object onto which to store the result.@JsMethod public Number computeVisibility(BoundingSphere occludeeBS)
Example:
BoundingSphere sphere1 = new BoundingSphere(new Cartesian3(0, 0, -1.5), 0.5);
BoundingSphere sphere2 = new BoundingSphere(new Cartesian3(0, 0, -2.5), 0.5);
Cartesian3 cameraPosition = new Cartesian3(0, 0, 0);
Occluder occluder = new Occluder(sphere1, cameraPosition);
occluder.computeVisibility(sphere2); //returns Visibility.NONE
occludeeBS
- The bounding sphere of the occludee.Visibility.NONE()
if the occludee is not visible, Visibility.PARTIAL()
if the
occludee is partially visible, or Visibility.FULL()
if the occludee is fully visible.@JsMethod public boolean isBoundingSphereVisible(BoundingSphere occludee)
Example:
Cartesian3 cameraPosition = new Cesium.Cartesian3(0, 0, 0);
BoundingSphere littleSphere = new BoundingSphere(new Cartesian3(0, 0, -1), 0.25);
Occluder occluder = new Occluder(littleSphere, cameraPosition);
BoundingSphere bigSphere = new BoundingSphere(new Cartesian3(0, 0, -3), 1);
occluder.isBoundingSphereVisible(bigSphere); //returns true
occludee
- The bounding sphere surrounding the occludee object.computeVisibility(BoundingSphere)
@JsMethod public boolean isPointVisible(Cartesian3 occludee)
Example:
Cartesian3 cameraPosition = new Cartesian3(0, 0, 0);
BoundingSphere littleSphere = new BoundingSphere(new Cartesian3(0, 0, -1), 0.25);
Occluder occluder = new Occluder(littleSphere, cameraPosition);
Cartesian3 point = new Cartesian3(0, 0, -3);
occluder.isPointVisible(point); //returns true
occludee
- The point surrounding the occludee object.computeVisibility(BoundingSphere)
Copyright © 2019. All rights reserved.