VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtFxGizmoRenderer.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
9 
10 #pragma once
11 
12 
13 #include <bdi_vector_arrays.h>
14 #include <osg/Vec3>
15 #include <vrvFx/vrvFx.h>
16 
17 namespace osg
18 {
19  class RenderInfo;
20 }
21 
22 class bdiUShortArray;
23 
24 namespace makVrv
25 {
26  class DtFxOglParticleSystemRenderer;
30  {
31  public:
37  void releaseGLObjects(osg::State* state) const;
38 
40  void init();
42  void setName(const char* name);
44  void update(const bdiVec3fArray& verts,
45  const bdiVec4fArray* colors, const bdiVec3fArray* normals, const bdiVec2fArray* uvs,
46  const bdiUShortArray* index_buffer);
48  void updateBuffer(GLuint& id, const char* suffix, int size, void* data);
49 
51  void draw(const bdiMat4f& model_matrix, const bdiVec4f& default_color = bdiVec4f(1, 1, 1, 1));
52 
53  public:
54  std::string m_name;
55 
56  mutable unsigned int m_verts_object;
57  mutable unsigned int m_colors_object;
58  mutable unsigned int m_normals_object;
59  mutable unsigned int m_index_buffer;
60  mutable unsigned int m_model_matrix_buffer;
61  mutable unsigned int m_color_array_buffer;
66  };
67 
71  {
72  public:
77 
79  void releaseGLObjects(osg::State* state);
80 
82  void setCameraPos(const bdiFarPosition& pos);
83 
85  void drawAxis(osg::RenderInfo& renderInfo, const osg::Vec3& pos);
86 
88  void drawStreamedData(osg::RenderInfo& renderInfo, const bdiMat4f& model_matrix, int primitive_type,
89  const bdiVec3fArray& verts, const bdiVec4fArray* colors, const bdiVec3fArray* normals,
90  const std::vector<unsigned short>* index_buffer,
91  const bdiVec4f& default_color = bdiVec4f(1, 1, 1, 1));
92 
94  void drawBox(osg::RenderInfo& renderInfo, bool highlight, const bdiFarPosition& p1, const bdiFarPosition& p2,
95  const bdiVec4f& color);
96 
98  void drawBoxFromPoints(osg::RenderInfo& renderInfo, const bdiMat4f& model_matrix, bool highlight,
99  const bdiVec3f& pMin, const bdiVec3f& pMax, const bdiVec4f& color);
100 
102  static void renderSphereIntoVbo(const bdiVec3f& localCenter, const bdiVec3f& radii, const bdiMat4f& geocentricMatrix,
103  const bdiVec4f& force_color, bdiVec3fArray& verts, bdiVec4fArray& colors);
104 
106  static void renderCircleIntoVbo(const bdiVec3f& localCenter, const float radii, const bdiMat4f& geocentricMatrix,
107  const bdiVec4f& force_color, bdiVec3fArray& verts, bdiVec4fArray& colors);
108 
110  static void renderHemisphereIntoVbo(const bdiVec3f& center, const bdiVec3f& radii, const bdiMat4f& geocentricMatrix,
111  const bdiVec4f& force_color, bdiVec3fArray& verts, bdiVec4fArray& colors);
112 
114  static void renderEllipseIntoVbo(const bdiVec3f& localCenter, const bdiVec2f& radii, const bdiMat4f& geocentricMatrix,
115  const bdiVec4f& force_color, bdiVec3fArray& verts, bdiVec4fArray& colors);
116 
118  static void renderBoxIntoVbo(const bdiVec3f& localCenter, const bdiVec3f& localMin, const bdiVec3f& localMax, const bdiMat4f& geocentricMatrix,
119  const bdiVec4f& force_color, bdiVec3fArray& verts, bdiVec4fArray& colors);
120 
122  bdiVec3fArray& scratchVerts();
124  bdiVec4fArray& scratchColors();
125 
126  protected:
130 
131  // used for drawing boxes
132  bdiVec3fArray m_line_strip_verts[2];
133  bdiVec4fArray m_line_strip_colors[2];
134  std::vector<unsigned short> m_line_strip_indexes[2];
135 
137 
138  bdiFarPosition m_camera_pos;
139  bdiVec3fArray m_scratch_verts;
140  bdiVec4fArray m_scratch_colors;
141 
142 
147 
148  };
149 
150 
151 }
bdiVec4fArray m_scratch_colors
Definition: DtFxGizmoRenderer.h:140
a class to quickly render a bunch of basic primitives as debugging aids
Definition: DtFxGizmoRenderer.h:70
std::string m_name
Definition: DtFxGizmoRenderer.h:54
unsigned int m_index_buffer
Definition: DtFxGizmoRenderer.h:59
voidpf void uLong size
Definition: ioapi.h:39
#define DT_DLL_VRVFX
Definition: vrvFx.h:20
DtDe & myDe
Definition: DtFxGizmoRenderer.h:127
unsigned int GLuint
Definition: DtGlTextureBufferObject.h:17
DtFxStreamedVboData m_dynamic_vbo
Definition: DtFxGizmoRenderer.h:128
unsigned int m_verts_object
Definition: DtFxGizmoRenderer.h:56
Contains DLL export macros.
unsigned int m_colors_object
Definition: DtFxGizmoRenderer.h:57
int m_primitive_type
Definition: DtFxGizmoRenderer.h:65
bdiFarPosition m_camera_pos
Definition: DtFxGizmoRenderer.h:138
unsigned int m_normals_object
Definition: DtFxGizmoRenderer.h:58
int m_index_count
Definition: DtFxGizmoRenderer.h:63
osg::ref_ptr< osg::Program > m_default_program
Definition: DtFxGizmoRenderer.h:146
osg::ref_ptr< osg::Shader > m_vertex_shader
Definition: DtFxGizmoRenderer.h:144
GLuint m_vertex_array_object
Definition: DtFxGizmoRenderer.h:136
unsigned int m_color_array_buffer
Definition: DtFxGizmoRenderer.h:61
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
osg::ref_ptr< osg::Shader > m_fragment_shader
Definition: DtFxGizmoRenderer.h:145
unsigned int m_model_matrix_buffer
Definition: DtFxGizmoRenderer.h:60
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
DtFxStreamedVboData m_axis_vbo
Definition: DtFxGizmoRenderer.h:129
int m_intialized
Definition: DtFxGizmoRenderer.h:64
bdiVec3fArray m_scratch_verts
Definition: DtFxGizmoRenderer.h:139
a helper struct to send basic primitives to video card
Definition: DtFxGizmoRenderer.h:29
int m_primitive_size
Definition: DtFxGizmoRenderer.h:62
osg::ref_ptr< osg::StateSet > m_debug_state_set
Definition: DtFxGizmoRenderer.h:143

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)