C# Class Duality.Components.Camera

Inheritance: Component, ICmpInitializable
显示文件 Open project: BraveSirAndrew/duality Class Usage Examples

Private Properties

Property Type Description
AddEditorRendererFilter void
CollectDrawcalls void
ICmpInitializable void
NotifyCollectDrawcalls void
OnFrameRendered void
ReleaseDevice void
RemoveEditorRendererFilter void
RenderSinglePass void
SetupDevice void
SetupPickingRT void
UpdateDeviceConfig void

Public Methods

Method Description
Camera ( ) : System
GetScaleAtZ ( float z ) : float

Returns the scale factor of objects that are located at the specified (world space) z-Coordinate.

GetScreenCoord ( System.Vector2 spacePos ) : Vector3

Transforms world space coordinates to screen space coordinates.

GetScreenCoord ( Vector3 spacePos ) : Vector3

Transforms world space coordinates to screen space coordinates.

GetSpaceCoord ( System.Vector2 screenPos ) : Vector3

Transforms screen space coordinates to world space coordinates.

GetSpaceCoord ( Vector3 screenPos ) : Vector3

Transforms screen space coordinates to world space coordinates. The screen positions Z coordinate is interpreted as the target world Z coordinate.

IsCoordInView ( Vector3 c, float boundRad = 1.0f ) : bool

Returns whether the specified world-space position is visible in the Cameras view space.

MakeAvailable ( ) : void
OnPassRendered ( Pass pass ) : void
PickRendererAt ( Rect viewportRect, int x, int y ) : ICmpRenderer

Picks the Duality.ICmpRenderer that owns the pixel at the specified position.

PickRendererAt ( int x, int y ) : ICmpRenderer

Picks the Duality.ICmpRenderer that owns the pixel at the specified position.

PickRenderersIn ( Rect viewportRect, int x, int y, int w, int h ) : HashSet

Picks all ICmpRenderers contained within the specified rectangular area.

PickRenderersIn ( int x, int y, int w, int h ) : HashSet

Picks all ICmpRenderers contained within the specified rectangular area.

Render ( Rect viewportRect ) : void

Renders the current Duality.Resources.Scene.

RenderPickingMap ( System.Vector2 viewportSize ) : bool

Renders a picking map of the current Duality.Resources.Scene. If picking is required, this will be (automatically) done each frame a picking operation needs to be performed.

ScreenToViewportCoord ( System.Vector2 screenPos ) : System.Vector2

Transforms screen space coordinates to viewport coordinates.

ToString ( ) : string

Protected Methods

Method Description
OnCopyTo ( Component target, Duality provider ) : void

Private Methods

Method Description
AddEditorRendererFilter ( Predicate filter ) : void
CollectDrawcalls ( ) : void
ICmpInitializable ( Component context ) : void
NotifyCollectDrawcalls ( IDrawDevice device ) : void
OnFrameRendered ( ) : void
ReleaseDevice ( ) : void
RemoveEditorRendererFilter ( Predicate filter ) : void
RenderSinglePass ( Rect viewportRect, Pass p ) : void
SetupDevice ( ) : void
SetupPickingRT ( System.Vector2 size ) : void
UpdateDeviceConfig ( ) : void

Method Details

Camera() public method

public Camera ( ) : System
return System

GetScaleAtZ() public method

Returns the scale factor of objects that are located at the specified (world space) z-Coordinate.
public GetScaleAtZ ( float z ) : float
z float
return float

GetScreenCoord() public method

Transforms world space coordinates to screen space coordinates.
public GetScreenCoord ( System.Vector2 spacePos ) : Vector3
spacePos System.Vector2
return Vector3

GetScreenCoord() public method

Transforms world space coordinates to screen space coordinates.
public GetScreenCoord ( Vector3 spacePos ) : Vector3
spacePos Vector3
return Vector3

GetSpaceCoord() public method

Transforms screen space coordinates to world space coordinates.
public GetSpaceCoord ( System.Vector2 screenPos ) : Vector3
screenPos System.Vector2
return Vector3

GetSpaceCoord() public method

Transforms screen space coordinates to world space coordinates. The screen positions Z coordinate is interpreted as the target world Z coordinate.
public GetSpaceCoord ( Vector3 screenPos ) : Vector3
screenPos Vector3
return Vector3

IsCoordInView() public method

Returns whether the specified world-space position is visible in the Cameras view space.
public IsCoordInView ( Vector3 c, float boundRad = 1.0f ) : bool
c Vector3 The position to test.
boundRad float The visual bounding radius to assume for the specified position.
return bool

MakeAvailable() public method

public MakeAvailable ( ) : void
return void

OnCopyTo() protected method

protected OnCopyTo ( Component target, Duality provider ) : void
target Component
provider Duality
return void

OnPassRendered() public method

public OnPassRendered ( Pass pass ) : void
pass Pass
return void

PickRendererAt() public method

Picks the Duality.ICmpRenderer that owns the pixel at the specified position.
public PickRendererAt ( Rect viewportRect, int x, int y ) : ICmpRenderer
viewportRect Rect The viewport area to which will be rendered.
x int x-Coordinate of the pixel to check.
y int y-Coordinate of the pixel to check.
return ICmpRenderer

PickRendererAt() public method

Picks the Duality.ICmpRenderer that owns the pixel at the specified position.
public PickRendererAt ( int x, int y ) : ICmpRenderer
x int x-Coordinate of the pixel to check.
y int y-Coordinate of the pixel to check.
return ICmpRenderer

PickRenderersIn() public method

Picks all ICmpRenderers contained within the specified rectangular area.
public PickRenderersIn ( Rect viewportRect, int x, int y, int w, int h ) : HashSet
viewportRect Rect The viewport area to which will be rendered.
x int x-Coordinate of the Rect.
y int y-Coordinate of the Rect.
w int Width of the Rect.
h int Height of the Rect.
return HashSet

PickRenderersIn() public method

Picks all ICmpRenderers contained within the specified rectangular area.
public PickRenderersIn ( int x, int y, int w, int h ) : HashSet
x int x-Coordinate of the Rect.
y int y-Coordinate of the Rect.
w int Width of the Rect.
h int Height of the Rect.
return HashSet

Render() public method

Renders the current Duality.Resources.Scene.
public Render ( Rect viewportRect ) : void
viewportRect Rect The viewport area to which will be rendered.
return void

RenderPickingMap() public method

Renders a picking map of the current Duality.Resources.Scene. If picking is required, this will be (automatically) done each frame a picking operation needs to be performed.
public RenderPickingMap ( System.Vector2 viewportSize ) : bool
viewportSize System.Vector2 Sife of the viewport area to which will be rendered.
return bool

ScreenToViewportCoord() public method

Transforms screen space coordinates to viewport coordinates.
public ScreenToViewportCoord ( System.Vector2 screenPos ) : System.Vector2
screenPos System.Vector2
return System.Vector2

ToString() public method

public ToString ( ) : string
return string