00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __PLSCENE_SCENENODE_LINEGRID_H__
00024 #define __PLSCENE_SCENENODE_LINEGRID_H__
00025 #pragma once
00026
00027
00028
00029
00030
00031 #include <PLGraphics/Color/Color4.h>
00032 #include "PLScene/Scene/SceneNode.h"
00033
00034
00035
00036
00037
00038 namespace PLScene {
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 class SNLineGrid : public SceneNode {
00049
00050
00051
00052
00053
00054 public:
00055
00056
00057
00058
00059 enum EFlags {
00060 NoDepthTest = 1<<10,
00061 NoMainLines = 1<<11,
00062 NoMinorLines = 1<<12
00063 };
00064 pl_enum(EFlags)
00065 pl_enum_base(SceneNode::EFlags)
00066 pl_enum_value(NoDepthTest, "Do not perform a depth test")
00067 pl_enum_value(NoMainLines, "Do not draw the main lines")
00068 pl_enum_value(NoMinorLines, "Do not draw the minor lines")
00069 pl_enum_end
00070
00071
00072
00073
00074
00075 pl_class(PLS_RTTI_EXPORT, SNLineGrid, "PLScene", PLScene::SceneNode, "Line grid scene node on the nodes local space x/y-plane")
00076
00077 pl_attribute(NumOfXLines, PLCore::uint32, 5, ReadWrite, DirectValue, "Number of lines along each +/- x axis", "")
00078 pl_attribute(NumOfYLines, PLCore::uint32, 5, ReadWrite, DirectValue, "Number of lines along each +/- y axis", "")
00079 pl_attribute(MainWidth, float, 1.0f, ReadWrite, DirectValue, "Main lines width (if supported by the the used renderer API)", "Min='1.0'")
00080 pl_attribute(MainColor, PLGraphics::Color4, PLGraphics::Color4(0.1f, 0.1f, 0.1f, 1.0f), ReadWrite, DirectValue, "Main lines color (r/g/b/a)", "")
00081 pl_attribute(MinorWidth, float, 1.0f, ReadWrite, DirectValue, "Minor lines width (if supported by the the used renderer API)", "Min='1.0'")
00082 pl_attribute(MinorColor, PLGraphics::Color4, PLGraphics::Color4(0.55f, 0.55f, 0.55f, 1.0f), ReadWrite, DirectValue, "Minor lines color (r/g/b/a)", "")
00083
00084 pl_attribute(Flags, pl_flag_type(EFlags), 0, ReadWrite, GetSet, "Flags", "")
00085 pl_attribute(AABBMin, PLMath::Vector3, PLMath::Vector3(-0.5f, -0.5f, -0.5f), ReadWrite, GetSet, "Minimum position of the 'scene node space' axis aligned bounding box", "")
00086 pl_attribute(AABBMax, PLMath::Vector3, PLMath::Vector3( 0.5f, 0.5f, 0.5f), ReadWrite, GetSet, "Maximum position of the 'scene node space' axis aligned bounding box", "")
00087
00088 pl_constructor_0(DefaultConstructor, "Default constructor", "")
00089 pl_class_end
00090
00091
00092
00093
00094
00095 public:
00096
00097
00098
00099
00100 PLS_API SNLineGrid();
00101
00102
00103
00104
00105
00106 PLS_API virtual ~SNLineGrid();
00107
00108
00109
00110
00111
00112 private:
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122 void DrawGrid(PLRenderer::Renderer &cRenderer, const VisNode &cVisNode);
00123
00124
00125
00126
00127
00128 public:
00129 PLS_API virtual void DrawSolid(PLRenderer::Renderer &cRenderer, const VisNode *pVisNode = nullptr) override;
00130 PLS_API virtual void DrawTransparent(PLRenderer::Renderer &cRenderer, const VisNode *pVisNode = nullptr) override;
00131
00132
00133 };
00134
00135
00136
00137
00138
00139 }
00140
00141
00142 #endif // __PLSCENE_SCENENODE_LINEGRID_H__