CameraComponentclass
Every scene should have at least one Camera.
Constructors1
Showing 1 constructors
public CameraComponent()
No results match this filter.
Methods26
Showing 26 methods
public void AddCommandList(Sandbox.Rendering.CommandList buffer, Sandbox.Rendering.Stage stage, int order = 0)
Add a command list to the render
| Parameter | Type | Description |
|---|---|---|
| buffer | CommandList | — |
| stage | Stage | — |
| order = 0 | int | — |
void—public System.IDisposable AddHookAfterOpaque(string debugName, int order, System.Action`1<Sandbox.SceneCamera> renderEffect)
Obsolete: Use CommandList
| Parameter | Type | Description |
|---|---|---|
| debugName | string | — |
| order | int | — |
| renderEffect | Action<SceneCamera> | — |
IDisposable—public System.IDisposable AddHookAfterTransparent(string debugName, int order, System.Action`1<Sandbox.SceneCamera> renderEffect)
Obsolete: Use CommandList
| Parameter | Type | Description |
|---|---|---|
| debugName | string | — |
| order | int | — |
| renderEffect | Action<SceneCamera> | — |
IDisposable—public System.IDisposable AddHookAfterUI(string debugName, int order, System.Action`1<Sandbox.SceneCamera> renderEffect)
Obsolete: Use CommandList
| Parameter | Type | Description |
|---|---|---|
| debugName | string | — |
| order | int | — |
| renderEffect | Action<SceneCamera> | — |
IDisposable—public System.IDisposable AddHookBeforeOverlay(string debugName, int order, System.Action`1<Sandbox.SceneCamera> renderEffect)
Obsolete: Use CommandList
| Parameter | Type | Description |
|---|---|---|
| debugName | string | — |
| order | int | — |
| renderEffect | Action<SceneCamera> | — |
IDisposable—public Sandbox.Rect BBoxToScreenPixels(BBox bounds, bool isBehind)
Given a BBox in world space, will return the screen space rect that totally contains the box.
| Parameter | Type | Description |
|---|---|---|
| bounds | BBox | — |
| isBehind | bool | — |
public Matrix CalculateObliqueMatrix(Sandbox.Plane clipPlane)
Calculates a projection matrix with an oblique clip-plane defined in world space.
| Parameter | Type | Description |
|---|---|---|
| clipPlane | Plane | — |
public bool RenderToTexture(Sandbox.Texture target, Sandbox.Rendering.ViewSetup config = null)
Render scene to a texture from this camera's point of view
| Parameter | Type | Description |
|---|---|---|
| target | Texture | — |
| config = null | ViewSetup | — |
bool—public virtual void Reset()
void—public Vector3 ScreenToWorld(Vector2 screen)
Convert from screen coords to world coords on the near frustum plane.
| Parameter | Type | Description |
|---|---|---|
| screen | Vector2 | — |
public void UpdateSceneCamera(Sandbox.SceneCamera camera, bool includeTags = True)
Update a SceneCamera with the settings from this component
| Parameter | Type | Description |
|---|---|---|
| camera | SceneCamera | — |
| includeTags = True | bool | — |
void—No results match this filter.
Properties26
Showing 26 properties
public Sandbox.CameraComponent.AutoExposureSetup Sandbox.CameraComponent.AutoExposure { get; set; }
Enables and configures auto exposure on the camera. This is usually controlled by the Tonemapping component. But if you're not using that, it can be controlled manually here.
public Color Sandbox.CameraComponent.BackgroundColor { get; set; }
The background color of this camera's view if there's no 2D Sky in the scene.
public Sandbox.ClearFlags Sandbox.CameraComponent.ClearFlags { get; set; }
The clear flags for this camera.
public System.Nullable`1<Matrix> Sandbox.CameraComponent.CustomProjectionMatrix { get; set; }
Allows specifying a custom projection matrix for this camera
public System.Nullable`1<Vector2> Sandbox.CameraComponent.CustomSize { get; set; }
Allows specifying a custom aspect ratio for this camera. By default (or when null) the camera size is screen size or render target size.
public Sandbox.SceneCameraDebugMode Sandbox.CameraComponent.DebugMode { get; set; }
Render this camera using a different render mode
public bool Sandbox.CameraComponent.EnablePostProcessing { get; set; }
Enable or disable post processing for this camera.
bool—public float Sandbox.CameraComponent.FieldOfView { get; set; }
The field of view of this camera.
float—public Sandbox.CameraComponent.Axis Sandbox.CameraComponent.FovAxis { get; set; }
The axis to use for the field of view.
public Sandbox.Rendering.HudPainter Sandbox.CameraComponent.Hud { get; set; }
Allows drawing on the camera. This is drawn before the post processing.
public bool Sandbox.CameraComponent.IsMainCamera { get; set; }
Returns true if this is the main game camera.
bool—public bool Sandbox.CameraComponent.Orthographic { get; set; }
Whether or not to use orthographic projection instead of perspective.
bool—public float Sandbox.CameraComponent.OrthographicHeight { get; set; }
The orthographic size for this camera while `Sandbox.CameraComponent.Orthographic` is set to true.
float—public Sandbox.Rendering.HudPainter Sandbox.CameraComponent.Overlay { get; set; }
Used to draw to the screen. This is drawn on top of everything, so is good for debug overlays etc.
public Sandbox.GameObject Sandbox.CameraComponent.PostProcessAnchor { get; set; }
If set then we'll trigger post process volumes from this position, instead of the camera's position.
public int Sandbox.CameraComponent.Priority { get; set; }
The priority of this camera. Dictates which camera gets rendered on top of another. Higher means it'll be rendered on top.
int—public Matrix Sandbox.CameraComponent.ProjectionMatrix { get; set; }
Get frustum projection matrix.
public Sandbox.TagSet Sandbox.CameraComponent.RenderExcludeTags { get; set; }
A list of tags that will be checked to exclude specific game objects when rendering this camera.
public Sandbox.TagSet Sandbox.CameraComponent.RenderTags { get; set; }
A list of tags that will be checked to include specific game objects when rendering this camera. If none are set, it will include everything.
public Sandbox.Texture Sandbox.CameraComponent.RenderTarget { get; set; }
The texture to draw this camera to. Requires `Sandbox.Texture.CreateRenderTarget`
public Sandbox.Rect Sandbox.CameraComponent.ScreenRect { get; set; }
The size of the viewport, in screen coordinates
public Sandbox.StereoTargetEye Sandbox.CameraComponent.TargetEye { get; set; }
The HMD eye that this camera is targeting. Use `Sandbox.StereoTargetEye.None` for the user's monitor (i.e. the companion window).
public Vector4 Sandbox.CameraComponent.Viewport { get; set; }
The size of the camera represented on the screen. Normalized between 0 and 1.
public bool Sandbox.CameraComponent.WireframeMode { get; set; }
Render this camera using a wireframe view.
bool—public float Sandbox.CameraComponent.ZFar { get; set; }
The camera's far clip plane distance. This is the furthest distance this camera will be able to render. This value totally depends on the game you're making. Shorter the better, sensible ranges would be between about 1000 and 30000, but if you want it to be further out you can balance that out by making ZNear larger.
float—public float Sandbox.CameraComponent.ZNear { get; set; }
The camera's near clip plane distance. This is the closest distance this camera will be able to render. A good value for this is about 5. Below 5 and particularly below 1 you're going to start to see a lot of artifacts like z-fighting.
float—No results match this filter.