diff --git a/Source/Editor/CustomEditors/Elements/DoubleValueElement.cs b/Source/Editor/CustomEditors/Elements/DoubleValueElement.cs
index e46040a42..07af5e991 100644
--- a/Source/Editor/CustomEditors/Elements/DoubleValueElement.cs
+++ b/Source/Editor/CustomEditors/Elements/DoubleValueElement.cs
@@ -22,7 +22,7 @@ namespace FlaxEditor.CustomEditors.Elements
///
/// [Deprecated on 26.05.2022, expires on 26.05.2024]
///
- [System.Obsolete("Deprecated in 1.4")]
+ [System.Obsolete("Deprecated in 1.4, use ValueBox instead")]
public DoubleValueBox DoubleValue => ValueBox;
///
diff --git a/Source/Editor/CustomEditors/Elements/FloatValueElement.cs b/Source/Editor/CustomEditors/Elements/FloatValueElement.cs
index 552e9d125..789d8966e 100644
--- a/Source/Editor/CustomEditors/Elements/FloatValueElement.cs
+++ b/Source/Editor/CustomEditors/Elements/FloatValueElement.cs
@@ -22,7 +22,7 @@ namespace FlaxEditor.CustomEditors.Elements
///
/// [Deprecated on 26.05.2022, expires on 26.05.2024]
///
- [System.Obsolete("Deprecated in 1.4, ValueBox instead")]
+ [System.Obsolete("Deprecated in 1.4, use ValueBox instead")]
public FloatValueBox FloatValue => ValueBox;
///
diff --git a/Source/Editor/GUI/Input/ValueBox.cs b/Source/Editor/GUI/Input/ValueBox.cs
index 492887611..321782a8e 100644
--- a/Source/Editor/GUI/Input/ValueBox.cs
+++ b/Source/Editor/GUI/Input/ValueBox.cs
@@ -182,6 +182,7 @@ namespace FlaxEditor.GUI.Input
}
SlidingEnd?.Invoke();
Defocus();
+ Parent?.Focus();
}
///
diff --git a/Source/Editor/Surface/Archetypes/Animation.cs b/Source/Editor/Surface/Archetypes/Animation.cs
index a05ede1e7..40a3d2a63 100644
--- a/Source/Editor/Surface/Archetypes/Animation.cs
+++ b/Source/Editor/Surface/Archetypes/Animation.cs
@@ -59,8 +59,11 @@ namespace FlaxEditor.Surface.Archetypes
if (Surface != null)
{
_assetSelect = GetChild();
- _assetBox = GetBox(8);
- _assetSelect.Visible = !_assetBox.HasAnyConnection;
+ if (TryGetBox(8, out var box))
+ {
+ _assetBox = box;
+ _assetSelect.Visible = !_assetBox.HasAnyConnection;
+ }
UpdateTitle();
}
}
@@ -68,7 +71,11 @@ namespace FlaxEditor.Surface.Archetypes
private void UpdateTitle()
{
var asset = Editor.Instance.ContentDatabase.Find((Guid)Values[0]);
- Title = _assetBox.HasAnyConnection || asset == null ? "Animation" : asset.ShortName;
+ if (_assetBox != null)
+ Title = _assetBox.HasAnyConnection || asset == null ? "Animation" : asset.ShortName;
+ else
+ Title = asset?.ShortName ?? "Animation";
+
var style = Style.Current;
Resize(Mathf.Max(230, style.FontLarge.MeasureText(Title).X + 30), 160);
}
@@ -78,6 +85,8 @@ namespace FlaxEditor.Surface.Archetypes
{
base.ConnectionTick(box);
+ if (_assetBox == null)
+ return;
if (box.ID != _assetBox.ID)
return;
diff --git a/Source/Editor/Tools/Terrain/PaintTerrainGizmo.cs b/Source/Editor/Tools/Terrain/PaintTerrainGizmo.cs
index c16bdd7e6..c9a521734 100644
--- a/Source/Editor/Tools/Terrain/PaintTerrainGizmo.cs
+++ b/Source/Editor/Tools/Terrain/PaintTerrainGizmo.cs
@@ -150,6 +150,12 @@ namespace FlaxEditor.Tools.Terrain
return;
}
+ // Increase or decrease brush size with scroll
+ if (Input.GetKey(KeyboardKeys.Shift))
+ {
+ Mode.CurrentBrush.Size += dt * Mode.CurrentBrush.Size * Input.Mouse.ScrollDelta * 5f;
+ }
+
// Check if no terrain is selected
var terrain = SelectedTerrain;
if (!terrain)
diff --git a/Source/Editor/Tools/Terrain/SculptTerrainGizmo.cs b/Source/Editor/Tools/Terrain/SculptTerrainGizmo.cs
index 96270a740..fef8bbf09 100644
--- a/Source/Editor/Tools/Terrain/SculptTerrainGizmo.cs
+++ b/Source/Editor/Tools/Terrain/SculptTerrainGizmo.cs
@@ -158,6 +158,12 @@ namespace FlaxEditor.Tools.Terrain
return;
}
+ // Increase or decrease brush size with scroll
+ if (Input.GetKey(KeyboardKeys.Shift))
+ {
+ Mode.CurrentBrush.Size += dt * Mode.CurrentBrush.Size * Input.Mouse.ScrollDelta * 5f;
+ }
+
// Check if selected terrain was changed during painting
if (terrain != _paintTerrain && IsPainting)
{
diff --git a/Source/Editor/Viewport/EditorViewport.cs b/Source/Editor/Viewport/EditorViewport.cs
index 13c06157a..e20069120 100644
--- a/Source/Editor/Viewport/EditorViewport.cs
+++ b/Source/Editor/Viewport/EditorViewport.cs
@@ -1119,7 +1119,12 @@ namespace FlaxEditor.Viewport
var win = (WindowRootControl)Root;
// Get current mouse position in the view
- _viewMousePos = PointFromWindow(win.MousePosition);
+ {
+ // When the window is not focused, the position in window does not return sane values
+ Float2 pos = PointFromWindow(win.MousePosition);
+ if (!float.IsInfinity(pos.LengthSquared))
+ _viewMousePos = pos;
+ }
// Update input
var window = win.Window;
diff --git a/Source/Editor/Viewport/Previews/AudioClipPreview.cs b/Source/Editor/Viewport/Previews/AudioClipPreview.cs
index 446cef657..3235cd194 100644
--- a/Source/Editor/Viewport/Previews/AudioClipPreview.cs
+++ b/Source/Editor/Viewport/Previews/AudioClipPreview.cs
@@ -171,7 +171,7 @@ namespace FlaxEditor.Viewport.Previews
case DrawModes.Fill:
clipsInView = 1.0f;
clipWidth = width;
- samplesPerIndex = (uint)(samplesPerChannel / width);
+ samplesPerIndex = (uint)(samplesPerChannel / width) * info.NumChannels;
break;
case DrawModes.Single:
clipsInView = Mathf.Min(clipsInView, 1.0f);
diff --git a/Source/Editor/Windows/Assets/AudioClipWindow.cs b/Source/Editor/Windows/Assets/AudioClipWindow.cs
index 8cf31f416..b1d9796dc 100644
--- a/Source/Editor/Windows/Assets/AudioClipWindow.cs
+++ b/Source/Editor/Windows/Assets/AudioClipWindow.cs
@@ -335,6 +335,22 @@ namespace FlaxEditor.Windows.Assets
}
}
+ ///
+ public override bool OnKeyDown(KeyboardKeys key)
+ {
+ if (base.OnKeyDown(key))
+ return true;
+
+ if (key == KeyboardKeys.Spacebar)
+ {
+ if (_previewSource?.State == AudioSource.States.Playing)
+ OnPause();
+ else
+ OnPlay();
+ }
+ return false;
+ }
+
///
public override bool UseLayoutData => true;
diff --git a/Source/Engine/Animations/Graph/AnimGroup.Animation.cpp b/Source/Engine/Animations/Graph/AnimGroup.Animation.cpp
index a19b84370..0518fe248 100644
--- a/Source/Engine/Animations/Graph/AnimGroup.Animation.cpp
+++ b/Source/Engine/Animations/Graph/AnimGroup.Animation.cpp
@@ -1,6 +1,7 @@
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
#include "AnimGraph.h"
+#include "Engine/Core/Types/VariantValueCast.h"
#include "Engine/Content/Assets/Animation.h"
#include "Engine/Content/Assets/SkeletonMask.h"
#include "Engine/Content/Assets/AnimationGraphFunction.h"
@@ -753,6 +754,13 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu
auto anim = node->Assets[0].As();
auto& bucket = context.Data->State[node->BucketIndex].Animation;
+ // Override animation when animation reference box is connected
+ auto animationAssetBox = node->TryGetBox(8);
+ if (animationAssetBox && animationAssetBox->HasConnection())
+ {
+ anim = TVariantValueCast::Cast(tryGetValue(animationAssetBox, Value::Null));
+ }
+
switch (box->ID)
{
// Animation
@@ -762,18 +770,6 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu
const float speed = (float)tryGetValue(node->GetBox(5), node->Values[1]);
const bool loop = (bool)tryGetValue(node->GetBox(6), node->Values[2]);
const float startTimePos = (float)tryGetValue(node->GetBox(7), node->Values[3]);
-
- // Override animation when animation reference box is connected
- auto animationAssetBox = node->GetBox(8);
- if (animationAssetBox->HasConnection())
- {
- const Value assetBoxValue = tryGetValue(animationAssetBox, Value::Null);
- if (assetBoxValue != Value::Null)
- anim = (Animation*)assetBoxValue.AsAsset;
- else
- anim = nullptr;
- }
-
const float length = anim ? anim->GetLength() : 0.0f;
// Calculate new time position
diff --git a/Source/Engine/Audio/AudioSource.cpp b/Source/Engine/Audio/AudioSource.cpp
index afe5c4b49..cb32e0967 100644
--- a/Source/Engine/Audio/AudioSource.cpp
+++ b/Source/Engine/Audio/AudioSource.cpp
@@ -187,7 +187,6 @@ float AudioSource::GetTime() const
return 0.0f;
float time = AudioBackend::Source::GetCurrentBufferTime(this);
- ASSERT(time >= 0.0f && time <= Clip->GetLength());
if (UseStreaming())
{
diff --git a/Source/Engine/Audio/XAudio2/AudioBackendXAudio2.cpp b/Source/Engine/Audio/XAudio2/AudioBackendXAudio2.cpp
index f90c58875..3092a2229 100644
--- a/Source/Engine/Audio/XAudio2/AudioBackendXAudio2.cpp
+++ b/Source/Engine/Audio/XAudio2/AudioBackendXAudio2.cpp
@@ -27,7 +27,15 @@
#define MAX_INPUT_CHANNELS 2
#define MAX_OUTPUT_CHANNELS 8
#define MAX_CHANNELS_MATRIX_SIZE (MAX_INPUT_CHANNELS*MAX_OUTPUT_CHANNELS)
-
+#if ENABLE_ASSERTION
+#define XAUDIO2_CHECK_ERROR(method) \
+ if (hr != 0) \
+ { \
+ LOG(Error, "XAudio2 method {0} failed with error 0x{1:X} (at line {2})", TEXT(#method), (uint32)hr, __LINE__ - 1); \
+ }
+#else
+#define XAUDIO2_CHECK_ERROR(method)
+#endif
#define FLAX_COORD_SCALE 0.01f // units are meters
#define FLAX_DST_TO_XAUDIO(x) x * FLAX_COORD_SCALE
#define FLAX_POS_TO_XAUDIO(vec) X3DAUDIO_VECTOR(vec.X * FLAX_COORD_SCALE, vec.Y * FLAX_COORD_SCALE, vec.Z * FLAX_COORD_SCALE)
@@ -104,7 +112,9 @@ namespace XAudio2
COM_DECLSPEC_NOTHROW void STDMETHODCALLTYPE OnVoiceError(THIS_ void* pBufferContext, HRESULT Error) override
{
+#if ENABLE_ASSERTION
LOG(Warning, "IXAudio2VoiceCallback::OnVoiceError! Error: 0x{0:x}", Error);
+#endif
}
public:
@@ -121,7 +131,8 @@ namespace XAudio2
XAUDIO2_SEND_DESCRIPTOR Destination;
float Pitch;
float Pan;
- float StartTime;
+ float StartTimeForQueueBuffer;
+ float LastBufferStartTime;
float DopplerFactor;
uint64 LastBufferStartSamplesPlayed;
int32 BuffersProcessed;
@@ -145,7 +156,8 @@ namespace XAudio2
Destination.pOutputVoice = nullptr;
Pitch = 1.0f;
Pan = 0.0f;
- StartTime = 0.0f;
+ StartTimeForQueueBuffer = 0.0f;
+ LastBufferStartTime = 0.0f;
IsDirty = false;
Is3D = false;
IsPlaying = false;
@@ -255,18 +267,18 @@ namespace XAudio2
buffer.pAudioData = aBuffer->Data.Get();
buffer.AudioBytes = aBuffer->Data.Count();
- if (aSource->StartTime > ZeroTolerance)
+ if (aSource->StartTimeForQueueBuffer > ZeroTolerance)
{
- buffer.PlayBegin = (UINT32)(aSource->StartTime * (aBuffer->Info.SampleRate * aBuffer->Info.NumChannels));
- buffer.PlayLength = aBuffer->Info.NumSamples / aBuffer->Info.NumChannels - buffer.PlayBegin;
- aSource->StartTime = 0;
+ // Offset start position when playing buffer with a custom time offset
+ const uint32 bytesPerSample = aBuffer->Info.BitDepth / 8 * aBuffer->Info.NumChannels;
+ buffer.PlayBegin = (UINT32)(aSource->StartTimeForQueueBuffer * aBuffer->Info.SampleRate);
+ buffer.PlayLength = (buffer.AudioBytes / bytesPerSample) - buffer.PlayBegin;
+ aSource->LastBufferStartTime = aSource->StartTimeForQueueBuffer;
+ aSource->StartTimeForQueueBuffer = 0;
}
const HRESULT hr = aSource->Voice->SubmitSourceBuffer(&buffer);
- if (FAILED(hr))
- {
- LOG(Warning, "XAudio2: Failed to submit source buffer (error: 0x{0:x})", hr);
- }
+ XAUDIO2_CHECK_ERROR(SubmitSourceBuffer);
}
void VoiceCallback::OnBufferEnd(void* pBufferContext)
@@ -375,7 +387,7 @@ void AudioBackendXAudio2::Source_OnAdd(AudioSource* source)
const auto& header = clip->AudioHeader;
auto& format = aSource->Format;
format.wFormatTag = WAVE_FORMAT_PCM;
- format.nChannels = source->Is3D() ? 1 : header.Info.NumChannels; // 3d audio is always mono (AudioClip auto-converts before buffer write)
+ format.nChannels = clip->Is3D() ? 1 : header.Info.NumChannels; // 3d audio is always mono (AudioClip auto-converts before buffer write)
format.nSamplesPerSec = header.Info.SampleRate;
format.wBitsPerSample = header.Info.BitDepth;
format.nBlockAlign = (WORD)(format.nChannels * (format.wBitsPerSample / 8));
@@ -391,12 +403,10 @@ void AudioBackendXAudio2::Source_OnAdd(AudioSource* source)
1,
&aSource->Destination
};
- const HRESULT hr = XAudio2::Instance->CreateSourceVoice(&aSource->Voice, &aSource->Format, 0, 2.0f, &aSource->Callback, &sendList);
+ HRESULT hr = XAudio2::Instance->CreateSourceVoice(&aSource->Voice, &aSource->Format, 0, 2.0f, &aSource->Callback, &sendList);
+ XAUDIO2_CHECK_ERROR(CreateSourceVoice);
if (FAILED(hr))
- {
- LOG(Error, "Failed to create XAudio2 voice. Error: 0x{0:x}", hr);
return;
- }
// Prepare source state
aSource->Callback.Source = source;
@@ -410,7 +420,8 @@ void AudioBackendXAudio2::Source_OnAdd(AudioSource* source)
aSource->DopplerFactor = source->GetDopplerFactor();
aSource->UpdateTransform(source);
aSource->UpdateVelocity(source);
- aSource->Voice->SetVolume(source->GetVolume());
+ hr = aSource->Voice->SetVolume(source->GetVolume());
+ XAUDIO2_CHECK_ERROR(SetVolume);
// 0 is invalid ID so shift them
sourceID++;
@@ -451,7 +462,8 @@ void AudioBackendXAudio2::Source_VolumeChanged(AudioSource* source)
auto aSource = XAudio2::GetSource(source);
if (aSource && aSource->Voice)
{
- aSource->Voice->SetVolume(source->GetVolume());
+ const HRESULT hr = aSource->Voice->SetVolume(source->GetVolume());
+ XAUDIO2_CHECK_ERROR(SetVolume);
}
}
@@ -494,12 +506,18 @@ void AudioBackendXAudio2::Source_IsLoopingChanged(AudioSource* source)
XAudio2::Buffer* aBuffer = XAudio2::Buffers[bufferId - 1];
XAudio2::Locker.Unlock();
+ HRESULT hr;
const bool isPlaying = source->IsActuallyPlayingSth();
if (isPlaying)
- aSource->Voice->Stop();
+ {
+ hr = aSource->Voice->Stop();
+ XAUDIO2_CHECK_ERROR(Stop);
+ }
- aSource->Voice->FlushSourceBuffers();
+ hr = aSource->Voice->FlushSourceBuffers();
+ XAUDIO2_CHECK_ERROR(FlushSourceBuffers);
aSource->LastBufferStartSamplesPlayed = 0;
+ aSource->LastBufferStartTime = 0;
aSource->BuffersProcessed = 0;
XAUDIO2_BUFFER buffer = { 0 };
@@ -512,12 +530,15 @@ void AudioBackendXAudio2::Source_IsLoopingChanged(AudioSource* source)
const UINT32 totalSamples = aBuffer->Info.NumSamples / aBuffer->Info.NumChannels;
buffer.PlayBegin = state.SamplesPlayed % totalSamples;
buffer.PlayLength = totalSamples - buffer.PlayBegin;
- aSource->StartTime = 0;
+ aSource->StartTimeForQueueBuffer = 0;
XAudio2::QueueBuffer(aSource, source, bufferId, buffer);
if (isPlaying)
- aSource->Voice->Start();
+ {
+ hr = aSource->Voice->Start();
+ XAUDIO2_CHECK_ERROR(Start);
+ }
}
void AudioBackendXAudio2::Source_SpatialSetupChanged(AudioSource* source)
@@ -572,7 +593,8 @@ void AudioBackendXAudio2::Source_Play(AudioSource* source)
if (aSource && aSource->Voice && !aSource->IsPlaying)
{
// Play
- aSource->Voice->Start();
+ const HRESULT hr = aSource->Voice->Start();
+ XAUDIO2_CHECK_ERROR(Start);
aSource->IsPlaying = true;
}
}
@@ -583,7 +605,8 @@ void AudioBackendXAudio2::Source_Pause(AudioSource* source)
if (aSource && aSource->Voice && aSource->IsPlaying)
{
// Pause
- aSource->Voice->Stop();
+ const HRESULT hr = aSource->Voice->Stop();
+ XAUDIO2_CHECK_ERROR(Stop);
aSource->IsPlaying = false;
}
}
@@ -593,14 +616,18 @@ void AudioBackendXAudio2::Source_Stop(AudioSource* source)
auto aSource = XAudio2::GetSource(source);
if (aSource && aSource->Voice)
{
- aSource->StartTime = 0.0f;
+ aSource->StartTimeForQueueBuffer = 0.0f;
+ aSource->LastBufferStartTime = 0.0f;
// Pause
- aSource->Voice->Stop();
+ HRESULT hr = aSource->Voice->Stop();
+ XAUDIO2_CHECK_ERROR(Stop);
aSource->IsPlaying = false;
// Unset streaming buffers to rewind
- aSource->Voice->FlushSourceBuffers();
+ hr = aSource->Voice->FlushSourceBuffers();
+ XAUDIO2_CHECK_ERROR(FlushSourceBuffers);
+ Platform::Sleep(10); // TODO: find a better way to handle case when VoiceCallback::OnBufferEnd is called after source was stopped thus BuffersProcessed != 0, probably via buffers contexts ptrs
aSource->BuffersProcessed = 0;
aSource->Callback.PeekSamples();
}
@@ -612,7 +639,7 @@ void AudioBackendXAudio2::Source_SetCurrentBufferTime(AudioSource* source, float
if (aSource)
{
// Store start time so next buffer submitted will start from here (assumes audio is stopped)
- aSource->StartTime = value;
+ aSource->StartTimeForQueueBuffer = value;
}
}
@@ -628,8 +655,9 @@ float AudioBackendXAudio2::Source_GetCurrentBufferTime(const AudioSource* source
aSource->Voice->GetState(&state);
const uint32 numChannels = clipInfo.NumChannels;
const uint32 totalSamples = clipInfo.NumSamples / numChannels;
+ const uint32 sampleRate = clipInfo.SampleRate;// / clipInfo.NumChannels;
state.SamplesPlayed -= aSource->LastBufferStartSamplesPlayed % totalSamples; // Offset by the last buffer start to get time relative to its begin
- time = aSource->StartTime + (state.SamplesPlayed % totalSamples) / static_cast(Math::Max(1U, clipInfo.SampleRate));
+ time = aSource->LastBufferStartTime + (state.SamplesPlayed % totalSamples) / static_cast(Math::Max(1U, sampleRate));
}
return time;
}
@@ -697,10 +725,7 @@ void AudioBackendXAudio2::Source_DequeueProcessedBuffers(AudioSource* source)
if (aSource && aSource->Voice)
{
const HRESULT hr = aSource->Voice->FlushSourceBuffers();
- if (FAILED(hr))
- {
- LOG(Warning, "XAudio2: FlushSourceBuffers failed. Error: 0x{0:x}", hr);
- }
+ XAUDIO2_CHECK_ERROR(FlushSourceBuffers);
aSource->BuffersProcessed = 0;
}
}
@@ -749,8 +774,7 @@ void AudioBackendXAudio2::Buffer_Write(uint32 bufferId, byte* samples, const Aud
XAudio2::Buffer* aBuffer = XAudio2::Buffers[bufferId - 1];
XAudio2::Locker.Unlock();
- const uint32 bytesPerSample = info.BitDepth / 8;
- const int32 samplesLength = info.NumSamples * bytesPerSample;
+ const uint32 samplesLength = info.NumSamples * info.BitDepth / 8;
aBuffer->Info = info;
aBuffer->Data.Set(samples, samplesLength);
@@ -779,7 +803,8 @@ void AudioBackendXAudio2::Base_SetVolume(float value)
{
if (XAudio2::MasteringVoice)
{
- XAudio2::MasteringVoice->SetVolume(value);
+ const HRESULT hr = XAudio2::MasteringVoice->SetVolume(value);
+ XAUDIO2_CHECK_ERROR(SetVolume);
}
}
diff --git a/Source/Engine/Graphics/Mesh.cs b/Source/Engine/Graphics/Mesh.cs
index 0a986d44d..68ff7e07f 100644
--- a/Source/Engine/Graphics/Mesh.cs
+++ b/Source/Engine/Graphics/Mesh.cs
@@ -339,7 +339,7 @@ namespace FlaxEngine
/// The normal vectors (per vertex). Use null to compute them from normal vectors.
/// The texture coordinates (per vertex).
/// The vertex colors (per vertex).
- [Obsolete("Deprecated in 1.4")]
+ [Obsolete("Deprecated in 1.4, use overload with Float3 and Float2 parameters")]
public void UpdateMesh(Vector3[] vertices, int[] triangles, Vector3[] normals = null, Vector3[] tangents = null, Vector2[] uv = null, Color32[] colors = null)
{
UpdateMesh(Utils.ConvertCollection(vertices), triangles, Utils.ConvertCollection(normals), Utils.ConvertCollection(tangents), Utils.ConvertCollection(uv), colors);
@@ -357,7 +357,7 @@ namespace FlaxEngine
/// The normal vectors (per vertex). Use null to compute them from normal vectors.
/// The texture coordinates (per vertex).
/// The vertex colors (per vertex).
- [Obsolete("Deprecated in 1.4")]
+ [Obsolete("Deprecated in 1.4, use overload with Float3 and Float2 parameters")]
public void UpdateMesh(List vertices, List triangles, List normals = null, List tangents = null, List uv = null, List colors = null)
{
UpdateMesh(Utils.ConvertCollection(vertices), triangles, Utils.ConvertCollection(normals), Utils.ConvertCollection(tangents), Utils.ConvertCollection(uv), colors);
@@ -375,7 +375,7 @@ namespace FlaxEngine
/// The normal vectors (per vertex). Use null to compute them from normal vectors.
/// The texture coordinates (per vertex).
/// The vertex colors (per vertex).
- [Obsolete("Deprecated in 1.4")]
+ [Obsolete("Deprecated in 1.4, use overload with Float3 and Float2 parameters")]
public void UpdateMesh(Vector3[] vertices, uint[] triangles, Vector3[] normals = null, Vector3[] tangents = null, Vector2[] uv = null, Color32[] colors = null)
{
UpdateMesh(Utils.ConvertCollection(vertices), triangles, Utils.ConvertCollection(normals), Utils.ConvertCollection(tangents), Utils.ConvertCollection(uv), colors);
@@ -393,7 +393,7 @@ namespace FlaxEngine
/// The normal vectors (per vertex). Use null to compute them from normal vectors.
/// The texture coordinates (per vertex).
/// The vertex colors (per vertex).
- [Obsolete("Deprecated in 1.4")]
+ [Obsolete("Deprecated in 1.4, use overload with Float3 and Float2 parameters")]
public void UpdateMesh(List vertices, List triangles, List normals = null, List tangents = null, List uv = null, List colors = null)
{
UpdateMesh(Utils.ConvertCollection(vertices), triangles, Utils.ConvertCollection(normals), Utils.ConvertCollection(tangents), Utils.ConvertCollection(uv), colors);
@@ -411,7 +411,7 @@ namespace FlaxEngine
/// The tangent vectors (per vertex). Use null to compute them from normal vectors.
/// The texture coordinates (per vertex).
/// The vertex colors (per vertex).
- [Obsolete("Deprecated in 1.4")]
+ [Obsolete("Deprecated in 1.4, use overload with Float3 and Float2 parameters")]
public void UpdateMesh(Vector3[] vertices, ushort[] triangles, Vector3[] normals = null, Vector3[] tangents = null, Vector2[] uv = null, Color32[] colors = null)
{
UpdateMesh(Utils.ConvertCollection(vertices), triangles, Utils.ConvertCollection(normals), Utils.ConvertCollection(tangents), Utils.ConvertCollection(uv), colors);
@@ -429,7 +429,7 @@ namespace FlaxEngine
/// The tangent vectors (per vertex). Use null to compute them from normal vectors.
/// The texture coordinates (per vertex).
/// The vertex colors (per vertex).
- [Obsolete("Deprecated in 1.4")]
+ [Obsolete("Deprecated in 1.4, use overload with Float3 and Float2 parameters")]
public void UpdateMesh(List vertices, List triangles, List normals = null, List tangents = null, List uv = null, List colors = null)
{
UpdateMesh(Utils.ConvertCollection(vertices), triangles, Utils.ConvertCollection(normals), Utils.ConvertCollection(tangents), Utils.ConvertCollection(uv), colors);
diff --git a/Source/Engine/Graphics/SkinnedMesh.cs b/Source/Engine/Graphics/SkinnedMesh.cs
index 8fb7a83dc..a7b7594bb 100644
--- a/Source/Engine/Graphics/SkinnedMesh.cs
+++ b/Source/Engine/Graphics/SkinnedMesh.cs
@@ -216,7 +216,7 @@ namespace FlaxEngine
/// The normal vectors (per vertex).
/// The normal vectors (per vertex). Use null to compute them from normal vectors.
/// The texture coordinates (per vertex).
- [Obsolete("Deprecated in 1.4")]
+ [Obsolete("Deprecated in 1.4, use overload with Float3 and Float2 parameters")]
public void UpdateMesh(Vector3[] vertices, int[] triangles, Int4[] blendIndices, Vector4[] blendWeights, Vector3[] normals = null, Vector3[] tangents = null, Vector2[] uv = null)
{
UpdateMesh(Utils.ConvertCollection(vertices), triangles, blendIndices, Utils.ConvertCollection(blendWeights), Utils.ConvertCollection(normals), Utils.ConvertCollection(tangents), Utils.ConvertCollection(uv));
@@ -235,7 +235,7 @@ namespace FlaxEngine
/// The normal vectors (per vertex).
/// The normal vectors (per vertex). Use null to compute them from normal vectors.
/// The texture coordinates (per vertex).
- [Obsolete("Deprecated in 1.4")]
+ [Obsolete("Deprecated in 1.4, use overload with Float3 and Float2 parameters")]
public void UpdateMesh(Vector3[] vertices, uint[] triangles, Int4[] blendIndices, Vector4[] blendWeights, Vector3[] normals = null, Vector3[] tangents = null, Vector2[] uv = null)
{
UpdateMesh(Utils.ConvertCollection(vertices), triangles, blendIndices, Utils.ConvertCollection(blendWeights), Utils.ConvertCollection(normals), Utils.ConvertCollection(tangents), Utils.ConvertCollection(uv));
@@ -254,7 +254,7 @@ namespace FlaxEngine
/// The normal vectors (per vertex).
/// The tangent vectors (per vertex). Use null to compute them from normal vectors.
/// The texture coordinates (per vertex).
- [Obsolete("Deprecated in 1.4")]
+ [Obsolete("Deprecated in 1.4, use overload with Float3 and Float2 parameters")]
public void UpdateMesh(Vector3[] vertices, ushort[] triangles, Int4[] blendIndices, Vector4[] blendWeights, Vector3[] normals = null, Vector3[] tangents = null, Vector2[] uv = null)
{
UpdateMesh(Utils.ConvertCollection(vertices), triangles, blendIndices, Utils.ConvertCollection(blendWeights), Utils.ConvertCollection(normals), Utils.ConvertCollection(tangents), Utils.ConvertCollection(uv));
diff --git a/Source/Engine/Physics/CollisionData.cs b/Source/Engine/Physics/CollisionData.cs
index 8b54c6218..e7f76a90f 100644
--- a/Source/Engine/Physics/CollisionData.cs
+++ b/Source/Engine/Physics/CollisionData.cs
@@ -19,7 +19,7 @@ namespace FlaxEngine
/// The convex mesh generation flags.
/// The convex mesh vertex limit. Use values in range [8;255]
/// True if failed, otherwise false.
- [Obsolete("Deprecated in 1.4")]
+ [Obsolete("Deprecated in 1.4, use overload with Float3 and Float2 parameters")]
public bool CookCollision(CollisionDataType type, Vector3[] vertices, uint[] triangles, ConvexMeshGenerationFlags convexFlags = ConvexMeshGenerationFlags.None, int convexVertexLimit = 255)
{
if (vertices == null)
@@ -43,7 +43,7 @@ namespace FlaxEngine
/// The convex mesh generation flags.
/// The convex mesh vertex limit. Use values in range [8;255]
/// True if failed, otherwise false.
- [Obsolete("Deprecated in 1.4")]
+ [Obsolete("Deprecated in 1.4, use overload with Float3 and Float2 parameters")]
public bool CookCollision(CollisionDataType type, Vector3[] vertices, int[] triangles, ConvexMeshGenerationFlags convexFlags = ConvexMeshGenerationFlags.None, int convexVertexLimit = 255)
{
if (vertices == null)
@@ -60,7 +60,7 @@ namespace FlaxEngine
///
/// The output vertex buffer.
/// The output index buffer.
- [Obsolete("Deprecated in 1.4")]
+ [Obsolete("Deprecated in 1.4, use overload with Float3 and Float2 parameters")]
public void ExtractGeometry(out Vector3[] vertexBuffer, out int[] indexBuffer)
{
ExtractGeometry(out Float3[] tmp, out indexBuffer);
diff --git a/Source/Engine/UI/SpriteRender.cpp b/Source/Engine/UI/SpriteRender.cpp
index fb4f54e7f..25446c9c5 100644
--- a/Source/Engine/UI/SpriteRender.cpp
+++ b/Source/Engine/UI/SpriteRender.cpp
@@ -113,7 +113,7 @@ void SpriteRender::Draw(RenderContext& renderContext)
auto model = _quadModel.As();
if (model->GetLoadedLODs() == 0)
return;
- const auto& view = renderContext.View;
+ const auto& view = (renderContext.LodProxyView ? *renderContext.LodProxyView : renderContext.View);
Matrix m1, m2, m3, world;
Matrix::Scaling(_size.X, _size.Y, 1.0f, m2);
Matrix::RotationY(PI, m3);