class CameraComponent : Component

robot_2Generated
code_blocksInput

Description

The CameraComponent class in the Sandbox namespace is a crucial component for rendering scenes. Every scene should have at least one camera to capture and display the visual elements. This class provides a variety of methods and properties to control camera behavior, rendering settings, and more.

Members

Instance Methods

Member NameSummary
AddCommandListAdd a command list to the render
RemoveCommandListRemove an entry
ClearCommandListsRemove all entries in this stage
ResetResets the camera component to its default state
UpdateSceneCameraUpdate a SceneCamera with the settings from this component
AddHookAfterOpaqueObsolete. Adds a render hook after opaque rendering
AddHookAfterTransparentAdds a render hook after transparent rendering
AddHookBeforeOverlayAdds a render hook before overlay rendering
AddHookAfterUIObsolete. Adds a render hook after UI rendering
PointToScreenNormalConverts a world position to screen space in normalized coordinates
PointToScreenPixelsConverts a world position to screen space in pixel coordinates
BBoxToScreenPixelsReturns the screen space rect that contains the given BBox
ScreenPixelToRayConverts a screen pixel position to a world space ray
ScreenNormalToRayConverts a screen normal position to a world space ray
ScreenToWorldConverts a screen position to a world position
GetFrustumGets the camera's frustum for a given screen rectangle
RenderToTextureRenders the camera view to a specified texture
CalculateObliqueMatrixCalculates a projection matrix with an oblique clip-plane
RenderToBitmapRender this camera to the target bitmap

Instance Properties

Member NameSummary
ClearFlagsThe clear flags for this camera
BackgroundColorThe background color of this camera's view
IsMainCameraReturns true if this is the main game camera
FovAxisThe axis to use for the field of view
FieldOfViewThe field of view of this camera
ZNearThe camera's near clip plane distance
ZFarThe camera's far clip plane distance
PriorityThe priority of this camera
OrthographicWhether to use orthographic projection
OrthographicHeightThe orthographic size for this camera
TargetEyeThe target eye for stereo rendering
RenderTagsTags to include specific game objects when rendering
RenderExcludeTagsTags to exclude specific game objects when rendering
ViewportThe size of the camera on the screen
RenderTargetThe texture to draw this camera to
ScreenRectThe size of the viewport in screen coordinates
CustomProjectionMatrixSpecifies a custom projection matrix for this camera
CustomSizeSpecifies a custom aspect ratio for this camera
ProjectionMatrixGet frustum projection matrix
HudAllows drawing on the camera before post processing
OverlayUsed to draw to the screen for debug overlays