Exemple #1
0
        public override float Process(int theChannel, float theData, float theTime)
        {
            if (_myValues == null || theChannel >= _myChannels || _myValues.Length < _myChannels)
            {
                _myChannels = theChannel + 1;
                _myValues   = new float[_myChannels];
            }
            if (_myValues[theChannel] == 0)
            {
                _myValues[theChannel] = theData;
                return(_myValues[theChannel]);
            }
            if (CCMath.Abs(_myValues[theChannel] - theData) > skipRange && skipRange > 0)
            {
                _myValues[theChannel] = theData;
                return(_myValues[theChannel]);
            }

            _myValues[theChannel] = CCMath.Blend(theData, _myValues[theChannel], weight);
            if (bypass)
            {
                return(theData);
            }
            return(_myValues[theChannel]);
        }
Exemple #2
0
 private static void RenderGraph(IReadOnlyList <float> theList, Color theColor, float theY0, float theY1, float theMax)
 {
     GL.Begin(GL.LINE_STRIP);
     GL.Color(theColor);
     for (var i = 0; i < theList.Count; i++)
     {
         var x = (float)i / (theList.Count - 1);
         var y = CCMath.Blend(theY0, theY1, CCMath.Saturate(CCMath.Norm(theList[i], -theMax, theMax)));
         GL.Vertex3(x, y, 0);
     }
     GL.End();
 }
 public override float TotalLength()
 {
     return(CCMath.Blend(_mySpline1.TotalLength(), _mySpline2.TotalLength(), _myBlend));
 }