public CamNode GetPointInBetween(CamNode point1, CamNode point2, double percent, double wholeProgress, bool isFirstLoop,
                                         bool isLastLoop)
        {
            var point = point1.GetPointBetween(point2, percent);

            var iteration          = isFirstLoop ? 0 : isLastLoop && _sizeOfIteration < 0.5 ? 2 : 1;
            var additionalProgress = iteration * _sizeOfIteration;

            wholeProgress = additionalProgress + wholeProgress * _sizeOfIteration;


            if (_xSpline != null)
            {
                point.X = _xSpline.ValueAt(wholeProgress);
            }

            if (_ySpline != null)
            {
                point.Y = _ySpline.ValueAt(wholeProgress);
            }

            if (_zSpline != null)
            {
                point.Z = _zSpline.ValueAt(wholeProgress);
            }


            if (_yawSpline != null)
            {
                point.Yaw = (float)_yawSpline.ValueAt(wholeProgress);
            }

            if (_pitchSpline != null)
            {
                point.Pitch = (float)_pitchSpline.ValueAt(wholeProgress);
            }

            if (_rollSpline != null)
            {
                point.Roll = (float)_rollSpline.ValueAt(wholeProgress);
            }


            if (_fovSpline != null)
            {
                point.FieldOfView = _fovSpline.ValueAt(wholeProgress);
            }

            if (_saturationSpline != null)
            {
                point.Saturation = _saturationSpline.ValueAt(wholeProgress);
            }

            if (_sepiaSpline != null)
            {
                point.Sepia = _sepiaSpline.ValueAt(wholeProgress);
            }

            return(point);
        }
Пример #2
0
        public CamNode GetPointBetween(CamNode point1, CamNode point2, double percent, double wholeProgress, float renderTickTime, bool isFirstLoop, bool isLastLoop)
        {
            var newPoint = _path.CachedInterpolation.GetPointInBetween(point1, point2, percent, wholeProgress, isFirstLoop, isLastLoop);

            if (_path.Target != null)
            {
                newPoint.Pitch = (float)LastPitch;
                newPoint.Yaw   = (float)LastYaw;

                var pos = _path.Target.GetPosition();

                if (pos != null)
                {
                    var timeSinceLastRenderFrame = DateTime.Now.Ticks - CamEventHandlerClient.LastRenderTime;
                    newPoint.LookAt(pos, 0.00000001F, 0.00000001F, timeSinceLastRenderFrame / 600000000D * _path.CameraFollowSpeed);
                }
                LastPitch = newPoint.Pitch;
                LastYaw   = newPoint.Y;
            }
            return(newPoint);
        }
Пример #3
0
        public virtual void ProcessPoint(CamNode node)
        {
            ClientSettings.FieldOfView = (int)node.FieldOfView;

            Game.EntityPlayer.Pos.X     = node.X;
            Game.EntityPlayer.Pos.Y     = node.Y;
            Game.EntityPlayer.Pos.Z     = node.Z;
            Game.EntityPlayer.Pos.Yaw   = node.Yaw;
            Game.EntityPlayer.Pos.Pitch = node.Pitch;
            Game.EntityPlayer.Pos.Roll  = node.Roll;

            Game.SetField("mouseYaw", node.Yaw);
            Game.SetField("mousePitch", node.Pitch);

            ClientSettings.FieldOfView = (int)node.FieldOfView;
            ClientSettings.SepiaLevel  = (float)node.Sepia;

            ((AmbientManager)Api.Ambient).SetFogRange((float)node.FogLevel, 0);
            var c = ((AmbientManager)Api.Ambient).BlendedFogColor;

            ((AmbientManager)Api.Ambient).BlendedFogColor =
                new Vec4f((float)node.FogColourR, (float)node.FogColourG, (float)node.FogColourB, c.A);
        }
        /// <summary>
        ///     Gets the point in between.
        /// </summary>
        /// <param name="point1">The point1.</param>
        /// <param name="point2">The point2.</param>
        /// <param name="percent">The percent.</param>
        /// <param name="wholeProgress">The whole progress.</param>
        /// <param name="isFirstLoop">if set to <c>true</c> [is first loop].</param>
        /// <param name="isLastLoop">if set to <c>true</c> [is last loop].</param>
        /// <returns>CamNode.</returns>
        internal new CamNode GetPointInBetween(CamNode point1, CamNode point2, double percent, double wholeProgress, bool isFirstLoop,
                                               bool isLastLoop)
        {
            var newCamPoint = base.GetPointInBetween(point1, point2, percent, wholeProgress, isFirstLoop, isLastLoop);

            var angle = wholeProgress * 360;

            var center = _target.GetPosition();

            if (center == null)
            {
                return(newCamPoint);
            }

            var centerPoint = new Vec3d(center.X, center.Y, center.Z);

            var newPoint = new Vec3d(_sphereOrigin.X, _sphereOrigin.Y, _sphereOrigin.Z)
            {
                Y = 0
            };

            var matrix = new Matrix3d();

            Matrix3d.RotY(angle * GameMath.DEG2RAD);
            matrix.Transform(newPoint);

            newPoint.Y = _yAxis.ValueAt(wholeProgress) - center.Y;
            newPoint.Normalize();
            newPoint.Scale(_radius);

            newPoint.Add(centerPoint);
            newCamPoint.X = newPoint.X;
            newCamPoint.Y = newPoint.Y;
            newCamPoint.Z = newPoint.Z;
            return(newCamPoint);
        }
Пример #5
0
 public CamNode GetPointInBetween(CamNode point1, CamNode point2, double percent, double wholeProgress, bool isFirstLoop,
                                  bool isLastLoop)
 {
     return(point1.GetPointBetween(point2, percent));
 }
Пример #6
0
 public override void ProcessPoint(CamNode point)
 {
     base.ProcessPoint(point);
 }