Expose various engine features to scripting
This commit is contained in:
@@ -161,6 +161,11 @@ namespace FlaxEngine
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the aspect ratio used by the viewport.
|
||||
/// </summary>
|
||||
public float AspectRatio => !Mathf.IsZero(Height) ? Width / Height : 0f;
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified <see cref="Viewport"/> is equal to this instance.
|
||||
/// </summary>
|
||||
@@ -326,21 +331,5 @@ namespace FlaxEngine
|
||||
vector /= w;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the aspect ratio used by the viewport.
|
||||
/// </summary>
|
||||
/// <value>The aspect ratio.</value>
|
||||
public float AspectRatio
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!Mathf.IsZero(Height))
|
||||
{
|
||||
return Width / Height;
|
||||
}
|
||||
return 0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -514,7 +514,7 @@ public:
|
||||
API_FIELD(ReadOnly) static BlendingMode Additive;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the alpha blending.
|
||||
/// Gets the alpha blending. Source alpha controls the output color (0 - use destination color, 1 - use source color).
|
||||
/// </summary>
|
||||
API_FIELD(ReadOnly) static BlendingMode AlphaBlend;
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ public:
|
||||
/// <summary>
|
||||
/// Quad rendering shader
|
||||
/// </summary>
|
||||
GPUShader* QuadShader;
|
||||
API_FIELD(ReadOnly) GPUShader* QuadShader;
|
||||
|
||||
/// <summary>
|
||||
/// The current task being executed.
|
||||
|
||||
@@ -84,6 +84,14 @@ void RenderView::PrepareCache(const RenderContext& renderContext, float width, f
|
||||
MainScreenSize = mainView->ScreenSize;
|
||||
}
|
||||
|
||||
void RenderView::SetUp(const Matrix& viewProjection)
|
||||
{
|
||||
// Copy data
|
||||
Matrix::Invert(viewProjection, IVP);
|
||||
Frustum.SetMatrix(viewProjection);
|
||||
CullingFrustum = Frustum;
|
||||
}
|
||||
|
||||
void RenderView::SetUp(const Matrix& view, const Matrix& projection)
|
||||
{
|
||||
// Copy data
|
||||
|
||||
@@ -255,13 +255,7 @@ public:
|
||||
public:
|
||||
// Set up view with custom params
|
||||
// @param viewProjection View * Projection matrix
|
||||
void SetUp(const Matrix& viewProjection)
|
||||
{
|
||||
// Copy data
|
||||
Matrix::Invert(viewProjection, IVP);
|
||||
Frustum.SetMatrix(viewProjection);
|
||||
CullingFrustum = Frustum;
|
||||
}
|
||||
void SetUp(const Matrix& viewProjection);
|
||||
|
||||
// Set up view with custom params
|
||||
// @param view View matrix
|
||||
|
||||
@@ -29,9 +29,8 @@ public:
|
||||
/// Performs rendering for the input task.
|
||||
/// </summary>
|
||||
/// <param name="task">The scene rendering task.</param>
|
||||
static void Render(SceneRenderTask* task);
|
||||
API_FUNCTION() static void Render(SceneRenderTask* task);
|
||||
|
||||
public:
|
||||
/// <summary>
|
||||
/// Draws scene objects depth (to the output Z buffer). The output must be depth texture to write hardware depth to it.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user