頂點(diǎn)格式定義組成頂點(diǎn)的屬性。可以向a
new VertexFormat(options)
Geometry
提供VertexFormat,以請(qǐng)求計(jì)算某些屬性,例如,僅位置、位置和正常值等。
Parameters:
options
(Object)
具有與代碼示例中所示的VertexFormat屬性對(duì)應(yīng)的布爾屬性的對(duì)象。
Example
// Create a vertex format with position and 2D texture coordinate attributes.
var format = new bmgl.VertexFormat({
position : true,
st : true
});
- Geometry#attributes
- Packable
See:
Members
(static, constant) ALL : VertexFormat
一種不可變的頂點(diǎn)格式,具有眾所周知的屬性:位置、法向、st、切線(xiàn)和位范圍。
See:
(static, constant) DEFAULT : VertexFormat
具有位置、法向和st屬性的不可變頂點(diǎn)格式。這與大多數(shù)外觀和材質(zhì)都兼容;但是通常不需要Normal和ST屬性。如果事先知道這一點(diǎn),則應(yīng)使用另一個(gè)
VertexFormat
。
(static) packedLength : Number
用于將對(duì)象打包到數(shù)組中的元素?cái)?shù)。
(static, constant) POSITION_AND_COLOR : VertexFormat
具有位置和顏色屬性的不可變頂點(diǎn)格式。
(static, constant) POSITION_AND_NORMAL : VertexFormat
具有位置和法向?qū)傩缘牟豢勺冺旤c(diǎn)格式。這與
PerInstanceColorAppearance
等每個(gè)實(shí)例的顏色外觀兼容。
(static, constant) POSITION_AND_ST : VertexFormat
具有位置和st屬性的不可變頂點(diǎn)格式。這與
EllipsoidSurfaceAppearance
兼容。
(static, constant) POSITION_NORMAL_AND_ST : VertexFormat
具有位置、法向和st屬性的不可變頂點(diǎn)格式。當(dāng)
MaterialAppearance#materialSupport
為TEXTURED
時(shí),這與MaterialAppearance
兼容。
(static, constant) POSITION_ONLY : VertexFormat
只有位置屬性的不可變頂點(diǎn)格式。
bitangent : Boolean
當(dāng)
true
時(shí),頂點(diǎn)有一個(gè)位范圍屬性(標(biāo)準(zhǔn)化),用于切線(xiàn)空間效果,如凹凸貼圖。32位浮點(diǎn)。每個(gè)屬性3個(gè)組件。
-
Default Value:
false
color : Boolean
當(dāng)
true
時(shí),頂點(diǎn)具有RGB顏色屬性。8位無(wú)符號(hào)字節(jié)。每個(gè)屬性3個(gè)組件。
-
Default Value:
false
normal : Boolean
當(dāng)
true
時(shí),頂點(diǎn)有一個(gè)正常屬性(標(biāo)準(zhǔn)化),通常用于照明。32位浮點(diǎn)。每個(gè)屬性3個(gè)組件。
-
Default Value:
false
position : Boolean
當(dāng)
true
時(shí),頂點(diǎn)具有3D位置屬性。64位浮點(diǎn)(用于精度)。每個(gè)屬性3個(gè)組件。
-
Default Value:
false
st : Boolean
當(dāng)
true
時(shí),頂點(diǎn)具有二維紋理坐標(biāo)屬性。32位浮點(diǎn)。每個(gè)屬性2個(gè)組件
-
Default Value:
false
tangent : Boolean
當(dāng)
true
時(shí),頂點(diǎn)有一個(gè)切線(xiàn)屬性(標(biāo)準(zhǔn)化),用于切線(xiàn)空間效果,如凹凸貼圖。32位浮點(diǎn)。每個(gè)屬性3個(gè)組件。
-
Default Value:
false
Methods
(static) clone(vertexFormat, result) → {VertexFormat}
復(fù)制VertexFormat實(shí)例。
Parameters:
將提供的實(shí)例存儲(chǔ)到提供的數(shù)組中。
Parameters:
array
(Array.<Number>)
要打包的數(shù)組。
startingIndex
(Number)
(default 0
)
數(shù)組中開(kāi)始打包元素的索引。
從壓縮數(shù)組中檢索實(shí)例。
Parameters:
array
(Array.<Number>)
壓縮數(shù)組。
startingIndex
(Number)
(default 0
)
要解包的元素的起始索引。