Files
WickedEngine/Editor/Translator.h
T
Turánszki János f1ced24f05 Multi swapchain support (#257)
* multi swapchain draft

* uwp fix

* swapchain resize handling

* swapchain buffercount

* vsync toggle

* tests fix

* update

* everything removed from graphicsdevice regarding global screen params, engine refactor

* added GetSwapChainTexture() function to graphics device; screenshot() now requires swapChain

* linux fix: vulkan device needs window handle for instance creation

* refactor

* removed unused includes

* shader refactor and lensflare fix

* swapchain clearcolor and other refactors

* vulkan: no vector allocation in submit

* tests fix

* refactors

* lens flare canvas size fix

* gui refactor for canvas support

* refactors

* removed global canvas state

* msaa fix

* fixes

* refactor to minimize interface changes

* gui changes

* checkbox fix

* gui fixes

* fixes

* input system will accept window handle

* editor fixes

* refactor and removed resolution related system events

* small editor update

* refactor: renderpath inherits from canvas

* fixed tests duh

* image refactor

* image fix

* removed every using namespace std

* pushconstant fix

* editor: object picking only when necessary

* removed include

* dx12: copy fence waiting performed on CPU

* dx12 copyallocator update

* vulkan: copy allocator with timeline semaphores

* missing include

* dx12 copy allocator update

* refactor

* editor update

* vulkan copy allocator fix

* dx12 update

* vulkan, dx12 fixes

* version bump

* vsync event helper

* documentation update

* updated vulkan, dx12, dxc
2021-04-22 11:36:22 +02:00

56 lines
1.2 KiB
C++

#pragma once
#include "CommonInclude.h"
#include "wiCanvas.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(const wiCanvas& canvas);
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; }
};