Skip to content

ShadowEdge

namespace Griff.Runtime;
public struct ShadowEdge

One 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).

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.

public Vector2 Outward { get; }

Which way the side faces: out of the shape it belongs to.

public object? Owner { get; init; }
public bool Crosses(Vector2 from, Vector2 to)

True if the straight line from from to to crosses this side.

public void Deconstruct(out Vector2 A, out Vector2 B, out object? Owner)
public override bool Equals(object obj)
public bool Equals(ShadowEdge other)
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.

public override int GetHashCode()
public override string ToString()