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