Plush

MatterStructure#

PlushEngine · Type index

Namespace: PlushEngine.Matter (using PlushEngine.Matter;)

The baked structural graph of a Matter mesh: nodes cluster the mesh surface into cells, and edges join two nodes only where the mesh itself connects them (a triangle spans both cells), so separate parts — or two arms of a U wider apart than a cell — never share an edge. Each node carries a weakness from deterministic 3D noise, so identical meshes can fail differently by seed. Nodes are in mesh space; edge lengths include the occurrence scale. Built once by Matter Build.

public sealed class MatterStructure

Members: Build · CellSize · EdgeA · EdgeB · EdgeLength · MeshCellSize · Nodes · Noise · Scale · VertexNode · Weakness

Build#

public static MatterStructure Build(MeshAsset mesh, Vector3 scale, int seed, float weakness, int resolution = 8);
ParameterDescription
resolutionCells along the mesh's longest side.
weakness0 = uniform; 1 = weakness varies by ±100% (clamped).

CellSize#

public float CellSize { get; init; }

Scaled cell size in meters (the graph's resolution).

EdgeA#

public int[] EdgeA { get; init; }

Initial value: Array.Empty<int>()

EdgeB#

public int[] EdgeB { get; init; }

Initial value: Array.Empty<int>()

EdgeLength#

public float[] EdgeLength { get; init; }

Initial value: Array.Empty<float>()

MeshCellSize#

public float MeshCellSize { get; init; }

Cell size in mesh units (unscaled).

Nodes#

public Vector3[] Nodes { get; init; }

Initial value: Array.Empty<Vector3>()

Noise#

public static float Noise(Vector3 p, int seed);

Smooth deterministic 3D value noise in [0, 1].

Scale#

public float Scale { get; init; }

Initial value: 1

Average occurrence scale, to measure mesh-space distances in meters.

VertexNode#

public int[] VertexNode { get; init; }

Initial value: Array.Empty<int>()

For each mesh vertex, the node of its own cell (the start of its render binding).

Weakness#

public float[] Weakness { get; init; }

Initial value: Array.Empty<float>()

MeshAsset

Source#