Skip to main content

Camera

class Camera

It is responsible for rendering everything seen in the scene, they are like your eyes at the game.

See the camera component topic to learn more about the camera.


public class Camera extends Component

— Constructors (1) —

ConstructorDescription
Camera()Creates a new Camera.

— Enumerators (2) —

public enum FreeAspectResolutionSide {
Width, Height
}

public enum ResolutionMode {
Percentage, FixedResolution, FreeAspectResolution
}

— Methods (91) —

NameDescription
float getRenderDistance()Returns the Camera's render distance value.
void setRenderDistance(float value)Sets the Camera's render distance value to be "value" argument.
float getMinimalDistance()Returns the minimum distance rendered by the Camera.
void setMinimalDistance(float value)Sets the minimum distance rendered by the Camera to be "value" argument.
float getFov()Returns the Camera's field of view.
void setFov(float value)Sets the Camera's field of view to be "value" argument.
int getRenderPercentage()Returns the rendering quality (resolution) of the Camera.
void setRenderPercentage(int value)Sets the Camera's rendering quality (resolution) to be "value" argument.
int getLayer()Returns the Camera layer.
void setLayer(int value)Defines the Camera layer to be "value" argument.
float getOrthoDiameter()Returns the diameter of the Camera's orthographic view(only in 2D camera projection).
void setOrthoDiameter(float value)Sets the diameter of the Camera's orthographic view(only in 2D camera projection) to be "value" argument.
int getProjection()Returns the Camera projection(2D or 3D).
void setProjection(int value)Sets the Camera projection(2D or 3D) to be "value" argument.
int getBackground()Returns the Camera's background.
void setBackground(int value)Sets the Camera's background to be "value" argument.
[CameraObjectFilter] getObjectFilter()Returns the filter of the object attached to the Camera.
void setObjectFilter([CameraObjectFilter] filter)Defines the filter of the object attached to the Camera to be "filter" argument.
RayDirection screenPointRay(int x, int y)Returns a ray coming out of the Camera pointing in the direction of the screen coordinates to be "x" and "y" arguments.
RayDirection screenPointRay(Point2 screenCoords)Returns a ray coming out of the Camera pointing in the direction of screen coordinates to be "screenCoods" argument.
RayDirection screenPointRay(float x, float y)Returns a ray coming out of the Camera pointing in the direction of the screen coordinates to be "x" and "y" arguments.
RayDirection screenPointRay(Vector2 screenCoords)Returns a ray coming out of the Camera pointing in the direction of screen coordinates to be "screenCoods" argument.
Vector3 screenPointNormal(int x, int y)Returns a normal that tells the direction leaving the Camera pointing in the direction of the screen coordinates to be "x" and "y" arguments.
Vector3 screenPointNormal(Point2 screenCoords)Returns a normal that tells the direction coming out of the Camera pointing in the direction of screen coordinates to be "screenCoords" argument.
Vector3 screenPointNormal(float x, float y)Returns a normal that tells the direction leaving the Camera pointing in the direction of the screen coordinates to be "x" and "y" arguments.
Vector3 screenPointNormal(Vector2 screenCoords)Returns a normal that tells the direction coming out of the camera pointing in the direction of screen coordinates to be "screenCoords" argument.
void takeScreenShot(String folder, String outputFile)Take a print (Screenshot) of the screen and saves it in a folder with the name passed to be "folder" argument, and in a file inside that folder with the name passed to be "outputFile" argument.
void takeScreenShot(String folder, String outputFile, boolean bypassFileChecking)Take a print (Screenshot) of the screen and save it in a folder with the name passed to be "folder" argument, and in a file inside that folder with the name passed to be "outputFile" argument, and if the "bypassFileChecking" argument is "true ", the engine does not check if the address of the file is writable, and it tries to put an address anyway, for example, if you put an address outside, it will give an error, since Android does not allow writing outside the date of the app.
void takeScreenShot(File folder, String outputFile)Take a print (Screenshot) of the screen and saves it in a folder to be "folder" argument, and in a file inside that folder with the name passed to be "outputFile" argument.
[float[] getViewMatrix()Returns the Camera's matrix view.
float[] getProjectionMatrix()Returns the Camera's matrix projection.
ArrayList getFilters()Returns the current filters used on Camera.
[CameraFilter] getFilter(int idx)Returns a Camera filter by an id to be "idx" argument.
[CameraFilter] getFilter(String tittle)Returns a Camera filter by its name to be "tittle" argument.
[CameraFilter] getFilter([Class] classReference)Returns a Camera filter by a reference class to be "classReference" argument.
int getFilterCount()Returns the number of filters used on Camera.
void setFilters(ArrayList filters)Defines filters on the Camera to be "filters" argument.
void addFilter([CameraFilter] cameraFilter)Adds a camera filter to be "cameraFilter" argument.
void removeFilter([CameraFilter] cameraFilter)Removes a camera filter to be "cameraFilter" argument.
void recalculateMatrices()Forces instant recalculation of Camera matrices.
FrameBuffer getFrameBuffer()Returns the FrameBuffer attached to the Camera.
boolean isVisible(ModelRenderer modelRenderer)Returns true if the ModelRenderer of the Camera is visible, returns false if not.
boolean isVisible(Vertex vertex, SpatialObject object)Returns true if the vertex of the object defined to be the argument is visible to the Camera, returns false if not.
boolean isVisible(Vertex vertex, Transform transform)Returns true if the object vertex and Transform are visible to the Camera, returns false if not.
boolean isVisible(Vertex vertex, float[] renderMatrix)Returns true if the object vertex and rendering matrix are visible to the Camera, returns false if not.
boolean isSphereVisible(Vector3 position, float radius)Returns true if the position and radius of the sphere are visible to the Camera, returns false if not.
boolean isSphereVisible(float x, float y, float z, float radius)Returns true if the position and radius of the sphere are visible to the Camera, returns false if not.
boolean isSphereVisible(Transform transform, float radius)Returns true if the position of the Transform and the radius of the sphere are visible to the Camera, returns false if not.
boolean isCubeVisible(Vector3 position, float size)Returns true if the position and size of the cube are visible to the Camera, returns false if not.
boolean isCubeVisible(float x, float y, float z, float size)Returns true if the position and size of the cube are visible to the Camera, returns false if not.
boolean isPointVisible(SpatialObject object)Returns true if the SpatialObject defined to be the argument is visible to the Camera, returns false if not.
boolean isPointVisible(Transform transform)Returns true if the Transform defined to be the argument is visible to the Camera, returns false if not.
boolean isPointVisible(Vector3 position)Returns true if the position defined to be the argument is visible to the Camera, returns false if not.
boolean isPointVisible(float x, float y, float z)Returns true if the position defined to be the argument is visible to the Camera, returns false if not.
int determineImageResolutionPercentage()Sets the current resolution percentage of the Camera image.
float getExposure()Returns the value of the current Camera Exposure effect.
int getFixedResolutionPixelsHeight()Returns the fixed vertical resolution value in Camera pixels.
void setFixedResolutionPixelsHeight(int value)Sets the fixed vertical resolution value in Camera pixels.
int getFixedResolutionPixelsWidth()Returns the fixed horizontal resolution value in Camera pixels.
void setFixedResolutionPixelsWidth(int value)Sets the fixed horizontal resolution value in Camera pixels.
[FreeAspectResolutionSide] getFreeAspectResolutionSide()Returns the value of the free resolution in pixels of the Camera keeping the aspect ratio according to the screen side of the device.
void setFreeAspectResolutionSide([FreeAspectResolutionSide] value)Sets the value of the free resolution in pixels of the Camera keeping the aspect ratio according to the screen side of the device.
int getFreeResolutionPixels()Returns the free resolution value in Camera pixels.
void setFreeResolutionPixels(int value)Sets the value of the free resolution in Camera pixels.
float[] getFrustumMatrix()Returns the current Camera frustum Matrix.
float getGamma()Returns the value of the Camera’s current Gamma effect.
float[] getHierarchyCameraMatrix()Returns the Camera Matrix hierarchy.
int getImageHeight()Returns the current height of the Camera image.
float getImageRatio()Returns the current aspect ratio of the Camera image.
int getImageWidth()Returns the current width of the Camera image.
float[] getInverseFrustumMatrix()Returns the current inverse frustum Matrix of the Camera.
float[] getInverseViewMatrix()Returns the current view of the inverse Camera Matrix.
float getNearPlane()Returns the value of the Camera’s current NearPlane effect.
float getFarPlane()Returns the current FarPlane effect value of the Camera.
float getScaledRectHeight()Returns the current height scale of the Camera Rect.
float getRectHeight()Returns the current height of the Camera Rect.
void setRectHeight(float value)Sets the current height of the Camera Rect.
float getRectPosX()Returns the current X position of the Camera Rect.
float getScaledRectPosX()Returns the current scale of the X position of the Camera Rect.
void setRectPosX(float value)Sets the current X position of the Camera Rect.
float getRectPosY()Returns the current Y position of the Camera Rect.
float getScaledRectPosY()Returns the current scale of the Y position of the Camera Rect.
void setRectPosY(float value)Sets the current Y position of the Camera Rect.
float getRectWidth()Returns the current width of the Camera Rect.
float getScaledRectWidth()Returns the current scale of the width of the Camera Rect.
void setRectWidth( float value)Sets the current width of the Camera Rect.
Vector3 getRenderCameraDirection()Returns the current rendering direction of the Camera.
Vector3 getRenderCameraPosition()Returns the current rendering position of the Camera.
[ResolutionMode] getResolutionMode()Returns the current resolution mode of the Camera.
void setResolutionMode([ResolutionMode] value)Sets the current resolution mode of the Camera.
FrameBuffer getFrameBuffer()Returns the current frame buffer of the Camera.