Class Info |
|---|
class SubMesh 子网格类,保存顶点数据和索引数据在缓存中的起始位置和数量、图元类型、材质等数据,是完成渲染任务的最小单元。 |
Qualifier and Type |
Method Name and Description |
|---|---|
void |
SetVertexBuffer(const VertexBuffer* vertexBuffer) 设置子网格绑定的顶点缓冲区。
注意:
该接口已废弃。 |
const VertexBuffer* |
GetVertexBuffer() const 获取子网格绑定的顶点缓冲区。
注意:
该接口已废弃。 |
void |
SetIndexBuffer(const IndexBuffer* indexBuffer) 设置子网格待绑定的索引缓冲区。
注意:
该接口已废弃。 |
const IndexBuffer* |
GetIndexBuffer() const 获取子网格绑定的索引缓冲区。
注意:
该接口已废弃。 |
void |
SetPrimitiveMode(PrimitiveMode mode) 设置子网格的图元拓扑类型。 |
GetPrimitiveMode() const 获取子网格的图元拓扑类型。 |
|
GetTriangleCount() const 读取索引缓冲区内索引数量,根据图元拓扑类型计算并获取三角形数量。 |
|
GetVertexCount() const 获取顶点缓冲区中的顶点总数。 |
|
void |
设置子网格的包围盒。 |
const AABB& |
GetAABB() const 获取子网格的包围盒。 |
bool |
Resume() 应用程序从后台切到前台时,完成子网格资源的重建。
注意:
该接口已废弃。 |
void |
Pause() 应用程序从前台切到后台时,完成子网格资源的销毁。
注意:
该接口已废弃。 |
const Mesh* |
GetMesh() const 获取当前网格模型。 |
void |
SetVertexCount(u32 vertexCount) 设置顶点缓冲区的顶点数量。 |
void |
SetAABB(const Vector3& max, const Vector3& min) 根据指定的最小点和最大点设置子网格的包围盒。 |
void |
SetVertexStart(u32 vertexStart) 设置子网格顶点在顶点缓冲区的起始位置。 |
GetVertexStart() const 获取子网格顶点在顶点缓冲区的起始位置。 |
|
void |
SetIndexCount(u32 indexCount) 设置索引缓冲区的索引数量。 |
GetIndexCount() const 获取索引缓冲区的索引数量。 |
|
void |
SetIndexStart(u32 indexStart) 设置子网格顶点索引在索引缓冲区的起始位置。 |
GetIndexStart() const 获取子网格顶点索引在索引缓冲区的起始位置。 |
|
void |
SetMaterialInstanceIndex(u32 materialInstanceIndex) 设置子网格对应材质实例的索引。 |
GetMaterialInstanceIndex() const 获取子网格对应材质实例的索引。 |
该接口已废弃。
Method |
|---|
void SetVertexBuffer(const VertexBuffer* vertexBuffer) 设置子网格绑定的顶点缓冲区。 |
Parameters
Name |
Description |
|---|---|
vertexBuffer |
指向待绑定顶点缓冲区的指针。 |
该接口已废弃。
Method |
|---|
const VertexBuffer* GetVertexBuffer() const 获取子网格绑定的顶点缓冲区。 |
Returns
Type |
Description |
|---|---|
const VertexBuffer* |
返回指向子网格绑定的顶点缓冲区的指针。 |
该接口已废弃。
Method |
|---|
void SetIndexBuffer(const IndexBuffer* indexBuffer) 设置子网格绑定的索引缓冲区。 |
Parameters
Name |
Description |
|---|---|
indexBuffer |
指向待绑定索引缓冲区的指针。 |
该接口已废弃。
Method |
|---|
const IndexBuffer* GetIndexBuffer() const 获取子网格绑定的索引缓冲区。 |
Returns
Type |
Description |
|---|---|
const IndexBuffer* |
返回指向子网格绑定的索引缓冲区的指针。 |
Method |
|---|
void SetPrimitiveMode(PrimitiveMode mode) 设置子网格的图元拓扑类型。 |
Parameters
Name |
Description |
|---|---|
mode |
PrimitiveMode类型枚举值。 |
Method |
|---|
PrimitiveMode GetPrimitiveMode() const 获取子网格的图元拓扑类型。 |
Returns
Type |
Description |
|---|---|
返回PrimitiveMode类型枚举值。 |
Method |
|---|
u32 GetTriangleCount() const 读取索引缓冲区内索引数量,根据图元拓扑类型计算并获取三角形数量。 |
Returns
Type |
Description |
|---|---|
获取三角形数量。 |
Method |
|---|
u32 GetVertexCount() const 获取顶点缓冲区中的顶点数量。 |
Returns
Type |
Description |
|---|---|
获取顶点缓冲区中的顶点数量。 |
Method |
|---|
void SetAABB(const AABB& aabb) 设置子网格的包围盒。 |
Parameters
Name |
Description |
|---|---|
aabb |
待设置的包围盒。 |
Method |
|---|
const AABB& GetAABB() const 获取子网格的包围盒。 |
Returns
Type |
Description |
|---|---|
const AABB& |
返回子网格的包围盒。 |
该接口已废弃。
Method |
|---|
bool Resume() 应用程序从后台切到前台时,完成子网格资源的重建。 |
Returns
Type |
Description |
|---|---|
bool |
|
Method |
|---|
const Mesh* GetMesh() const 获取当前网格模型。 |
Returns
Type |
Description |
|---|---|
const Mesh* |
返回指向当前网格模型的指针。 |
Method |
|---|
void SetVertexCount(u32 vertexCount) 设置顶点缓冲区的顶点数量。 |
Parameters
Name |
Description |
|---|---|
vertexCount |
顶点缓冲区的顶点数量。 |
Parameters
Name |
Description |
|---|---|
max |
在三维坐标系中指定的包围盒最大点位置。 |
min |
在三维坐标系中指定的包围盒最小点位置。 |
Method |
|---|
void SetVertexStart(u32 vertexStart) 设置子网格顶点在顶点缓冲区的起始位置。 |
Parameters
Name |
Description |
|---|---|
vertexStart |
子网格顶点在顶点缓冲区的起始位置。 |
Method |
|---|
u32 GetVertexStart() const 获取子网格顶点在顶点缓冲区的起始位置。 |
Returns
Type |
Description |
|---|---|
获取子网格顶点在顶点缓冲区的起始位置。 |
Method |
|---|
void SetIndexCount(u32 indexCount) 设置索引缓冲区的索引数量。 |
Parameters
Name |
Description |
|---|---|
indexCount |
索引缓冲区的索引数量。 |
Method |
|---|
u32 GetIndexCount() const 获取索引缓冲区中的索引数量。 |
Returns
Type |
Description |
|---|---|
获取索引缓冲区中的索引数量。 |
Method |
|---|
void SetIndexStart(u32 indexStart) 设置子网格顶点索引在索引缓冲区的起始位置。 |
Parameters
Name |
Description |
|---|---|
indexStart |
子网格顶点索引在索引缓冲区的起始位置。 |
Method |
|---|
u32 GetIndexStart() const 获取子网格顶点索引在索引缓冲区的起始位置。 |
Returns
Type |
Description |
|---|---|
获取子网格顶点索引在索引缓冲区的起始位置。 |
Method |
|---|
void SetMaterialInstanceIndex(u32 materialInstanceIndex) 设置子网格对应材质实例的索引。 |
Parameters
Name |
Description |
|---|---|
materialInstanceIndex |
子网格对应材质实例的索引。 |