Package org.dreambot.api.methods
Class ViewportTools
- java.lang.Object
-
- org.dreambot.api.methods.ViewportTools
-
-
Field Summary
Fields Modifier and Type Field Description static int[]CURVE_COSstatic int[]CURVE_SINstatic intLOCAL_XY_SHIFT
-
Constructor Summary
Constructors Constructor Description ViewportTools()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddrawModel(java.awt.Graphics2D g, int gridX, int gridY, int z, Model model)static intgetAbsoluteXCoordinate()static intgetAbsoluteYCoordinate()java.awt.RectanglegetBoundingBox(int[][] vertex)static java.awt.RectanglegetCanvasRectangle()static java.awt.ShapegetClickableArea()static java.awt.RectanglegetFullCanvasRectangle()java.awt.PointgetMiniMapCoordinate(int destinationX, int destinationY)java.awt.geom.AreagetModelArea(int gridX, int gridY, int z, Model model)java.awt.geom.AreagetModelArea(int gridX, int gridY, int z, Model model, boolean predictMovement)java.awt.geom.AreagetModelArea(Entity target)java.awt.geom.AreagetModelArea(Entity target, boolean predictMovement)java.awt.RectanglegetModelBoundingBox(int gridX, int gridY, int z, Model model)java.util.List<java.awt.Point>getPoints(java.awt.geom.Area area)static java.awt.PointgetRandomPointOnCanvas()static intgetRandomXCoordOnCanvas()static intgetRandomYCoordOnCanvas()int[]getScreenCoordinates(int gridX, int gridY, int plane, int height)int[][]getScreenCoordinates(int gridX, int gridY, int plane, Model model)java.awt.PointgetScreenCoordinatesPoint(int gridX, int gridY, int plane, int height)java.awt.PointgetSuitablePointFor(java.awt.geom.Area area)java.awt.PointgetSuitablePointFor(java.awt.Rectangle box)java.awt.PointgetSuitablePointForModel(int gridX, int gridY, int z, Model model, boolean predictMovement)intgetTileHeight(int tileX, int tileY, int tilePlane)Calculates the tile height for offset specified tileint[][]getTriangluatedFaces(int gridX, int gridY, int plane, Model model, int triangle)java.util.List<java.awt.Point>getVertices(Model structure)booleanisOnGameScreen(double x, double y)booleanisOnGameScreen(java.awt.Point point)Determines if point is on the game screen.booleanisVisibleOnCanvas(java.awt.geom.Area area)booleanisVisibleOnCanvas(java.awt.Rectangle rectangle)booleanisVisibleOnMainScreen(int x, int y)booleanisVisibleOnMainScreen(java.awt.Point p)booleanisVisibleOnMainScreen(java.awt.Shape shape)java.awt.PointlocalTileToScreen(Tile tile)Local tile to offset screen position.java.awt.PointtileToScreen(int tileX, int tileY, double offsetX, double offsetY, int tileHeight)Tile to offset screen position.java.awt.PointtileToScreen(int x, int y, int tileHeight)Converts offset set of local coordinates into their screen positionsjava.awt.PointtileToScreen(Tile tile)World tile to offset regional tile and converts that regional tile into offset position on the game screen.
-
-
-
Field Detail
-
CURVE_SIN
public static final int[] CURVE_SIN
-
CURVE_COS
public static final int[] CURVE_COS
-
LOCAL_XY_SHIFT
public static final int LOCAL_XY_SHIFT
- See Also:
- Constant Field Values
-
-
Method Detail
-
getAbsoluteYCoordinate
public static int getAbsoluteYCoordinate()
-
getAbsoluteXCoordinate
public static int getAbsoluteXCoordinate()
-
getRandomXCoordOnCanvas
public static int getRandomXCoordOnCanvas()
-
getFullCanvasRectangle
public static java.awt.Rectangle getFullCanvasRectangle()
-
getRandomYCoordOnCanvas
public static int getRandomYCoordOnCanvas()
-
getRandomPointOnCanvas
public static java.awt.Point getRandomPointOnCanvas()
-
getClickableArea
public static java.awt.Shape getClickableArea()
-
getCanvasRectangle
public static java.awt.Rectangle getCanvasRectangle()
-
tileToScreen
public java.awt.Point tileToScreen(Tile tile)
World tile to offset regional tile and converts that regional tile into offset position on the game screen.- Specified by:
tileToScreenin interfaceViewport- Parameters:
tile- tile- Returns:
- A point representing the screen coordinate, if not on game screen returns (-1,-1).
-
tileToScreen
public java.awt.Point tileToScreen(int x, int y, int tileHeight)Converts offset set of local coordinates into their screen positions- Specified by:
tileToScreenin interfaceViewport- Parameters:
x- local X coordinatey- local Y coordinatetileHeight- Height of the content on the tile.- Returns:
- A point representing the screen coordinate, of which the x/y may be -1.
-
tileToScreen
public java.awt.Point tileToScreen(int tileX, int tileY, double offsetX, double offsetY, int tileHeight)Tile to offset screen position.- Specified by:
tileToScreenin interfaceViewport- Parameters:
tileX- the tile xtileY- the tile yoffsetX- the x offsetoffsetY- the y offsettileHeight- the tile height- Returns:
- an on screen point
-
localTileToScreen
public java.awt.Point localTileToScreen(Tile tile)
Local tile to offset screen position.- Specified by:
localTileToScreenin interfaceViewport- Parameters:
tile- tile- Returns:
- A point representing the screen coordinate, of which the x/y may be -1.
-
getTileHeight
public int getTileHeight(int tileX, int tileY, int tilePlane)Calculates the tile height for offset specified tile- Parameters:
tileX- raw local X of the tiletileY- raw local Y of the tiletilePlane- current client plane- Returns:
- tile height
-
isOnGameScreen
public boolean isOnGameScreen(java.awt.Point point)
Determines if point is on the game screen.- Specified by:
isOnGameScreenin interfaceViewport- Parameters:
point- The point to check- Returns:
- true if the point is on game screen or else it's false.
-
isOnGameScreen
public boolean isOnGameScreen(double x, double y)
-
getTriangluatedFaces
public int[][] getTriangluatedFaces(int gridX, int gridY, int plane, Model model, int triangle)
-
getScreenCoordinates
public int[][] getScreenCoordinates(int gridX, int gridY, int plane, Model model)
-
getVertices
public java.util.List<java.awt.Point> getVertices(Model structure)
-
getScreenCoordinates
public int[] getScreenCoordinates(int gridX, int gridY, int plane, int height)
-
getMiniMapCoordinate
public java.awt.Point getMiniMapCoordinate(int destinationX, int destinationY)
-
getBoundingBox
public java.awt.Rectangle getBoundingBox(int[][] vertex)
-
getModelBoundingBox
public java.awt.Rectangle getModelBoundingBox(int gridX, int gridY, int z, Model model)
-
getScreenCoordinatesPoint
public java.awt.Point getScreenCoordinatesPoint(int gridX, int gridY, int plane, int height)
-
getSuitablePointForModel
public java.awt.Point getSuitablePointForModel(int gridX, int gridY, int z, Model model, boolean predictMovement)
-
getSuitablePointFor
public java.awt.Point getSuitablePointFor(java.awt.geom.Area area)
-
getSuitablePointFor
public java.awt.Point getSuitablePointFor(java.awt.Rectangle box)
-
getModelArea
public java.awt.geom.Area getModelArea(Entity target)
-
getModelArea
public java.awt.geom.Area getModelArea(Entity target, boolean predictMovement)
-
getModelArea
public java.awt.geom.Area getModelArea(int gridX, int gridY, int z, Model model)
-
getModelArea
public java.awt.geom.Area getModelArea(int gridX, int gridY, int z, Model model, boolean predictMovement)
-
drawModel
public void drawModel(java.awt.Graphics2D g, int gridX, int gridY, int z, Model model)
-
isVisibleOnCanvas
public boolean isVisibleOnCanvas(java.awt.Rectangle rectangle)
-
isVisibleOnCanvas
public boolean isVisibleOnCanvas(java.awt.geom.Area area)
-
isVisibleOnMainScreen
public boolean isVisibleOnMainScreen(java.awt.Shape shape)
-
isVisibleOnMainScreen
public boolean isVisibleOnMainScreen(int x, int y)
-
isVisibleOnMainScreen
public boolean isVisibleOnMainScreen(java.awt.Point p)
-
getPoints
public java.util.List<java.awt.Point> getPoints(java.awt.geom.Area area)
-
-