public sealed class Sandbox.CameraComponent : Sandbox.Component
Every scene should have at least one Camera.
Related Guides
Broader workflow and conceptual references connected to this API.
Sometimes you know what you're looking for, but you don't know where it is.
There are various interfaces that can be given to components for specific purposes.
You can broadcast and listen to events in your scene using interfaces.
To make a multiplayer game you need to take care of a few things. There's a special component that helps with those things, called NetworkHelper. This is a simple component that fits a lot of situations, but can be used as an example to code your own network component.
You can define movies and play them back using C#.
The PlayerController component is a first and third person player controller.
Constructors
Showing 1 constructors
public CameraComponent()
No results match this filter.
Methods
Showing 25 methods
public void AddCommandList(Sandbox.Rendering.CommandList buffer, Sandbox.Rendering.Stage stage, int order = 0)
Add a command list to the render
Parameters
order: Default: 0
public System.IDisposable AddHookAfterOpaque(string debugName, int order, System.Action`1<Sandbox.SceneCamera> renderEffect)Obsolete
Obsolete: Use CommandList
public System.IDisposable AddHookAfterTransparent(string debugName, int order, System.Action`1<Sandbox.SceneCamera> renderEffect)Obsolete
Obsolete: Use CommandList
public System.IDisposable AddHookAfterUI(string debugName, int order, System.Action`1<Sandbox.SceneCamera> renderEffect)Obsolete
Obsolete: Use CommandList
public System.IDisposable AddHookBeforeOverlay(string debugName, int order, System.Action`1<Sandbox.SceneCamera> renderEffect)Obsolete
Obsolete: Use CommandList
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.
public Matrix CalculateObliqueMatrix(Sandbox.Plane clipPlane)
Calculates a projection matrix with an oblique clip-plane defined in world space.
public void RenderToBitmap(Sandbox.Bitmap targetBitmap)
Render this camera to the target bitmap.
public bool RenderToTexture(Sandbox.Texture target, Sandbox.Rendering.ViewSetup config = null)
Render scene to a texture from this camera's point of view
Parameters
config: Default: null
public virtual void Reset()
public Vector3 ScreenToWorld(Vector2 screen)
Convert from screen coords to world coords on the near frustum plane.
public void UpdateSceneCamera(Sandbox.SceneCamera camera, bool includeTags = True)
Update a SceneCamera with the settings from this component
Parameters
includeTags: Default: True
No results match this filter.
Properties
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.
public float Sandbox.CameraComponent.FieldOfView { get; set; }
The field of view of this camera.
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.
public bool Sandbox.CameraComponent.Orthographic { get; set; }
Whether or not to use orthographic projection instead of perspective.
public float Sandbox.CameraComponent.OrthographicHeight { get; set; }
The orthographic size for this camera while `Sandbox.CameraComponent.Orthographic` is set to true.
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.
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.
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.
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.
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox |
| Type | class |
| Assembly | Sandbox.Engine |
| Doc ID | T:Sandbox.CameraComponent |