Class RainCoverData
- Namespace
- DFA.Puddlecraft
Saved rain cover for one scene: a top-down grid of the highest surface over each spot. A point lower than that surface is under cover (a roof, an awning, a bridge) and gets no rain. Baked in the editor with ray tracing against render meshes.
[Icon("Packages/com.dfa.puddlecraft/editor/icons/puddlecraft.png")]
public sealed class RainCoverData : ScriptableObject
- Inheritance
-
RainCoverData
Fields
NoCover
Cover heights at or below this mean no geometry was found.
public const float NoCover = -100000
Field Value
Properties
cellSize
Side of one grid cell, in metres.
public float cellSize { get; }
Property Value
heights
The cover heights, one RFloat texel per cell. Readable on the CPU.
public Texture2D heights { get; }
Property Value
isValid
True when the map holds baked data.
public bool isValid { get; }
Property Value
origin
World XZ of the grid's corner.
public Vector2 origin { get; }
Property Value
resolutionX
Number of cells along world X.
public int resolutionX { get; }
Property Value
resolutionZ
Number of cells along world Z.
public int resolutionZ { get; }
Property Value
size
Size of the grid in metres, along world X and Z.
public Vector2 size { get; }
Property Value
Methods
CoverHeight(Vector3)
Height of the highest surface over a world position, or NoCover outside the grid.
public float CoverHeight(Vector3 position)
Parameters
positionVector3
Returns
IsExposed(Vector3, float)
True when rain reaches a world position: nothing in the grid sits more than tolerance metres above it.
public bool IsExposed(Vector3 position, float tolerance = 0.1)