Class: Plane
平面几何体
代码示例:
const plane - new Plane(renderer);
const plane = new Mesh(renderer, { geometry: planeGeometry, program });
scene.add(plane);
Hierarchy
-
↳
Plane
Table of contents
Constructors
Properties
Accessors
Methods
- addAttribute
- getAttribute
- setAttributeData
- updateAttribute
- removeAttribute
- setIndex
- setVertices
- setNormals
- setUVs
- setColors
- setDrawRange
- setInstancedCount
- createVAO
- bindAttributes
- computeBoundingBox
- computeBoundingSphere
- draw
- copy
- clone
- destroy
Constructors
constructor
• new Plane(renderer
, «destructured»?
): Plane
Parameters
Name | Type | Description |
---|---|---|
renderer | Renderer | 渲染器 |
«destructured» | Partial <PlaneOptions > | - |
Returns
Overrides
Defined in
Properties
renderer
• renderer: Renderer
Inherited from
Defined in
drawRange
• drawRange: any
Inherited from
Defined in
instancedCount
• instancedCount: number
Inherited from
Defined in
isInstanced
• isInstanced: boolean
Inherited from
Defined in
drawMode
• drawMode: number
Inherited from
Defined in
Accessors
gl
• get
gl(): WebGLRenderingContext
| WebGL2RenderingContext
获取 webgl
实例
Returns
WebGLRenderingContext
| WebGL2RenderingContext
Inherited from
Geometry.gl
Defined in
rendererState
• get
rendererState(): State
获取渲染状态
Returns
Inherited from
Geometry.rendererState
Defined in
id
• get
id(): string
获取当前几何体数据的唯一标识
Returns
string
Inherited from
Geometry.id
Defined in
attributes
• get
attributes(): Map
<string
, BufferAttribute
>
获取全部的属性信息
Returns
Map
<string
, BufferAttribute
>
Inherited from
Geometry.attributes
Defined in
attributesData
• get
attributesData(): Attributes
获取属性数据
Returns
Inherited from
Geometry.attributesData
Defined in
index
• get
index(): undefined
| BufferAttribute
获取顶点索引属性
Returns
undefined
| BufferAttribute
Inherited from
Geometry.index
Defined in
bounds
• get
bounds(): any
获取当前几何体的包围盒
Returns
any
Inherited from
Geometry.bounds
Defined in
• set
bounds(bounds
): void
手动设置包围盒,一般我们只需要内部计算
Parameters
Name | Type |
---|---|
bounds | any |
Returns
void
Inherited from
Geometry.bounds
Defined in
Methods
addAttribute
▸ addAttribute(name
, attribute
): void
添加对应的属性信息(顶点数据)
Parameters
Name | Type |
---|---|
name | string |
attribute | BufferAttribute |
Returns
void
Inherited from
Defined in
getAttribute
▸ getAttribute(name
): undefined
| BufferAttribute
获取对应的属性信息(顶点数据)
Parameters
Name | Type |
---|---|
name | any |
Returns
undefined
| BufferAttribute
Inherited from
Defined in
setAttributeData
▸ setAttributeData(name
, data
): void
设置对应的属性数据
Parameters
Name | Type |
---|---|
name | any |
data | any |
Returns
void
Inherited from
Defined in
updateAttribute
▸ updateAttribute(attribute
): void
更新顶点属性数据
Parameters
Name | Type |
---|---|
attribute | any |
Returns
void
Inherited from
Defined in
removeAttribute
▸ removeAttribute(attribute
): void
移除属性信息
Parameters
Name | Type |
---|---|
attribute | any |
Returns
void
Inherited from
Defined in
setIndex
▸ setIndex(index
): void
设置顶点索引数据
Parameters
Name | Type |
---|---|
index | any |
Returns
void
Inherited from
Defined in
setVertices
▸ setVertices(data
): void
设置顶点数据
Parameters
Name | Type |
---|---|
data | any |
Returns
void
Inherited from
Defined in
setNormals
▸ setNormals(data
): void
设置顶点法向量数据
Parameters
Name | Type |
---|---|
data | any |
Returns
void
Inherited from
Defined in
setUVs
▸ setUVs(data
): void
设置纹理 UV 数据
Parameters
Name | Type |
---|---|
data | any |
Returns
void
Inherited from
Defined in
setColors
▸ setColors(colors
): void
设置顶点颜色数据
Parameters
Name | Type |
---|---|
colors | (Float32Array | Float64Array | number [] | Vector3 | Vector4 )[] |
Returns
void