CCollisionEditorViewport: Make use of in-class initializers
This commit is contained in:
parent
6bc9c7fdb1
commit
4c6080184f
|
@ -1,12 +1,11 @@
|
||||||
#include "CCollisionEditorViewport.h"
|
#include "CCollisionEditorViewport.h"
|
||||||
|
|
||||||
/** Constructor */
|
/** Constructor */
|
||||||
CCollisionEditorViewport::CCollisionEditorViewport(QWidget* pParent /*= 0*/)
|
CCollisionEditorViewport::CCollisionEditorViewport(QWidget* pParent)
|
||||||
: CBasicViewport(pParent)
|
: CBasicViewport(pParent)
|
||||||
, mGridEnabled(true)
|
, mpRenderer{std::make_unique<CRenderer>()}
|
||||||
{
|
{
|
||||||
mpRenderer = std::make_unique<CRenderer>();
|
const qreal pixelRatio = devicePixelRatioF();
|
||||||
qreal pixelRatio = devicePixelRatioF();
|
|
||||||
mpRenderer->SetViewportSize(width() * pixelRatio, height() * pixelRatio);
|
mpRenderer->SetViewportSize(width() * pixelRatio, height() * pixelRatio);
|
||||||
mpRenderer->SetClearColor(CColor(0.3f, 0.3f, 0.3f));
|
mpRenderer->SetClearColor(CColor(0.3f, 0.3f, 0.3f));
|
||||||
mpRenderer->ToggleGrid(true);
|
mpRenderer->ToggleGrid(true);
|
||||||
|
|
|
@ -12,22 +12,22 @@ class CCollisionEditorViewport : public CBasicViewport
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
std::unique_ptr<CRenderer> mpRenderer;
|
std::unique_ptr<CRenderer> mpRenderer;
|
||||||
CCollisionNode* mpCollisionNode;
|
CCollisionNode* mpCollisionNode = nullptr;
|
||||||
CGridRenderable mGrid;
|
CGridRenderable mGrid;
|
||||||
bool mGridEnabled;
|
bool mGridEnabled = true;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/** Constructor */
|
/** Constructor */
|
||||||
CCollisionEditorViewport(QWidget* pParent = 0);
|
explicit CCollisionEditorViewport(QWidget* pParent = nullptr);
|
||||||
|
|
||||||
/** CBasicViewport interface */
|
/** CBasicViewport interface */
|
||||||
virtual void Paint() override;
|
void Paint() override;
|
||||||
virtual void OnResize() override;
|
void OnResize() override;
|
||||||
|
|
||||||
/** Accessors */
|
/** Accessors */
|
||||||
inline void SetNode(CCollisionNode* pNode) { mpCollisionNode = pNode; }
|
void SetNode(CCollisionNode* pNode) { mpCollisionNode = pNode; }
|
||||||
inline void SetGridEnabled(bool Enabled) { mGridEnabled = Enabled; }
|
void SetGridEnabled(bool Enabled) { mGridEnabled = Enabled; }
|
||||||
inline void SetOBBTreeDepth(int Depth)
|
void SetOBBTreeDepth(int Depth)
|
||||||
{
|
{
|
||||||
mViewInfo.CollisionSettings.DrawBoundingHierarchy = (Depth > 0);
|
mViewInfo.CollisionSettings.DrawBoundingHierarchy = (Depth > 0);
|
||||||
mViewInfo.CollisionSettings.BoundingHierarchyRenderDepth = Depth;
|
mViewInfo.CollisionSettings.BoundingHierarchyRenderDepth = Depth;
|
||||||
|
|
Loading…
Reference in New Issue