class CameraComponent : Component

book_4_sparkGenerated
code_blocksInput

Description

The CameraComponent class is a crucial part of the Sandbox engine, responsible for managing camera properties and behaviors within a scene. Every scene should have at least one camera to render the view.

Members

Properties

Member NameSummary
ClearFlagsThe clear flags for this camera.
BackgroundColorThe background color of this camera's view if there's no 2D Sky in the scene.
IsMainCameraReturns true if this is the main game camera.
FieldOfViewThe field of view of this camera.
ZNearThe camera's near clip plane distance. A good value for this is about 5.
ZFarThe camera's far clip plane distance. Sensible ranges are between 1000 and 30000.
PriorityThe priority of this camera. Higher means it'll be rendered on top.
OrthographicWhether or not to use orthographic projection instead of perspective.
OrthographicHeightThe orthographic size for this camera while Orthographic is set to true.
TargetEyeSpecifies the stereo target eye for this camera.
RenderTagsA list of tags to include specific game objects when rendering this camera.
RenderExcludeTagsA list of tags to exclude specific game objects when rendering this camera.
ViewportThe size of the camera represented on the screen. Normalized between 0 and 1.
RenderTargetThe texture to draw this camera to. Requires Texture.CreateRenderTarget.
ScreenRectThe size of the viewport, in screen coordinates.
CustomProjectionMatrixAllows specifying a custom projection matrix for this camera.
CustomSizeAllows specifying a custom aspect ratio for this camera.
ProjectionMatrixGet frustum projection matrix.
HudAccess the HUD painter for this camera.

Methods

Member NameSummary
AddCommandListAdd a command list to the render.
RemoveCommandListRemove an entry.
ClearCommandListsRemove all entries in this stage.
ResetReset the camera component to its default state.
UpdateSceneCameraUpdate a SceneCamera with the settings from this component.
AddHookAfterOpaqueAdd a render hook after opaque rendering.
AddHookAfterTransparentAdd a render hook after transparent rendering.
AddHookBeforeOverlayAdd a render hook before overlay rendering.
AddHookAfterUIAdd a render hook after UI rendering.
PointToScreenNormalConvert a world position to screen space in normalized coordinates.
PointToScreenPixelsConvert a world position to screen space in pixel coordinates.
ScreenPixelToRayConvert a screen pixel position to a world space ray.
ScreenNormalToRayConvert a screen normalized position to a world space ray.
ScreenToWorldConvert a screen position to a world position.
GetFrustumGet the camera's frustum for a given screen rectangle.
RenderToTextureRender the camera's view to a texture.
CalculateObliqueMatrixCalculates a projection matrix with an oblique clip-plane defined in world space.