public float SDF(Vector2 point) { float sdf = SDFUtil.SegmentSDF(point, Points[0], Points[1]); for (int i = 2; i < Points.Length; ++i) { float val = SDFUtil.SegmentSDF(point, Points[i], Points[i - 1]); sdf = Mathf.Min(sdf, val); } return(sdf); }
public float SDF(Vector2 point) { return(SDFUtil.CircleSDF(point, Position, Radius)); }
public float SDF(Vector2 point) { return(SDFUtil.PolygonSDF(point, Points)); }
public float SDF(Vector2 point) { return(SDFUtil.OrientedBoxSDF(point, Position, Rotation, HalfSize)); }