示例#1
0
文件: Transition.cs 项目: zarlant/ACE
        public bool CheckCollisions(PhysicsObj obj)
        {
            SpherePath.InsertType     = InsertType.Placement;
            SpherePath.CheckPos       = SpherePath.CurPos;
            SpherePath.CheckCell      = SpherePath.CurCell;
            SpherePath.CellArrayValid = false;
            SpherePath.CacheGlobalSphere(Vector3.Zero);

            return(obj.FindObjCollisions(this) != TransitionState.OK);
        }
示例#2
0
        public bool StepDown(float stepDownHeight, float zVal)
        {
            if (Bailout)
            {
                return(true);
            }

            SpherePath.NegPolyHit = false;
            SpherePath.StepDown   = true;

            SpherePath.StepDownAmt = stepDownHeight;
            SpherePath.WalkInterp  = 1.0f;

            if (!SpherePath.StepUp)
            {
                SpherePath.CellArrayValid = false;

                var offset = new Vector3(0, 0, -stepDownHeight);

                SpherePath.CheckPos.Frame.Origin.Z -= stepDownHeight;
                SpherePath.CacheGlobalSphere(offset);
            }

            var transitionState = TransitionalInsert(5);

            SpherePath.StepDown = false;

            if (transitionState == TransitionState.OK && CollisionInfo.ContactPlaneValid && CollisionInfo.ContactPlane.Normal.Z >= zVal &&
                ((ObjectInfo.State & ObjectInfoState.EdgeSlide) == 0 || SpherePath.StepUp || CheckWalkable(zVal)))
            {
                SpherePath.Backup     = SpherePath.InsertType;
                SpherePath.InsertType = InsertType.Placement;

                transitionState = TransitionalInsert(1);

                SpherePath.InsertType = SpherePath.Backup;
                return(transitionState == TransitionState.OK);
            }

            return(false);
        }