summaryrefslogtreecommitdiffstats
path: root/src/Authoring/Qt3DStudio/Render/StudioWidgetImpl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Authoring/Qt3DStudio/Render/StudioWidgetImpl.h')
-rw-r--r--src/Authoring/Qt3DStudio/Render/StudioWidgetImpl.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/Authoring/Qt3DStudio/Render/StudioWidgetImpl.h b/src/Authoring/Qt3DStudio/Render/StudioWidgetImpl.h
index b78c1edf..9205fc5d 100644
--- a/src/Authoring/Qt3DStudio/Render/StudioWidgetImpl.h
+++ b/src/Authoring/Qt3DStudio/Render/StudioWidgetImpl.h
@@ -36,6 +36,7 @@
#include "Qt3DSRenderNode.h"
#include "Qt3DSRenderShaderCodeGeneratorV2.h"
+#include "Qt3DSRenderCamera.h"
#include "StudioPreferences.h"
namespace qt3ds {
@@ -91,6 +92,7 @@ namespace widgets {
NVRenderVertexBuffer *m_ImmediateVertexBuffer;
NVRenderInputAssembler *m_ImmediateInputAssembler;
NVRenderShaderProgram *m_ImmediateShader;
+ bool m_isAxisHelper;
SStudioWidgetImpl(NVAllocatorCallback &inAlloc)
: m_Allocator(inAlloc)
@@ -103,6 +105,7 @@ namespace widgets {
, m_ImmediateVertexBuffer(NULL)
, m_ImmediateInputAssembler(NULL)
, m_ImmediateShader(NULL)
+ , m_isAxisHelper(false)
{
}
@@ -318,6 +321,8 @@ namespace widgets {
void SetAxisScale(const QT3DSVec3 &inAxisScale) override { m_AxisScale = inAxisScale; }
+ void setAsAxisHelper(bool isAxisHelper) override { m_isAxisHelper = isAxisHelper; }
+
void SetRotationEdges(const QT3DSVec3 &inStartDirection, const QT3DSVec3 &inRotationAxis,
QT3DSF32 inAngleRad, QT3DSF32 inEndLineLen) override
{
@@ -327,14 +332,21 @@ namespace widgets {
void ClearRotationEdges() override { m_RotationWedge = Empty(); }
+ bool isNodeBehindCamera() const override
+ {
+ return m_WidgetInfo.m_Camera && m_Node
+ && m_WidgetInfo.m_Camera->GetDirection().dot(
+ (m_Node->GetGlobalPos() - m_WidgetInfo.m_Camera->GetGlobalPos())) > 0.f;
+ }
+
static inline QT3DSVec3 ToGLSLColor(const QColor &c)
{
return QT3DSVec3(c.redF(), c.greenF(), c.blueF());
}
- static QT3DSVec3 GetXAxisColor() { return ToGLSLColor(CStudioPreferences::GetXAxisColor()); }
- static QT3DSVec3 GetYAxisColor() { return ToGLSLColor(CStudioPreferences::GetYAxisColor()); }
- static QT3DSVec3 GetZAxisColor() { return ToGLSLColor(CStudioPreferences::GetZAxisColor()); }
+ static QT3DSVec3 GetXAxisColor() { return ToGLSLColor(CStudioPreferences::xAxisColor()); }
+ static QT3DSVec3 GetYAxisColor() { return ToGLSLColor(CStudioPreferences::yAxisColor()); }
+ static QT3DSVec3 GetZAxisColor() { return ToGLSLColor(CStudioPreferences::zAxisColor()); }
static inline QT3DSF32 GetDiscPos() { return 65.0f; }
static inline QT3DSF32 GetDiscRadius() { return 7.0f; }