Geometries 的内容管道功能.
See:
Methods
static Cesium.GeometryPipeline.compressVertices(geometry) → Geometry
压缩和包装几何正常属性值以保存内存.
| Name | Type | Description |
|---|---|---|
geometry |
Geometry | 几何来修改. |
Returns:
修改后的 NT 0 几何 NT 1 参数,其常态压缩并打包.
Example:
geometry = Cesium.GeometryPipeline.compressVertices(geometry);
static Cesium.GeometryPipeline.computeNormal(geometry) → Geometry
计算包含 NT 0 TRIANGLES NT 1 的几何学的每个顶点的正常值 以平均
所有三角形事件 顶点。 结果是新增了 NT 0 正态 NT 1 属性加入到几何中.
这假设逆时针风速.
| Name | Type | Description |
|---|---|---|
geometry |
Geometry | 几何来修改. |
Returns:
The modified
geometry argument with the computed normal attribute.
Throws:
-
DeveloperError : geometry.indices length must be greater than 0 and be a multiple of 3.
-
DeveloperError : geometry.primitiveType must be
PrimitiveType.TRIANGLES.
Example:
Cesium.GeometryPipeline.computeNormal(geometry);
static Cesium.GeometryPipeline.computeTangentAndBitangent(geometry) → Geometry
计算含有 NT 0 TRIANGLES NT 1 的几何体的每个顶点正切值和比特剂.
结果为新增 NT 0 tangent NT 1 和 NT 2 bitangent NT 3 属性加入几何.
这假设逆时针风速.
Based on Computing Tangent Space Basis Vectors for an Arbitrary Mesh by Eric Lengyel.
| Name | Type | Description |
|---|---|---|
geometry |
Geometry | 几何来修改. |
Returns:
与计算出的
tangent 和 bitangent =====================.
Throws:
-
DeveloperError : geometry.indices length must be greater than 0 and be a multiple of 3.
-
DeveloperError : geometry.primitiveType must be
PrimitiveType.TRIANGLES.
Example:
Cesium.GeometryPipeline.computeTangentAndBiTangent(geometry);
Creates an object that maps attribute names to unique locations (indices)
用于匹配顶点属性和阴影程序.
| Name | Type | Description |
|---|---|---|
geometry |
Geometry | 未修改的几何来创建对象. |
Returns:
具有属性名称/索引对的对象.
Example:
const attributeLocations = Cesium.GeometryPipeline.createAttributeLocations(geometry);
// Example output
// {
// 'position' : 0,
// 'normal' : 1
// }
static Cesium.GeometryPipeline.createLineSegmentsForVectors(geometry, attributeName, length) → Geometry
Creates a new
Geometry with LINES representing the provided
用于提供几何属性的属性( 属性Name )。 这是用来
可视化向量属性,如正常,正切,和比坦基.
| Name | Type | Default | Description |
|---|---|---|---|
geometry |
Geometry | 带有属性的 NT#0 Geometry NT#1 例. | |
attributeName |
string |
'normal'
|
optional The name of the attribute. |
length |
number |
10000.0
|
optional The length of each line segment in meters. This can be negative to point the vector in the opposite direction. |
Returns:
A new
Geometry instance with line segments for the vector.
Throws:
-
DeveloperError : geometry.attributes must have an attribute with the same name as the attributeName parameter.
Example:
const geometry = Cesium.GeometryPipeline.createLineSegmentsForVectors(instance.geometry, 'bitangent', 100000.0);
static Cesium.GeometryPipeline.encodeAttribute(geometry, attributeName, attributeHighName, attributeLowName) → Geometry
将浮点几何属性值编码为两个单独的属性来改进
rendering precision.
这通常用于创建高精度位置顶点属性.
| Name | Type | Description |
|---|---|---|
geometry |
Geometry | 几何来修改. |
attributeName |
string | 属性名. |
attributeHighName |
string | 编码高位的属性名称. |
attributeLowName |
string | 编码低位的属性名称. |
Returns:
修改后的 NT 0 几何 NT 1 参数,带有其编码属性.
Throws:
-
DeveloperError : geometry must have attribute matching the attributeName argument.
-
DeveloperError : The attribute componentDatatype must be ComponentDatatype.DOUBLE.
Example:
geometry = Cesium.GeometryPipeline.encodeAttribute(geometry, 'position3D', 'position3DHigh', 'position3DLow');
static Cesium.GeometryPipeline.fitToUnsignedShortIndices(geometry) → Array.<Geometry>
必要时将几何分割成多个几何,以确保
indices fit into unsigned shorts. This is used to meet the WebGL requirements
未签名的输入索引不支持时.
如果几何没有 NT 0 indices NT 1 ,此函数没有效果.
| Name | Type | Description |
|---|---|---|
geometry |
Geometry | 被分割成多个几何的几何. |
Returns:
一组几何图案,每个图案的索引都符合未签名的短文.
Throws:
-
DeveloperError : geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS
-
DeveloperError : All geometry attribute lists must have the same number of attributes.
Example:
const geometries = Cesium.GeometryPipeline.fitToUnsignedShortIndices(geometry);
static Cesium.GeometryPipeline.projectTo2D(geometry, attributeName, attributeName3D, attributeName2D, projection) → Geometry
投射一个几何的 3D NT 0 位置 NT 1 属性到2D,取代 NT 2 位置 NT 3
attribute with separate
position3D and position2D attributes.
If the geometry does not have a position, this function has no effect.
| Name | Type | Default | Description |
|---|---|---|---|
geometry |
Geometry | 几何来修改. | |
attributeName |
string | 属性名. | |
attributeName3D |
string | 3D中的属性名称. | |
attributeName2D |
string | 2D中的属性名称. | |
projection |
object |
new GeographicProjection()
|
optional The projection to use. |
Returns:
The modified
geometry argument with position3D and position2D attributes.
Throws:
-
DeveloperError : geometry must have attribute matching the attributeName argument.
-
DeveloperError : The attribute componentDatatype must be ComponentDatatype.DOUBLE.
-
DeveloperError : Could not project a point to 2D.
Example:
geometry = Cesium.GeometryPipeline.projectTo2D(geometry, 'position', 'position3D', 'position2D');
static Cesium.GeometryPipeline.reorderForPostVertexCache(geometry, cacheCapacity) → Geometry
重排一个几何图案的 NT 0 indices NT 1 ,以便从 NT 2 获得更好的性能
post vertex-shader cache by using the Tipsify algorithm. If the geometry
primitiveType
is not TRIANGLES or the geometry does not have an indices, this function has no effect.
| Name | Type | Default | Description |
|---|---|---|---|
geometry |
Geometry | 几何来修改. | |
cacheCapacity |
number |
24
|
optional 在 NT 0 的顶点缓存中可以持有的顶点数量. |
Returns:
修改后的 NT 0 几何 NT 1 参数,其索引重新排列,用于顶点后缓存.
Throws:
-
DeveloperError : cacheCapacity must be greater than two.
- GeometryPipeline.reorderForPreVertexCache
- Fast Triangle Reordering for Vertex Locality and Reduced Overdraw by Sander, Nehab, and Barczak
Example:
geometry = Cesium.GeometryPipeline.reorderForPostVertexCache(geometry);
See:
static Cesium.GeometryPipeline.reorderForPreVertexCache(geometry) → Geometry
重排一个几何属性和
indices ,以从 GPU 前置阴影缓存实现更好的性能.
| Name | Type | Description |
|---|---|---|
geometry |
Geometry | 几何来修改. |
Returns:
修改后的 NT 0 几何 NT 1 参数,其属性和索引重新排列为 NT 0 2 的前置阴影缓存.
Throws:
-
DeveloperError : Each attribute array in geometry.attributes must have the same number of attributes.
Example:
geometry = Cesium.GeometryPipeline.reorderForPreVertexCache(geometry);
See:
static Cesium.GeometryPipeline.toWireframe(geometry) → Geometry
将一个几何三角指数转换为线指数。 如果几何有
indices
和它的 NT+0 原始Type NT+1 为 NT+2 Triangles NT+3 , NT+4 Triangle STRIP NT+5 ,
TRINANGLE FAN ,改为 LINES ;否则,几何学不变.
这通常用于创建用于视觉调试的线框几何.
| Name | Type | Description |
|---|---|---|
geometry |
Geometry | 几何来修改. |
Returns:
修改后的 NT 0 几何 NT 1 参数,其三角形指数转换为线条.
Throws:
-
DeveloperError : geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.
Example:
geometry = Cesium.GeometryPipeline.toWireframe(geometry);
static Cesium.GeometryPipeline.transformToWorldCoordinates(instance) → GeometryInstance
-NT=0=- 世界坐标的几何实例。 此变化
the instance's
modelMatrix to Matrix4.IDENTITY and transforms the
如果属性存在,则遵循以下属性: NT 0 位置 NT 1 , NT 2 正常 NT 3 ,
tangent, and bitangent.
| Name | Type | Description |
|---|---|---|
instance |
GeometryInstance | 要修改的几何实例 . |
Returns:
修改后的 NT 0 instance NT 1 参数,其属性变为世界坐标.
Example:
Cesium.GeometryPipeline.transformToWorldCoordinates(instance);