BoxGeometry

new Cesium.BoxGeometry(options)

描述以原点为中心的立方体。
Name Type Description
options Object 对象,具有以下属性:
Name Type Default Description
minimum Cartesian3 盒子的最小x, y, z坐标。
maximum Cartesian3 盒子的最大x, y, z坐标。
vertexFormat VertexFormat VertexFormat.DEFAULT optional 要计算的顶点属性。
Example:
var box = new Cesium.BoxGeometry({
  vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
  maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0),
  minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0)
});
var geometry = Cesium.BoxGeometry.createGeometry(box);
Demo:
See:

Members

staticCesium.BoxGeometry.packedLength : Number

用于将对象包装成数组的元素数量。

Methods

staticCesium.BoxGeometry.createGeometry(boxGeometry)Geometry|undefined

计算盒子的几何表示,包括其顶点、索引和包围球。
Name Type Description
boxGeometry BoxGeometry 盒子的描述。
Returns:
计算的顶点和索引。

staticCesium.BoxGeometry.fromAxisAlignedBoundingBox(boundingBox)BoxGeometry

从AxisAlignedBoundingBox的尺寸创建一个立方体。
Name Type Description
boundingBox AxisAlignedBoundingBox AxisAlignedBoundingBox的描述。
Returns:
Example:
var aabb = Cesium.AxisAlignedBoundingBox.fromPoints(Cesium.Cartesian3.fromDegreesArray([
     -72.0, 40.0,
     -70.0, 35.0,
     -75.0, 30.0,
     -70.0, 30.0,
     -68.0, 40.0
]));
var box = Cesium.BoxGeometry.fromAxisAlignedBoundingBox(aabb);
See:

staticCesium.BoxGeometry.fromDimensions(options)BoxGeometry

创建一个以给定尺寸的原点为中心的立方体。
Name Type Description
options Object 对象,具有以下属性:
Name Type Default Description
dimensions Cartesian3 分别存储在Cartesian3的x、y和z坐标中的盒子的宽度、深度和高度。
vertexFormat VertexFormat VertexFormat.DEFAULT optional 要计算的顶点属性。
Returns:
Throws:
Example:
var box = Cesium.BoxGeometry.fromDimensions({
  vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
  dimensions : new Cesium.Cartesian3(500000.0, 500000.0, 500000.0)
});
var geometry = Cesium.BoxGeometry.createGeometry(box);
See:

staticCesium.BoxGeometry.pack(value, array, startingIndex)Array.<Number>

将提供的实例存储到提供的数组中。
Name Type Default Description
value BoxGeometry 要包装的值。
array Array.<Number> 要被包装到的数组。
startingIndex Number 0 optional 开始包装元素的数组索引。
Returns:
被包装到的数组。

staticCesium.BoxGeometry.unpack(array, startingIndex, result)BoxGeometry

从已包装的数组中检索实例。
Name Type Default Description
array Array.<Number> 包装的数组。
startingIndex Number 0 optional 要解包的元素的起始索引。
result BoxGeometry optional 存储结果的对象。
Returns:
修改后的结果参数或新的BoxGeometry实例(如果没有提供)。