PrimeWorldEditor/UI/CSceneViewport.h

50 lines
1.1 KiB
C
Raw Normal View History

#ifndef CSCENEVIEWPORT_H
#define CSCENEVIEWPORT_H
#include "CBasicViewport.h"
#include "INodeEditor.h"
class CSceneViewport : public CBasicViewport
{
Q_OBJECT
INodeEditor *mpEditor;
CSceneManager *mpScene;
CRenderer *mpRenderer;
// Render settings
bool mDrawSky;
// Scene interaction
bool mGizmoHovering;
bool mGizmoTransforming;
CSceneNode *mpHoverNode;
CVector3f mHoverPoint;
public:
CSceneViewport(QWidget *pParent = 0);
~CSceneViewport();
void SetScene(INodeEditor *pEditor, CSceneManager *pScene);
void SetSkyEnabled(bool b);
CRenderer* Renderer();
CSceneNode* HoverNode();
CVector3f HoverPoint();
void CheckGizmoInput(const CRay& ray);
void SceneRayCast(const CRay& ray);
void ResetHover();
bool IsHoveringGizmo();
signals:
void GizmoMoved();
protected slots:
void CheckUserInput();
void Paint();
void ContextMenu(QContextMenuEvent *pEvent);
void OnResize();
void OnMouseClick(QMouseEvent *pEvent);
void OnMouseRelease(QMouseEvent *pEvent);
};
#endif // CSCENEVIEWPORT_H