DI-Guy SDK Documentation  13.7
diguyAuthorVisualRegionMesh.h
Go to the documentation of this file.
1 
2 /*********************************************************************
3  ** Copyright (c) 1992-2022 MAK Technologies, Inc.
4  ** All rights reserved.
5  *********************************************************************/
6 
7 
8 #ifndef __diguyAuthorVisualRegionMesh_H
9 #define __diguyAuthorVisualRegionMesh_H
10 
11 #include <declspec_diguy.h>
14 class diguyVec3f;
15 class diguyRegion;
16 class bdiRenderRegionMeshData;
17 
19 
20 
21 /*l
22  ** Function for setting the create function for region mesh visual subclass
23  ** objects. This should be called after diguy_author_initialize(), but
24  ** before any scenario is created of loaded.
25  */
27 
28 
29 
30 /*********************************************************************/
44 class BDI_DECLSPEC_diguy diguyAuthorVisualRegionMesh
45 {
46 
47 public:
48 
49  /*l
50  ** Returns the visual material to be used for rendering this object.
51  */
52  diguyAuthorVisualMaterial* get_visual_material();
53 
54  /*l
55  ** Returns the diguyRegion object that this visual is associated with.
56  ** Note that one diguyRegion will most likely have multiple region mesh
57  ** visuals.
58  */
59  diguyRegion* get_region();
60 
61  /*l
62  ** Returns the index of the subregion of the associated diguyRegion that
63  ** this visual is part of. This value will be one of the
64  ** diguySubregionIndex enumerated values.
65  */
66  int get_subregion_index();
67 
68  /*l
69  ** Returns the number of quad polygons to be rendered by this visual.
70  ** They should be rendered using the material's brush color.
71  */
72  int get_num_quads();
73 
74  /*l
75  ** Returns one corner of one of the visual's quads. Corner argument
76  ** should be between 0 and 3, quad argument between 0 and the result
77  ** from get_num_quads() - 1.
78  **
79  ** The returned vertex will be relative to the region's origin as
80  ** returned by get_mesh_origin().
81  **
82  ** Note: this will be slow. Use get_quads_data_ptr() if possible.
83  */
84  diguyVec3f get_quad_point(int quad, int corner);
85 
86  /*l
87  ** Returns a pointer to a contiguous data buffer that contains all
88  ** quad polygon data for this visual. There will be four times the
89  ** value returned by get_num_quads() vectors in the data buffer.
90  **
91  ** The returned vertices will be relative to the region's origin as
92  ** returned by get_mesh_origin().
93  */
94  diguyVec3f* get_quads_data_ptr();
95 
96  /*l
97  ** Returns the number of line segment edges to be rendered by this
98  ** visual. They should be rendered using the material's pen color.
99  */
100  int get_num_edges();
101 
102  /*l
103  ** Returns one endpoint of one of the visual's edges. End argument
104  ** should be 0 or 1, edge argument between 0 and the result from
105  ** get_num_edges() - 1.
106  **
107  ** The returned vertex will be relative to the region's origin as
108  ** returned by get_mesh_origin().
109  **
110  ** Note: this will be slow. Use get_edges_data_ptr() if possible.
111  */
112  diguyVec3f get_edge_point(int edge, int end);
113 
114  /*l
115  ** Returns a pointer to a contiguous data buffer that contains all
116  ** line segment edge data for this visual. There will be two times the
117  ** value returned by get_num_edges() vectors in the data buffer.
118  **
119  ** The returned vertices will be relative to the region's origin as
120  ** returned by get_mesh_origin().
121  */
122  diguyVec3f* get_edges_data_ptr();
123 
124  /*l
125  ** Returns the origin of the geometry in the visual. All quads and
126  ** edges will be relative to this origin.
127  */
128  diguyVec3f get_mesh_origin();
129 
130  /*l
131  ** Returns the level at which this mesh should be highlighted. This
132  ** will be 0, 1, or 2. The higher the highlight level, the brighter
133  ** the mesh should appear.
134  **
135  ** It's recommended that for highlight level 0, the colors of the visual
136  ** material be scaled by a factor of 0.6; for highlight level 1, by a
137  ** factor of 0.8; and for highlight level 2 don't scale.
138  **
139  ** Highlight level 2 should have a wider line width than levels 0 or 1.
140  */
141  int get_highlight_level();
142 
143  /*l
144  ** Returns 1 if this visual should be visible, else 0.
145  */
146  int get_visible();
147 
148 
149 /*****************************************************************************/
161  /*l
162  *b Description:
163  **
164  ** build() will be called by DI-Guy when it is time for a
165  ** renderer-specific visual object to be created. All information
166  ** necessary to build the visual should be available via the Accessor
167  ** Functions above when this function is called.
168  **
169  ** It is common for build() and update() to use the same internal,
170  ** user-written function for creating geometry.
171  **
172  *i Immediate Mode:
173  **
174  ** Immediate mode renderers may override this function to create an
175  ** object, for example a vertex array, that may be used when draw() is
176  ** called.
177  **
178  *i Scene Graph:
179  **
180  ** Scene graph renderers almost always override this function to
181  ** create a scene graph node object that is attached to the scene
182  ** graph and updated when update() is called.
183  */
184  virtual void build();
185 
186  /*l
187  *b Description:
188  **
189  ** See diguyAuthorVisualWaypoint::unbuild() for general information
190  ** about this function.
191  */
192  virtual void unbuild();
193 
194  /*l
195  *b Description:
196  **
197  ** See diguyAuthorVisualWaypoint::update() for general information
198  ** about this function. Specifics for this visual type are below.
199  **
200  *i DIGUY_GRAPHICS_VISUAL_UPDATE_GEOMETRY
201  **
202  ** Region mesh visuals need to use calls to get_num_quads(),
203  ** get_quads_data_ptr(), etc. to determine geometry.
204  **
205  *i DIGUY_GRAPHICS_VISUAL_UPDATE_POSITION
206  **
207  ** Region mesh visuals do not use this value. The overall positions
208  ** of polygons that make up the mesh are recomputed and applied
209  ** during an overall geometry update operation.
210  */
211  virtual void update(int update_flags);
212 
213  /*l
214  *b Description:
215  **
216  ** See diguyAuthorVisualWaypoint::draw() for general information
217  ** about this function.
218  */
219  virtual void draw();
220 
221  /*l
222  *b Description:
223  **
224  ** See diguyAuthorVisualWaypoint::show() for general information
225  ** about this function.
226  */
227  virtual void show();
228 
229  /*l
230  *b Description:
231  **
232  ** See diguyAuthorVisualWaypoint::hide() for general information
233  ** about this function.
234  */
235  virtual void hide();
236 
237 
238 
240 /****************************************************************************/
241 /****************************************************************************/
248  static diguyAuthorVisualRegionMeshCreateFunc* s_create_func;
249 
250  diguyAuthorVisualRegionMesh(void* internal_data);
251  virtual ~diguyAuthorVisualRegionMesh();
252 
253  bdiRenderRegionMeshData* m_scripted_object;
254  bdiRenderRegionMeshData* get_scripted_object() {return m_scripted_object;}
255 
256  friend class bdiRenderRegionMeshData;
257 };
258 
259 #endif /* __diguyAuthorVisualRegionMesh_H */
260 
A two-and-a-half-dimensional surface that represents either a navigation mesh or an area that's been ...
Definition: diguyRegion.h:50
diguyAuthorVisualRegionMesh * diguyAuthorVisualRegionMeshCreateFunc(void *internal_data)
Definition: diguyAuthorVisualRegionMesh.h:17
The diguyAuthorVisualRegionMesh class provides an interface for creating supplemental visuals needed ...
Definition: diguyAuthorVisualRegionMesh.h:39
void diguy_author_set_region_mesh_visual_create_func(diguyAuthorVisualRegionMeshCreateFunc *func)
Function for setting the create function for region mesh visual subclass objects. ...
Definition: diguy_vector_classes.h:74
The diguyAuthorVisualMaterial class provides data needed to render DI-Guy Author visuals in a Host IG...
Definition: diguyAuthorVisualMaterial.h:22