Initial commit

This commit is contained in:
alexpete
2021-03-05 11:26:34 -08:00
commit a10351f38d
27091 changed files with 5521199 additions and 0 deletions
@@ -0,0 +1,48 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#include <AzToolsFramework/Render/EditorIntersectorComponent.h>
#include <AzFramework/Entity/EntityContext.h>
#include <AzFramework/Render/Intersector.h>
#include <AzToolsFramework/Entity/EditorEntityContextBus.h>
namespace AzToolsFramework
{
namespace Components
{
void EditorIntersectorComponent::Activate()
{
AzFramework::EntityContextId editorContextId;
AzToolsFramework::EditorEntityContextRequestBus::BroadcastResult(
editorContextId, &AzToolsFramework::EditorEntityContextRequests::GetEditorEntityContextId);
m_intersector = AZStd::make_unique<AzFramework::RenderGeometry::Intersector>(editorContextId);
}
void EditorIntersectorComponent::Deactivate()
{
m_intersector.reset();
}
void EditorIntersectorComponent::Reflect(AZ::ReflectContext* context)
{
if (auto* serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
{
serializeContext->Class<EditorIntersectorComponent, AZ::Component>()
->Version(0)
;
}
}
} // namespace Components
} // namespace AzToolsFramework
@@ -0,0 +1,46 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
#include <AzFramework/Render/IntersectorInterface.h>
namespace AzToolsFramework
{
namespace Components
{
//! System component for calculating render geometry intersections against entities.
//! Contains an implementation of AzFramework::IntersectorInterface.
class EditorIntersectorComponent
: public AZ::Component
{
public:
AZ_COMPONENT(EditorIntersectorComponent, "{8496804C-2CC8-4ABF-B9B1-60845E37FB7A}");
//////////////////////////////////////////////////////////////////////////
// Component overrides
void Activate() override;
void Deactivate() override;
static void Reflect(AZ::ReflectContext* context);
static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent)
{
dependent.push_back(AZ_CRC("EditorEntityContextService", 0x28d93a43));
}
private:
AZStd::unique_ptr<AzFramework::RenderGeometry::IntersectorInterface> m_intersector;
};
} // namespace Components
} // namespace AzToolsFramework