Ejemplo n.º 1
0
        private static Vector3D?TAPI_GetClosestShieldPoint(IMyTerminalBlock block, Vector3D pos)
        {
            var logic = block?.GameLogic?.GetAs <DefenseShields>()?.ShieldComp?.DefenseShields;

            if (logic == null)
            {
                return(null);
            }

            Vector3D?closestShieldPoint;

            lock (logic.MatrixLock)
                closestShieldPoint = CustomCollision.ClosestEllipsoidPointToPos(logic.DetectMatrixOutsideInv, logic.DetectMatrixOutside, pos);

            return(closestShieldPoint);
        }