diff --git a/Editor/Editor.cpp b/Editor/Editor.cpp index 4cab6203c..773a48cc8 100644 --- a/Editor/Editor.cpp +++ b/Editor/Editor.cpp @@ -858,6 +858,7 @@ void EditorComponent::Load() decalTex = *(Texture2D*)Content.add("images/decal.dds"); forceFieldTex = *(Texture2D*)Content.add("images/forcefield.dds"); emitterTex = *(Texture2D*)Content.add("images/emitter.dds"); + cameraTex = *(Texture2D*)Content.add("images/camera.dds"); } void EditorComponent::Start() { @@ -1608,6 +1609,37 @@ void EditorComponent::Compose() } } + if (rendererWnd->GetPickType() & PICK_CAMERA) + { + for (auto& y : x->cameras) + { + float dist = wiMath::Distance(y->translation, wiRenderer::getCamera()->translation) * 0.08f; + + wiImageEffects fx; + fx.pos = y->translation; + fx.siz = XMFLOAT2(dist, dist); + fx.typeFlag = ImageType::WORLD; + fx.pivot = XMFLOAT2(0.5f, 0.5f); + fx.col = XMFLOAT4(1, 1, 1, 0.5f); + + if (hovered.camera == y) + { + fx.col = XMFLOAT4(1, 1, 1, 1); + } + for (auto& picked : selected) + { + if (picked->camera == y) + { + fx.col = XMFLOAT4(1, 1, 0, 1); + break; + } + } + + + wiImage::Draw(&cameraTex, fx, GRAPHICSTHREAD_IMMEDIATE); + } + } + if (rendererWnd->GetPickType() & PICK_EMITTER) { for (auto& y : x->objects) diff --git a/Editor/Editor.h b/Editor/Editor.h index 2ff4ccc96..b6f6995eb 100644 --- a/Editor/Editor.h +++ b/Editor/Editor.h @@ -31,7 +31,7 @@ class Editor; class EditorComponent : public Renderable2DComponent { private: - wiGraphicsTypes::Texture2D pointLightTex, spotLightTex, dirLightTex, areaLightTex, decalTex, forceFieldTex, emitterTex; + wiGraphicsTypes::Texture2D pointLightTex, spotLightTex, dirLightTex, areaLightTex, decalTex, forceFieldTex, emitterTex, cameraTex; public: MaterialWindow* materialWnd; PostprocessWindow* postprocessWnd; diff --git a/Editor/images/camera.dds b/Editor/images/camera.dds new file mode 100644 index 000000000..feba2ae1c Binary files /dev/null and b/Editor/images/camera.dds differ diff --git a/Editor/startup.lua b/Editor/startup.lua index 85a2655f1..5f0f9ab94 100644 --- a/Editor/startup.lua +++ b/Editor/startup.lua @@ -71,7 +71,7 @@ runProcess(function() if(input.Press(VK_F8)) then tt = 0.0 - play = true + play = not play end if(play) then local prox = {}