Class Camera


  • public final class Camera
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.util.concurrent.ConcurrentMap<com.runemate.game.api.script.framework.AbstractBot,​java.util.concurrent.ExecutorService> executorMap  
      static java.util.concurrent.ConcurrentMap<com.runemate.game.api.script.framework.AbstractBot,​java.util.concurrent.FutureTask<java.lang.Boolean>> lastTaskMap  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.concurrent.Future<java.lang.Boolean> concurrentlyTurnTo​(double pitch)
      Starts turning the camera to the specified pitch using a reasonable tolerance (uses PlayerSense and is asynchronized)
      static java.util.concurrent.Future<java.lang.Boolean> concurrentlyTurnTo​(int yaw)
      Starts turning the camera to the specified yaw using a reasonable tolerance (uses PlayerSense and is asynchronized)
      static java.util.concurrent.Future<java.lang.Boolean> concurrentlyTurnTo​(int yaw, double pitch)
      Starts turning the camera to the specified yaw and pitch using a reasonable tolerance (uses PlayerSense and is asynchronized)
      static java.util.concurrent.Future<java.lang.Boolean> concurrentlyTurnTo​(int desiredYaw, double desiredPitch, double tolerance)
      Starts turning the camera to the specified yaw and pitch(uses PlayerSense and is asynchronized)
      static java.util.concurrent.Future<java.lang.Boolean> concurrentlyTurnTo​(Locatable target)
      Starts turning the camera to the specified target using a reasonable tolerance (uses PlayerSense, is asynchronized, and adjusts yaw and pitch)
      static java.util.concurrent.Future<java.lang.Boolean> concurrentlyTurnTo​(Locatable target, double pitch)  
      static java.util.concurrent.Future<java.lang.Boolean> concurrentlyTurnTo​(Locatable target, int yaw)  
      static int getJagPitch()  
      static int getJagYaw()  
      static int getJagZoom()
      Gets the zoom level on OSRS in the pure form used by the OSRS game engine.
      static double getPitch()
      Gets the normalized camera pitch
      static int getX()
      An OSRS-only method to get the camera x
      static int getY()
      An OSRS-only method to get the camera y
      static int getYaw()
      Gets the current camera yaw as an angle
      static int getZ()
      An OSRS-only method to get the camera z
      static double getZoom()
      Gets the normalized camera zoom between 0 and 1, osrs only
      static int getZoomSetting()
      Gets the zoom level as seen from the in-game zoom setting.
      static boolean isSceneTileDrawn​(int floor, int tileX, int tileZ)  
      static boolean isTurning()  
      static boolean isZoomLocked()
      Reports whether the zoom is locked and cannot be changed.
      static boolean setJagZoom​(int desiredJagZoom, int tolerance)  
      static void setZoom​(double zoom, double tolerance)  
      static boolean setZoomSetting​(int desiredZoom, int tolerance)
      Tries to set the zoom value to the value provided.
      static boolean turnTo​(double pitch)
      Turns the camera to the specified pitch (uses PlayerSense)
      static boolean turnTo​(int yaw)
      Turns the camera to the specified yaw using a reasonable tolerance (uses PlayerSense)
      static boolean turnTo​(int yaw, double pitch)
      Turns the camera to the specified yaw and pitch using a reasonable tolerance (uses PlayerSense)
      static boolean turnTo​(int yaw, double pitch, double tolerance)
      Turns the camera to the specified yaw and pitch using a specified tolerance (uses PlayerSense)
      static boolean turnTo​(Locatable target)
      Turns the camera to the specified target using a reasonable tolerance (uses PlayerSense and adjusts yaw and pitch)
      static boolean turnTo​(Locatable target, double pitch)  
      static boolean turnTo​(Locatable target, int yaw)  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • executorMap

        public static final java.util.concurrent.ConcurrentMap<com.runemate.game.api.script.framework.AbstractBot,​java.util.concurrent.ExecutorService> executorMap
      • lastTaskMap

        public static final java.util.concurrent.ConcurrentMap<com.runemate.game.api.script.framework.AbstractBot,​java.util.concurrent.FutureTask<java.lang.Boolean>> lastTaskMap
    • Method Detail

      • getYaw

        public static int getYaw()
        Gets the current camera yaw as an angle
        Returns:
        The camera yaw as an angle (0-359), or -1 if unavailable
      • getPitch

        public static double getPitch()
        Gets the normalized camera pitch
        Returns:
        The camera pitch, normalized between 0 and 1, or -1 if unavailable
      • getX

        @OSRSOnly
        public static int getX()
        An OSRS-only method to get the camera x
        Returns:
        a value representing an axis of the camera's position.
      • getY

        @OSRSOnly
        public static int getY()
        An OSRS-only method to get the camera y
        Returns:
        a value representing an axis of the camera's position.
      • getZ

        @OSRSOnly
        public static int getZ()
        An OSRS-only method to get the camera z
        Returns:
        a value representing an axis of the camera's position.
      • getJagYaw

        @OSRSOnly
        public static int getJagYaw()
      • getJagPitch

        @OSRSOnly
        public static int getJagPitch()
      • getJagZoom

        @OSRSOnly
        public static int getJagZoom()
        Gets the zoom level on OSRS in the pure form used by the OSRS game engine. Not normalized at all. In resizable mode, the maximum and minimum values seem to depend on the screen height. Used for projection.
        Returns:
        Zoom level
      • getZoomSetting

        @OSRSOnly
        public static int getZoomSetting()
        Gets the zoom level as seen from the in-game zoom setting. Not normalized at all. Unlike JagZoom, the minimum and maximum values do not vary with the display mode.
        Returns:
        Zoom level. From 128 (fully zoomed out) to 896 (fully zoomed in).
      • getZoom

        @OSRSOnly
        public static double getZoom()
        Gets the normalized camera zoom between 0 and 1, osrs only
        Returns:
        Normalized zoom level
      • setZoom

        @OSRSOnly
        public static void setZoom​(double zoom,
                                   double tolerance)
        Parameters:
        zoom - Normalized zoom between 0.0 and 1.0
        tolerance - Tolerance of the provided zoom value
      • setZoomSetting

        @OSRSOnly
        public static boolean setZoomSetting​(int desiredZoom,
                                             int tolerance)
        Tries to set the zoom value to the value provided.
        Parameters:
        desiredZoom - From 128 to 896
        tolerance - Absolute tolerance
        Returns:
        True if the final zoom was within provided tolerance, false otherwise.
      • setJagZoom

        @OSRSOnly
        public static boolean setJagZoom​(int desiredJagZoom,
                                         int tolerance)
      • turnTo

        public static boolean turnTo​(int yaw)
        Turns the camera to the specified yaw using a reasonable tolerance (uses PlayerSense)
      • turnTo

        public static boolean turnTo​(int yaw,
                                     double pitch)
        Turns the camera to the specified yaw and pitch using a reasonable tolerance (uses PlayerSense)
      • concurrentlyTurnTo

        public static java.util.concurrent.Future<java.lang.Boolean> concurrentlyTurnTo​(int yaw,
                                                                                        double pitch)
        Starts turning the camera to the specified yaw and pitch using a reasonable tolerance (uses PlayerSense and is asynchronized)
      • concurrentlyTurnTo

        public static java.util.concurrent.Future<java.lang.Boolean> concurrentlyTurnTo​(int desiredYaw,
                                                                                        double desiredPitch,
                                                                                        double tolerance)
        Starts turning the camera to the specified yaw and pitch(uses PlayerSense and is asynchronized)

        Bugfix by @Guru - Camera sometimes turns wrong direction

        Parameters:
        tolerance - - How precise does our camera movement need to be? 0 = 100% precise (must be exact), 0.05 = 95% precise, 1 = 0% precise
      • turnTo

        public static boolean turnTo​(double pitch)
        Turns the camera to the specified pitch (uses PlayerSense)
      • turnTo

        public static boolean turnTo​(int yaw,
                                     double pitch,
                                     double tolerance)
        Turns the camera to the specified yaw and pitch using a specified tolerance (uses PlayerSense)
      • turnTo

        public static boolean turnTo​(Locatable target)
        Turns the camera to the specified target using a reasonable tolerance (uses PlayerSense and adjusts yaw and pitch)
      • concurrentlyTurnTo

        public static java.util.concurrent.Future<java.lang.Boolean> concurrentlyTurnTo​(Locatable target)
        Starts turning the camera to the specified target using a reasonable tolerance (uses PlayerSense, is asynchronized, and adjusts yaw and pitch)
        Parameters:
        target - the entity to be in focus
      • turnTo

        public static boolean turnTo​(Locatable target,
                                     int yaw)
      • concurrentlyTurnTo

        public static java.util.concurrent.Future<java.lang.Boolean> concurrentlyTurnTo​(Locatable target,
                                                                                        int yaw)
      • turnTo

        public static boolean turnTo​(Locatable target,
                                     double pitch)
      • concurrentlyTurnTo

        public static java.util.concurrent.Future<java.lang.Boolean> concurrentlyTurnTo​(Locatable target,
                                                                                        double pitch)
      • concurrentlyTurnTo

        public static java.util.concurrent.Future<java.lang.Boolean> concurrentlyTurnTo​(int yaw)
        Starts turning the camera to the specified yaw using a reasonable tolerance (uses PlayerSense and is asynchronized)
      • concurrentlyTurnTo

        public static java.util.concurrent.Future<java.lang.Boolean> concurrentlyTurnTo​(double pitch)
        Starts turning the camera to the specified pitch using a reasonable tolerance (uses PlayerSense and is asynchronized)
      • isZoomLocked

        public static boolean isZoomLocked()
        Reports whether the zoom is locked and cannot be changed.
      • isTurning

        public static boolean isTurning()
      • isSceneTileDrawn

        public static boolean isSceneTileDrawn​(int floor,
                                               int tileX,
                                               int tileZ)