new BoxGeometry()
Used to create three-dimensional cubic geometric models.
| Name | Type | Default | Description |
|---|---|---|---|
options.minimum |
Cartesian3 |
The minimum x, y, and z coordinates of the box. |
|
options.maximum |
Cartesian3 |
The maximum x, y, and z coordinates of the box. |
|
options.vertexFormat |
VertexFormat | VertexFormat.DEFAULT |
optional
The vertex attributes to be calculated. |
- 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
-
The number of elements used to package objects into an array.
Methods
-
static createGeometry(boxGeometry){Geometry|undefined}
-
Calculate the geometric representation of a bounding box, including its vertices, indices, and bounding balls.
Name Type Description boxGeometryBoxGeometry The description of the box.
Returns:
Type Description Geometry | undefined Compute vertices and indexes. -
static fromAxisAlignedBoundingBox(AxisAlignedBoundingBox){BoxGeometry}
-
Create a cube based on the dimensions of AxisAlignedSoundBox.
Name Type Description AxisAlignedBoundingBoxAxisAlignedBoundingBox Description of AxisAlignedSoundingBox.
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}
-
Create a cube with the origin as the center given the size.
Name Type Default Description options.dimensionsCartesian3 The width, depth, and height of the boxes stored separately in the x, y, and z coordinates of Cartesian3.
options.vertexFormatVertexFormat VertexFormat.DEFAULT optional The vertex attributes to be calculated.
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>}
-
Store the provided instance in the provided array.
Name Type Default Description valueBoxGeometry The value to be packaged.
arrayArray.<Number> The array to be packaged.
startingIndexNumber 0 optional Start packaging the array index of elements.
Returns:
Type Description Array.<Number> The loaded array. -
static unpack(array, startingIndex, result){BoxGeometry}
-
Retrieve instances from the packaged array.
Name Type Default Description arrayArray.<Number> Packaged array.
startingIndexNumber 0 optional The starting index of the element to be unpacked.
resultBoxGeometry optional The object that stores the results.
Returns:
Type Description BoxGeometry The modified result parameters or a new BoxGeometry instance (if not provided).