Struct Viewport
Describes the viewport dimensions.
Assembly: FlaxEngine.dll
File: Engine/Core/Math/Viewport.h
Syntax
public struct ViewportConstructors
Viewport()
Empty constructor.
Declaration
public Viewport() = defaultViewport(const Float2& size)
Initializes a new instance of the Viewport struct.
Declaration
public Viewport(const Float2& size)Parameters
| Float2
        size The viewport size. | 
Viewport(const Rectangle& bounds)
Initializes a new instance of the Viewport struct.
Declaration
public Viewport(const Rectangle& bounds)Parameters
| Rectangle
        bounds A bounding rectangle that defines the location and size of the viewport in a render target. | 
Viewport(float x, float y, float width, float height, float minDepth = 0.0f, float maxDepth=1.0f)
Initializes a new instance of the Viewport struct.
Declaration
public Viewport(float x, float y, float width, float height, float minDepth = 0.0f, float maxDepth=1.0f)Parameters
| float
        x The x coordinate of the upper-left corner of the viewport in pixels. | 
| float
        y The y coordinate of the upper-left corner of the viewport in pixels. | 
| float
        width The width of the viewport in pixels. | 
| float
        height The height of the viewport in pixels. | 
| float
        minDepth The minimum depth of the clip volume. | 
| float
        maxDepth The maximum depth of the clip volumes. | 
Fields
Height
Declaration
public float HeightField Value
| float 
 | 
Location
Declaration
public Float2 LocationField Value
| Float2 
 | 
MaxDepth
Declaration
public float MaxDepthField Value
| float 
 | 
MinDepth
Declaration
public float MinDepthField Value
| float 
 | 
Size
Declaration
public Float2 SizeField Value
| Float2 
 | 
Width
Declaration
public float WidthField Value
| float 
 | 
X
Declaration
public float XField Value
| float 
 | 
Y
Declaration
public float YField Value
| float 
 | 
Methods
GetAspectRatio()
Declaration
public float GetAspectRatio() constReturns
| float 
 | 
GetBounds()
operator!=(const Viewport& other)
Declaration
public bool operator!=(const Viewport& other) constParameters
| Viewport
        other 
 | 
Returns
| bool 
 | 
operator==(const Viewport& other)
Declaration
public bool operator==(const Viewport& other) constParameters
| Viewport
        other 
 | 
Returns
| bool 
 | 
Project(const Vector3& source, const Matrix& vp, Vector3& result)
Projects a 3D vector from object space into screen space.
Declaration
public void Project(const Vector3& source, const Matrix& vp, Vector3& result) constParameters
| Vector3
        source The vector to project. | 
| Matrix
        vp A combined WorldViewProjection matrix. | 
| Vector3
        result The projected vector. | 
SetBounds(const Rectangle& bounds)
ToString()
Unproject(const Vector3& source, const Matrix& ivp, Vector3& result)
Converts a screen space point into a corresponding point in world space.
Declaration
public void Unproject(const Vector3& source, const Matrix& ivp, Vector3& result) constParameters
| Vector3
        source The vector to un-project. | 
| Matrix
        ivp An inverted combined WorldViewProjection matrix. | 
| Vector3
        result The un-projected vector |