180ddc3586
* renderer updates: material shadertype, customshaders * custom shader updates * hologram fix * editor windows refactor * major gui update: - gui no longer lifetime manager - window no longer needs gui to construct - removed gui constructors/destructors - rewritten every editor window * renderer update * gui hasfocus fix * editor fix * renderpath upgrades: hybrid forward-deferred * fix * water ripple refactor * cmake fix * cmake fix * renderer fix * volumetric light fix * customshader stencilref * cmake fix * rtdeferred fix * editor update * raytraced shadows denoise * anisotropic shader * sss stencil greater * added cartoon shader * using precomputed tangents * added unlit object shader * importer update * editor update * editor fix * vulkan envmap rendering fix * terrain shader simplification (normal texture mapping instead of triplanar) * added subsurface profiles, reduced gbuffer * denoise disocclusion fallback * editor fix * more sorting priority for blend than instancing * hairparticle culling * particle updates; font update instancing instead of index buffer; vulkan/dx12 fixes; * shader fixes * hairparticle trianglestrip and no cross section * editor fix * cam wnd update * terrain shader fix
55 lines
1.2 KiB
C++
55 lines
1.2 KiB
C++
#pragma once
|
|
#include "CommonInclude.h"
|
|
|
|
#include <list>
|
|
|
|
class Translator
|
|
{
|
|
private:
|
|
XMFLOAT4 prevPointer = XMFLOAT4(0, 0, 0, 0);
|
|
XMFLOAT4X4 dragDeltaMatrix = IDENTITYMATRIX;
|
|
bool dragging = false;
|
|
bool dragStarted = false;
|
|
bool dragEnded = false;
|
|
public:
|
|
void Create();
|
|
|
|
void Update();
|
|
void Draw(const wiScene::CameraComponent& camera, wiGraphics::CommandList cmd) const;
|
|
|
|
// Attach selection to translator temporarily
|
|
void PreTranslate();
|
|
// Apply translator to selection
|
|
void PostTranslate();
|
|
|
|
wiScene::TransformComponent transform;
|
|
std::list<wiScene::PickResult> selected;
|
|
|
|
bool enabled = false;
|
|
|
|
enum TRANSLATOR_STATE
|
|
{
|
|
TRANSLATOR_IDLE,
|
|
TRANSLATOR_X,
|
|
TRANSLATOR_Y,
|
|
TRANSLATOR_Z,
|
|
TRANSLATOR_XY,
|
|
TRANSLATOR_XZ,
|
|
TRANSLATOR_YZ,
|
|
TRANSLATOR_XYZ,
|
|
} state = TRANSLATOR_IDLE;
|
|
|
|
float dist = 1;
|
|
|
|
bool isTranslator = true, isScalator = false, isRotator = false;
|
|
|
|
|
|
// Check if the drag started in this exact frame
|
|
bool IsDragStarted() const { return dragStarted; };
|
|
// Check if the drag ended in this exact frame
|
|
bool IsDragEnded() const { return dragEnded; };
|
|
// Delta matrix from beginning to end of drag operation
|
|
XMFLOAT4X4 GetDragDeltaMatrix() const { return dragDeltaMatrix; }
|
|
};
|
|
|