TriMesh
概述
TriMesh 是 Aspose.3D FOSS 中用于 .NET 的一个类。继承自:Entity、INamedObject、IEnumerable<Vertex>,以及另外 1 个。
一个 TriMesh 包含可直接被 GPU 使用的原始数据。
此类提供了 40 个用于在 .NET 程序中处理 TriMesh 对象的方法。可用的方法包括:A3DObject、AddTriangle、BeginVertex、CopyFrom、EndVertex、Entity、FindProperty、FromMesh、FromRawData、GetBoundingBox、GetEntityRendererKey、GetEnumerator,以及另外 21 个方法。所有公共成员在安装了 Aspose.3D FOSS for .NET 包后,可供任何 .NET 应用程序访问。属性:Capacity、Excluded、IndicesCount、Name、ParentNode、ParentNodes,以及另外 6 项。
属性
| 名称 | 类型 | 访问 | 描述 |
|---|---|---|---|
VertexDeclaration | VertexDeclaration | 读取 | 获取顶点声明。 |
VerticesCount | int | 读取 | 获取顶点计数。 |
IndicesCount | int | 读取 | 获取索引计数。 |
UnmergedVerticesCount | int | 读取 | 获取未合并的顶点计数。 |
Capacity | int | 读取 | 获取容量。 |
VerticesSizeInBytes | int | 读取 | 获取顶点大小(字节)。 |
Excluded | bool | 读写 | 获取或设置在导出期间是否排除此实体。 |
ParentNodes | List<Node> | 读取 | 获取所有父节点,一个实体可以附加到多个父节点以实现几何实例化 |
ParentNode | Node | 读写 | 获取或设置第一个父节点;如果设置第一个父节点,则此实体将从其他父节点分离. |
Scene | Scene | 读取 | 获取此对象所属的场景 |
Name | string | 读写 | 获取或设置名称。 |
Properties | PropertyCollection | 读取 | 获取所有属性的集合。 |
方法
| 签名 | 描述 |
|---|---|
TriMesh(name: string, declaration: VertexDeclaration) | 在此 TriMesh 实例上调用 TriMesh(name, declaration)。 |
FromMesh(declaration: VertexDeclaration, mesh: Mesh) | 在此 TriMesh 实例上调用 FromMesh(declaration, mesh)。 |
CopyFrom(input: TriMesh, vd: VertexDeclaration) | 在此 TriMesh 实例上调用 CopyFrom(input, vd)。 |
FromMesh(mesh: Mesh, useFloat: bool) | 在此 TriMesh 实例上调用 FromMesh(mesh, useFloat)。 |
BeginVertex() | 在此 TriMesh 实例上调用 BeginVertex。 |
EndVertex() | 在此 TriMesh 实例上调用 EndVertex。 |
WriteVerticesTo(stream: Stream) | 在此 TriMesh 实例上调用 WriteVerticesTo(stream)。 |
Write16bIndicesTo(stream: Stream) | 在此 TriMesh 实例上调用 Write16bIndicesTo(stream)。 |
Write32bIndicesTo(stream: Stream) | 在此 TriMesh 实例上调用 Write32bIndicesTo(stream)。 |
VerticesToArray() | 在此 TriMesh 实例上调用 VerticesToArray。 |
IndicesToArray(result: ushort[]) | 在此 TriMesh 实例上调用 IndicesToArray(result)。 |
IndicesToArray(result: int[]) | 在此 TriMesh 实例上调用 IndicesToArray(result)。 |
ToString() | 在此 TriMesh 实例上调用 ToString。 |
FromRawData(vd: VertexDeclaration, vertices: byte[], indices: int[], generateVertexMapping: bool) | 在此 TriMesh 实例上调用 FromRawData(vd, vertices, indices, generateVertexMapping)。 |
LoadVerticesFromBytes(verticesInBytes: byte[]) | 在此 TriMesh 实例上调用 LoadVerticesFromBytes(verticesInBytes)。 |
AddTriangle(a: int, b: int, c: int) | 在此 TriMesh 实例上调用 AddTriangle(a, b, c)。 |
GetEnumerator() | 在此 TriMesh 实例上调用 GetEnumerator。 |
ReadVector4(idx: int, field: VertexField) | 在此 TriMesh 实例上调用 ReadVector4(idx, field)。 |
ReadFVector4(idx: int, field: VertexField) | 在此 TriMesh 实例上调用 ReadFVector4(idx, field)。 |
ReadVector3(idx: int, field: VertexField) | 在此 TriMesh 实例上调用 ReadVector3(idx, field)。 |
ReadFVector3(idx: int, field: VertexField) | 在此 TriMesh 实例上调用 ReadFVector3(idx, field)。 |
ReadVector2(idx: int, field: VertexField) | 在此 TriMesh 实例上调用 ReadVector2(idx, field)。 |
ReadFVector2(idx: int, field: VertexField) | 在此 TriMesh 实例上调用 ReadFVector2(idx, field)。 |
ReadDouble(idx: int, field: VertexField) | 在此 TriMesh 实例上调用 ReadDouble(idx, field)。 |
ReadFloat(idx: int, field: VertexField) | 在此 TriMesh 实例上调用 ReadFloat(idx, field)。 |
TriMesh(name: string) | 初始化一个实例。 |
FromMesh(mesh: Mesh) | 根据给定的网格对象创建一个 TriMesh,并自动生成顶点布局。 |
VerticesToTypedArray() | 将顶点数据转换为类型化数组 |
Entity(name: string) | 初始化 Entity 类的一个新实例。 |
GetBoundingBox() | 获取当前实体在其对象空间坐标系中的包围盒。 |
GetEntityRendererKey() | 获取在渲染器中注册的实体渲染器的键 |
SceneObject(name: string) | 使用默认名称初始化一个 SceneObject |
SceneObject() | 初始化一个 SceneObject。 |
A3DObject() | 初始化 A3DObject 类的一个未命名新实例。 |
A3DObject(name: string) | 初始化 A3DObject 类的新实例。 |
RemoveProperty(property: Property) | 移除动态属性。 |
RemoveProperty(property: string) | 删除指定名称标识的属性 |
GetProperty(property: string) | 获取指定属性的值 |
SetProperty(property: string, value: object?) | 设置指定属性的值 |
FindProperty(propertyName: string) | 查找属性。 |