Merge branch 'main' into hasareej_LYN-2475_viewportui_switcher
This commit is contained in:
@@ -26,4 +26,4 @@ namespace AZ
|
||||
template <typename T>
|
||||
using Instance = AZStd::intrusive_ptr<T>;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,4 +60,4 @@ namespace AZ
|
||||
return m_guid != rhs.m_guid || m_subId != rhs.m_subId;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,4 +35,4 @@ namespace AZStd
|
||||
base_type::assign(list.begin(), list.end());
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,4 +158,4 @@ namespace AZStd
|
||||
/// Old elements will be evicted if the capacity is exceeded.
|
||||
size_t m_capacity = 0;
|
||||
};
|
||||
} // namespace AZStd
|
||||
} // namespace AZStd
|
||||
|
||||
@@ -76,4 +76,4 @@ namespace AZStd
|
||||
base_type::m_container.set_allocator(allocator);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -231,4 +231,4 @@ namespace AZStd
|
||||
protected:
|
||||
RandomAccessContainer m_container;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,4 +16,4 @@ set(FILES
|
||||
lru_cache.cpp
|
||||
Main.cpp
|
||||
vector_set.cpp
|
||||
)
|
||||
)
|
||||
|
||||
@@ -169,4 +169,4 @@ namespace UnitTest
|
||||
intintptr_cache.clear();
|
||||
EXPECT_EQ(p->use_count(), 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,4 +282,4 @@ namespace UnitTest
|
||||
VectorSetTester<AZStd::fixed_vector_set<int32_t, 64>> tester;
|
||||
tester.TestIteratorsConst();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,4 +193,4 @@ public class KeyboardHandler
|
||||
private Activity m_activity;
|
||||
private InputMethodManager m_inputManager;
|
||||
private DummyTextView m_textView;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,4 +88,4 @@ public class APKHandler
|
||||
|
||||
private static AssetManager s_assetManager = null;
|
||||
private static boolean s_debug = false;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -320,4 +320,4 @@ public class ObbDownloaderActivity extends Activity implements IDownloaderClient
|
||||
private int m_buttonPauseTextId;
|
||||
private int m_kbPerSecondTextId;
|
||||
private int m_timeRemainingTextId;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -37,4 +37,4 @@ public class ObbDownloaderAlarmReceiver extends BroadcastReceiver
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -75,4 +75,4 @@ public class ObbDownloaderService extends DownloaderService
|
||||
private byte[] m_salt = new byte[] { 23, 12, 4, -12, -34, 23,
|
||||
-120, 122, -23, -104, -2, -4, 12, 3, -21, 123, -11, 4, -11, 32
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,4 +84,4 @@ public class SimpleObject
|
||||
// ----
|
||||
|
||||
private static final String TAG = "SimpleObject";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,4 +11,4 @@
|
||||
|
||||
set(FILES
|
||||
AzAutoGen.py
|
||||
)
|
||||
)
|
||||
|
||||
@@ -417,4 +417,4 @@ namespace AZ
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,4 +219,4 @@ namespace AZ
|
||||
bool m_isRunning; //!< Internal flag indicating if the application is running, mainly used to determine if we shoudl be blocking on the event pump while paused
|
||||
};
|
||||
} // namespace Android
|
||||
} // namespace AZ
|
||||
} // namespace AZ
|
||||
|
||||
@@ -485,4 +485,4 @@ namespace AZ { namespace Android
|
||||
} // namespace AZ
|
||||
|
||||
|
||||
#include <AzCore/Android/JNI/Internal/Object_impl.h>
|
||||
#include <AzCore/Android/JNI/Internal/Object_impl.h>
|
||||
|
||||
@@ -1104,8 +1104,11 @@ namespace AZ
|
||||
// If we either already had valid asset data, or just created it via FindOrCreateAsset, try to queue the load.
|
||||
if (m_assetData && m_assetData->GetId().IsValid())
|
||||
{
|
||||
// Only try to queue if the asset isn't already loading or loaded.
|
||||
if (m_assetData->GetStatus() == AZ::Data::AssetData::AssetStatus::NotLoaded)
|
||||
// Try to queue if the asset isn't already loading or loaded.
|
||||
// Also try to queue if the asset *is* already loading or loaded, but we're the only one with a strong reference
|
||||
// (i.e. use count == 1), because that means it was in the process of being garbage-collected.
|
||||
if ((m_assetData->GetStatus() == AZ::Data::AssetData::AssetStatus::NotLoaded) ||
|
||||
(m_assetData->GetUseCount() == 1))
|
||||
{
|
||||
*this = AssetInternal::GetAsset(m_assetData->GetId(), m_assetData->GetType(), loadBehavior, loadParams);
|
||||
}
|
||||
|
||||
@@ -255,7 +255,7 @@ namespace AZ
|
||||
|
||||
bool AssetContainer::IsValid() const
|
||||
{
|
||||
return (m_containerAssetId.IsValid() && m_initComplete);
|
||||
return (m_containerAssetId.IsValid() && m_initComplete && m_rootAsset);
|
||||
}
|
||||
|
||||
void AssetContainer::CheckReady()
|
||||
@@ -341,6 +341,7 @@ namespace AZ
|
||||
|
||||
void AssetContainer::OnAssetError(Asset<AssetData> asset)
|
||||
{
|
||||
AZ_Warning("AssetContainer", false, "Error loading asset %s", asset->GetId().ToString<AZStd::string>().c_str());
|
||||
HandleReadyAsset(asset);
|
||||
}
|
||||
|
||||
@@ -366,7 +367,10 @@ namespace AZ
|
||||
auto remainingPreloadIter = m_preloadList.find(waiterId);
|
||||
if (remainingPreloadIter == m_preloadList.end())
|
||||
{
|
||||
AZ_Warning("AssetContainer", !m_initComplete, "Couldn't find waiting list for %s", waiterId.ToString<AZStd::string>().c_str());
|
||||
// If we got here without an entry on the preload list, it probably means this asset was triggered to load multiple
|
||||
// times, some with dependencies and some without. To ensure that we don't disturb the loads that expect the
|
||||
// dependencies, just silently return and don't treat the asset as finished loading. We'll rely on the other load
|
||||
// to send an OnAssetReady() whenever its expected dependencies are met.
|
||||
return;
|
||||
}
|
||||
if (!remainingPreloadIter->second.erase(preloadID))
|
||||
@@ -610,7 +614,12 @@ namespace AZ
|
||||
}
|
||||
for(auto& thisList : preloadList)
|
||||
{
|
||||
m_preloadList[thisList.first].insert(thisList.second.begin(), thisList.second.end());
|
||||
// Only save the entry to the final preload list if it has at least one dependent asset still remaining after
|
||||
// the checks above.
|
||||
if (!thisList.second.empty())
|
||||
{
|
||||
m_preloadList[thisList.first].insert(thisList.second.begin(), thisList.second.end());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,6 +208,7 @@ namespace AZ::Data
|
||||
void AssetDataStream::Close()
|
||||
{
|
||||
AZ_Assert(m_isOpen, "Attempting to close a stream that hasn't been opened.");
|
||||
AZ_Assert(m_curReadRequest == nullptr, "Attempting to close a stream with a read request in flight.");
|
||||
|
||||
// Destroy the asset buffer and unlock the allocator, so the allocator itself knows that it is no longer needed.
|
||||
if (m_buffer != m_preloadedData.data())
|
||||
@@ -222,6 +223,16 @@ namespace AZ::Data
|
||||
AZ_PROFILE_INTERVAL_END(AZ::Debug::ProfileCategory::AzCore, this);
|
||||
}
|
||||
|
||||
void AssetDataStream::RequestCancel()
|
||||
{
|
||||
AZStd::scoped_lock<AZStd::mutex> lock(m_readRequestMutex);
|
||||
if (m_curReadRequest)
|
||||
{
|
||||
auto streamer = Interface<IO::IStreamer>::Get();
|
||||
m_curReadRequest = streamer->Cancel(m_curReadRequest);
|
||||
}
|
||||
}
|
||||
|
||||
void AssetDataStream::Seek(AZ::IO::OffsetType bytes, AZ::IO::GenericStream::SeekMode mode)
|
||||
{
|
||||
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore);
|
||||
|
||||
@@ -82,6 +82,10 @@ namespace AZ::Data
|
||||
//! Gets the size of data loaded (so far).
|
||||
size_t GetLoadedSize() const { return m_loadedSize; }
|
||||
|
||||
//! Request a cancellation of any current IO streamer requests.
|
||||
//! Note: This is asynchronous and not guaranteed to cancel if the request is already in-process.
|
||||
void RequestCancel();
|
||||
|
||||
private:
|
||||
//! Perform any operations needed by all variants of Open()
|
||||
void OpenInternal(size_t assetSize, const char* streamName);
|
||||
|
||||
@@ -28,6 +28,8 @@ namespace AZ::Data::AssetInternal
|
||||
class WeakAsset
|
||||
{
|
||||
public:
|
||||
static constexpr bool EnableAssetCancellation = false;
|
||||
|
||||
WeakAsset() = default;
|
||||
|
||||
WeakAsset(AssetData* assetData, AssetLoadBehavior assetReferenceLoadBehavior);
|
||||
@@ -111,7 +113,14 @@ namespace AZ::Data::AssetInternal
|
||||
// - If the left and right sides are the same, clearing the right side's reference means one less reference will exist
|
||||
if (m_assetData)
|
||||
{
|
||||
m_assetData->ReleaseWeak();
|
||||
if constexpr (EnableAssetCancellation)
|
||||
{
|
||||
m_assetData->ReleaseWeak();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_assetData->Release();
|
||||
}
|
||||
}
|
||||
m_assetData = AZStd::move(rhs.m_assetData);
|
||||
rhs.m_assetData = nullptr;
|
||||
@@ -141,13 +150,27 @@ namespace AZ::Data::AssetInternal
|
||||
|
||||
if (assetData)
|
||||
{
|
||||
assetData->AcquireWeak();
|
||||
if constexpr (EnableAssetCancellation)
|
||||
{
|
||||
assetData->AcquireWeak();
|
||||
}
|
||||
else
|
||||
{
|
||||
assetData->Acquire();
|
||||
}
|
||||
m_assetId = assetData->GetId();
|
||||
}
|
||||
|
||||
if (m_assetData)
|
||||
{
|
||||
m_assetData->ReleaseWeak();
|
||||
if constexpr (EnableAssetCancellation)
|
||||
{
|
||||
m_assetData->ReleaseWeak();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_assetData->Release();
|
||||
}
|
||||
}
|
||||
|
||||
m_assetData = assetData;
|
||||
|
||||
@@ -2144,7 +2144,7 @@ namespace AZ
|
||||
if (curIter != m_assetContainers.end())
|
||||
{
|
||||
auto newRef = curIter->second.lock();
|
||||
if (newRef)
|
||||
if (newRef && newRef->IsValid())
|
||||
{
|
||||
return newRef;
|
||||
}
|
||||
|
||||
@@ -87,4 +87,4 @@ namespace AZ
|
||||
size_t m_nextBlockSize;
|
||||
unsigned int m_compressedBufferIndex;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -63,13 +63,13 @@ namespace AZ
|
||||
static AssetTrackingImpl* GetSharedInstance();
|
||||
static ThreadData& GetSharedThreadData();
|
||||
|
||||
using MasterAssets = AZStd::unordered_map<AssetTrackingId, AssetMasterInfo, AZStd::hash<AssetTrackingId>, AZStd::equal_to<AssetTrackingId>, AZStdAssetTrackingAllocator>;
|
||||
using PrimaryAssets = AZStd::unordered_map<AssetTrackingId, AssetPrimaryInfo, AZStd::hash<AssetTrackingId>, AZStd::equal_to<AssetTrackingId>, AZStdAssetTrackingAllocator>;
|
||||
using ThreadData = ThreadData;
|
||||
using mutex_type = AZStd::mutex;
|
||||
using lock_type = AZStd::lock_guard<mutex_type>;
|
||||
|
||||
mutex_type m_mutex;
|
||||
MasterAssets m_masterAssets;
|
||||
PrimaryAssets m_primaryAssets;
|
||||
AssetTreeNodeBase* m_assetRoot = nullptr;
|
||||
AssetAllocationTableBase* m_allocationTable = nullptr;
|
||||
bool m_performingAnalysis = false;
|
||||
@@ -118,7 +118,7 @@ namespace AZ
|
||||
auto& threadData = GetSharedThreadData();
|
||||
AssetTreeNodeBase* parentAsset = threadData.m_currentAssetStack.empty() ? nullptr : threadData.m_currentAssetStack.back();
|
||||
AssetTreeNodeBase* childAsset;
|
||||
AssetMasterInfo* assetMasterInfo;
|
||||
AssetPrimaryInfo* assetPrimaryInfo;
|
||||
|
||||
if (!parentAsset)
|
||||
{
|
||||
@@ -128,22 +128,22 @@ namespace AZ
|
||||
{
|
||||
lock_type lock(m_mutex);
|
||||
|
||||
// Locate or create the master record for this asset
|
||||
auto masterItr = m_masterAssets.find(assetId);
|
||||
// Locate or create the primary record for this asset
|
||||
auto primaryItr = m_primaryAssets.find(assetId);
|
||||
|
||||
if (masterItr != m_masterAssets.end())
|
||||
if (primaryItr != m_primaryAssets.end())
|
||||
{
|
||||
assetMasterInfo = &masterItr->second;
|
||||
assetPrimaryInfo = &primaryItr->second;
|
||||
}
|
||||
else
|
||||
{
|
||||
auto insertResult = m_masterAssets.emplace(assetId, AssetMasterInfo());
|
||||
assetMasterInfo = &insertResult.first->second;
|
||||
assetMasterInfo->m_id = &insertResult.first->first;
|
||||
auto insertResult = m_primaryAssets.emplace(assetId, AssetPrimaryInfo());
|
||||
assetPrimaryInfo = &insertResult.first->second;
|
||||
assetPrimaryInfo->m_id = &insertResult.first->first;
|
||||
}
|
||||
|
||||
// Add this asset to the stack for this thread's context
|
||||
childAsset = parentAsset->FindOrAddChild(assetId, assetMasterInfo);
|
||||
childAsset = parentAsset->FindOrAddChild(assetId, assetPrimaryInfo);
|
||||
}
|
||||
|
||||
threadData.m_currentAssetStack.push_back(childAsset);
|
||||
@@ -304,7 +304,7 @@ namespace AZ
|
||||
char* pos = buffer;
|
||||
for (auto itr = assetStack.rbegin(); itr != assetStack.rend(); ++itr)
|
||||
{
|
||||
pos += azsnprintf(pos, BUFFER_SIZE - (pos - buffer), "%s\n", (*itr)->GetAssetMasterInfo()->m_id->m_id.c_str());
|
||||
pos += azsnprintf(pos, BUFFER_SIZE - (pos - buffer), "%s\n", (*itr)->GetAssetPrimaryInfo()->m_id->m_id.c_str());
|
||||
|
||||
if (pos >= buffer + BUFFER_SIZE)
|
||||
{
|
||||
|
||||
@@ -79,9 +79,9 @@ namespace AZ
|
||||
AssetTrackingString m_id;
|
||||
};
|
||||
|
||||
// Master information about an asset.
|
||||
// Primary information about an asset.
|
||||
// Currently just contains the ID of the asset, but in the future may carry additional information about that asset (such as where in code it was initialized).
|
||||
struct AssetMasterInfo
|
||||
struct AssetPrimaryInfo
|
||||
{
|
||||
const AssetTrackingId* m_id;
|
||||
};
|
||||
@@ -90,8 +90,8 @@ namespace AZ
|
||||
class AssetTreeNodeBase
|
||||
{
|
||||
public:
|
||||
virtual const AssetMasterInfo* GetAssetMasterInfo() const = 0;
|
||||
virtual AssetTreeNodeBase* FindOrAddChild(const AssetTrackingId& id, const AssetMasterInfo* info) = 0;
|
||||
virtual const AssetPrimaryInfo* GetAssetPrimaryInfo() const = 0;
|
||||
virtual AssetTreeNodeBase* FindOrAddChild(const AssetTrackingId& id, const AssetPrimaryInfo* info) = 0;
|
||||
};
|
||||
|
||||
// Base class for an asset tree. Implemented by the template AssetTree<>.
|
||||
|
||||
@@ -29,18 +29,18 @@ namespace AZ
|
||||
class AssetTreeNode : public AssetTreeNodeBase
|
||||
{
|
||||
public:
|
||||
AssetTreeNode(const AssetMasterInfo* masterInfo = nullptr, AssetTreeNode* parent = nullptr) :
|
||||
m_masterInfo(masterInfo),
|
||||
AssetTreeNode(const AssetPrimaryInfo* primaryInfo = nullptr, AssetTreeNode* parent = nullptr) :
|
||||
m_primaryinfo(primaryInfo),
|
||||
m_parent(parent)
|
||||
{
|
||||
}
|
||||
|
||||
const AssetMasterInfo* GetAssetMasterInfo() const override
|
||||
const AssetPrimaryInfo* GetAssetPrimaryInfo() const override
|
||||
{
|
||||
return m_masterInfo;
|
||||
return m_primaryinfo;
|
||||
}
|
||||
|
||||
AssetTreeNodeBase* FindOrAddChild(const AssetTrackingId& id, const AssetMasterInfo* info) override
|
||||
AssetTreeNodeBase* FindOrAddChild(const AssetTrackingId& id, const AssetPrimaryInfo* info) override
|
||||
{
|
||||
AssetTreeNodeBase* result = nullptr;
|
||||
auto childItr = m_children.find(id);
|
||||
@@ -61,7 +61,7 @@ namespace AZ
|
||||
|
||||
using AssetMap = AssetTrackingMap<AssetTrackingId, AssetTreeNode>;
|
||||
|
||||
const AssetMasterInfo* m_masterInfo;
|
||||
const AssetPrimaryInfo* m_primaryinfo;
|
||||
AssetTreeNode* m_parent;
|
||||
AssetMap m_children;
|
||||
AssetDataT m_data;
|
||||
|
||||
@@ -82,4 +82,4 @@ namespace AZ
|
||||
|
||||
#define AZ_TRACE_INSTANT_THREAD_CATEGORY(name, category) \
|
||||
EBUS_QUEUE_EVENT(AZ::Debug::EventTraceDrillerBus, RecordInstantThread, name, category, AZStd::this_thread::get_id(), AZStd::GetTimeNowMicroSecond())
|
||||
#define AZ_TRACE_INSTANT_THREAD(name) AZ_TRACE_INSTANT_THREAD_CATEGORY(name, "")
|
||||
#define AZ_TRACE_INSTANT_THREAD(name) AZ_TRACE_INSTANT_THREAD_CATEGORY(name, "")
|
||||
|
||||
@@ -64,4 +64,4 @@ namespace AZ
|
||||
} // namespace AZ
|
||||
|
||||
#endif // AZCORE_FRAME_PROFILER_H
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
@@ -39,4 +39,4 @@ namespace AZ
|
||||
} // namespace AZ
|
||||
|
||||
#endif // AZCORE_FRAME_PROFILER_BUS_H
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
@@ -46,4 +46,4 @@ namespace AZ
|
||||
}
|
||||
|
||||
#endif // AZCORE_PROFILER_DRILLER_BUS_H
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
@@ -194,4 +194,4 @@ namespace AZ
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,4 +112,4 @@ namespace AZ
|
||||
return m_offsetEnd;
|
||||
}
|
||||
} // namespace IO
|
||||
} // namesapce AZ
|
||||
} // namesapce AZ
|
||||
|
||||
@@ -71,4 +71,4 @@ namespace AZ
|
||||
u64 m_offsetEnd : 63;
|
||||
};
|
||||
} // namespace IO
|
||||
} // namesapce AZ
|
||||
} // namesapce AZ
|
||||
|
||||
@@ -24,4 +24,4 @@
|
||||
|
||||
#if AZ_TRAIT_JSON_CLANG_IGNORE_UNKNOWN_WARNING && defined(AZ_COMPILER_CLANG)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -46,4 +46,4 @@ namespace AZ
|
||||
}
|
||||
|
||||
#endif
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
@@ -68,4 +68,4 @@ namespace AZ
|
||||
}
|
||||
|
||||
#endif
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
@@ -70,4 +70,4 @@ namespace AZ
|
||||
}
|
||||
|
||||
#endif
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
@@ -36,4 +36,4 @@ namespace AZ
|
||||
}
|
||||
|
||||
#endif
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
@@ -96,4 +96,4 @@ namespace AZ
|
||||
}
|
||||
|
||||
#endif
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
@@ -135,4 +135,4 @@ namespace AZ
|
||||
}
|
||||
|
||||
#endif
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
@@ -146,8 +146,8 @@ namespace AZ
|
||||
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)
|
||||
->Method("GetTranslated", &Aabb::GetTranslated)
|
||||
->Method("GetSurfaceArea", &Aabb::GetSurfaceArea)
|
||||
->Method("GetTransformedObb", &Aabb::GetTransformedObb)
|
||||
->Method("GetTransformedAabb", &Aabb::GetTransformedAabb)
|
||||
->Method("GetTransformedObb", static_cast<Obb(Aabb::*)(const Transform&) const>(&Aabb::GetTransformedObb))
|
||||
->Method("GetTransformedAabb", static_cast<Aabb(Aabb::*)(const Transform&) const>(&Aabb::GetTransformedAabb))
|
||||
->Method("ApplyTransform", &Aabb::ApplyTransform)
|
||||
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)
|
||||
->Method("Clone", [](const Aabb& rhs) -> Aabb { return rhs; })
|
||||
@@ -195,6 +195,20 @@ namespace AZ
|
||||
}
|
||||
|
||||
|
||||
Obb Aabb::GetTransformedObb(const Matrix3x4& matrix3x4) const
|
||||
{
|
||||
Matrix3x4 matrixNoScale = matrix3x4;
|
||||
const AZ::Vector3 scale = matrixNoScale.ExtractScale();
|
||||
const AZ::Quaternion rotation = AZ::Quaternion::CreateFromMatrix3x4(matrixNoScale);
|
||||
|
||||
return Obb::CreateFromPositionRotationAndHalfLengths(
|
||||
matrix3x4 * GetCenter(),
|
||||
rotation,
|
||||
0.5f * scale * GetExtents()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
void Aabb::ApplyTransform(const Transform& transform)
|
||||
{
|
||||
Vector3 a, b, axisCoeffs;
|
||||
@@ -224,4 +238,17 @@ namespace AZ
|
||||
m_min = newMin;
|
||||
m_max = newMax;
|
||||
}
|
||||
|
||||
|
||||
void Aabb::ApplyMatrix3x4(const Matrix3x4& matrix3x4)
|
||||
{
|
||||
const AZ::Vector3 extents = GetExtents();
|
||||
const AZ::Vector3 center = matrix3x4 * GetCenter();
|
||||
AZ::Vector3 newHalfExtents(
|
||||
0.5f * matrix3x4.GetRowAsVector3(0).GetAbs().Dot(extents),
|
||||
0.5f * matrix3x4.GetRowAsVector3(1).GetAbs().Dot(extents),
|
||||
0.5f * matrix3x4.GetRowAsVector3(2).GetAbs().Dot(extents));
|
||||
m_min = center - newHalfExtents;
|
||||
m_max = center + newHalfExtents;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,11 +129,21 @@ namespace AZ
|
||||
|
||||
void ApplyTransform(const Transform& transform);
|
||||
|
||||
void ApplyMatrix3x4(const Matrix3x4& matrix3x4);
|
||||
|
||||
void MultiplyByScale(const Vector3& scale);
|
||||
|
||||
//! Transforms an Aabb and returns the resulting Obb.
|
||||
class Obb GetTransformedObb(const Transform& transform) const;
|
||||
[[nodiscard]] Obb GetTransformedObb(const Transform& transform) const;
|
||||
|
||||
//! Transforms an Aabb and returns the resulting Obb.
|
||||
[[nodiscard]] Obb GetTransformedObb(const Matrix3x4& matrix3x4) const;
|
||||
|
||||
//! Returns a new AABB containing the transformed AABB.
|
||||
Aabb GetTransformedAabb(const Transform& transform) const;
|
||||
[[nodiscard]] Aabb GetTransformedAabb(const Transform& transform) const;
|
||||
|
||||
//! Returns a new AABB containing the transformed AABB.
|
||||
[[nodiscard]] Aabb GetTransformedAabb(const Matrix3x4& matrix3x4) const;
|
||||
|
||||
//! Checks if this aabb is equal to another within a floating point tolerance.
|
||||
bool IsClose(const Aabb& rhs, float tolerance = Constants::Tolerance) const;
|
||||
|
||||
@@ -292,6 +292,14 @@ namespace AZ
|
||||
}
|
||||
|
||||
|
||||
AZ_MATH_INLINE void Aabb::MultiplyByScale(const Vector3& scale)
|
||||
{
|
||||
m_min *= scale;
|
||||
m_max *= scale;
|
||||
AZ_MATH_ASSERT(IsValid(), "Min must be less than Max");
|
||||
}
|
||||
|
||||
|
||||
AZ_MATH_INLINE Aabb Aabb::GetTransformedAabb(const Transform& transform) const
|
||||
{
|
||||
Aabb aabb = Aabb::CreateFromMinMax(m_min, m_max);
|
||||
@@ -300,6 +308,14 @@ namespace AZ
|
||||
}
|
||||
|
||||
|
||||
AZ_MATH_INLINE Aabb Aabb::GetTransformedAabb(const Matrix3x4& matrix3x4) const
|
||||
{
|
||||
Aabb aabb = Aabb::CreateFromMinMax(m_min, m_max);
|
||||
aabb.ApplyMatrix3x4(matrix3x4);
|
||||
return aabb;
|
||||
}
|
||||
|
||||
|
||||
AZ_MATH_INLINE bool Aabb::IsClose(const Aabb& rhs, float tolerance) const
|
||||
{
|
||||
return m_min.IsClose(rhs.m_min, tolerance) && m_max.IsClose(rhs.m_max, tolerance);
|
||||
|
||||
@@ -296,4 +296,4 @@ namespace AZ
|
||||
m_updateCallback(index);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,4 +164,4 @@ namespace AZ
|
||||
return GetTargetValue();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,4 +67,4 @@ namespace AZ
|
||||
//! Transforms a position by a matrix. This function can be used with any generic cases which include projection matrices.
|
||||
Vector3 MatrixTransformPosition(const Matrix4x4& matrix, const Vector3& inPosition);
|
||||
|
||||
} // namespace AZ
|
||||
} // namespace AZ
|
||||
|
||||
@@ -110,4 +110,4 @@ namespace AZ
|
||||
|
||||
} // namespace AZ
|
||||
|
||||
#include <AzCore/Math/Internal/VertexContainer.inl>
|
||||
#include <AzCore/Math/Internal/VertexContainer.inl>
|
||||
|
||||
@@ -172,4 +172,4 @@ namespace AZ
|
||||
template<>
|
||||
inline AZ::Vector3 AdaptVertexOut<AZ::Vector2>(const AZ::Vector2& vector) { return Vector2ToVector3(vector); }
|
||||
|
||||
} // namespace AZ
|
||||
} // namespace AZ
|
||||
|
||||
@@ -31,4 +31,4 @@ namespace AZ
|
||||
return modulePath;
|
||||
}
|
||||
} // namespace Internal
|
||||
} // namespace AZ
|
||||
} // namespace AZ
|
||||
|
||||
@@ -113,4 +113,4 @@
|
||||
#define AZCG_Unpack_98(x, ...) AZCG_Unpack_1(x) AZCG_Unpack_97(__VA_ARGS__)
|
||||
#define AZCG_Unpack_99(x, ...) AZCG_Unpack_1(x) AZCG_Unpack_98(__VA_ARGS__)
|
||||
#define AZCG_Unpack(...) AZ_MACRO_SPECIALIZE(AZCG_Unpack_, AZ_VA_NUM_ARGS(__VA_ARGS__), (__VA_ARGS__))
|
||||
#define AZCG_Paste(x) x
|
||||
#define AZCG_Paste(x) x
|
||||
|
||||
@@ -26,4 +26,4 @@ namespace AZ
|
||||
void Activate() override { }
|
||||
void Deactivate() override { }
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,4 +79,4 @@ namespace AZ
|
||||
AZ_TYPE_INFO_SPECIALIZE(Script::Attributes::OperatorType, "{26B98C03-7E07-4E3E-9E31-03DA2168E896}");
|
||||
AZ_TYPE_INFO_SPECIALIZE(Script::Attributes::StorageType, "{57FED71F-B590-4002-9599-A48CB50B0F8E}");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,4 +32,4 @@ namespace AZ
|
||||
};
|
||||
|
||||
typedef AZ::EBus<BehaviorObjectSignalsInterface> BehaviorObjectSignals;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,4 +138,4 @@ namespace AZ
|
||||
m_currentlyProcessingTypeIds.pop_back();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,4 +208,4 @@ namespace AZ
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1411,4 +1411,4 @@ namespace AZ
|
||||
m_value = entityProperty->m_value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,4 +38,4 @@ namespace AZ
|
||||
};
|
||||
|
||||
typedef AZ::EBus<ScriptPropertyWatcherInterface> ScriptPropertyWatcherBus;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,4 +47,4 @@ namespace AZ
|
||||
}
|
||||
}
|
||||
|
||||
#endif // #if !defined(AZCORE_EXCLUDE_LUA)
|
||||
#endif // #if !defined(AZCORE_EXCLUDE_LUA)
|
||||
|
||||
@@ -287,4 +287,4 @@ namespace AZ
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,4 +139,4 @@ namespace AZ
|
||||
|
||||
/// @deprecated Use SliceBus.
|
||||
using PrefabBus = SliceBus;
|
||||
} // namespace AZ
|
||||
} // namespace AZ
|
||||
|
||||
@@ -39,4 +39,4 @@ namespace AZ
|
||||
|
||||
SliceAssetHandler m_assetHandler;
|
||||
};
|
||||
} // namespace AZ
|
||||
} // namespace AZ
|
||||
|
||||
@@ -125,4 +125,4 @@ namespace AZ
|
||||
bool DummyStateHandler(HSM& /*sm*/, const HSM::Event& /*e*/) { return handleEvent; }
|
||||
}
|
||||
#endif // AZCORE_HIERARCHIAL_STATE_MACHINE_H
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
@@ -38,4 +38,4 @@ namespace AZStd
|
||||
using std::is_placeholder;
|
||||
template<class T>
|
||||
constexpr size_t is_placeholder_v = is_placeholder<T>::value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2024,4 +2024,4 @@ namespace AZStd
|
||||
|
||||
|
||||
#endif // AZSTD_DELEGATE_H
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
@@ -228,4 +228,4 @@ namespace AZStd
|
||||
}
|
||||
|
||||
#endif //AZSTD_DELEGATE_BIND_H
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
@@ -23,4 +23,4 @@ namespace AZStd
|
||||
|
||||
|
||||
#endif // AZSTD_DELEGATE_H
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
+1
-1
@@ -194,4 +194,4 @@ namespace AZStd
|
||||
}
|
||||
|
||||
#endif // AZSTD_PARALLEL_CONTAINERS_CONCURRENT_FIXED_UNORDERED_MAP_H
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
+1
-1
@@ -162,4 +162,4 @@ namespace AZStd
|
||||
}
|
||||
|
||||
#endif // AZSTD_PARALLEL_CONTAINERS_CONCURRENT_FIXED_UNORDERED_SET_H
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
@@ -266,4 +266,4 @@ namespace AZStd
|
||||
}
|
||||
|
||||
#endif // AZSTD_PARALLEL_CONTAINERS_CONCURRENT_UNORDERED_MAP_H
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
@@ -228,4 +228,4 @@ namespace AZStd
|
||||
}
|
||||
|
||||
#endif // AZSTD_PARALLEL_CONTAINERS_CONCURRENT_UNORDERED_SET_H
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
@@ -159,4 +159,4 @@ namespace AZStd
|
||||
}
|
||||
|
||||
#endif
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
@@ -23,4 +23,4 @@ namespace AZStd
|
||||
*/
|
||||
using intrusive_base = intrusive_refcount<atomic_uint>;
|
||||
|
||||
} // namespace AZStd
|
||||
} // namespace AZStd
|
||||
|
||||
@@ -75,4 +75,4 @@ namespace AZStd
|
||||
Deleter m_deleter;
|
||||
};
|
||||
|
||||
} // namespace AZStd
|
||||
} // namespace AZStd
|
||||
|
||||
@@ -62,4 +62,4 @@ namespace AZStd
|
||||
}
|
||||
}
|
||||
|
||||
#endif // AZSTD_MEMORYTOASCII_H
|
||||
#endif // AZSTD_MEMORYTOASCII_H
|
||||
|
||||
@@ -16,4 +16,4 @@ namespace AZStd
|
||||
{
|
||||
using std::add_const;
|
||||
using std::add_const_t;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,4 +17,4 @@ namespace AZStd
|
||||
using std::add_pointer;
|
||||
template<class Type>
|
||||
using add_pointer_t = std::add_pointer_t<Type>;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -129,4 +129,4 @@ namespace AZStd
|
||||
{
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,4 +41,4 @@ namespace AZStd
|
||||
template <size_t index, typename ...Args>
|
||||
using pack_traits_get_arg_t = typename pack_traits_get_arg<index, pack_traits_arg_sequence<Args...>>::type;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,4 +17,4 @@ namespace AZStd
|
||||
{
|
||||
using std::is_member_object_pointer;
|
||||
using std::is_member_object_pointer_v;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,4 +17,4 @@ namespace AZStd
|
||||
using std::remove_pointer;
|
||||
template<class Type>
|
||||
using remove_pointer_t = std::remove_pointer_t<Type>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,4 +19,4 @@ namespace AZStd
|
||||
// It can be used to detect ill-formed which are not mappable to void
|
||||
template<typename... Args> struct make_void { using type = void; };
|
||||
template<typename... Args> using void_t = typename make_void<Args...>::type;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,4 +11,4 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/AzCore_Traits_Android.h>
|
||||
#include <AzCore/AzCore_Traits_Android.h>
|
||||
|
||||
@@ -21,4 +21,4 @@ namespace AZ
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,4 +11,4 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "../../../Common/UnixLike/AzCore/Socket/AzSocket_UnixLike.h"
|
||||
#include "../../../Common/UnixLike/AzCore/Socket/AzSocket_UnixLike.h"
|
||||
|
||||
@@ -11,4 +11,4 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "../../../Common/UnixLike/AzCore/Socket/AzSocket_fwd_UnixLike.h"
|
||||
#include "../../../Common/UnixLike/AzCore/Socket/AzSocket_fwd_UnixLike.h"
|
||||
|
||||
@@ -9,4 +9,4 @@
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
@@ -91,4 +91,4 @@ if (LY_TEST_PROJECT)
|
||||
PROPERTY COMPILE_DEFINITIONS
|
||||
VALUES LY_NO_ASSETS
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -65,4 +65,4 @@ namespace AZ::IO::Platform
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,4 +21,4 @@ inline void* memalign(size_t blocksize, size_t bytes)
|
||||
}
|
||||
|
||||
# define AZ_OS_MALLOC(byteSize, alignment) memalign(alignment, byteSize)
|
||||
# define AZ_OS_FREE(pointer) ::free(pointer)
|
||||
# define AZ_OS_FREE(pointer) ::free(pointer)
|
||||
|
||||
+1
-1
@@ -34,4 +34,4 @@ namespace AZ::Platform
|
||||
m_threadSleepCondition.notify_one();
|
||||
}
|
||||
|
||||
} // namespace AZ::Platform
|
||||
} // namespace AZ::Platform
|
||||
|
||||
+1
-1
@@ -28,4 +28,4 @@ namespace AZ
|
||||
{
|
||||
}
|
||||
} // namespace Internal
|
||||
} // namespace AZ
|
||||
} // namespace AZ
|
||||
|
||||
@@ -27,4 +27,4 @@ namespace AZStd
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,4 +50,4 @@ namespace RADTelemetry
|
||||
using ProfileTelemetryRequestBus = AZ::EBus<ProfileTelemetryRequests>;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -90,4 +90,4 @@ namespace AZ
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -26,4 +26,4 @@ namespace AZ
|
||||
bool FormatAndPeelOffWildCardExtension(const char* sourcePath, char* filePath, size_t filePathSize, char* extensionPath, size_t extensionSize, bool keepWildcard = false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,4 +14,4 @@
|
||||
#include <malloc.h>
|
||||
|
||||
# define AZ_OS_MALLOC(byteSize, alignment) ::memalign(alignment, byteSize)
|
||||
# define AZ_OS_FREE(pointer) ::free(pointer)
|
||||
# define AZ_OS_FREE(pointer) ::free(pointer)
|
||||
|
||||
@@ -12,4 +12,4 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <unistd.h>
|
||||
#include <unistd.h>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user