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.
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.
Member Name | Summary |
---|---|
ClearFlags | The clear flags for this camera. |
BackgroundColor | The background color of this camera's view if there's no 2D Sky in the scene. |
IsMainCamera | Returns true if this is the main game camera. |
FieldOfView | The field of view of this camera. |
ZNear | The camera's near clip plane distance. A good value for this is about 5. |
ZFar | The camera's far clip plane distance. Sensible ranges are between 1000 and 30000. |
Priority | The priority of this camera. Higher means it'll be rendered on top. |
Orthographic | Whether or not to use orthographic projection instead of perspective. |
OrthographicHeight | The orthographic size for this camera while Orthographic is set to true. |
TargetEye | Specifies the stereo target eye for this camera. |
RenderTags | A list of tags to include specific game objects when rendering this camera. |
RenderExcludeTags | A list of tags to exclude specific game objects when rendering this camera. |
Viewport | The size of the camera represented on the screen. Normalized between 0 and 1. |
RenderTarget | The texture to draw this camera to. Requires Texture.CreateRenderTarget. |
ScreenRect | The size of the viewport, in screen coordinates. |
CustomProjectionMatrix | Allows specifying a custom projection matrix for this camera. |
CustomSize | Allows specifying a custom aspect ratio for this camera. |
ProjectionMatrix | Get frustum projection matrix. |
Hud | Access the HUD painter for this camera. |
Member Name | Summary |
---|---|
AddCommandList | Add a command list to the render. |
RemoveCommandList | Remove an entry. |
ClearCommandLists | Remove all entries in this stage. |
Reset | Reset the camera component to its default state. |
UpdateSceneCamera | Update a SceneCamera with the settings from this component. |
AddHookAfterOpaque | Add a render hook after opaque rendering. |
AddHookAfterTransparent | Add a render hook after transparent rendering. |
AddHookBeforeOverlay | Add a render hook before overlay rendering. |
AddHookAfterUI | Add a render hook after UI rendering. |
PointToScreenNormal | Convert a world position to screen space in normalized coordinates. |
PointToScreenPixels | Convert a world position to screen space in pixel coordinates. |
ScreenPixelToRay | Convert a screen pixel position to a world space ray. |
ScreenNormalToRay | Convert a screen normalized position to a world space ray. |
ScreenToWorld | Convert a screen position to a world position. |
GetFrustum | Get the camera's frustum for a given screen rectangle. |
RenderToTexture | Render the camera's view to a texture. |
CalculateObliqueMatrix | Calculates a projection matrix with an oblique clip-plane defined in world space. |