Package org.dreambot.api.methods.input
Class Camera
- java.lang.Object
-
- org.dreambot.api.methods.input.Camera
-
public class Camera extends java.lang.ObjectCreated by Nezz
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidfirePitchAndYawEvent(int pitch, int yaw)Fires theRuneScriptEventto change camera pitch/yaw Does not verify your inputsstatic voidfireZoomEvent(int zoom)Fires theRuneScriptEventto change camera zoom Does not verify your inputsstatic CameraModegetCameraMode()Returns the current camera mode, showing how the client will move the camera by defaultstatic intgetLowestPitch()Gets the lowest availble pitch Recently updated to just be a flat 128static intgetMaxZoom()Gets the maximum zoom value, this is the value representing being zoomed all the way outstatic intgetMinZoom()Gets the minimum zoom value, this is the value representing being zoomed all the way in.static intgetPitch()Gets the pitch of the camerastatic intgetPitchForEntity(Entity entity)Gets the pitch required to look at the given entity SeegetPitchForTile(Tile)where the tile isEntity.getTile()static intgetPitchForTile(Tile tile)Gets the pitch required to look at the given Tilestatic intgetX()Gets the X of the camerastatic intgetY()Gets the Y of the camerastatic intgetYaw()Gets the yaw of the camerastatic intgetYawForEntity(Entity entity)Gets the yaw required to look at the given entity SeegetYawForTile(Tile)where the tile isEntity.getTile()static intgetYawForTile(Tile tile)Gets the yaw required to view the given tilestatic intgetZ()Gets the Z of the camerastatic intgetZoom()Gets the camera's current zoom levelstatic booleankeyboardRotateTo(int yaw, int pitch)Rotates camera to a particular yaw and pitch using the keyboardstatic booleankeyboardRotateToEntity(Entity entity)Rotates camera to face an entity by using the keyboardstatic booleankeyboardRotateToPitch(int pitch)Rotates camera pitch to specified angle using the keyboardstatic booleankeyboardRotateToTile(Tile tile)Rotates camera to face a tile by using the keyboardstatic booleankeyboardRotateToYaw(int yaw)Rotates camera yaw to specified angle using the keyboardstatic booleanmouseRotateTo(int yaw, int pitch)Rotates camera to a particular yaw and pitch using the mouse scroll wheelstatic booleanmouseRotateToEntity(Entity entity)Rotates camera to face an entity by using the mouse scroll wheelstatic booleanmouseRotateToPitch(int pitch)Rotates camera pitch to specified angle using the mouse scroll wheelstatic booleanmouseRotateToTile(Tile tile)Rotates camera to face a tile by using the mouse scroll wheelstatic booleanmouseRotateToYaw(int yaw)Rotates camera yaw to specified angle using the mouse scroll wheelstatic booleanrotateTo(int yaw, int pitch)Rotates camera to a particular yaw and pitchstatic booleanrotateToEntity(Entity entity)Rotates the camera to face an entitystatic booleanrotateToEntity(Entity entity, Condition interrupt)Rotates the camera to face an entitystatic CameraEventrotateToEntityEvent(Entity entity)Generates and runs a CameraEvent to rotate camera to specified entitystatic CameraEventrotateToEvent(int yaw, int pitch)Generates and runs a CameraEvent to rotate camera to specified yaw and pitchstatic booleanrotateToPitch(int pitch)Rotates camera pitch to specified anglestatic CameraEventrotateToPitchEvent(int pitch)Generates and runs a CameraEvent to rotate camera to specified pitchstatic booleanrotateToTile(Tile tile)Rotates the camera to face a tilestatic booleanrotateToTile(Tile tile, Condition interrupt)Rotates camera to face a tilestatic CameraEventrotateToTileEvent(Tile tile)Generates and runs a CameraEvent to rotate camera to specified tilestatic booleanrotateToYaw(int yaw)Rotates camera yaw to specified anglestatic CameraEventrotateToYawEvent(int yaw)Generates and runs a CameraEvent to rotate camera to specified yawstatic voidsetCameraMode(CameraMode mode)static booleansetZoom(int zoomLevel)Sets the camera's zoom level using the scroll wheel If the scrolling overshoots the target zoom level, the method will not re-adjust but the method may still return false if it overshoots by too far.
-
-
-
Method Detail
-
getCameraMode
public static CameraMode getCameraMode()
Returns the current camera mode, showing how the client will move the camera by default- Returns:
- Camera mode, the default of which is
CameraMode.MOUSE_OR_KEYBOARDwhich chooses randomly when moving the camera
-
setCameraMode
public static void setCameraMode(CameraMode mode)
- Parameters:
mode- Camera
-
getPitch
public static int getPitch()
Gets the pitch of the camera- Returns:
- value of the pitch
-
getYaw
public static int getYaw()
Gets the yaw of the camera- Returns:
- value of the yaw
-
getX
public static int getX()
Gets the X of the camera- Returns:
- value of the camera X
-
getY
public static int getY()
Gets the Y of the camera- Returns:
- value of the camera Y
-
getZ
public static int getZ()
Gets the Z of the camera- Returns:
- value of the camera Z
-
getZoom
public static int getZoom()
Gets the camera's current zoom level- Returns:
- Zoom level from about 330 (zoomed all the way out) to about 3000 (zoomed all the way in) Note: minimum and maximum zoom levels depend on your position in game
-
getLowestPitch
public static int getLowestPitch()
Gets the lowest availble pitch Recently updated to just be a flat 128- Returns:
- 128 constant
-
firePitchAndYawEvent
public static void firePitchAndYawEvent(int pitch, int yaw)Fires theRuneScriptEventto change camera pitch/yaw Does not verify your inputs- Parameters:
pitch- desired pitchyaw- desired yaw
-
fireZoomEvent
public static void fireZoomEvent(int zoom)
Fires theRuneScriptEventto change camera zoom Does not verify your inputs- Parameters:
zoom- desired zoom
-
setZoom
public static boolean setZoom(int zoomLevel)
Sets the camera's zoom level using the scroll wheel If the scrolling overshoots the target zoom level, the method will not re-adjust but the method may still return false if it overshoots by too far.- Parameters:
zoomLevel- The desired zoom level, from about 330 (zoomed all the way out) to about 3000 (zoomed all the way in) Note: minimum and maximum zoom levels depend on your position in game- Returns:
- true if the final zoom level is within an acceptable margin (within 3.4% or overshot within 8%), false otherwise
-
rotateToEntity
public static boolean rotateToEntity(Entity entity)
Rotates the camera to face an entity- Parameters:
entity- entity to rotate camera to- Returns:
- true if successfully rotated
-
rotateToEntity
public static boolean rotateToEntity(Entity entity, Condition interrupt)
Rotates the camera to face an entity- Parameters:
entity- entity to rotate camera to- Returns:
- true if successfully rotated
-
rotateToTile
public static boolean rotateToTile(Tile tile)
Rotates the camera to face a tile- Parameters:
tile- tile to rotate camera to- Returns:
- true if successfully rotated
-
rotateToTile
public static boolean rotateToTile(Tile tile, Condition interrupt)
Rotates camera to face a tile
-
rotateTo
public static boolean rotateTo(int yaw, int pitch)Rotates camera to a particular yaw and pitch- Parameters:
yaw- yaw to rotate to (this is left-right)pitch- pitch to rotate to (this is up-down)- Returns:
- true if successfully rotated
-
rotateToYaw
public static boolean rotateToYaw(int yaw)
Rotates camera yaw to specified angle- Parameters:
yaw- yaw to rotate to- Returns:
- true if successfully rotated
-
rotateToPitch
public static boolean rotateToPitch(int pitch)
Rotates camera pitch to specified angle- Parameters:
pitch- pitch to rotate to- Returns:
- true if successfully rotated
-
mouseRotateToEntity
public static boolean mouseRotateToEntity(Entity entity)
Rotates camera to face an entity by using the mouse scroll wheel- Parameters:
entity- entity to rotate camera to- Returns:
- true if successfully rotated
-
mouseRotateToTile
public static boolean mouseRotateToTile(Tile tile)
Rotates camera to face a tile by using the mouse scroll wheel- Parameters:
tile- tile to rotate camera to- Returns:
- true if successfully rotated
-
mouseRotateTo
public static boolean mouseRotateTo(int yaw, int pitch)Rotates camera to a particular yaw and pitch using the mouse scroll wheel- Parameters:
yaw- yaw to rotate to (this is left-right)pitch- pitch to rotate to (this is up-down)- Returns:
- true if successfully rotated
-
mouseRotateToYaw
public static boolean mouseRotateToYaw(int yaw)
Rotates camera yaw to specified angle using the mouse scroll wheel- Parameters:
yaw- yaw to rotate to- Returns:
- true if successfully rotated
-
mouseRotateToPitch
public static boolean mouseRotateToPitch(int pitch)
Rotates camera pitch to specified angle using the mouse scroll wheel- Parameters:
pitch- pitch to rotate to- Returns:
- true if successfully rotated
-
keyboardRotateToEntity
public static boolean keyboardRotateToEntity(Entity entity)
Rotates camera to face an entity by using the keyboard- Parameters:
entity- entity to rotate camera to- Returns:
- true if successfully rotated
-
keyboardRotateToTile
public static boolean keyboardRotateToTile(Tile tile)
Rotates camera to face a tile by using the keyboard- Parameters:
tile- tile to rotate camera to- Returns:
- true if successfully rotated
-
keyboardRotateTo
public static boolean keyboardRotateTo(int yaw, int pitch)Rotates camera to a particular yaw and pitch using the keyboard- Parameters:
yaw- yaw to rotate to (this is left-right)pitch- pitch to rotate to (this is up-down)- Returns:
- true if successfully rotated
-
keyboardRotateToYaw
public static boolean keyboardRotateToYaw(int yaw)
Rotates camera yaw to specified angle using the keyboard- Parameters:
yaw- yaw to rotate to- Returns:
- true if successfully rotated
-
keyboardRotateToPitch
public static boolean keyboardRotateToPitch(int pitch)
Rotates camera pitch to specified angle using the keyboard- Parameters:
pitch- pitch to rotate to- Returns:
- true if successfully rotated
-
rotateToEntityEvent
public static CameraEvent rotateToEntityEvent(Entity entity)
Generates and runs a CameraEvent to rotate camera to specified entity- Parameters:
entity- entity to rotate camera to- Returns:
- CameraEvent
-
rotateToTileEvent
public static CameraEvent rotateToTileEvent(Tile tile)
Generates and runs a CameraEvent to rotate camera to specified tile- Parameters:
tile- tile to rotate camera to- Returns:
- true if successfully rotated
-
rotateToEvent
public static CameraEvent rotateToEvent(int yaw, int pitch)
Generates and runs a CameraEvent to rotate camera to specified yaw and pitch- Parameters:
yaw- yaw to rotate camera topitch- pitch to rotate camera to- Returns:
- CameraEvent
-
rotateToYawEvent
public static CameraEvent rotateToYawEvent(int yaw)
Generates and runs a CameraEvent to rotate camera to specified yaw- Parameters:
yaw- to rotate camera to- Returns:
- CameraEvent
-
rotateToPitchEvent
public static CameraEvent rotateToPitchEvent(int pitch)
Generates and runs a CameraEvent to rotate camera to specified pitch- Parameters:
pitch- pitch to rotate camera to- Returns:
- CameraEvent
-
getYawForTile
public static int getYawForTile(Tile tile)
Gets the yaw required to view the given tile- Parameters:
tile- Tile to get yaw for- Returns:
- Yaw required to be looking at the given tile, returns
getYaw()if local player is null or tile is not local
-
getYawForEntity
public static int getYawForEntity(Entity entity)
Gets the yaw required to look at the given entity SeegetYawForTile(Tile)where the tile isEntity.getTile()
-
getPitchForTile
public static int getPitchForTile(Tile tile)
Gets the pitch required to look at the given Tile- Parameters:
tile- Tile to check pitch for- Returns:
- Pitch required to be looking at the given tile, returns
getPitch()if local player is null or tile is not local
-
getPitchForEntity
public static int getPitchForEntity(Entity entity)
Gets the pitch required to look at the given entity SeegetPitchForTile(Tile)where the tile isEntity.getTile()
-
getMaxZoom
public static int getMaxZoom()
Gets the maximum zoom value, this is the value representing being zoomed all the way out
-
getMinZoom
public static int getMinZoom()
Gets the minimum zoom value, this is the value representing being zoomed all the way in.
-
-