| 限定符和类型 | 类 | 说明 |
|---|---|---|
static class |
CameraComponent.CameraType |
Enumerates camera types.
|
| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
CAMERA_FLAG_SHADOW_BIT |
Specifies whether the camera is used for shadow rendering.
|
| 构造器 | 说明 |
|---|---|
CameraComponent() |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
int |
getAdditionalFlags() |
Obtains the additional flags of the camera, for example, whether the camera is used for shadow rendering.
|
CameraComponent.CameraType |
getCameraType() |
Obtains the camera type.
|
Matrix4x4 |
getCustomProjection() |
Obtains the projection matrix for the customized type of camera.
|
String |
getName() |
Obtains the camera name.
|
float |
getOrthoHeight() |
Obtains the height of the viewport for the orthographic camera only.
|
float |
getOrthoWidth() |
Obtains the width of the viewport for the orthographic camera only.
|
float |
getPerspectiveAspectRatio() |
Obtains the aspect ratio for the perspective camera only.
|
float |
getPerspectiveVerticalFov() |
Obtains the vertical field of view (FOV) for the perspective camera only.
|
int |
getRenderResolutionX() |
Obtains the horizontal rendering resolution (in pixels) for the camera.
|
int |
getRenderResolutionY() |
Obtains the vertical rendering resolution (in pixels) for the camera.
|
float[] |
getViewportParams() |
Obtains the position and size of the viewport for a normalized rendering resolution (from 0.0 to 1.0).
|
float |
getZfar() |
Obtains the far plane location.
|
float |
getZnear() |
Obtains the near plane location.
|
void |
setAdditionalFlags(int additionalFlags) |
Sets the additional flags of the camera.
|
void |
setCameraType(CameraComponent.CameraType cameraType) |
Sets the camera type.
|
void |
setCustomProjection(Matrix4x4 customProjection) |
Sets the projection matrix for the customized type of camera.
|
void |
setName(String name) |
Sets the camera name.
|
void |
setOrthoHeight(float orthoHeight) |
Sets the viewport height for the orthographic camera only.
|
void |
setOrthoWidth(float orthoWidth) |
Sets the viewport width for the orthographic camera only.
|
void |
setPerspectiveAspectRatio(float perspectiveAspectRatio) |
Sets the aspect ratio for the perspective camera only.
|
void |
setPerspectiveVerticalFov(float perspectiveVerticalFov) |
Sets the vertical FOV for the perspective camera only.
|
void |
setRenderResolution(int renderResolutionX,
int renderResolutionY) |
Sets rendering resolutions for the camera.
|
void |
setViewportParams(float[] viewportParams) |
Sets the position and size of the viewport.
|
void |
setZfar(float zfar) |
Sets the far plane location.
|
void |
setZnear(float znear) |
Sets the near plane location.
|
public static final int CAMERA_FLAG_SHADOW_BIT
public String getName()
public void setName(String name)
name - Indicates the camera name to set.public CameraComponent.CameraType getCameraType()
public void setCameraType(CameraComponent.CameraType cameraType)
cameraType - Indicates the camera type, as enumerated in CameraType.public int getAdditionalFlags()
public void setAdditionalFlags(int additionalFlags)
additionalFlags - Indicates the flags to set.public float getPerspectiveAspectRatio()
If the initial aspect ratio is 0 or less, you should use the aspect ratio of the render target.
public void setPerspectiveAspectRatio(float perspectiveAspectRatio)
perspectiveAspectRatio - Indicates the aspect ratio to set.public float getPerspectiveVerticalFov()
public void setPerspectiveVerticalFov(float perspectiveVerticalFov)
perspectiveVerticalFov - Indicates the vertical FOV to set.public float getOrthoWidth()
public void setOrthoWidth(float orthoWidth)
orthoWidth - Indicates the viewport width to set.public float getOrthoHeight()
public void setOrthoHeight(float orthoHeight)
orthoHeight - Indicates the viewport height to set.public Matrix4x4 getCustomProjection()
public void setCustomProjection(Matrix4x4 customProjection)
customProjection - Indicates the projection matrix to set.public float getZnear()
public void setZnear(float znear)
znear - Indicates the near plane location to set.public float getZfar()
public void setZfar(float zfar)
zfar - Indicates the far plane location to set.public float[] getViewportParams()
The position and size are represented in an array consisting of four float values: [0] = x, [1] = y, [2] = the relative width, [3] = the relative height.
public void setViewportParams(float[] viewportParams)
getViewportParams().viewportParams - Indicates the viewport parameters.public int getRenderResolutionX()
public int getRenderResolutionY()
public void setRenderResolution(int renderResolutionX,
int renderResolutionY)
renderResolutionX - Indicates the horizontal rendering resolution.renderResolutionY - Indicates the vertical rendering resolution.