public void ResetAdjacentSurfaces() { AboveBehindWall = null; FrontWall = null; SideWall = null; BelowBehindWall = null; FrontUnderCeiling = null; }
private bool GetAdjacentWallInfo(Vector3 origin, Vector3 direction, PlayerMoveScanner.RotationDirection turnDirection) { moveScanner.FindAdjacentSurface(origin, direction, turnDirection); AdjacentSurface adjSurface = moveScanner.SideWall; if (adjSurface != null && adjSurface.adjacentTurns == 0) { atInsideCorner = IsAtInsideCorner(adjSurface.turnHitDistance); } if (adjSurface != null) { adjacentLedgeDirection = adjSurface.grabDirection; adjacentWallRay = adjSurface.adjacentSurfaceRay; } return(adjSurface != null); }
private void AssignAdjacentSurface(AdjacentSurface surf, RotationDirection turnDirection) { /// using info about the surface found, and the turn direction used to find it, determine /// the type of surface to surface transition and assign to appropriate surface variable /// if surf is null, we didn't find an adjacent surface. /// if the number of turns to find the surface is the wrong number, we didn't find the desired surface int turns = 0; if (surf != null) { turns = surf.adjacentTurns; } if (turnDirection == RotationDirection.XZClockwise || turnDirection == RotationDirection.XZCounterClockwise) { SideWall = surf; } else if (turnDirection == RotationDirection.YZClockwise && turns >= 2) { AboveBehindWall = surf; } else if (turnDirection == RotationDirection.YZCounterClockwise) { if (hangingMotor.IsHanging && turns == 1) { FrontWall = surf; } else if (turns == 2 && surf.grabDirection.y < 0.2f) { BelowBehindWall = surf; } else if (turns == 3 && surf.grabDirection.y > 0.8f) { FrontUnderCeiling = surf; } } }
public void CutAndPasteFrontUnderCeilingTo(ref Vector3 CeilingDirection) { CeilingDirection = FrontUnderCeiling.grabDirection; FrontUnderCeiling = null; }