Example #1
0
        /// <summary>
        /// Attempts to slide the CylSphere from a collision
        /// </summary>
        public TransitionState SlideSphere(Transition transition, Sphere checkPos, Vector3 disp, float radsum, int sphereNum)
        {
            Vector3 collisionNormal;

            CollisionNormal(transition, checkPos, disp, radsum, sphereNum, out collisionNormal);
            if (Vec.NormalizeCheckSmall(ref collisionNormal))
            {
                return(TransitionState.Collided);
            }

            return(checkPos.SlideSphere(transition, ref collisionNormal, transition.SpherePath.GlobalCurrCenter[sphereNum].Center));
        }
Example #2
0
        /// <summary>
        /// Attempts to slide a sphere from a collision
        /// </summary>
        public TransitionState SlideSphere(Transition transition, Sphere checkPos, Vector3 disp, float radsum, int sphereNum)
        {
            var globalCenter = transition.SpherePath.GlobalCurrCenter[sphereNum].Center;

            var collisionNormal = globalCenter - Center;

            if (CollisionInfo.NormalizeCheckSmall(ref collisionNormal))
            {
                return(TransitionState.Collided);
            }
            else
            {
                return(checkPos.SlideSphere(transition, collisionNormal, globalCenter));
            }
        }