Class: BoxGeometry

BoxGeometry

new BoxGeometry()

用于创建三维立方体几何模型。

Name Type Default Description
options.minimum Cartesian3

box的最小 x、y 和 z 坐标。

options.maximum Cartesian3

box的最大 x、y 和 z 坐标。

options.vertexFormat VertexFormat VertexFormat.DEFAULT 可选

要计算的顶点属性。

See:
Example
var box = new SuperMap3D.BoxGeometry({
  vertexFormat : SuperMap3D.VertexFormat.POSITION_ONLY,
  maximum : new SuperMap3D.Cartesian3(250000.0, 250000.0, 250000.0),
  minimum : new SuperMap3D.Cartesian3(-250000.0, -250000.0, -250000.0)
});
var geometry = SuperMap3D.BoxGeometry.createGeometry(box);

Members

static packedLengthNumber

用于将对象打包到数组中的元素数量。

Methods

static createGeometry(boxGeometry){Geometry|undefined}

计算框的几何表示,包括其顶点、索引和包围球。

Name Type Description
boxGeometry BoxGeometry

box的描述。

Returns:
Type Description
Geometry | undefined 计算的顶点和索引。

static fromAxisAlignedBoundingBox(AxisAlignedBoundingBox){BoxGeometry}

根据 AxisAlignedBoundingBox 的尺寸创建立方体。

Name Type Description
AxisAlignedBoundingBox AxisAlignedBoundingBox

AxisAlignedBoundingBox的描述。

See:
Returns:
Type Description
BoxGeometry
Example
var aabb = SuperMap3D.AxisAlignedBoundingBox.fromPoints(SuperMap3D.Cartesian3.fromDegreesArray([
     -72.0, 40.0,
     -70.0, 35.0,
     -75.0, 30.0,
     -70.0, 30.0,
     -68.0, 40.0
]));
var box = SuperMap3D.BoxGeometry.fromAxisAlignedBoundingBox(aabb);

static fromDimensions(){BoxGeometry}

在给定尺寸的情况下创建一个以原点为中心的立方体。

Name Type Default Description
options.dimensions Cartesian3

分别存储在 Cartesian3 的 x、y 和 z 坐标中的box的宽度、深度和高度。

options.vertexFormat VertexFormat VertexFormat.DEFAULT 可选

要计算的顶点属性。

See:
Throws:

All dimensions components must be greater than or equal to zero.

Type
DeveloperError
Returns:
Type Description
BoxGeometry
Example
var box = SuperMap3D.BoxGeometry.fromDimensions({
  vertexFormat : SuperMap3D.VertexFormat.POSITION_ONLY,
  dimensions : new SuperMap3D.Cartesian3(500000.0, 500000.0, 500000.0)
});
var geometry = SuperMap3D.BoxGeometry.createGeometry(box);

static pack(value, array, startingIndex){Array.<Number>}

将提供的实例存储到提供的数组中。

Name Type Default Description
value BoxGeometry

要打包的值。

array Array.<Number>

要打包的数组。

startingIndex Number 0 可选

开始打包元素的数组索引。

Returns:
Type Description
Array.<Number> 装入的数组。

static unpack(array, startingIndex, result){BoxGeometry}

从打包数组中检索实例。

Name Type Default Description
array Array.<Number>

打包的数组。

startingIndex Number 0 可选

要解包的元素的起始索引。

result BoxGeometry 可选

存储结果的对象。

Returns:
Type Description
BoxGeometry 修改后的结果参数或新的 BoxGeometry 实例(如果未提供)。