MatterDamage#
Per-occurrence damage field over a MatterStructure: one value per node, accumulated by impacts and discarded when the scene ends. 1 ≈ "heavily damaged" for display.
public sealed class MatterDamageMembers: Damage · Deposit · Elastic · Gradient · Moved · Peak · Plastic · Structure · Total · Version
Damage#
public float[] Damage { get; }Deposit#
public float Deposit(Vector3 meshPoint, float amount, float radius);Spreads amount of damage from the node nearest meshPoint through the graph, out to radius meters of graph distance, weighted by falloff and node weakness. The whole amount is always deposited, so the total never depends on the noise.
Elastic#
public Vector3[] Elastic { get; }Gradient#
public Matrix4x4 Gradient(int node);The displacement field's gradient J (∂d/∂x, mesh space) at node, a least-squares fit over its graph neighbours. Across the surface only (no stretch through the thickness), so a flat patch pushed in rigidly has J = 0. The renderer turns J into smooth normals: n' ∝ n − Jᵀn.
Moved#
public bool Moved(int node);True when this node or a graph neighbour is displaced (its gradient can be non-zero).
Peak#
public float Peak { get; }Plastic#
public Vector3[] Plastic { get; }Per-node displacement in mesh units: plastic (kept: a dent) and elastic (springs back). The renderer blends them onto vertices — the field drives the geometry.
Structure#
public MatterStructure Structure { get; }Total#
public float Total { get; }Version#
public int Version { get; }Changes whenever damage or displacement changes (the renderer re-uploads then).
Related types#
Source#
- MatterStructure.cs