Package rsb.methods
Class Camera
java.lang.Object
rsb.methods.MethodProvider
rsb.methods.Camera
Camera related operations.
- 
Nested Class SummaryNested Classes
- 
Field SummaryFields inherited from class rsb.methods.MethodProvidermethods
- 
Method SummaryModifier and TypeMethodDescriptionintgetAngle()Returns the current compass orientation in degrees, with North at 0, increasing counter-clockwise to 360.intgetAngleTo(int degrees) Returns the angle between the current camera angle and the given angle in degrees.intReturns the camera angle at which the camera would be facing a certain character.intReturns the camera angle at which the camera would be facing a certain object.intgetPitch()Returns the current percentage of the maximum pitch of the camera in an open area.intReturns the camera angle at which the camera would be facing a certain tile.intgetX()Returns the current x position of the camera.intgetY()Returns the current y position of the camera.intgetZ()Returns the current z position of the camera.voidmoveRandomly(int timeOut) Moves the camera in a random direction for a given time.voidsetAngle(int degrees) Rotates the camera to a specific angle in the closest direction.voidsetCompass(char direction) Rotates the camera to the specified cardinal direction.voidsetNorth()Uses the compass component to set the camera to face north.booleansetPitch(boolean up) Sets the altitude to max or minimum.booleansetPitch(int percent) Set the camera to a certain percentage of the maximum pitch.voidsetRotationMethod(Camera.ROTATION_METHOD rotationMethod) voidTurns to a RSCharacter (RSNPC or RSPlayer).voidturnTo(RSCharacter c, int dev) Turns to within a few degrees of an RSCharacter (RSNPC or RSPlayer).voidTurns to an RSObject.voidTurns to within a few degrees of an RSObject.voidTurns to a specific RSTile.voidTurns within a few degrees to a specific RSTile.voidDeprecated.voidturnToCharacter(RSCharacter c, int dev) Deprecated.voidDeprecated.voidturnToObject(RSObject o, int dev) Deprecated.voidturnToTile(RSTile tile) Deprecated.voidturnToTile(RSTile tile, int dev) Deprecated.
- 
Method Details- 
turnToCharacterDeprecated.Turns to an RSCharacter (RSNPC or RSPlayer).- Parameters:
- c- The RSCharacter to turn to.
 
- 
turnToTurns to a RSCharacter (RSNPC or RSPlayer).- Parameters:
- c- The RSCharacter to turn to.
 
- 
turnToCharacterDeprecated.Turns to within a few degrees of an RSCharacter (RSNPC or RSPlayer).- Parameters:
- c- The RSCharacter to turn to.
- dev- The maximum difference in the angle.
 
- 
turnToTurns to within a few degrees of an RSCharacter (RSNPC or RSPlayer).- Parameters:
- c- The RSCharacter to turn to.
- dev- The maximum difference in the angle.
 
- 
turnToObjectDeprecated.Turns to an RSObject- Parameters:
- o- The RSObject to turn to.
 
- 
turnToTurns to an RSObject.- Parameters:
- o- The RSObject to turn to.
 
- 
turnToObjectDeprecated.Turns to within a few degrees of an RSObject.- Parameters:
- o- The RSObject to turn to.
- dev- The maximum difference in the turn angle.
 
- 
turnToTurns to within a few degrees of an RSObject.- Parameters:
- o- The RSObject to turn to.
- dev- The maximum difference in the turn angle.
 
- 
turnToTileDeprecated.Turns to a specific RSTile.- Parameters:
- tile- Tile to turn to.
 
- 
turnToTurns to a specific RSTile.- Parameters:
- tile- Tile to turn to.
 
- 
turnToTileDeprecated.Turns within a few degrees to a specific RSTile.- Parameters:
- tile- Tile to turn to.
- dev- Maximum deviation from the angle to the tile.
 
- 
turnToTurns within a few degrees to a specific RSTile.- Parameters:
- tile- Tile to turn to.
- dev- Maximum deviation from the angle to the tile.
 
- 
setPitchpublic boolean setPitch(boolean up) Sets the altitude to max or minimum.- Parameters:
- up- True to go up. False to go down.
- Returns:
- trueif the altitude was changed.
 
- 
setRotationMethod
- 
setPitchpublic boolean setPitch(int percent) Set the camera to a certain percentage of the maximum pitch. Don't rely on the return value too much - it should return whether the camera was successfully set, but it isn't very accurate near the very extremes of the height. This also depends on the maximum camera angle in a region, as it changes depending on situation and surroundings. So in some areas, 68% might be the maximum altitude. This method will do the best it can to switch the camera altitude to what you want, but if it hits the maximum or stops moving for any reason, it will return. Mess around a little to find the altitude percentage you like. In later versions, there will be easier-to-work-with methods regarding altitude.- Parameters:
- percent- The percentage of the maximum pitch to set the camera to.
- Returns:
- true if the camera was successfully moved; otherwise false.
 
- 
moveRandomlypublic void moveRandomly(int timeOut) Moves the camera in a random direction for a given time.- Parameters:
- timeOut- The maximum time in milliseconds to move the camera for.
 
- 
setAnglepublic void setAngle(int degrees) Rotates the camera to a specific angle in the closest direction.- Parameters:
- degrees- The angle to rotate to.
 
- 
setCompasspublic void setCompass(char direction) Rotates the camera to the specified cardinal direction.- Parameters:
- direction- The char direction to turn the map. char options are w,s,e,n and defaults to north if character is unrecognized.
 
- 
setNorthpublic void setNorth()Uses the compass component to set the camera to face north.
- 
getCharacterAngleReturns the camera angle at which the camera would be facing a certain character.- Parameters:
- n- the RSCharacter
- Returns:
- The angle
 
- 
getObjectAngleReturns the camera angle at which the camera would be facing a certain object.- Parameters:
- o- The RSObject
- Returns:
- The angle
 
- 
getTileAngleReturns the camera angle at which the camera would be facing a certain tile.- Parameters:
- t- The target tile
- Returns:
- The angle in degrees
 
- 
getAngleTopublic int getAngleTo(int degrees) Returns the angle between the current camera angle and the given angle in degrees.- Parameters:
- degrees- The target angle.
- Returns:
- The angle between the who angles in degrees.
 
- 
getAnglepublic int getAngle()Returns the current compass orientation in degrees, with North at 0, increasing counter-clockwise to 360.- Returns:
- The current camera angle in degrees.
 
- 
getPitchpublic int getPitch()Returns the current percentage of the maximum pitch of the camera in an open area.- Returns:
- The current camera altitude percentage.
 
- 
getXpublic int getX()Returns the current x position of the camera.- Returns:
- The x position.
 
- 
getYpublic int getY()Returns the current y position of the camera.- Returns:
- The y position.
 
- 
getZpublic int getZ()Returns the current z position of the camera.- Returns:
- The z position.
 
 
-