C# Class Microsoft.Xna.Framework.Graphics.Viewport

Show file Open project: procfxgen/MGShaderEditor Class Usage Examples

Private Properties

Property Type Description
WithinEpsilon bool

Public Methods

Method Description
Project ( System.Vector3 source, System.Matrix projection, System.Matrix view, System.Matrix world ) : System.Vector3

Projects a Vector3 from world space into screen space.

ToString ( ) : string

Returns a String representation of this Viewport in the format: {X:[X] Y:[Y] Width:[Width] Height:[Height] MinDepth:[MinDepth] MaxDepth:[MaxDepth]}

Unproject ( System.Vector3 source, System.Matrix projection, System.Matrix view, System.Matrix world ) : System.Vector3

Unprojects a Vector3 from screen space into world space.

Viewport ( Rectangle bounds ) : System

Creates a new instance of Viewport struct.

Viewport ( int x, int y, int width, int height ) : System

Constructs a viewport from the given values. The MinDepth will be 0.0 and MaxDepth will be 1.0.

Viewport ( int x, int y, int width, int height, float minDepth, float maxDepth ) : System

Constructs a viewport from the given values.

Private Methods

Method Description
WithinEpsilon ( float a, float b ) : bool

Method Details

Project() public method

Projects a Vector3 from world space into screen space.
public Project ( System.Vector3 source, System.Matrix projection, System.Matrix view, System.Matrix world ) : System.Vector3
source System.Vector3 The to project.
projection System.Matrix The projection .
view System.Matrix The view .
world System.Matrix The world .
return System.Vector3

ToString() public method

Returns a String representation of this Viewport in the format: {X:[X] Y:[Y] Width:[Width] Height:[Height] MinDepth:[MinDepth] MaxDepth:[MaxDepth]}
public ToString ( ) : string
return string

Unproject() public method

Unprojects a Vector3 from screen space into world space.
public Unproject ( System.Vector3 source, System.Matrix projection, System.Matrix view, System.Matrix world ) : System.Vector3
source System.Vector3 The to unproject.
projection System.Matrix The projection .
view System.Matrix The view .
world System.Matrix The world .
return System.Vector3

Viewport() public method

Creates a new instance of Viewport struct.
public Viewport ( Rectangle bounds ) : System
bounds Rectangle A that defines the location and size of the in a render target.
return System

Viewport() public method

Constructs a viewport from the given values. The MinDepth will be 0.0 and MaxDepth will be 1.0.
public Viewport ( int x, int y, int width, int height ) : System
x int The x coordinate of the upper-left corner of the view bounds in pixels.
y int The y coordinate of the upper-left corner of the view bounds in pixels.
width int The width of the view bounds in pixels.
height int The height of the view bounds in pixels.
return System

Viewport() public method

Constructs a viewport from the given values.
public Viewport ( int x, int y, int width, int height, float minDepth, float maxDepth ) : System
x int The x coordinate of the upper-left corner of the view bounds in pixels.
y int The y coordinate of the upper-left corner of the view bounds in pixels.
width int The width of the view bounds in pixels.
height int The height of the view bounds in pixels.
minDepth float The lower limit of depth.
maxDepth float The upper limit of depth.
return System