public static Vector3 SelectGate(DeathGateScene fromScene, DeathGateScene toScene) { Vector3 bestGatePosition; return(TrySelectGate(MySide, CompareDepth(fromScene, toScene), out bestGatePosition) ? bestGatePosition : Vector3.Zero); }
public static GateSide GetSide(DeathGateScene scene, Vector3 position) { if (scene == null || !scene.IsValid) { return(GateSide.None); } var exitIsCloser = scene.DeepPortalPosition.Distance(position) < scene.ShallowPortalPosition.Distance(position); return(exitIsCloser ? GateSide.DeepSide : GateSide.ShallowSide); }
public static SceneDepth CompareDepth(DeathGateScene thisScene, DeathGateScene otherScene) { var sequence = CreateSequence(); var index = sequence.IndexOf(otherScene); if (index >= 0) { if (index > sequence.Index) { return(SceneDepth.Deeper); } if (index < sequence.Index) { return(SceneDepth.Shallower); } if (index == sequence.Index) { return(SceneDepth.Same); } } return(SceneDepth.NotFound); }
public static SceneDepth CompareDepth(DeathGateScene thisScene, Vector3 targetPosition) { var targetScene = NearestGateSceneToPosition(targetPosition); return(CompareDepth(thisScene, targetScene)); }