Ejemplo n.º 1
0
 public Vector3 GetStart(int frame)
 {
     return(new Vector3(
                _startX.GetFrameValue(frame),
                _startY.GetFrameValue(frame),
                _startZ.GetFrameValue(frame)));
 }
Ejemplo n.º 2
0
        public FogAnimationFrame GetAnimFrame(float index)
        {
            FogAnimationFrame frame;
            float *           dPtr = (float *)&frame;

            for (int x = 0; x < 2; x++)
            {
                KeyframeArray a = KeyArrays[x];
                *dPtr++         = a.GetFrameValue(index);
                frame.SetBools(x, a.GetKeyframe((int)index) != null);
                frame.Index = index;
            }

            //Ignore alpha value; not used
            if (ConstantColor)
            {
                frame.Color = (Vector3)_solidColor;
            }
            else
            {
                int     colorIndex = (int)Math.Truncate(index);
                Vector3 color      = (Vector3)_colors[colorIndex];
                if (colorIndex + 1 < _colors.Count)
                {
                    float   frac   = index - colorIndex;
                    Vector3 interp = (Vector3)_colors[colorIndex + 1];
                    color += (interp - color) * frac;
                }
                frame.Color = color;
            }
            frame.Type = Type;
            return(frame);
        }
Ejemplo n.º 3
0
        public LightAnimationFrame GetAnimFrame(float index)
        {
            LightAnimationFrame frame;
            float *dPtr = (float *)&frame;

            for (int x = 0; x < Keyframes.ArrayCount; x++)
            {
                KeyframeArray a = Keyframes[x];
                *dPtr++         = a.GetFrameValue(index);
                frame.SetBools(x, a.GetKeyframe((int)index) != null);
                frame.Index = index;
            }

            frame.Enabled = GetEnabled(index);

            if (ConstantColor)
            {
                frame.Color = (Vector4)_solidColors[0];
            }
            else if (_lightColor.Count > 0)
            {
                int     colorIndex = ((int)Math.Truncate(index)).Clamp(0, _lightColor.Count - 1);
                Vector4 color      = (Vector4)_lightColor[colorIndex];
                if (colorIndex + 1 < _lightColor.Count)
                {
                    float   frac   = index - colorIndex;
                    Vector4 interp = (Vector4)_lightColor[colorIndex + 1];
                    color += (interp - color) * frac;
                }
                frame.Color = color;
            }

            if (SpecularEnabled)
            {
                if (ConstantSpecular)
                {
                    frame.SpecularColor = (Vector4)_solidColors[1];
                }
                else if (_specColor.Count > 0)
                {
                    int     specIndex = ((int)Math.Truncate(index)).Clamp(0, _specColor.Count - 1);
                    Vector4 specColor = (Vector4)_specColor[specIndex];
                    if (specIndex + 1 < _specColor.Count)
                    {
                        float   frac   = index - specIndex;
                        Vector4 interp = (Vector4)_specColor[specIndex + 1];
                        specColor += (interp - specColor) * frac;
                    }
                    frame.SpecularColor = specColor;
                }
            }

            return(frame);
        }
Ejemplo n.º 4
0
        internal FogAnimationFrame GetAnimFrame(int index)
        {
            FogAnimationFrame frame;
            float *           dPtr = (float *)&frame;

            for (int x = 0; x < 2; x++)
            {
                KeyframeArray a = GetKeys(x);
                *dPtr++         = a.GetFrameValue(index);
                frame.SetBools(x, a.GetKeyframe(index) != null);
                frame.Index = index;
            }
            return(frame);
        }
Ejemplo n.º 5
0
        public CameraAnimationFrame GetAnimFrame(float index)
        {
            CameraAnimationFrame frame;
            float *dPtr = (float *)&frame;

            for (int x = 0; x < 15; x++)
            {
                KeyframeArray a = Keyframes[x];
                *dPtr++         = a.GetFrameValue(index);
                frame.SetBools(x, a.GetKeyframe((int)index) != null);
                frame.Index = index;
            }
            return(frame);
        }
Ejemplo n.º 6
0
        internal LightAnimationFrame GetAnimFrame(int index)
        {
            LightAnimationFrame frame;
            float *dPtr = (float *)&frame;

            for (int x = 0; x < 10; x++)
            {
                KeyframeArray a = GetKeys(x);
                *dPtr++         = a.GetFrameValue(index);
                frame.SetBools(x, a.GetKeyframe(index) != null);
                frame.Index = index;
            }

            //if (((FixedFlags)_flags1).HasFlag(FixedFlags.EnabledConstant))
            //    frame.Enabled = UsageFlags.HasFlag(UsageFlags.Enabled);
            //else
            //    frame.Enabled = index < _enabled.Count ? _enabled[index] : false;

            return(frame);
        }