Struct DFMesh
Stores decomposed mesh data. A mesh is made up of one or more submeshes (DFSubMesh). Each submesh has a unique texture. All faces sharing a texture have been grouped into the appropriate submesh. Each submesh contains one or more planes (DFPlane). A plane is a collection of points (DFPoint) in a fan radiating from point 0. Planes with 3 points can be written as triangles to your 3D engine, however planes with 4 or more points must be written based on your needs. For example, if you wanted to write a triangle list then write the first triangle from the first three points (indices 0, 1, 2), then increment the second two point indices (0, 2, 3, then 0, 3, 4, and so on) until all points have been read. This structure has been chosen as a half-way point between native Daggerfall formats and modern 3D engines. How the data is used will depend on the engine chosen for visualisation.
Namespace: DaggerfallConnect
Assembly: Assembly-CSharp.dll
Syntax
[Serializable]
public struct DFMesh
Fields
| Improve this Doc View SourceCentre
Centre of mesh vertex cloud.
Declaration
public DFMesh.DFPoint Centre
Field Value
Type | Description |
---|---|
DFMesh.DFPoint |
ObjectId
Object ID of the mesh. This ID is referenced by higher level structures such as blocks.
Declaration
public int ObjectId
Field Value
Type | Description |
---|---|
Int32 |
Radius
Radius of this mesh from origin to farthest point.
Declaration
public float Radius
Field Value
Type | Description |
---|---|
Single |
Size
Size of this mesh in each dimension from origin.
Declaration
public DFMesh.DFPoint Size
Field Value
Type | Description |
---|---|
DFMesh.DFPoint |
SubMeshes
Submesh array. Each submesh contains DFPlane structures grouped by texture.
Declaration
public DFMesh.DFSubMesh[] SubMeshes
Field Value
Type | Description |
---|---|
DFMesh.DFSubMesh[] |
TotalTriangles
Total number of triangles across all subeshes. Helpful for allocating index buffers.
Declaration
public int TotalTriangles
Field Value
Type | Description |
---|---|
Int32 |
TotalVertices
Total number of vertices across all submeshes. Helpful for allocating vertex buffers.
Declaration
public int TotalVertices
Field Value
Type | Description |
---|---|
Int32 |