editor update: camera picker icon added

This commit is contained in:
Turanszki Janos
2018-05-26 18:15:17 +01:00
parent 44efb14c81
commit d2c9c9626f
4 changed files with 34 additions and 2 deletions
+32
View File
@@ -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)
+1 -1
View File
@@ -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;
Binary file not shown.
+1 -1
View File
@@ -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 = {}