VertexFormat

顶点格式定义组成顶点的属性。可以向aGeometry提供VertexFormat,以请求计算某些属性,例如,仅位置、位置和正常值等。
new VertexFormat(options)
Parameters:
options (Object) 具有与代码示例中所示的VertexFormat属性对应的布尔属性的对象。
Example
// Create a vertex format with position and 2D texture coordinate attributes.
var format = new bmgl.VertexFormat({
  position : true,
  st : true
});
See:

Members

(static, constant) ALL : VertexFormat

一种不可变的顶点格式,具有众所周知的属性:位置、法向、st、切线和位范围。
See:

(static, constant) DEFAULT : VertexFormat

具有位置、法向和st属性的不可变顶点格式。这与大多数外观和材质都兼容;但是通常不需要Normal和ST属性。如果事先知道这一点,则应使用另一个VertexFormat
See:

(static) packedLength : Number

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

(static, constant) POSITION_AND_COLOR : VertexFormat

具有位置和颜色属性的不可变顶点格式。
See:

(static, constant) POSITION_AND_NORMAL : VertexFormat

具有位置和法向属性的不可变顶点格式。这与PerInstanceColorAppearance等每个实例的颜色外观兼容。
See:

(static, constant) POSITION_AND_ST : VertexFormat

具有位置和st属性的不可变顶点格式。这与EllipsoidSurfaceAppearance兼容。
See:

(static, constant) POSITION_NORMAL_AND_ST : VertexFormat

具有位置、法向和st属性的不可变顶点格式。当MaterialAppearance#materialSupportTEXTURED时,这与MaterialAppearance兼容。
See:

(static, constant) POSITION_ONLY : VertexFormat

只有位置属性的不可变顶点格式。
See:

bitangent : Boolean

true时,顶点有一个位范围属性(标准化),用于切线空间效果,如凹凸贴图。

32位浮点。每个属性3个组件。

Default Value: false

color : Boolean

true时,顶点具有RGB颜色属性。

8位无符号字节。每个属性3个组件。

Default Value: false

normal : Boolean

true时,顶点有一个正常属性(标准化),通常用于照明。

32位浮点。每个属性3个组件。

Default Value: false

position : Boolean

true时,顶点具有3D位置属性。

64位浮点(用于精度)。每个属性3个组件。

Default Value: false

st : Boolean

true时,顶点具有二维纹理坐标属性。

32位浮点。每个属性2个组件

Default Value: false

tangent : Boolean

true时,顶点有一个切线属性(标准化),用于切线空间效果,如凹凸贴图。

32位浮点。每个属性3个组件。

Default Value: false

Methods

(static) clone(vertexFormat, result) → {VertexFormat}
复制VertexFormat实例。
Parameters:
vertexFormat (VertexFormat) 要复制的顶点格式。
result (VertexFormat) 存储结果的对象。
(static) pack(value, array, startingIndex) → {Array.<Number>}
将提供的实例存储到提供的数组中。
Parameters:
value (VertexFormat) 要打包的值。
array (Array.<Number>) 要打包的数组。
startingIndex (Number) (default 0) 数组中开始打包元素的索引。
(static) unpack(array, startingIndex, result) → {VertexFormat}
从压缩数组中检索实例。
Parameters:
array (Array.<Number>) 压缩数组。
startingIndex (Number) (default 0) 要解包的元素的起始索引。
result (VertexFormat) 存储结果的对象。