Merge branch 'main' into transform-float-scale
This commit is contained in:
@@ -60,6 +60,7 @@ namespace AzFramework
|
||||
virtual void DrawTrianglesIndexed(const AZStd::vector<AZ::Vector3>& vertices, const AZStd::vector<AZ::u32>& indices, const AZ::Color& color) { (void)vertices; (void)indices, (void)color; }
|
||||
virtual void DrawWireBox(const AZ::Vector3& min, const AZ::Vector3& max) { (void)min; (void)max; }
|
||||
virtual void DrawSolidBox(const AZ::Vector3& min, const AZ::Vector3& max) { (void)min; (void)max; }
|
||||
virtual void DrawWireOBB(const AZ::Vector3& center, const AZ::Vector3& axisX, const AZ::Vector3& axisY, const AZ::Vector3& axisZ, const AZ::Vector3& halfExtents) { (void)center; (void)axisX; (void)axisY; (void)axisZ; (void)halfExtents; }
|
||||
virtual void DrawSolidOBB(const AZ::Vector3& center, const AZ::Vector3& axisX, const AZ::Vector3& axisY, const AZ::Vector3& axisZ, const AZ::Vector3& halfExtents) { (void)center; (void)axisX; (void)axisY; (void)axisZ; (void)halfExtents; }
|
||||
virtual void DrawPoint(const AZ::Vector3& p, int nSize = 1) { (void)p; (void)nSize; }
|
||||
virtual void DrawLine(const AZ::Vector3& p1, const AZ::Vector3& p2) { (void)p1; (void)p2; }
|
||||
@@ -70,18 +71,15 @@ namespace AzFramework
|
||||
virtual void DrawLine2d(const AZ::Vector2& p1, const AZ::Vector2& p2, float z) { (void)p1; (void)p2; (void)z; }
|
||||
virtual void DrawLine2dGradient(const AZ::Vector2& p1, const AZ::Vector2& p2, float z, const AZ::Vector4& firstColor, const AZ::Vector4& secondColor) { (void)p1; (void)p2; (void)z; (void)firstColor; (void)secondColor; }
|
||||
virtual void DrawWireCircle2d(const AZ::Vector2& center, float radius, float z) { (void)center; (void)radius; (void)z; }
|
||||
virtual void DrawTerrainCircle(const AZ::Vector3& worldPos, float radius, float height) { (void)worldPos; (void)radius; (void)height; }
|
||||
virtual void DrawTerrainCircle(const AZ::Vector3& center, float radius, float angle1, float angle2, float height) { (void)center; (void)radius; (void)angle1; (void)angle2; (void)height; }
|
||||
virtual void DrawArc(const AZ::Vector3& pos, float radius, float startAngleDegrees, float sweepAngleDegrees, float angularStepDegrees, int referenceAxis = 2) { (void)pos; (void)radius; (void)startAngleDegrees; (void)sweepAngleDegrees; (void)angularStepDegrees; (void)referenceAxis; }
|
||||
virtual void DrawArc(const AZ::Vector3& pos, float radius, float startAngleDegrees, float sweepAngleDegrees, float angularStepDegrees, const AZ::Vector3& fixedAxis) { (void)pos; (void)radius; (void)startAngleDegrees; (void)sweepAngleDegrees; (void)angularStepDegrees; (void)fixedAxis; }
|
||||
virtual void DrawCircle(const AZ::Vector3& pos, float radius, int nUnchangedAxis = 2 /*z axis*/) { (void)pos; (void)radius; (void)nUnchangedAxis; }
|
||||
virtual void DrawHalfDottedCircle(const AZ::Vector3& pos, float radius, const AZ::Vector3& viewPos, int nUnchangedAxis = 2 /*z axis*/) { (void)pos; (void)radius; (void)viewPos; (void)nUnchangedAxis; }
|
||||
virtual void DrawCone(const AZ::Vector3& pos, const AZ::Vector3& dir, float radius, float height, bool drawShaded = true) { (void)pos; (void)dir; (void)radius; (void)height; (void)drawShaded; }
|
||||
virtual void DrawWireCone(const AZ::Vector3& pos, const AZ::Vector3& dir, float radius, float height) { (void)pos; (void)dir; (void)radius; (void)height; }
|
||||
virtual void DrawSolidCone(const AZ::Vector3& pos, const AZ::Vector3& dir, float radius, float height, bool drawShaded = true) { (void)pos; (void)dir; (void)radius; (void)height; (void)drawShaded; }
|
||||
virtual void DrawWireCylinder(const AZ::Vector3& center, const AZ::Vector3& axis, float radius, float height) { (void)center; (void)axis; (void)radius; (void)height; }
|
||||
virtual void DrawSolidCylinder(const AZ::Vector3& center, const AZ::Vector3& axis, float radius, float height, bool drawShaded = true) { (void)center; (void)axis; (void)radius; (void)height; (void)drawShaded; }
|
||||
virtual void DrawWireCapsule(const AZ::Vector3& center, const AZ::Vector3& axis, float radius, float heightStraightSection) { (void)center; (void)axis; (void)radius; (void)heightStraightSection; }
|
||||
virtual void DrawTerrainRect(float x1, float y1, float x2, float y2, float height) { (void)x1; (void)y1; (void)x2; (void)y2; (void)height; }
|
||||
virtual void DrawTerrainLine(AZ::Vector3 worldPos1, AZ::Vector3 worldPos2) { (void)worldPos1; (void)worldPos2; }
|
||||
virtual void DrawWireSphere(const AZ::Vector3& pos, float radius) { (void)pos; (void)radius; }
|
||||
virtual void DrawWireSphere(const AZ::Vector3& pos, const AZ::Vector3 radius) { (void)pos; (void)radius; }
|
||||
virtual void DrawWireDisk(const AZ::Vector3& pos, const AZ::Vector3& dir, float radius) { (void)pos; (void)dir; (void)radius; }
|
||||
@@ -91,11 +89,8 @@ namespace AzFramework
|
||||
virtual void DrawTextLabel(const AZ::Vector3& pos, float size, const char* text, const bool bCenter = false, int srcOffsetX = 0, int srcOffsetY = 0) { (void)pos; (void)size; (void)text; (void)bCenter; (void)srcOffsetX; (void)srcOffsetY; }
|
||||
virtual void Draw2dTextLabel(float x, float y, float size, const char* text, bool bCenter = false) { (void)x; (void)y; (void)size; (void)text; (void)bCenter; }
|
||||
virtual void DrawTextOn2DBox(const AZ::Vector3& pos, const char* text, float textScale, const AZ::Vector4& TextColor, const AZ::Vector4& TextBackColor) { (void)pos; (void)text; (void)textScale; (void)TextColor; (void)TextBackColor; }
|
||||
virtual void DrawTextureLabel(ITexture* texture, const AZ::Vector3& pos, float sizeX, float sizeY, int texIconFlags) { (void)texture; (void)pos; (void)sizeX; (void)sizeY; (void)texIconFlags; }
|
||||
virtual void DrawTextureLabel(int textureId, const AZ::Vector3& pos, float sizeX, float sizeY, int texIconFlags) { (void)textureId; (void)pos; (void)sizeX; (void)sizeY; (void)texIconFlags; }
|
||||
virtual void SetLineWidth(float width) { (void)width; }
|
||||
virtual bool IsVisible(const AZ::Aabb& bounds) { (void)bounds; return false; }
|
||||
virtual int SetFillMode(int nFillMode) { (void)nFillMode; return 0; }
|
||||
virtual float GetLineWidth() { return 0.0f; }
|
||||
virtual float GetAspectRatio() { return 0.0f; }
|
||||
virtual void DepthTestOff() {}
|
||||
|
||||
@@ -123,8 +123,9 @@ namespace AzFramework
|
||||
OctreeNode* insertCheck = this;
|
||||
while (insertCheck != nullptr)
|
||||
{
|
||||
if (AZ::ShapeIntersection::Contains(insertCheck->m_bounds, boundingVolume))
|
||||
if (AZ::ShapeIntersection::Contains(insertCheck->m_bounds, boundingVolume) || !insertCheck->m_parent)
|
||||
{
|
||||
// Insert here if the entry is fully contained or if we've reached the root node
|
||||
return insertCheck->Insert(octreeScene, entry);
|
||||
}
|
||||
insertCheck = insertCheck->m_parent;
|
||||
|
||||
@@ -447,17 +447,14 @@ namespace AzToolsFramework
|
||||
m_radius * viewScale);
|
||||
|
||||
debugDisplay.SetColor(ViewColor(manipulatorState.m_mouseOver, m_color, m_mouseOverColor).GetAsVector4());
|
||||
|
||||
// show wireframe if the axis has been corrected/flipped
|
||||
// note: please see IRenderAuxGeom.h for the definition of e_FillModeWireframe and e_FillModeSolid.
|
||||
// it is not possible to include IRenderAuxGeom from here and we also don't want to introduce that dependency.
|
||||
// these legacy enums should be wrapped so set SetFillMode can be used in a type safe way, until then,
|
||||
// use the values directly until the API has been updated.
|
||||
const AZ::u32 prevFillMode = debugDisplay.SetFillMode(
|
||||
m_shouldCorrect ? /*e_FillModeWireframe =*/ 0x1 << 26 : /*e_FillModeSolid =*/ 0);
|
||||
|
||||
debugDisplay.DrawCone(coneBound.m_base, coneBound.m_axis, coneBound.m_radius, coneBound.m_height, false);
|
||||
debugDisplay.SetFillMode(prevFillMode);
|
||||
if (m_shouldCorrect)
|
||||
{
|
||||
debugDisplay.DrawWireCone(coneBound.m_base, coneBound.m_axis, coneBound.m_radius, coneBound.m_height);
|
||||
}
|
||||
else
|
||||
{
|
||||
debugDisplay.DrawSolidCone(coneBound.m_base, coneBound.m_axis, coneBound.m_radius, coneBound.m_height, false);
|
||||
}
|
||||
|
||||
RefreshBoundInternal(managerId, manipulatorId, coneBound);
|
||||
}
|
||||
|
||||
+1
-2
@@ -140,8 +140,7 @@ namespace AzToolsFramework
|
||||
ProductAssetBrowserEntry* productEntry = static_cast<ProductAssetBrowserEntry*>(childEntry);
|
||||
AZStd::string assetName;
|
||||
AzFramework::StringFunc::Path::GetFileName(productEntry->GetFullPath().c_str(), assetName);
|
||||
m_assets.push_back({
|
||||
assetName, productEntry->GetFullPath(), productEntry->GetAssetId()
|
||||
m_assets.push_back({ productEntry->GetName(), productEntry->GetFullPath(), productEntry->GetAssetId()
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -233,9 +233,9 @@ namespace AzToolsFramework
|
||||
}();
|
||||
|
||||
debugDisplay.SetColor(iconHighlight);
|
||||
debugDisplay.DrawTextureLabel(
|
||||
iconTextureId, entityPosition, iconSize, iconSize,
|
||||
/*DisplayContext::ETextureIconFlags::TEXICON_ON_TOP=*/ 0x0008);
|
||||
// debugDisplay.DrawTextureLabel(
|
||||
// iconTextureId, entityPosition, iconSize, iconSize,
|
||||
// /*DisplayContext::ETextureIconFlags::TEXICON_ON_TOP=*/ 0x0008);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <AzCore/Console/IConsole.h>
|
||||
#include <AzCore/Console/Console.h>
|
||||
#include <AzCore/Name/NameDictionary.h>
|
||||
#include <AzCore/Console/IConsole.h>
|
||||
#include <AzFramework/Visibility/OctreeSystemComponent.h>
|
||||
#include <random>
|
||||
|
||||
@@ -94,6 +95,20 @@ namespace UnitTest
|
||||
AZ::Console* m_console;
|
||||
};
|
||||
|
||||
void ValidateEntryCountEqualsExpectedCount(const IVisibilityScene* visScene, uint32_t expectedEntryCount)
|
||||
{
|
||||
// InsertOrUpdateEntry assumes that updating an existing entry won't change the count
|
||||
// so it doesn't modify the counter used by GetEntryCount.
|
||||
// If an entry is removed from the octree as an unintended side effect of updating an existing entry,
|
||||
// GetEntryCount can't be relied upon to report the actual entry count.
|
||||
// So manually count the entries when using the entry count for validation.
|
||||
uint32_t manualEntryCount = 0;
|
||||
visScene->EnumerateNoCull([&manualEntryCount](const AzFramework::IVisibilityScene::NodeData& nodeData) { manualEntryCount += nodeData.m_entries.size(); });
|
||||
|
||||
EXPECT_EQ(manualEntryCount, expectedEntryCount);
|
||||
EXPECT_EQ(visScene->GetEntryCount(), expectedEntryCount);
|
||||
}
|
||||
|
||||
TEST_F(OctreeTests, InsertDeleteSingleEntry)
|
||||
{
|
||||
AzFramework::VisibilityEntry visEntry;
|
||||
@@ -102,11 +117,11 @@ namespace UnitTest
|
||||
m_octreeScene->InsertOrUpdateEntry(visEntry);
|
||||
EXPECT_TRUE(visEntry.m_internalNode != nullptr);
|
||||
EXPECT_TRUE(visEntry.m_internalNodeIndex == 0);
|
||||
EXPECT_TRUE(m_octreeScene->GetEntryCount() == 1);
|
||||
ValidateEntryCountEqualsExpectedCount(m_octreeScene, 1);
|
||||
|
||||
m_octreeScene->RemoveEntry(visEntry);
|
||||
EXPECT_TRUE(visEntry.m_internalNode == nullptr);
|
||||
EXPECT_TRUE(m_octreeScene->GetEntryCount() == 0);
|
||||
ValidateEntryCountEqualsExpectedCount(m_octreeScene, 0);
|
||||
|
||||
EXPECT_TRUE(true); //TEST
|
||||
}
|
||||
@@ -121,34 +136,34 @@ namespace UnitTest
|
||||
m_octreeScene->InsertOrUpdateEntry(visEntry[0]);
|
||||
EXPECT_TRUE(visEntry[0].m_internalNode != nullptr);
|
||||
EXPECT_TRUE(visEntry[0].m_internalNodeIndex == 0);
|
||||
EXPECT_TRUE(m_octreeScene->GetEntryCount() == 1);
|
||||
ValidateEntryCountEqualsExpectedCount(m_octreeScene, 1);
|
||||
EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1);
|
||||
|
||||
m_octreeScene->InsertOrUpdateEntry(visEntry[1]); // This should force a split of the root node
|
||||
EXPECT_TRUE(visEntry[1].m_internalNode != nullptr);
|
||||
EXPECT_TRUE(visEntry[1].m_internalNodeIndex == 0);
|
||||
EXPECT_TRUE(m_octreeScene->GetEntryCount() == 2);
|
||||
ValidateEntryCountEqualsExpectedCount(m_octreeScene, 2);
|
||||
EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1 + m_octreeScene->GetChildNodeCount());
|
||||
|
||||
m_octreeScene->InsertOrUpdateEntry(visEntry[2]); // This should force a split of the roots +/+/+ child node
|
||||
EXPECT_TRUE(visEntry[2].m_internalNode != nullptr);
|
||||
EXPECT_TRUE(visEntry[2].m_internalNodeIndex == 0);
|
||||
EXPECT_TRUE(m_octreeScene->GetEntryCount() == 3);
|
||||
ValidateEntryCountEqualsExpectedCount(m_octreeScene, 3);
|
||||
EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1 + (2 * m_octreeScene->GetChildNodeCount()));
|
||||
|
||||
m_octreeScene->RemoveEntry(visEntry[2]);
|
||||
EXPECT_TRUE(visEntry[2].m_internalNode == nullptr);
|
||||
EXPECT_TRUE(m_octreeScene->GetEntryCount() == 2);
|
||||
ValidateEntryCountEqualsExpectedCount(m_octreeScene, 2);
|
||||
EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1 + m_octreeScene->GetChildNodeCount());
|
||||
|
||||
m_octreeScene->RemoveEntry(visEntry[1]);
|
||||
EXPECT_TRUE(visEntry[1].m_internalNode == nullptr);
|
||||
EXPECT_TRUE(m_octreeScene->GetEntryCount() == 1);
|
||||
ValidateEntryCountEqualsExpectedCount(m_octreeScene, 1);
|
||||
EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1);
|
||||
|
||||
m_octreeScene->RemoveEntry(visEntry[0]);
|
||||
EXPECT_TRUE(visEntry[0].m_internalNode == nullptr);
|
||||
EXPECT_TRUE(m_octreeScene->GetEntryCount() == 0);
|
||||
ValidateEntryCountEqualsExpectedCount(m_octreeScene, 0);
|
||||
}
|
||||
|
||||
TEST_F(OctreeTests, UpdateSingleEntry)
|
||||
@@ -159,19 +174,19 @@ namespace UnitTest
|
||||
m_octreeScene->InsertOrUpdateEntry(visEntry);
|
||||
EXPECT_TRUE(visEntry.m_internalNode != nullptr);
|
||||
EXPECT_TRUE(visEntry.m_internalNodeIndex == 0);
|
||||
EXPECT_TRUE(m_octreeScene->GetEntryCount() == 1);
|
||||
ValidateEntryCountEqualsExpectedCount(m_octreeScene, 1);
|
||||
EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1);
|
||||
|
||||
visEntry.m_boundingVolume = AZ::Aabb::CreateFromMinMax(AZ::Vector3(-0.5f), AZ::Vector3(0.5f));
|
||||
m_octreeScene->InsertOrUpdateEntry(visEntry);
|
||||
EXPECT_TRUE(visEntry.m_internalNode != nullptr);
|
||||
EXPECT_TRUE(visEntry.m_internalNodeIndex == 0);
|
||||
EXPECT_TRUE(m_octreeScene->GetEntryCount() == 1);
|
||||
ValidateEntryCountEqualsExpectedCount(m_octreeScene, 1);
|
||||
EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1);
|
||||
|
||||
m_octreeScene->RemoveEntry(visEntry);
|
||||
EXPECT_TRUE(visEntry.m_internalNode == nullptr);
|
||||
EXPECT_TRUE(m_octreeScene->GetEntryCount() == 0);
|
||||
ValidateEntryCountEqualsExpectedCount(m_octreeScene, 0);
|
||||
EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1);
|
||||
}
|
||||
|
||||
@@ -185,19 +200,19 @@ namespace UnitTest
|
||||
m_octreeScene->InsertOrUpdateEntry(visEntry[0]);
|
||||
EXPECT_TRUE(visEntry[0].m_internalNode != nullptr);
|
||||
EXPECT_TRUE(visEntry[0].m_internalNodeIndex == 0);
|
||||
EXPECT_TRUE(m_octreeScene->GetEntryCount() == 1);
|
||||
ValidateEntryCountEqualsExpectedCount(m_octreeScene, 1);
|
||||
EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1);
|
||||
|
||||
m_octreeScene->InsertOrUpdateEntry(visEntry[1]); // This should force a split of the root node
|
||||
EXPECT_TRUE(visEntry[1].m_internalNode != nullptr);
|
||||
EXPECT_TRUE(visEntry[1].m_internalNodeIndex == 0);
|
||||
EXPECT_TRUE(m_octreeScene->GetEntryCount() == 2);
|
||||
ValidateEntryCountEqualsExpectedCount(m_octreeScene, 2);
|
||||
EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1 + m_octreeScene->GetChildNodeCount());
|
||||
|
||||
m_octreeScene->InsertOrUpdateEntry(visEntry[2]); // This should force a split of the roots +/+/+ child node
|
||||
EXPECT_TRUE(visEntry[2].m_internalNode != nullptr);
|
||||
EXPECT_TRUE(visEntry[2].m_internalNodeIndex == 0);
|
||||
EXPECT_TRUE(m_octreeScene->GetEntryCount() == 3);
|
||||
ValidateEntryCountEqualsExpectedCount(m_octreeScene, 3);
|
||||
EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1 + (2 * m_octreeScene->GetChildNodeCount()));
|
||||
|
||||
visEntry[1].m_boundingVolume = AZ::Aabb::CreateFromMinMax(AZ::Vector3(-0.9f), AZ::Vector3(-0.6f));
|
||||
@@ -206,22 +221,22 @@ namespace UnitTest
|
||||
m_octreeScene->InsertOrUpdateEntry(visEntry[0]);
|
||||
m_octreeScene->InsertOrUpdateEntry(visEntry[1]);
|
||||
m_octreeScene->InsertOrUpdateEntry(visEntry[2]);
|
||||
EXPECT_TRUE(m_octreeScene->GetEntryCount() == 3);
|
||||
ValidateEntryCountEqualsExpectedCount(m_octreeScene, 3);
|
||||
EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1 + (2 * m_octreeScene->GetChildNodeCount()));
|
||||
|
||||
m_octreeScene->RemoveEntry(visEntry[2]);
|
||||
EXPECT_TRUE(visEntry[2].m_internalNode == nullptr);
|
||||
EXPECT_TRUE(m_octreeScene->GetEntryCount() == 2);
|
||||
ValidateEntryCountEqualsExpectedCount(m_octreeScene, 2);
|
||||
EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1 + m_octreeScene->GetChildNodeCount());
|
||||
|
||||
m_octreeScene->RemoveEntry(visEntry[1]);
|
||||
EXPECT_TRUE(visEntry[1].m_internalNode == nullptr);
|
||||
EXPECT_TRUE(m_octreeScene->GetEntryCount() == 1);
|
||||
ValidateEntryCountEqualsExpectedCount(m_octreeScene, 1);
|
||||
EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1);
|
||||
|
||||
m_octreeScene->RemoveEntry(visEntry[0]);
|
||||
EXPECT_TRUE(visEntry[0].m_internalNode == nullptr);
|
||||
EXPECT_TRUE(m_octreeScene->GetEntryCount() == 0);
|
||||
ValidateEntryCountEqualsExpectedCount(m_octreeScene, 0);
|
||||
EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1);
|
||||
}
|
||||
|
||||
@@ -365,4 +380,48 @@ namespace UnitTest
|
||||
AZ::Frustum bound3 = AZ::Frustum(AZ::ViewFrustumAttributes(frustumTransform, 1.0f, 2.0f * atanf(0.5f), 2.6f, 2.9f));
|
||||
EnumerateMultipleEntriesHelper(m_octreeScene, bound1, bound2, bound3);
|
||||
}
|
||||
|
||||
TEST_F(OctreeTests, InsertOrUpdateEntry_OverFillRootNodeWithLargeEntries_EntriesAreNotLost)
|
||||
{
|
||||
// Validate that the octree works if you exceed the max entry count with large entries,
|
||||
// which will overfill the root node since they can't be distributed to child nodes
|
||||
|
||||
// Get the max extents and entries-per-node for the octree
|
||||
AZ::IConsole* console = AZ::Interface<AZ::IConsole>::Get();
|
||||
EXPECT_TRUE(console);
|
||||
|
||||
float maxExtents = 0.0f;
|
||||
AZ::GetValueResult getCvarResult = console->GetCvarValue("bg_octreeMaxWorldExtents", maxExtents);
|
||||
EXPECT_EQ(getCvarResult, AZ::GetValueResult::Success);
|
||||
|
||||
uint32_t maxEntriesPerNode = 0;
|
||||
getCvarResult = console->GetCvarValue("bg_octreeNodeMaxEntries", maxEntriesPerNode);
|
||||
EXPECT_EQ(getCvarResult, AZ::GetValueResult::Success);
|
||||
|
||||
// Create root entries that would exceed the size of the root node
|
||||
AZ::Aabb exceedMaxExtents = AZ::Aabb::CreateFromMinMax(AZ::Vector3(-maxExtents - 1.0f), AZ::Vector3(maxExtents + 1.0f));
|
||||
uint32_t exceedMaxEntriesPerNode = maxEntriesPerNode + 1;
|
||||
|
||||
AzFramework::VisibilityEntry visEntry;
|
||||
visEntry.m_boundingVolume = exceedMaxExtents;
|
||||
AZStd::vector<AzFramework::VisibilityEntry> visEntries(exceedMaxEntriesPerNode, visEntry);
|
||||
|
||||
// Insert them all into the scene
|
||||
for (AzFramework::VisibilityEntry& entry : visEntries)
|
||||
{
|
||||
m_octreeScene->InsertOrUpdateEntry(entry);
|
||||
}
|
||||
|
||||
// Expect all the entries to be in the scene
|
||||
ValidateEntryCountEqualsExpectedCount(m_octreeScene, visEntries.size());
|
||||
|
||||
// Update them, without making any actual changes
|
||||
for (AzFramework::VisibilityEntry& entry : visEntries)
|
||||
{
|
||||
m_octreeScene->InsertOrUpdateEntry(entry);
|
||||
}
|
||||
|
||||
// Expect all the entries to be in the scene
|
||||
ValidateEntryCountEqualsExpectedCount(m_octreeScene, visEntries.size());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -382,11 +382,6 @@ void SandboxIntegrationManager::Teardown()
|
||||
{
|
||||
AzToolsFramework::Layers::EditorLayerComponentNotificationBus::Handler::BusDisconnect();
|
||||
AzFramework::DisplayContextRequestBus::Handler::BusDisconnect();
|
||||
if( m_debugDisplayBusImplementationActive)
|
||||
{
|
||||
AzFramework::DebugDisplayRequestBus::Handler::BusDisconnect();
|
||||
m_debugDisplayBusImplementationActive = false;
|
||||
}
|
||||
AzToolsFramework::SliceEditorEntityOwnershipServiceNotificationBus::Handler::BusDisconnect();
|
||||
AzToolsFramework::EditorEntityContextNotificationBus::Handler::BusDisconnect();
|
||||
AzToolsFramework::EditorEvents::Bus::Handler::BusDisconnect();
|
||||
@@ -2041,678 +2036,6 @@ void SandboxIntegrationManager::BrowseForAssets(AssetSelectionModel& selection)
|
||||
AssetBrowserComponentRequestBus::Broadcast(&AssetBrowserComponentRequests::PickAssets, selection, GetMainWindow());
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::SetColor(float r, float g, float b, float a)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->SetColor(Vec3(r, g, b), a);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::SetColor(const AZ::Color& color)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->SetColor(AZColorToLYColorF(color));
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::SetColor(const AZ::Vector4& color)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->SetColor(AZVec3ToLYVec3(color.GetAsVector3()), color.GetW());
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::SetAlpha(float a)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->SetAlpha(a);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawQuad(const AZ::Vector3& p1, const AZ::Vector3& p2, const AZ::Vector3& p3, const AZ::Vector3& p4)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawQuad(
|
||||
AZVec3ToLYVec3(p1),
|
||||
AZVec3ToLYVec3(p2),
|
||||
AZVec3ToLYVec3(p3),
|
||||
AZVec3ToLYVec3(p4));
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawQuad(float width, float height)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawQuad(width, height);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawWireQuad(const AZ::Vector3& p1, const AZ::Vector3& p2, const AZ::Vector3& p3, const AZ::Vector3& p4)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawWireQuad(
|
||||
AZVec3ToLYVec3(p1),
|
||||
AZVec3ToLYVec3(p2),
|
||||
AZVec3ToLYVec3(p3),
|
||||
AZVec3ToLYVec3(p4));
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawWireQuad(float width, float height)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawWireQuad(width, height);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawQuadGradient(const AZ::Vector3& p1, const AZ::Vector3& p2, const AZ::Vector3& p3, const AZ::Vector3& p4, const AZ::Vector4& firstColor, const AZ::Vector4& secondColor)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawQuadGradient(
|
||||
AZVec3ToLYVec3(p1),
|
||||
AZVec3ToLYVec3(p2),
|
||||
AZVec3ToLYVec3(p3),
|
||||
AZVec3ToLYVec3(p4),
|
||||
ColorF(AZVec3ToLYVec3(firstColor.GetAsVector3()), firstColor.GetW()),
|
||||
ColorF(AZVec3ToLYVec3(secondColor.GetAsVector3()), secondColor.GetW()));
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawTri(const AZ::Vector3& p1, const AZ::Vector3& p2, const AZ::Vector3& p3)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawTri(
|
||||
AZVec3ToLYVec3(p1),
|
||||
AZVec3ToLYVec3(p2),
|
||||
AZVec3ToLYVec3(p3));
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawTriangles(const AZStd::vector<AZ::Vector3>& vertices, const AZ::Color& color)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
// transform to world space
|
||||
const auto vecTransform = [this](const AZ::Vector3& vec)
|
||||
{
|
||||
return m_dc->GetMatrix() * AZVec3ToLYVec3(vec);
|
||||
};
|
||||
|
||||
AZStd::vector<Vec3> cryVertices;
|
||||
cryVertices.reserve(vertices.size());
|
||||
AZStd::transform(vertices.begin(), vertices.end(), AZStd::back_inserter(cryVertices), vecTransform);
|
||||
m_dc->DrawTriangles(
|
||||
cryVertices,
|
||||
AZColorToLYColorF(color));
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawTrianglesIndexed(const AZStd::vector<AZ::Vector3>& vertices, const AZStd::vector<AZ::u32>& indices, const AZ::Color& color)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
// transform to world space
|
||||
const auto vecTransform = [this](const AZ::Vector3& vec)
|
||||
{
|
||||
return m_dc->GetMatrix() * AZVec3ToLYVec3(vec);
|
||||
};
|
||||
|
||||
AZStd::vector<Vec3> cryVertices;
|
||||
cryVertices.reserve(vertices.size());
|
||||
AZStd::transform(vertices.begin(), vertices.end(), AZStd::back_inserter(cryVertices), vecTransform);
|
||||
m_dc->DrawTrianglesIndexed(
|
||||
cryVertices,
|
||||
indices,
|
||||
AZColorToLYColorF(color));
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawWireBox(const AZ::Vector3& min, const AZ::Vector3& max)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawWireBox(
|
||||
AZVec3ToLYVec3(min),
|
||||
AZVec3ToLYVec3(max));
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawSolidBox(const AZ::Vector3& min, const AZ::Vector3& max)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawSolidBox(
|
||||
AZVec3ToLYVec3(min),
|
||||
AZVec3ToLYVec3(max));
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawSolidOBB(const AZ::Vector3& center, const AZ::Vector3& axisX, const AZ::Vector3& axisY, const AZ::Vector3& axisZ, const AZ::Vector3& halfExtents)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawSolidOBB(AZVec3ToLYVec3(center), AZVec3ToLYVec3(axisX), AZVec3ToLYVec3(axisY), AZVec3ToLYVec3(axisZ), AZVec3ToLYVec3(halfExtents));
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawPoint(const AZ::Vector3& p, int nSize)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawPoint(AZVec3ToLYVec3(p), nSize);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawLine(const AZ::Vector3& p1, const AZ::Vector3& p2)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawLine(
|
||||
AZVec3ToLYVec3(p1),
|
||||
AZVec3ToLYVec3(p2));
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawLine(const AZ::Vector3& p1, const AZ::Vector3& p2, const AZ::Vector4& col1, const AZ::Vector4& col2)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawLine(
|
||||
AZVec3ToLYVec3(p1),
|
||||
AZVec3ToLYVec3(p2),
|
||||
ColorF(AZVec3ToLYVec3(col1.GetAsVector3()), col1.GetW()),
|
||||
ColorF(AZVec3ToLYVec3(col2.GetAsVector3()), col2.GetW()));
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawLines(const AZStd::vector<AZ::Vector3>& lines, const AZ::Color& color)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
// transform to world space
|
||||
const auto vecTransform = [this](const AZ::Vector3& vec)
|
||||
{
|
||||
return m_dc->GetMatrix() * AZVec3ToLYVec3(vec);
|
||||
};
|
||||
|
||||
AZStd::vector<Vec3> cryLines;
|
||||
cryLines.reserve(cryLines.size());
|
||||
AZStd::transform(lines.begin(), lines.end(), AZStd::back_inserter(cryLines), vecTransform);
|
||||
m_dc->DrawLines(cryLines, AZColorToLYColorF(color));
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawPolyLine(const AZ::Vector3* pnts, int numPoints, bool cycled)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
Vec3* points = new Vec3[numPoints];
|
||||
for (int i = 0; i < numPoints; ++i)
|
||||
{
|
||||
points[i] = AZVec3ToLYVec3(pnts[i]);
|
||||
}
|
||||
|
||||
m_dc->DrawPolyLine(points, numPoints, cycled);
|
||||
|
||||
delete[] points;
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawWireQuad2d(const AZ::Vector2& p1, const AZ::Vector2& p2, float z)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawWireQuad2d(
|
||||
QPoint(static_cast<int>(p1.GetX()), static_cast<int>(p1.GetY())),
|
||||
QPoint(static_cast<int>(p2.GetX()), static_cast<int>(p2.GetY())),
|
||||
z);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawLine2d(const AZ::Vector2& p1, const AZ::Vector2& p2, float z)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawLine2d(
|
||||
QPoint(static_cast<int>(p1.GetX()), static_cast<int>(p1.GetY())),
|
||||
QPoint(static_cast<int>(p2.GetX()), static_cast<int>(p2.GetY())),
|
||||
z);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawLine2dGradient(const AZ::Vector2& p1, const AZ::Vector2& p2, float z, const AZ::Vector4& firstColor, const AZ::Vector4& secondColor)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawLine2dGradient(
|
||||
QPoint(static_cast<int>(p1.GetX()), static_cast<int>(p1.GetY())),
|
||||
QPoint(static_cast<int>(p2.GetX()), static_cast<int>(p2.GetY())),
|
||||
z,
|
||||
ColorF(AZVec3ToLYVec3(firstColor.GetAsVector3()), firstColor.GetW()),
|
||||
ColorF(AZVec3ToLYVec3(secondColor.GetAsVector3()), secondColor.GetW()));
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawWireCircle2d(const AZ::Vector2& center, float radius, float z)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawWireCircle2d(
|
||||
QPoint(static_cast<int>(center.GetX()), static_cast<int>(center.GetY())),
|
||||
radius, z);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawTerrainCircle(const AZ::Vector3& worldPos, float radius, float height)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawTerrainCircle(
|
||||
AZVec3ToLYVec3(worldPos), radius, height);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawTerrainCircle(const AZ::Vector3& center, float radius, float angle1, float angle2, float height)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawTerrainCircle(
|
||||
AZVec3ToLYVec3(center), radius, angle1, angle2, height);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawArc(const AZ::Vector3& pos, float radius, float startAngleDegrees, float sweepAngleDegrees, float angularStepDegrees, int referenceAxis)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawArc(
|
||||
AZVec3ToLYVec3(pos),
|
||||
radius,
|
||||
startAngleDegrees,
|
||||
sweepAngleDegrees,
|
||||
angularStepDegrees,
|
||||
referenceAxis);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawArc(const AZ::Vector3& pos, float radius, float startAngleDegrees, float sweepAngleDegrees, float angularStepDegrees, const AZ::Vector3& fixedAxis)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawArc(
|
||||
AZVec3ToLYVec3(pos),
|
||||
radius,
|
||||
startAngleDegrees,
|
||||
sweepAngleDegrees,
|
||||
angularStepDegrees,
|
||||
AZVec3ToLYVec3(fixedAxis));
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawCircle(const AZ::Vector3& pos, float radius, int nUnchangedAxis)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawCircle(
|
||||
AZVec3ToLYVec3(pos),
|
||||
radius,
|
||||
nUnchangedAxis);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawHalfDottedCircle(const AZ::Vector3& pos, float radius, const AZ::Vector3& viewPos, int nUnchangedAxis)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawHalfDottedCircle(
|
||||
AZVec3ToLYVec3(pos),
|
||||
radius,
|
||||
AZVec3ToLYVec3(viewPos),
|
||||
nUnchangedAxis);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawCone(const AZ::Vector3& pos, const AZ::Vector3& dir, float radius, float height, bool drawShaded)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawCone(
|
||||
AZVec3ToLYVec3(pos),
|
||||
AZVec3ToLYVec3(dir),
|
||||
radius,
|
||||
height,
|
||||
drawShaded);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawWireCylinder(const AZ::Vector3& center, const AZ::Vector3& axis, float radius, float height)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawWireCylinder(
|
||||
AZVec3ToLYVec3(center),
|
||||
AZVec3ToLYVec3(axis),
|
||||
radius,
|
||||
height);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawSolidCylinder(const AZ::Vector3& center, const AZ::Vector3& axis, float radius, float height, bool drawShaded)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawSolidCylinder(
|
||||
AZVec3ToLYVec3(center),
|
||||
AZVec3ToLYVec3(axis),
|
||||
radius,
|
||||
height,
|
||||
drawShaded);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawWireCapsule(const AZ::Vector3& center, const AZ::Vector3& axis, float radius, float height)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawWireCapsule(
|
||||
AZVec3ToLYVec3(center),
|
||||
AZVec3ToLYVec3(axis),
|
||||
radius,
|
||||
height);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawTerrainRect(float x1, float y1, float x2, float y2, float height)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawTerrainRect(x1, y1, x2, y2, height);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawTerrainLine(AZ::Vector3 worldPos1, AZ::Vector3 worldPos2)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawTerrainLine(
|
||||
AZVec3ToLYVec3(worldPos1),
|
||||
AZVec3ToLYVec3(worldPos2));
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawWireSphere(const AZ::Vector3& pos, float radius)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawWireSphere(AZVec3ToLYVec3(pos), radius);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawWireSphere(const AZ::Vector3& pos, const AZ::Vector3 radius)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawWireSphere(
|
||||
AZVec3ToLYVec3(pos),
|
||||
AZVec3ToLYVec3(radius));
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawWireDisk(const AZ::Vector3& pos, const AZ::Vector3& dir, float radius)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawWireDisk(
|
||||
AZVec3ToLYVec3(pos),
|
||||
AZVec3ToLYVec3(dir),
|
||||
radius);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawBall(const AZ::Vector3& pos, float radius, bool drawShaded)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawBall(AZVec3ToLYVec3(pos), radius, drawShaded);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawDisk(const AZ::Vector3& pos, const AZ::Vector3& dir, float radius)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawDisk(
|
||||
AZVec3ToLYVec3(pos),
|
||||
AZVec3ToLYVec3(dir),
|
||||
radius);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawArrow(const AZ::Vector3& src, const AZ::Vector3& trg, float fHeadScale, bool b2SidedArrow)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawArrow(
|
||||
AZVec3ToLYVec3(src),
|
||||
AZVec3ToLYVec3(trg),
|
||||
fHeadScale,
|
||||
b2SidedArrow);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawTextLabel(const AZ::Vector3& pos, float size, const char* text, const bool bCenter, int srcOffsetX, int srcOffsetY)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawTextLabel(
|
||||
AZVec3ToLYVec3(pos),
|
||||
size,
|
||||
text,
|
||||
bCenter,
|
||||
srcOffsetX,
|
||||
srcOffsetY);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::Draw2dTextLabel(float x, float y, float size, const char* text, bool bCenter)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->Draw2dTextLabel(x, y, size, text, bCenter);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawTextureLabel(ITexture* texture, const AZ::Vector3& pos, float sizeX, float sizeY, int texIconFlags)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
if (texture)
|
||||
{
|
||||
float textureWidth = aznumeric_caster(texture->GetWidth());
|
||||
float textureHeight = aznumeric_caster(texture->GetHeight());
|
||||
|
||||
// resize the label in proportion to the actual texture size
|
||||
if (textureWidth > textureHeight)
|
||||
{
|
||||
sizeY = sizeX * (textureHeight / textureWidth);
|
||||
}
|
||||
else
|
||||
{
|
||||
sizeX = sizeY * (textureWidth / textureHeight);
|
||||
}
|
||||
|
||||
m_dc->DrawTextureLabel(AZVec3ToLYVec3(pos), sizeX, sizeY, texture->GetTextureID(), texIconFlags);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawTextureLabel(int textureId, const AZ::Vector3& pos, float sizeX, float sizeY, int texIconFlags)
|
||||
{
|
||||
// ToDo: With Atom?
|
||||
AZ_UNUSED(textureId);
|
||||
AZ_UNUSED(pos);
|
||||
AZ_UNUSED(sizeX);
|
||||
AZ_UNUSED(sizeY);
|
||||
AZ_UNUSED(texIconFlags);
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::SetLineWidth(float width)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->SetLineWidth(width);
|
||||
}
|
||||
}
|
||||
|
||||
bool SandboxIntegrationManager::IsVisible(const AZ::Aabb& bounds)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
const AABB aabb(
|
||||
AZVec3ToLYVec3(bounds.GetMin()),
|
||||
AZVec3ToLYVec3(bounds.GetMax()));
|
||||
|
||||
return m_dc->IsVisible(aabb);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int SandboxIntegrationManager::SetFillMode(int nFillMode)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
return m_dc->SetFillMode(nFillMode);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
float SandboxIntegrationManager::GetLineWidth()
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
return m_dc->GetLineWidth();
|
||||
}
|
||||
|
||||
return 0.f;
|
||||
}
|
||||
|
||||
float SandboxIntegrationManager::GetAspectRatio()
|
||||
{
|
||||
if (m_dc && m_dc->GetView())
|
||||
{
|
||||
return m_dc->GetView()->GetAspectRatio();
|
||||
}
|
||||
|
||||
return 0.f;
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DepthTestOff()
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DepthTestOff();
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DepthTestOn()
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DepthTestOn();
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DepthWriteOff()
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DepthWriteOff();
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DepthWriteOn()
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DepthWriteOn();
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::CullOff()
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->CullOff();
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::CullOn()
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->CullOn();
|
||||
}
|
||||
}
|
||||
|
||||
bool SandboxIntegrationManager::SetDrawInFrontMode(bool bOn)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
return m_dc->SetDrawInFrontMode(bOn);
|
||||
}
|
||||
|
||||
return 0.f;
|
||||
}
|
||||
|
||||
AZ::u32 SandboxIntegrationManager::GetState()
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
return m_dc->GetState();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
AZ::u32 SandboxIntegrationManager::SetState(AZ::u32 state)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
return m_dc->SetState(state);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::PushMatrix(const AZ::Transform& tm)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
const Matrix34 m = AZTransformToLYTransform(tm);
|
||||
m_dc->PushMatrix(m);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::PopMatrix()
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->PopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
bool SandboxIntegrationManager::DisplayHelpersVisible()
|
||||
{
|
||||
return GetIEditor()->GetDisplaySettings()->IsDisplayHelpers();
|
||||
|
||||
@@ -100,7 +100,6 @@ class SandboxIntegrationManager
|
||||
, private AzToolsFramework::EditorEvents::Bus::Handler
|
||||
, private AzToolsFramework::EditorWindowRequests::Bus::Handler
|
||||
, private AzFramework::AssetCatalogEventBus::Handler
|
||||
, private AzFramework::DebugDisplayRequestBus::Handler
|
||||
, private AzFramework::DisplayContextRequestBus::Handler
|
||||
, private AzToolsFramework::EditorEntityContextNotificationBus::Handler
|
||||
, private AzToolsFramework::SliceEditorEntityOwnershipServiceNotificationBus::Handler
|
||||
@@ -202,70 +201,6 @@ private:
|
||||
const AzFramework::SliceInstantiationTicket& ticket) override;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// AzToolsFramework::DebugDisplayRequestBus
|
||||
void SetColor(float r, float g, float b, float a) override;
|
||||
void SetColor(const AZ::Color& color) override;
|
||||
void SetColor(const AZ::Vector4& color) override;
|
||||
void SetAlpha(float a) override;
|
||||
void DrawQuad(const AZ::Vector3& p1, const AZ::Vector3& p2, const AZ::Vector3& p3, const AZ::Vector3& p4) override;
|
||||
void DrawQuad(float width, float height) override;
|
||||
void DrawWireQuad(const AZ::Vector3& p1, const AZ::Vector3& p2, const AZ::Vector3& p3, const AZ::Vector3& p4) override;
|
||||
void DrawWireQuad(float width, float height) override;
|
||||
void DrawQuadGradient(const AZ::Vector3& p1, const AZ::Vector3& p2, const AZ::Vector3& p3, const AZ::Vector3& p4, const AZ::Vector4& firstColor, const AZ::Vector4& secondColor) override;
|
||||
void DrawTri(const AZ::Vector3& p1, const AZ::Vector3& p2, const AZ::Vector3& p3) override;
|
||||
void DrawTriangles(const AZStd::vector<AZ::Vector3>& vertices, const AZ::Color& color) override;
|
||||
void DrawTrianglesIndexed(const AZStd::vector<AZ::Vector3>& vertices, const AZStd::vector<AZ::u32>& indices, const AZ::Color& color) override;
|
||||
void DrawWireBox(const AZ::Vector3& min, const AZ::Vector3& max) override;
|
||||
void DrawSolidBox(const AZ::Vector3& min, const AZ::Vector3& max) override;
|
||||
void DrawSolidOBB(const AZ::Vector3& center, const AZ::Vector3& axisX, const AZ::Vector3& axisY, const AZ::Vector3& axisZ, const AZ::Vector3& halfExtents) override;
|
||||
void DrawPoint(const AZ::Vector3& p, int nSize) override;
|
||||
void DrawLine(const AZ::Vector3& p1, const AZ::Vector3& p2) override;
|
||||
void DrawLine(const AZ::Vector3& p1, const AZ::Vector3& p2, const AZ::Vector4& col1, const AZ::Vector4& col2) override;
|
||||
void DrawLines(const AZStd::vector<AZ::Vector3>& lines, const AZ::Color& color) override;
|
||||
void DrawPolyLine(const AZ::Vector3* pnts, int numPoints, bool cycled) override;
|
||||
void DrawWireQuad2d(const AZ::Vector2& p1, const AZ::Vector2& p2, float z) override;
|
||||
void DrawLine2d(const AZ::Vector2& p1, const AZ::Vector2& p2, float z) override;
|
||||
void DrawLine2dGradient(const AZ::Vector2& p1, const AZ::Vector2& p2, float z, const AZ::Vector4& firstColor, const AZ::Vector4& secondColor) override;
|
||||
void DrawWireCircle2d(const AZ::Vector2& center, float radius, float z) override;
|
||||
void DrawTerrainCircle(const AZ::Vector3& worldPos, float radius, float height) override;
|
||||
void DrawTerrainCircle(const AZ::Vector3& center, float radius, float angle1, float angle2, float height) override;
|
||||
void DrawArc(const AZ::Vector3& pos, float radius, float startAngleDegrees, float sweepAngleDegrees, float angularStepDegrees, int referenceAxis) override;
|
||||
void DrawArc(const AZ::Vector3& pos, float radius, float startAngleDegrees, float sweepAngleDegrees, float angularStepDegrees, const AZ::Vector3& fixedAxis) override;
|
||||
void DrawCone(const AZ::Vector3& pos, const AZ::Vector3& dir, float radius, float height, bool drawShaded = true) override;
|
||||
void DrawCircle(const AZ::Vector3& pos, float radius, int nUnchangedAxis) override;
|
||||
void DrawHalfDottedCircle(const AZ::Vector3& pos, float radius, const AZ::Vector3& viewPos, int nUnchangedAxis) override;
|
||||
void DrawWireCylinder(const AZ::Vector3& center, const AZ::Vector3& axis, float radius, float height) override;
|
||||
void DrawSolidCylinder(const AZ::Vector3& center, const AZ::Vector3& axis, float radius, float height, bool drawShaded = true) override;
|
||||
void DrawWireCapsule(const AZ::Vector3& center, const AZ::Vector3& axis, float radius, float height) override;
|
||||
void DrawTerrainRect(float x1, float y1, float x2, float y2, float height) override;
|
||||
void DrawTerrainLine(AZ::Vector3 worldPos1, AZ::Vector3 worldPos2) override;
|
||||
void DrawWireSphere(const AZ::Vector3& pos, float radius) override;
|
||||
void DrawWireSphere(const AZ::Vector3& pos, const AZ::Vector3 radius) override;
|
||||
void DrawWireDisk(const AZ::Vector3& pos, const AZ::Vector3& dir, float radius) override;
|
||||
void DrawBall(const AZ::Vector3& pos, float radius, bool drawShaded = true) override;
|
||||
void DrawDisk(const AZ::Vector3& pos, const AZ::Vector3& dir, float radius) override;
|
||||
void DrawArrow(const AZ::Vector3& src, const AZ::Vector3& trg, float fHeadScale, bool b2SidedArrow) override;
|
||||
void DrawTextLabel(const AZ::Vector3& pos, float size, const char* text, const bool bCenter, int srcOffsetX, int scrOffsetY) override;
|
||||
void Draw2dTextLabel(float x, float y, float size, const char* text, bool bCenter) override;
|
||||
void DrawTextureLabel(ITexture* texture, const AZ::Vector3& pos, float sizeX, float sizeY, int texIconFlags) override;
|
||||
void DrawTextureLabel(int textureId, const AZ::Vector3& pos, float sizeX, float sizeY, int texIconFlags) override;
|
||||
void SetLineWidth(float width) override;
|
||||
bool IsVisible(const AZ::Aabb& bounds) override;
|
||||
int SetFillMode(int nFillMode) override;
|
||||
float GetLineWidth() override;
|
||||
float GetAspectRatio() override;
|
||||
void DepthTestOff() override;
|
||||
void DepthTestOn() override;
|
||||
void DepthWriteOff() override;
|
||||
void DepthWriteOn() override;
|
||||
void CullOff() override;
|
||||
void CullOn() override;
|
||||
bool SetDrawInFrontMode(bool bOn) override;
|
||||
AZ::u32 GetState() override;
|
||||
AZ::u32 SetState(AZ::u32 state) override;
|
||||
void PushMatrix(const AZ::Transform& tm) override;
|
||||
void PopMatrix() override;
|
||||
|
||||
// AzFramework::DisplayContextRequestBus (and @deprecated EntityDebugDisplayRequestBus)
|
||||
// AzFramework::DisplayContextRequestBus
|
||||
void SetDC(DisplayContext* dc) override;
|
||||
|
||||
@@ -114,6 +114,11 @@ namespace AZ
|
||||
extern "C" AZ_DLL_EXPORT void InitializeDynamicModule(void* env)
|
||||
{
|
||||
AZ::Environment::Attach(static_cast<AZ::EnvironmentInstance>(env));
|
||||
if (!AZ::SceneAPI::FbxSceneBuilder::g_fbxImporter)
|
||||
{
|
||||
AZ::SceneAPI::FbxSceneBuilder::g_fbxImporter = aznew AZ::SceneAPI::FbxSceneImporter::FbxImportRequestHandler();
|
||||
AZ::SceneAPI::FbxSceneBuilder::g_fbxImporter->Activate();
|
||||
}
|
||||
}
|
||||
extern "C" AZ_DLL_EXPORT void Reflect(AZ::SerializeContext* context)
|
||||
{
|
||||
|
||||
@@ -39,9 +39,7 @@ namespace AZ
|
||||
|
||||
void FbxImportRequestHandler::Activate()
|
||||
{
|
||||
auto settingsRegistry = AZ::SettingsRegistry::Get();
|
||||
|
||||
if (settingsRegistry)
|
||||
if (auto* settingsRegistry = AZ::SettingsRegistry::Get())
|
||||
{
|
||||
settingsRegistry->GetObject(m_settings, "/O3DE/SceneAPI/AssetImporter");
|
||||
}
|
||||
@@ -70,6 +68,15 @@ namespace AZ
|
||||
|
||||
void FbxImportRequestHandler::GetSupportedFileExtensions(AZStd::unordered_set<AZStd::string>& extensions)
|
||||
{
|
||||
// It's unlikely an empty file extension list is intentional,
|
||||
// so if it's empty, try reloading it from the registry.
|
||||
if (m_settings.m_supportedFileTypeExtensions.empty())
|
||||
{
|
||||
if (auto* settingsRegistry = AZ::SettingsRegistry::Get())
|
||||
{
|
||||
settingsRegistry->GetObject(m_settings, "/O3DE/SceneAPI/AssetImporter");
|
||||
}
|
||||
}
|
||||
extensions.insert(m_settings.m_supportedFileTypeExtensions.begin(), m_settings.m_supportedFileTypeExtensions.end());
|
||||
}
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ namespace AZ
|
||||
SerializeContext* serializeContext = azrtti_cast<SerializeContext*>(context);
|
||||
if (serializeContext)
|
||||
{
|
||||
serializeContext->Class<AssImpAnimationImporter, SceneCore::LoadingComponent>()->Version(3); // [LYN-3349] Rolling back rotation change
|
||||
serializeContext->Class<AssImpAnimationImporter, SceneCore::LoadingComponent>()->Version(4); // [LYN-3971] Bone pruning crash fix in AssImp SDK
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user