Repository navigation
Mesh
Home | API by Category | Complete API Index | API Status
| Field | Value |
|---|---|
| Full name | Electron2D.Mesh |
| Namespace | Electron2D |
| Kind | class |
| Category | API Rendering |
Describes indexed two-dimensional surfaces consumed by retained canvas drawing.
public abstract class Electron2D.MeshSurfaces use typed copied arrays. Materials and textures are borrowed. Implementations provide the surface callbacks; geometry, naming and storage changes publish Resource.Changed after committing.
Inherits: Resource
Kind: constructor
protected Mesh()Initializes the reusable mesh resource contract.
Kind: method
public Electron2D.PlaceholderMesh CreatePlaceholder()Creates a caller-owned surface-free mesh retaining the current visibility bounds.
A new PlaceholderMesh with copied local bounds.
Kind: method
protected override System.Void Dispose(System.Boolean disposing)Kind: method
public Electron2D.Rect2 GetAABB()Returns the axis-aligned visibility bounds of this two-dimensional mesh.
Ordinary bounds include stored vertices from every topology, including unreferenced vertices. Packed server surfaces retain their explicitly authored visibility rectangles. Prepared custom surface snapshots are reused; live ArrayMesh positions are read without copied queries.
A finite local rectangle, empty without vertices.
-
T:System.ArgumentException: A custom bounds callback supplies an invalid rectangle.
Kind: method
public System.Int32 GetBlendShapeCount()Gets the number of named blend shapes.
A nonnegative count, zero for an unshaped mesh.
Kind: method
public System.String GetBlendShapeName(System.Int32 index)Gets one shape's authored name.
A non-null name; empty names are permitted.
-
index: Existing zero-based shape index.
Kind: method
public Electron2D.Vector2[] GetFaces()Gets copied local vertices for every triangle face.
Indexed and sequential triangles and triangle strips are expanded in surface order. Strip winding alternates to preserve face orientation. The result is caller-owned cold query storage.
Three vertices per face; point, line and UseEmptyVertexArray surfaces contribute no vertices.
-
T:System.ObjectDisposedException: The mesh is disposed. -
T:System.ArgumentException: Custom surface arrays are malformed.
Kind: method
public override Electron2D.RID GetRID()Returns the stable borrowed identity of this mesh.
A renderer-independent logical identity valid until resource disposal.
-
T:System.ObjectDisposedException: The mesh is disposed.
Kind: method
public System.Int32 GetSurfaceCount()Gets the number of currently authored surfaces.
The nonnegative surface count.
-
T:System.ObjectDisposedException: The mesh is disposed.
Kind: method
protected virtual Electron2D.Rect2 OnGetAABB()Supplies the local two-dimensional visibility rectangle.
Finite nonnegative local bounds; the default derives them from prepared surface positions.
Kind: method
protected virtual System.Int32 OnGetBlendShapeCount()Supplies the number of named shapes; unshaped meshes return zero.
A nonnegative count.
Kind: method
protected virtual System.String OnGetBlendShapeName(System.Int32 index)Supplies a name for an existing shape.
A non-null name.
-
index: Existing zero-based shape index.
Kind: method
protected abstract System.Int32 OnGetSurfaceCount()Supplies the authored surface count.
A nonnegative count.
Kind: method
protected virtual System.Void OnSetBlendShapeName(System.Int32 index, System.String name)Renames an existing shape and publishes its resource change.
-
index: Existing zero-based shape index. -
name: Non-null authored name.
Kind: method
protected abstract System.Int32 OnSurfaceGetArrayIndexLen(System.Int32 surfaceIndex)Supplies the explicit index count.
The index count.
-
surfaceIndex: Existing zero-based index.
Kind: method
protected abstract System.Int32 OnSurfaceGetArrayLen(System.Int32 surfaceIndex)Supplies a surface's vertex count.
The vertex count.
-
surfaceIndex: Existing zero-based index.
Kind: method
protected abstract Electron2D.MeshSurfaceData OnSurfaceGetArrays(System.Int32 surfaceIndex)Supplies copied typed arrays for one surface.
Independent channel arrays.
-
surfaceIndex: Existing zero-based index.
Kind: method
protected virtual Electron2D.MeshSurfaceData[] OnSurfaceGetBlendShapeArrays(System.Int32 surfaceIndex)Supplies copied shape payloads in the mesh's shape-index order.
Position/normal/tangent-only payloads, or empty when the mesh has no shapes.
-
surfaceIndex: Existing zero-based surface index.
Kind: method
protected abstract Electron2D.Mesh.ArrayFormat OnSurfaceGetFormat(System.Int32 surfaceIndex)Supplies a surface format mask.
The format mask.
-
surfaceIndex: Existing zero-based index.
Kind: method
protected virtual System.Collections.Generic.IReadOnlyDictionary<System.Single, System.Int32[]> OnSurfaceGetLODs(System.Int32 surfaceIndex)Supplies copied alternative index sets for one surface.
Positive finite local thresholds and independent index arrays; empty without LODs.
-
surfaceIndex: Existing zero-based surface index.
Kind: method
protected abstract Electron2D.Material OnSurfaceGetMaterial(System.Int32 surfaceIndex)Supplies a surface's borrowed material.
The borrowed material or null.
-
surfaceIndex: Existing zero-based index.
Kind: method
protected abstract Electron2D.Mesh.PrimitiveType OnSurfaceGetPrimitiveType(System.Int32 surfaceIndex)Supplies the primitive ordering policy.
The topology.
-
surfaceIndex: Existing zero-based index.
Kind: method
protected abstract System.Void OnSurfaceSetMaterial(System.Int32 surfaceIndex, Electron2D.Material material)Commits a borrowed surface material and reports its change.
-
surfaceIndex: Existing zero-based index. -
material: Borrowed live material or null.
Kind: method
public System.Void SetBlendShapeName(System.Int32 index, System.String name)Renames one shape without changing its index or payload.
-
index: Existing zero-based shape index. -
name: Non-null authored name.
Kind: method
public System.Int32 SurfaceGetArrayIndexLen(System.Int32 surfaceIndex)Gets one surface's explicit index count.
Zero for sequential vertices; otherwise the index count.
-
surfaceIndex: Existing zero-based surface index.
Kind: method
public System.Int32 SurfaceGetArrayLen(System.Int32 surfaceIndex)Gets one surface's vertex count.
The number of vertex positions.
-
surfaceIndex: Existing zero-based surface index.
Kind: method
public Electron2D.MeshSurfaceData SurfaceGetArrays(System.Int32 surfaceIndex)Gets independent typed arrays for one surface.
Caller-owned copies of the surface channels.
-
surfaceIndex: Existing zero-based surface index.
-
T:System.ArgumentOutOfRangeException: The index is outside the mesh. -
T:System.ObjectDisposedException: The mesh is disposed.
Kind: method
public Electron2D.MeshSurfaceData[] SurfaceGetBlendShapeArrays(System.Int32 surfaceIndex)Gets copied position/normal/tangent payloads for all named shapes of one surface.
Independent payloads in shape-index order; empty for an unshaped mesh.
-
surfaceIndex: Existing zero-based surface index.
Kind: method
public Electron2D.Mesh.ArrayFormat SurfaceGetFormat(System.Int32 surfaceIndex)Gets one surface's typed channel and policy mask.
The format mask.
-
surfaceIndex: Existing zero-based surface index.
Kind: method
public System.Collections.Generic.IReadOnlyDictionary<System.Single, System.Int32[]> SurfaceGetLODs(System.Int32 surfaceIndex)Returns copied local edge-error thresholds and alternative vertex indices.
Canvas drawing chooses the largest threshold whose transformed error is at most one framebuffer pixel. Base arrays, bounds and face queries keep the full authored geometry.
Ascending positive finite thresholds mapped to independent index arrays.
-
surfaceIndex: Existing zero-based surface index.
-
T:System.ArgumentOutOfRangeException: The surface index is outside the mesh.
Kind: method
public Electron2D.Material SurfaceGetMaterial(System.Int32 surfaceIndex)Gets a surface's borrowed material.
The material or null for the drawing item's material.
-
surfaceIndex: Existing zero-based surface index.
Kind: method
public Electron2D.Mesh.PrimitiveType SurfaceGetPrimitiveType(System.Int32 surfaceIndex)Gets one surface's primitive topology.
The primitive ordering policy.
-
surfaceIndex: Existing zero-based surface index.
Kind: method
public System.Void SurfaceSetMaterial(System.Int32 surfaceIndex, Electron2D.Material material)Assigns a borrowed material to one surface.
-
surfaceIndex: Existing zero-based surface index. -
material: Borrowed live material or null.
-
T:System.ObjectDisposedException: The mesh or material is disposed.