Class MeshData
This class provides methods that can be used to construct a mesh for a grid, and is used in mesh builders.
[Serializable]
public class MeshData : ScriptableObject
- Inheritance
-
MeshData
- Derived
- Inherited Members
-
Object.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T)Object.Instantiate<T>(T, Vector3, Quaternion)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.nameObject.hideFlags
Remarks
Some common cases are provided:
- UniformGridMeshData for grids where all cells are identical such as rect and hex grids.
- PeriodicGridMeshData for grids where patches of the grid repeat periodically, such as triangular grids.
- MeshStripMeshData for grids that require automatic division of cells along one dimension to look good, such as polar grids.
implement
Not all methods need to be implemented for the data to be useful.
implement
The returned lists must be consistent.
- The number of vertices must match the number of UVs and normals.
- The order of the UVs, normals and vertex colors must match the order of the vertices so that the nth UV and normal corresponds to the nth vertex.
- The triangle indices must correspond to the order of the vertices, and so cannot exceed or equal the vertex count, and must be positive.
- Normals should correspond to the triangle winding.
Methods
- GetNormals(IExplicitShape<GridPoint2>, GridMap<GridPoint2>, bool)
Gets the normals for the given shape.
- GetNormals(IExplicitShape<GridPoint3>, GridMap<GridPoint3>, bool)
Gets the normals for the given shape.
- GetNormals(IExplicitShape<int>, GridMap<int>, bool)
Gets the normals for the given shape.
- GetTriangles(IExplicitShape<GridPoint2>, bool, bool)
Gets a list of triangle indices for the given shape.
- GetTriangles(IExplicitShape<GridPoint3>, bool, bool)
Gets a list of triangle indices for the given shape.
- GetTriangles(IExplicitShape<int>, bool, bool)
Gets a list of triangle indices for the given shape.
- GetUVs(IExplicitShape<GridPoint2>)
Gets the UVs for the given shape.
- GetUVs(IExplicitShape<GridPoint3>)
Gets the UVs for the given shape.
- GetUVs(IExplicitShape<int>)
Gets the UVs for the given shape.
- GetVertices(IExplicitShape<GridPoint2>, GridMap<GridPoint2>)
Gets a list of vertices of a mesh for the given shape.
- GetVertices(IExplicitShape<GridPoint3>, GridMap<GridPoint3>)
Gets a list of vertices of a mesh for the given shape.
- GetVertices(IExplicitShape<int>, GridMap<int>)
Gets a list of vertices of a mesh for the given shape.