Merge remote-tracking branch 'origin/master' into 1.5
# Conflicts: # Source/Engine/Content/JsonAsset.cpp
This commit is contained in:
@@ -72,7 +72,7 @@ public:
|
||||
/// If checked, Environment Probes will use HDR texture format. Improves quality in very bright scenes at cost of higher memory usage.
|
||||
/// </summary>
|
||||
API_FIELD(Attributes = "EditorOrder(1502), EditorDisplay(\"Quality\")")
|
||||
bool UeeHDRProbes = false;
|
||||
bool UseHDRProbes = false;
|
||||
|
||||
/// <summary>
|
||||
/// If checked, enables Global SDF rendering. This can be used in materials, shaders, and particles.
|
||||
@@ -118,6 +118,21 @@ public:
|
||||
API_FIELD(Attributes="EditorOrder(10000), EditorDisplay(\"Post Process Settings\", EditorDisplayAttribute.InlineStyle)")
|
||||
PostProcessSettings PostProcessSettings;
|
||||
|
||||
private:
|
||||
/// <summary>
|
||||
/// Renamed UeeHDRProbes into UseHDRProbes
|
||||
/// [Deprecated on 12.10.2022, expires on 12.10.2024]
|
||||
/// </summary>
|
||||
API_PROPERTY(Attributes="Serialize, Obsolete, NoUndo") bool GetUeeHDRProbes() const
|
||||
{
|
||||
return UseHDRProbes;
|
||||
}
|
||||
|
||||
API_PROPERTY(Attributes="Serialize, Obsolete, NoUndo") void SetUeeHDRProbes(bool value)
|
||||
{
|
||||
UseHDRProbes = value;
|
||||
}
|
||||
|
||||
public:
|
||||
/// <summary>
|
||||
/// Gets the instance of the settings asset (default value if missing). Object returned by this method is always loaded with valid data to use.
|
||||
|
||||
@@ -120,6 +120,25 @@ void Camera::ProjectPoint(const Vector3& worldSpaceLocation, Float2& cameraViewp
|
||||
cameraViewportSpaceLocation = Float2(clipSpaceLocation);
|
||||
}
|
||||
|
||||
bool Camera::IsPointOnView(const Vector3& worldSpaceLocation) const
|
||||
{
|
||||
Vector3 cameraUp = GetTransform().GetUp();
|
||||
Vector3 cameraForward = GetTransform().GetForward();
|
||||
Vector3 directionToPosition = (worldSpaceLocation - GetPosition()).GetNormalized();
|
||||
if (Vector3::Dot(cameraForward, directionToPosition) < 0)
|
||||
return false;
|
||||
|
||||
Quaternion lookAt = Quaternion::LookRotation(directionToPosition, cameraUp);
|
||||
Vector3 lookAtDirection = lookAt * Vector3::Forward;
|
||||
Vector3 newWorldLocation = GetPosition() + lookAtDirection;
|
||||
|
||||
Float2 windowSpace;
|
||||
const Viewport viewport = GetViewport();
|
||||
ProjectPoint(newWorldLocation, windowSpace, viewport);
|
||||
|
||||
return windowSpace.X >= 0 && windowSpace.X <= viewport.Size.X && windowSpace.Y >= 0 && windowSpace.Y <= viewport.Size.Y;
|
||||
}
|
||||
|
||||
Ray Camera::ConvertMouseToRay(const Float2& mousePosition) const
|
||||
{
|
||||
return ConvertMouseToRay(mousePosition, GetViewport());
|
||||
|
||||
@@ -168,6 +168,13 @@ public:
|
||||
/// <param name="viewport">The viewport.</param>
|
||||
API_FUNCTION() void ProjectPoint(const Vector3& worldSpaceLocation, API_PARAM(Out) Float2& cameraViewportSpaceLocation, API_PARAM(Ref) const Viewport& viewport) const;
|
||||
|
||||
/// <summary>
|
||||
/// Checks if the 3d point of the world is in the camera's field of view.
|
||||
/// </summary>
|
||||
/// <param name="worldSpaceLocation">World Position (XYZ).</param>
|
||||
/// <returns>Returns true if the point is within the field of view.</returns>
|
||||
API_FUNCTION() bool IsPointOnView(const Vector3& worldSpaceLocation) const;
|
||||
|
||||
/// <summary>
|
||||
/// Converts the mouse position to 3D ray.
|
||||
/// </summary>
|
||||
|
||||
@@ -287,6 +287,8 @@ protected:
|
||||
bool _isUsingMouseOffset;
|
||||
Rectangle _mouseOffsetScreenSize;
|
||||
bool _isTrackingMouse;
|
||||
bool _isHorizontalFlippingMouse;
|
||||
bool _isVerticalFlippingMouse;
|
||||
bool _isClippingCursor;
|
||||
|
||||
explicit WindowBase(const CreateWindowSettings& settings);
|
||||
@@ -680,6 +682,22 @@ public:
|
||||
return _isTrackingMouse;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value indicating if the mouse flipped to the other screen edge horizontally
|
||||
/// </summary>
|
||||
API_PROPERTY() bool IsMouseFlippingHorizontally() const
|
||||
{
|
||||
return _isHorizontalFlippingMouse;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value indicating if the mouse flipped to the other screen edge vertically
|
||||
/// </summary>
|
||||
API_PROPERTY() bool IsMouseFlippingVertically() const
|
||||
{
|
||||
return _isVerticalFlippingMouse;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ends the mouse tracking.
|
||||
/// </summary>
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
// Copyright (c) 2012-2022 Wojciech Figat. All rights reserved.
|
||||
|
||||
using System;
|
||||
using FlaxEngine;
|
||||
|
||||
namespace FlaxEditor.Content.Settings
|
||||
{
|
||||
/// <summary>
|
||||
@@ -11,13 +14,24 @@ namespace FlaxEditor.Content.Settings
|
||||
|
||||
partial class GraphicsSettings
|
||||
{
|
||||
/// <summary>
|
||||
/// Renamed UeeHDRProbes into UseHDRProbes
|
||||
/// [Deprecated on 12.10.2022, expires on 12.10.2024]
|
||||
/// </summary>
|
||||
[Serialize, Obsolete, NoUndo]
|
||||
private bool UeeHDRProbes
|
||||
{
|
||||
get => UseHDRProbes;
|
||||
set => UseHDRProbes = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GraphicsSettings"/>.
|
||||
/// </summary>
|
||||
public GraphicsSettings()
|
||||
{
|
||||
// Initialize PostFx settings with default options (C# structs don't support it)
|
||||
PostProcessSettings = FlaxEngine.PostProcessSettings.Default;
|
||||
PostProcessSettings = PostProcessSettings.Default;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -544,6 +544,8 @@ void WindowsWindow::StartTrackingMouse(bool useMouseScreenOffset)
|
||||
_isTrackingMouse = true;
|
||||
_trackingMouseOffset = Float2::Zero;
|
||||
_isUsingMouseOffset = useMouseScreenOffset;
|
||||
_isHorizontalFlippingMouse = false;
|
||||
_isVerticalFlippingMouse = false;
|
||||
|
||||
int32 x = 0, y = 0, width = 0, height = 0;
|
||||
GetScreenInfo(x, y, width, height);
|
||||
@@ -558,6 +560,8 @@ void WindowsWindow::EndTrackingMouse()
|
||||
if (_isTrackingMouse)
|
||||
{
|
||||
_isTrackingMouse = false;
|
||||
_isHorizontalFlippingMouse = false;
|
||||
_isVerticalFlippingMouse = false;
|
||||
|
||||
ReleaseCapture();
|
||||
}
|
||||
@@ -824,14 +828,14 @@ LRESULT WindowsWindow::WndProc(UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
const Float2 mousePos(static_cast<float>(WINDOWS_GET_X_LPARAM(lParam)), static_cast<float>(WINDOWS_GET_Y_LPARAM(lParam)));
|
||||
Float2 mousePosition = ClientToScreen(mousePos);
|
||||
Float2 newMousePosition = mousePosition;
|
||||
if (mousePosition.X <= desktopLocation.X + 2)
|
||||
newMousePosition.X = desktopSize.X - 2;
|
||||
else if (mousePosition.X >= desktopSize.X - 1)
|
||||
newMousePosition.X = desktopLocation.X + 2;
|
||||
if (mousePosition.Y <= desktopLocation.Y + 2)
|
||||
newMousePosition.Y = desktopSize.Y - 2;
|
||||
else if (mousePosition.Y >= desktopSize.Y - 1)
|
||||
newMousePosition.Y = desktopLocation.Y + 2;
|
||||
if (_isHorizontalFlippingMouse = mousePosition.X <= desktopLocation.X + 2)
|
||||
newMousePosition.X = desktopSize.X - 3;
|
||||
else if (_isHorizontalFlippingMouse = mousePosition.X >= desktopSize.X - 1)
|
||||
newMousePosition.X = desktopLocation.X + 3;
|
||||
if (_isVerticalFlippingMouse = mousePosition.Y <= desktopLocation.Y + 2)
|
||||
newMousePosition.Y = desktopSize.Y - 3;
|
||||
else if (_isVerticalFlippingMouse = mousePosition.Y >= desktopSize.Y - 1)
|
||||
newMousePosition.Y = desktopLocation.Y + 3;
|
||||
if (!Float2::NearEqual(mousePosition, newMousePosition))
|
||||
{
|
||||
_trackingMouseOffset -= newMousePosition - mousePosition;
|
||||
|
||||
@@ -204,7 +204,7 @@ int32 ProbesRenderer::Entry::GetResolution() const
|
||||
|
||||
PixelFormat ProbesRenderer::Entry::GetFormat() const
|
||||
{
|
||||
return GraphicsSettings::Get()->UeeHDRProbes ? PixelFormat::R11G11B10_Float : PixelFormat::R8G8B8A8_UNorm;
|
||||
return GraphicsSettings::Get()->UseHDRProbes ? PixelFormat::R11G11B10_Float : PixelFormat::R8G8B8A8_UNorm;
|
||||
}
|
||||
|
||||
int32 ProbesRenderer::GetBakeQueueSize()
|
||||
|
||||
@@ -948,6 +948,10 @@ namespace FlaxEngine.GUI
|
||||
{
|
||||
// Set flag
|
||||
_isDragOver = true;
|
||||
|
||||
// Hide tooltip
|
||||
Tooltip?.Hide();
|
||||
|
||||
return DragDropEffect.None;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ namespace FlaxEngine.GUI
|
||||
private float _splitterValue;
|
||||
private Rectangle _splitterRect;
|
||||
private bool _splitterClicked, _mouseOverSplitter;
|
||||
private bool _cursorChanged;
|
||||
|
||||
/// <summary>
|
||||
/// The first panel (left or upper based on Orientation).
|
||||
@@ -161,6 +162,18 @@ namespace FlaxEngine.GUI
|
||||
if (_splitterClicked)
|
||||
{
|
||||
SplitterValue = _orientation == Orientation.Horizontal ? location.X / Width : location.Y / Height;
|
||||
Cursor = _orientation == Orientation.Horizontal ? CursorType.SizeWE : CursorType.SizeNS;
|
||||
_cursorChanged = true;
|
||||
}
|
||||
else if (_mouseOverSplitter)
|
||||
{
|
||||
Cursor = _orientation == Orientation.Horizontal ? CursorType.SizeWE : CursorType.SizeNS;
|
||||
_cursorChanged = true;
|
||||
}
|
||||
else if (_cursorChanged)
|
||||
{
|
||||
Cursor = CursorType.Default;
|
||||
_cursorChanged = false;
|
||||
}
|
||||
|
||||
base.OnMouseMove(location);
|
||||
@@ -197,6 +210,11 @@ namespace FlaxEngine.GUI
|
||||
{
|
||||
// Clear flag
|
||||
_mouseOverSplitter = false;
|
||||
if (_cursorChanged)
|
||||
{
|
||||
Cursor = CursorType.Default;
|
||||
_cursorChanged = false;
|
||||
}
|
||||
|
||||
base.OnMouseLeave();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user