public override double GetValue(double x) { double startX = StartX.GetValue(x); double startY = StartY.GetValue(x); double endX = EndX.GetValue(x); double endY = EndY.GetValue(x); if (x < startX) { // This makes it "flatline": x = startX; } else if (x > endX) { // This makes it "flatline": x = endX; } else { // Box x: x = (x - startX) / (endX - startX); } // Read there: double y = SourceModule.GetValue(x); if (y < startY) { // This makes it "flatline": y = startY; } else if (y > endY) { // This makes it "flatline": y = endY; } else { // Box y: y = (y - startY) / (endY - startY); } // Return y: return(y); }
public override UnityEngine.Color GetColour(double x, double y) { double startX = StartX.GetValue(x, y); double startY = StartY.GetValue(x, y); double endX = EndX.GetValue(x, y); double endY = EndY.GetValue(x, y); if (x < startX) { // This makes it clamp: x = startX; } else if (x > endX) { // This makes it clamp: x = endX; } else { // Box x: x = (x - startX) / (endX - startX); } if (y < startY) { // This makes it "flatline": y = startY; } else if (y > endY) { // This makes it "flatline": y = endY; } else { // Box y: y = (y - startY) / (endY - startY); } // Read there: return(SourceModule.GetColour(x, y)); }
public override double GetValue(double x, double y, double z) { double startX = StartX.GetValue(x, y, z); double startY = StartY.GetValue(x, y, z); double startZ = StartY.GetValue(x, y, z); double endX = EndX.GetValue(x, y, z); double endY = EndY.GetValue(x, y, z); double endZ = EndY.GetValue(x, y, z); if (x < startX) { // This makes it clamp: x = startX; } else if (x > endX) { // This makes it clamp: x = endX; } else { // Box x: x = (x - startX) / (endX - startX); } if (y < startY) { // This makes it "flatline": y = startY; } else if (y > endY) { // This makes it "flatline": y = endY; } else { // Box y: y = (y - startY) / (endY - startY); } if (z < startZ) { // This makes it "flatline": z = startZ; } else if (z > endZ) { // This makes it "flatline": z = endZ; } else { // Box z: z = (z - startZ) / (endZ - startZ); } // Read there: return(SourceModule.GetValue(x, y, z)); }