public static bool IsClosing(Ship.GenericShip thisShip, Ship.GenericShip anotherShip) { bool result = false; float distanceToFront = Vector3.Distance(thisShip.GetPosition(), anotherShip.GetCentralFrontPoint()); float distanceToBack = Vector3.Distance(thisShip.GetPosition(), anotherShip.GetCentralBackPoint()); result = (distanceToFront < distanceToBack) ? true : false; return(result); }
public static bool IsClosing(Ship.GenericShip thisShip, Ship.GenericShip anotherShip) { bool result = false; ShipDistanceInformation distanceInfo = new ShipDistanceInformation(thisShip, anotherShip); int range = distanceInfo.Range; if (range <= 1) { return(true); } if (range >= 3) { return(false); } float distanceToFront = Vector3.Distance(thisShip.GetPosition(), anotherShip.GetCentralFrontPoint()); float distanceToBack = Vector3.Distance(thisShip.GetPosition(), anotherShip.GetCentralBackPoint()); result = (distanceToFront < distanceToBack) ? true : false; return(result); }
public static void ApplyMovementRuler(Ship.GenericShip thisShip, Movement.GenericMovement movement) { CurrentTemplate = GetMovementRuler(movement); SaveCurrentMovementRulerPosition(); CurrentTemplate.position = thisShip.GetPosition(); CurrentTemplate.eulerAngles = thisShip.GetAngles() + new Vector3(0f, 90f, 0f); if (movement.Direction == Movement.ManeuverDirection.Left) { CurrentTemplate.eulerAngles = CurrentTemplate.eulerAngles + new Vector3(180f, 0f, 0f); } }
public static void ApplyMovementRuler(Ship.GenericShip thisShip) { if (Selection.ThisShip.AssignedManeuver.Speed != 0) { CurrentTemplate = GetMovementRuler(); SaveCurrentMovementRulerPosition(); CurrentTemplate.position = thisShip.GetPosition(); CurrentTemplate.eulerAngles = thisShip.GetAngles() + new Vector3(0f, 90f, 0f); if (Selection.ThisShip.AssignedManeuver.Direction == Movement.ManeuverDirection.Left) { CurrentTemplate.eulerAngles = CurrentTemplate.eulerAngles + new Vector3(180f, 0f, 0f); } } }