Ejemplo n.º 1
0
 public void UpdateSpeed(ref float speed)
 {
     if (speed < startSpeed)
     {
         QcMath.IsLerpingBySpeed(ref speed, startSpeed, startSpeed * 0.3f);
     }
     else
     {
         speed += accelerationPerSecond * Time.deltaTime;
     }
 }
Ejemplo n.º 2
0
        public static void SHADER_POSITION_AND_PREVIEW_UPDATE(StrokeVector st, bool hidePreview, float size)
        {
            PainterDataAndConfig.BRUSH_POINTED_UV.GlobalValue = st.uvTo.ToVector4(0, _previewAlpha);

            if (hidePreview && Math.Abs(_previewAlpha) < float.Epsilon)
            {
                return;
            }

            QcMath.IsLerpingBySpeed(ref _previewAlpha, hidePreview ? 0 : 1, 4f);

            PainterDataAndConfig.BRUSH_WORLD_POS_FROM.GlobalValue = _prevPosPreview.ToVector4(size);
            PainterDataAndConfig.BRUSH_WORLD_POS_TO.GlobalValue   = st.posTo.ToVector4((st.posTo - _prevPosPreview).magnitude); //new Vector4(st.posTo.x, st.posTo.y, st.posTo.z, (st.posTo - prevPosPreview).magnitude));
            _prevPosPreview = st.posTo;
        }
Ejemplo n.º 3
0
 public bool LerpBySpeed(float targetValue, float speed) => QcMath.IsLerpingBySpeed(ref colorAlpha, targetValue, speed);