Summary

Every scene should have at least one Camera.

Constructors

CameraComponent

Properties

BackgroundColor The background color of this camera's view if there's no 2D Sky in the scene.
ClearFlags The clear flags for this camera.
CustomProjectionMatrix Allows specifying a custom projection matrix for this camera
CustomSize Allows specifying a custom aspect ratio for this camera. By default the camera size is screen size or render target size.
FieldOfView The field of view of this camera.
FovAxis The axis to use for the field of view.
Hud Allows drawing on the camera. This is drawn before the post processing.
IsMainCamera Returns true if this is the main game camera.
Orthographic Whether or not to use orthographic projection instead of perspective.
OrthographicHeight The orthographic size for this camera while Sandbox.CameraComponent.Orthographic is set to true.
Overlay Used to draw to the screen. This is drawn on top of everything, so is good for debug overlays etc.
Priority The priority of this camera. Dictates which camera gets rendered on top of another. Higher means it'll be rendered on top.
ProjectionMatrix Get frustum projection matrix.
RenderExcludeTags A list of tags that will be checked to exclude specific game objects when rendering this camera.
RenderTags 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.
RenderTarget The texture to draw this camera to. Requires Sandbox.Texture.CreateRenderTarget
ScreenRect The size of the viewport, in screen coordinates
TargetEye
Viewport The size of the camera represented on the screen. Normalized between 0 and 1.
ZFar 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.
ZNear 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.

Methods

AddCommandList Add a command list to the render
AddHookAfterOpaqueobsolete
AddHookAfterTransparentobsolete
AddHookAfterUIobsolete
AddHookBeforeOverlayobsolete
BBoxToScreenPixels Given a BBox in world space, will return the screen space rect that totally contains the box.
CalculateObliqueMatrix Calculates a projection matrix with an oblique clip-plane defined in world space.
ClearCommandLists Remove all entries in this stage
GetFrustum
PointToScreenNormal
PointToScreenPixels
RemoveCommandList Remove an entry
RenderToBitmap Render this camera to the target bitmap.
RenderToTexture Render scene to a texture from this camera's point of view
Reset
ScreenNormalToRay
ScreenPixelToRay
ScreenToWorld
UpdateSceneCamera Update a SceneCamera with the settings from this component

Static Methods

RenderToPixmap Render this camera to the target widget. Once you do this the target widget becomes "externally painted", so you won't be able to paint on it anymore with Qt's Paint stuff.
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.