add AnimationComponent, Skeleton, AnimationClip; add single Renderer3D class, remove some useless code; problem now renderer2D cannot blend with Renderer3D
This commit is contained in:
@ -76,16 +76,6 @@ namespace Prism
|
||||
|
||||
m_EditorScene->OnRenderEditor(deltaTime, m_EditorCamera);
|
||||
|
||||
if (m_DrawOnTopBoundingBoxes)
|
||||
{
|
||||
Renderer::BeginRenderPass(SceneRenderer::GetFinalRenderPass(), false);
|
||||
const auto viewProj = m_EditorCamera.GetViewProjection();
|
||||
Renderer2D::BeginScene(viewProj, false);
|
||||
// TODO: Renderer::DrawAABB(m_MeshEntity.GetComponent<MeshComponent>(), m_MeshEntity.GetComponent<TransformComponent>());
|
||||
Renderer2D::EndScene();
|
||||
Renderer::EndRenderPass();
|
||||
}
|
||||
|
||||
if (!m_SelectionContext.empty() && false)
|
||||
{
|
||||
auto& selection = m_SelectionContext[0];
|
||||
@ -530,10 +520,7 @@ namespace Prism
|
||||
}
|
||||
}
|
||||
|
||||
if (UI::Property("Show Bounding Boxes", m_UIShowBoundingBoxes))
|
||||
ShowBoundingBoxes(m_UIShowBoundingBoxes, m_UIShowBoundingBoxesOnTop);
|
||||
if (m_UIShowBoundingBoxes && UI::Property("On Top", m_UIShowBoundingBoxesOnTop))
|
||||
ShowBoundingBoxes(m_UIShowBoundingBoxes, m_UIShowBoundingBoxesOnTop);
|
||||
UI::Property("Show Bounding Boxes", m_UIShowBoundingBoxes);
|
||||
|
||||
const char* label = m_SelectionMode == SelectionMode::Entity ? "Entity" : "Mesh";
|
||||
if (ImGui::Button(label))
|
||||
@ -903,7 +890,7 @@ namespace Prism
|
||||
|
||||
bool EditorLayer::OnKeyPressedEvent(KeyPressedEvent& e)
|
||||
{
|
||||
if (m_ViewportPanelFocused)
|
||||
if (m_ViewportPanelFocused || m_ViewportPanelHovered)
|
||||
{
|
||||
switch (e.GetKeyCode())
|
||||
{
|
||||
@ -921,7 +908,7 @@ namespace Prism
|
||||
break;
|
||||
case KeyCode::F:
|
||||
{
|
||||
if (m_SelectionContext.size() == 0)
|
||||
if (m_SelectionContext.empty())
|
||||
break;
|
||||
|
||||
Entity selectedEntity = m_SelectionContext[0].Entity;
|
||||
@ -964,7 +951,7 @@ namespace Prism
|
||||
case KeyCode::B:
|
||||
// Toggle bounding boxes
|
||||
m_UIShowBoundingBoxes = !m_UIShowBoundingBoxes;
|
||||
ShowBoundingBoxes(m_UIShowBoundingBoxes, m_UIShowBoundingBoxesOnTop);
|
||||
ShowBoundingBoxes(m_UIShowBoundingBoxes,false);
|
||||
break;
|
||||
case KeyCode::D:
|
||||
if (m_SelectionContext.size())
|
||||
@ -1053,7 +1040,21 @@ namespace Prism
|
||||
return a.Distance < b.Distance;
|
||||
});
|
||||
if (!m_SelectionContext.empty())
|
||||
{
|
||||
if (auto alreadySelectedEntity = m_SceneHierarchyPanel->GetSelected();
|
||||
m_SelectionContext.size() != 1 && alreadySelectedEntity)
|
||||
{
|
||||
const auto alreadySelectedEntityID = alreadySelectedEntity.GetUUID();
|
||||
|
||||
for (const auto& selectedEntity : m_SelectionContext)
|
||||
{
|
||||
if (alreadySelectedEntityID == selectedEntity.Entity.GetUUID()) continue;
|
||||
OnSelected(selectedEntity);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
OnSelected(m_SelectionContext[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@ -1062,7 +1063,6 @@ namespace Prism
|
||||
void EditorLayer::ShowBoundingBoxes(bool show, bool onTop)
|
||||
{
|
||||
SceneRenderer::GetOptions().ShowBoundingBoxes = show && !onTop;
|
||||
m_DrawOnTopBoundingBoxes = show && onTop;
|
||||
}
|
||||
|
||||
void EditorLayer::SelectEntity(Entity entity)
|
||||
|
||||
@ -138,10 +138,8 @@ namespace Prism
|
||||
|
||||
// configure button
|
||||
bool m_AllowViewportCameraEvents = false;
|
||||
bool m_DrawOnTopBoundingBoxes = false;
|
||||
|
||||
bool m_UIShowBoundingBoxes = false;
|
||||
bool m_UIShowBoundingBoxesOnTop = false;
|
||||
|
||||
enum class SceneType : uint32_t
|
||||
{
|
||||
|
||||
@ -1,62 +1,23 @@
|
||||
Scene: Scene Name
|
||||
Environment:
|
||||
AssetHandle: 1249421934001634765
|
||||
AssetHandle: 17073147362577408906
|
||||
Light:
|
||||
Direction: [-0.314, -0.941, -0.209]
|
||||
Radiance: [0, 0, 0]
|
||||
Multiplier: 0
|
||||
Multiplier: 1
|
||||
Entities:
|
||||
- Entity: 18090260616187152572
|
||||
- Entity: 3696833073589069488
|
||||
Parent: 0
|
||||
Children:
|
||||
[]
|
||||
TagComponent:
|
||||
Tag: Directional Light
|
||||
TransformComponent:
|
||||
Position: [0, 0, 0]
|
||||
Rotation: [0, 0, -2.7340124]
|
||||
Scale: [0.9999992, 0.9999992, 1]
|
||||
DirectionalLightComponent:
|
||||
Radiance: [1, 1, 1]
|
||||
CastShadows: true
|
||||
SoftShadows: true
|
||||
LightSize: 0.5
|
||||
- Entity: 18154648535203342017
|
||||
Parent: 0
|
||||
Children:
|
||||
[]
|
||||
TagComponent:
|
||||
Tag: Cube
|
||||
TransformComponent:
|
||||
Position: [0, 6.282704, 0]
|
||||
Rotation: [0, 0, 0]
|
||||
Scale: [1, 1, 1]
|
||||
MeshComponent:
|
||||
AssetID: 133168951455480052
|
||||
- Entity: 386484027514287028
|
||||
Parent: 0
|
||||
Children:
|
||||
[]
|
||||
TagComponent:
|
||||
Tag: Cube
|
||||
TransformComponent:
|
||||
Position: [0, 0, 0]
|
||||
Rotation: [0, 0, 0]
|
||||
Scale: [50, 1, 50]
|
||||
MeshComponent:
|
||||
AssetID: 133168951455480052
|
||||
- Entity: 6827989772960183355
|
||||
Parent: 0
|
||||
Children:
|
||||
[]
|
||||
TagComponent:
|
||||
Tag: Sky Light
|
||||
Tag: venice_dawn_1_4k
|
||||
TransformComponent:
|
||||
Position: [0, 0, 0]
|
||||
Rotation: [0, 0, 0]
|
||||
Scale: [1, 1, 1]
|
||||
SkyLightComponent:
|
||||
EnvironmentMap: 1249421934001634765
|
||||
EnvironmentMap: 17073147362577408906
|
||||
Intensity: 1
|
||||
Angle: 0
|
||||
PhysicsLayers:
|
||||
|
||||
@ -58,11 +58,12 @@ void main()
|
||||
vs_Output.WorldTransform = mat3(u_Transform);
|
||||
vs_Output.Binormal = a_Binormal;
|
||||
|
||||
vs_Output.FragPosLightSpace = u_LightSpaceMatrix * u_Transform * vec4(a_Position, 1.0);
|
||||
vs_Output.FragPosLightSpace = u_LightSpaceMatrix * u_Transform * localPosition;
|
||||
|
||||
vs_Output.ViewPosition = vec3(u_ViewMatrix * vec4(vs_Output.WorldPosition, 1.0));
|
||||
|
||||
gl_Position = u_ViewProjectionMatrix * u_Transform * vec4(a_Position, 1.0);
|
||||
// gl_Position = u_ViewProjectionMatrix * u_Transform * vec4(a_Position, 1.0);
|
||||
gl_Position = u_ViewProjectionMatrix * u_Transform * localPosition;
|
||||
}
|
||||
|
||||
#type fragment
|
||||
|
||||
Reference in New Issue
Block a user