Package org.dreambot.api.methods.input
Class Camera
- java.lang.Object
-
- org.dreambot.api.methods.input.Camera
-
public class Camera extends java.lang.Object
Created by Nezz
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
firePitchAndYawEvent(int pitch, int yaw)
Fires theRuneScriptEvent
to change camera pitch/yaw Does not verify your inputsstatic void
fireZoomEvent(int zoom)
Fires theRuneScriptEvent
to change camera zoom Does not verify your inputsstatic CameraMode
getCameraMode()
Returns the current camera mode, showing how the client will move the camera by defaultstatic int
getLowestPitch()
Gets the lowest availble pitch Recently updated to just be a flat 128static int
getMaxZoom()
Gets the maximum zoom valuestatic int
getPitch()
Gets the pitch of the camerastatic int
getPitchForEntity(Entity entity)
Gets the pitch required to look at the given entity SeegetPitchForTile(Tile)
where the tile isEntity.getTile()
static int
getPitchForTile(Tile tile)
Gets the pitch required to look at the given Tilestatic int
getX()
Gets the X of the camerastatic int
getY()
Gets the Y of the camerastatic int
getYaw()
Gets the yaw of the camerastatic int
getYawForEntity(Entity entity)
Gets the yaw required to look at the given entity SeegetYawForTile(Tile)
where the tile isEntity.getTile()
static int
getYawForTile(Tile tile)
Gets the yaw required to view the given tilestatic int
getZ()
Gets the Z of the camerastatic int
getZoom()
Gets the camera's current zoom levelstatic boolean
keyboardRotateTo(int yaw, int pitch)
Rotates camera to a particular yaw and pitch using the keyboardstatic boolean
keyboardRotateToEntity(Entity entity)
Rotates camera to face an entity by using the keyboardstatic boolean
keyboardRotateToPitch(int pitch)
Rotates camera pitch to specified angle using the keyboardstatic boolean
keyboardRotateToTile(Tile tile)
Rotates camera to face a tile by using the keyboardstatic boolean
keyboardRotateToYaw(int yaw)
Rotates camera yaw to specified angle using the keyboardstatic boolean
mouseRotateTo(int yaw, int pitch)
Rotates camera to a particular yaw and pitch using the mouse scroll wheelstatic boolean
mouseRotateToEntity(Entity entity)
Rotates camera to face an entity by using the mouse scroll wheelstatic boolean
mouseRotateToPitch(int pitch)
Rotates camera pitch to specified angle using the mouse scroll wheelstatic boolean
mouseRotateToTile(Tile tile)
Rotates camera to face a tile by using the mouse scroll wheelstatic boolean
mouseRotateToYaw(int yaw)
Rotates camera yaw to specified angle using the mouse scroll wheelstatic boolean
rotateTo(int yaw, int pitch)
Rotates camera to a particular yaw and pitchstatic boolean
rotateToEntity(Entity entity)
Rotates the camera to face an entitystatic boolean
rotateToEntity(Entity entity, Condition interrupt)
Rotates the camera to face an entitystatic CameraEvent
rotateToEntityEvent(Entity entity)
Generates and runs a CameraEvent to rotate camera to specified entitystatic CameraEvent
rotateToEvent(int yaw, int pitch)
Generates and runs a CameraEvent to rotate camera to specified yaw and pitchstatic boolean
rotateToPitch(int pitch)
Rotates camera pitch to specified anglestatic CameraEvent
rotateToPitchEvent(int pitch)
Generates and runs a CameraEvent to rotate camera to specified pitchstatic boolean
rotateToTile(Tile tile)
Rotates the camera to face a tilestatic boolean
rotateToTile(Tile tile, Condition interrupt)
Rotates camera to face a tilestatic CameraEvent
rotateToTileEvent(Tile tile)
Generates and runs a CameraEvent to rotate camera to specified tilestatic boolean
rotateToYaw(int yaw)
Rotates camera yaw to specified anglestatic CameraEvent
rotateToYawEvent(int yaw)
Generates and runs a CameraEvent to rotate camera to specified yawstatic void
setCameraMode(CameraMode mode)
static boolean
setZoom(int zoomLevel)
Sets the camera's zoom level using the scroll wheel
-
-
-
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_KEYBOARD
which 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 theRuneScriptEvent
to change camera pitch/yaw Does not verify your inputs- Parameters:
pitch
- desired pitchyaw
- desired yaw
-
fireZoomEvent
public static void fireZoomEvent(int zoom)
Fires theRuneScriptEvent
to 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- 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, 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
-
-