public LaserSegment(Ray ray, int depth, LaserColor color) { Ray = ray; EmissionNormal = ray.direction; ImpactNormal = -EmissionNormal; Depth = depth; Color = color; }
public static (LaserColor, LaserColor) SplitColor(LaserColor color) { GetRegistry(); if (currentRegistry) { foreach (var split in currentRegistry.colorSplit) { if (split.input == color) { return(split.outputA, split.outputB); } } } return(color, color); }
public static LaserColor MergeColors(LaserColor colorA, LaserColor colorB) { GetRegistry(); if (currentRegistry) { foreach (var merge in currentRegistry.colorMerges) { if ((merge.inputA == colorA && merge.inputB == colorB) || (merge.inputA == colorB && merge.inputB == colorA)) { return(merge.output); } } } return(colorA); }