ShadowEdge
namespace Griff.Runtime;
public struct ShadowEdgeOne side of something that blocks light, in the world. Its outside is on the left going from A to B, so the sides of a shape go round it clockwise. Owner is what it belongs to: an entity (its colliders), or a Tilemap (the tile at Cell).
Properties
Section titled “Properties”public Vector2 A { get; init; }public Vector2 B { get; init; }public ValueTuple<int, int> Cell { get; init; }For a side of a tile, the tile’s cell (column, row) in the Tilemap that’s its Owner.
Outward
Section titled “Outward”public Vector2 Outward { get; }Which way the side faces: out of the shape it belongs to.
public object? Owner { get; init; }Methods
Section titled “Methods”Crosses
Section titled “Crosses”public bool Crosses(Vector2 from, Vector2 to)True if the straight line from from to to crosses this side.
Deconstruct
Section titled “Deconstruct”public void Deconstruct(out Vector2 A, out Vector2 B, out object? Owner)Equals
Section titled “Equals”public override bool Equals(object obj)Equals
Section titled “Equals”public bool Equals(ShadowEdge other)FacesAwayFrom
Section titled “FacesAwayFrom”public bool FacesAwayFrom(Vector2 light)True if the side faces away from light. Shadows start at these, so whatever casts them is lit on the side facing the light, and dark behind.
GetHashCode
Section titled “GetHashCode”public override int GetHashCode()ToString
Section titled “ToString”public override string ToString()