Merge remote-tracking branch 'origin/master' into 1.9
This commit is contained in:
@@ -94,8 +94,8 @@ namespace FlaxEngine
|
||||
throw new ArgumentOutOfRangeException(nameof(values), "There must be sixteen and only four input values for Matrix2x2.");
|
||||
M11 = values[0];
|
||||
M12 = values[1];
|
||||
M21 = values[3];
|
||||
M22 = values[4];
|
||||
M21 = values[2];
|
||||
M22 = values[3];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -289,7 +289,7 @@ void Quaternion::Billboard(const Float3& objectPosition, const Float3& cameraPos
|
||||
|
||||
Quaternion Quaternion::FromDirection(const Float3& direction)
|
||||
{
|
||||
ASSERT(direction.IsNormalized());
|
||||
CHECK_RETURN_DEBUG(direction.IsNormalized(), Quaternion::Identity);
|
||||
Quaternion orientation;
|
||||
if (Float3::Dot(direction, Float3::Up) >= 0.999f)
|
||||
{
|
||||
|
||||
@@ -57,6 +57,7 @@ using Real = System.Single;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Runtime.CompilerServices;
|
||||
using FlaxEngine.Assertions;
|
||||
|
||||
namespace FlaxEngine
|
||||
{
|
||||
@@ -77,6 +78,7 @@ namespace FlaxEngine
|
||||
{
|
||||
Position = position;
|
||||
Direction = direction;
|
||||
Assert.IsTrue(Direction.IsNormalized, "The Ray Direction was not normalized");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
: Position(position)
|
||||
, Direction(direction)
|
||||
{
|
||||
ASSERT(Direction.IsNormalized());
|
||||
CHECK_DEBUG(Direction.IsNormalized());
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
@@ -324,15 +324,14 @@ public:
|
||||
{
|
||||
if (length <= 0)
|
||||
return;
|
||||
if (Base::Length() == 0)
|
||||
auto prev = Base::_data;
|
||||
const auto prevLength = Base::_length;
|
||||
if (prevLength == 0 || prev == nullptr)
|
||||
{
|
||||
Copy(data, length);
|
||||
return;
|
||||
}
|
||||
|
||||
auto prev = Base::_data;
|
||||
const auto prevLength = Base::_length;
|
||||
|
||||
Base::_length = prevLength + length;
|
||||
Base::_data = (T*)Allocator::Allocate(Base::_length * sizeof(T));
|
||||
|
||||
|
||||
@@ -2702,8 +2702,8 @@ void Variant::SetAsset(Asset* asset)
|
||||
SetType(VariantType(VariantType::Asset));
|
||||
if (AsAsset)
|
||||
{
|
||||
asset->OnUnloaded.Unbind<Variant, &Variant::OnAssetUnloaded>(this);
|
||||
asset->RemoveReference();
|
||||
AsAsset->OnUnloaded.Unbind<Variant, &Variant::OnAssetUnloaded>(this);
|
||||
AsAsset->RemoveReference();
|
||||
}
|
||||
AsAsset = asset;
|
||||
if (asset)
|
||||
|
||||
Reference in New Issue
Block a user