| GL Studio C++ Runtime API

gls_eyepoint.h
Go to the documentation of this file.
1/*! \file
2 \brief The disti::GlsEyePoint class. Implements eyepoints.
3
4 \par Copyright Information
5
6 Copyright (c) 2017 by The DiSTI Corporation.<br>
7 11301 Corporate Blvd; Suite 100<br>
8 Orlando, Florida 32817<br>
9 USA<br>
10 <br>
11 All rights reserved.<br>
12
13 This Software contains proprietary trade secrets of DiSTI and may not be
14 reproduced, in whole or part, in any form, or by any means of electronic,
15 mechanical, or otherwise, without the written permission of DiSTI. Said
16 permission may be derived through the purchase of applicable DiSTI product
17 licenses which detail the distribution rights of this content and any
18 Derivative Works based on this or other copyrighted DiSTI Software.
19
20 NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
21 AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
22 PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
23 AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
24 IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
25 PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
26
27 LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
28 IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
29 INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
30 DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
31 INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
32 INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBILITY
33 OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
34 EXCEED FIVE DOLLARS (US$5.00).
35
36 The aforementioned terms and restrictions are governed by the laws of the
37 State of Florida and the United States of America.
38
39*/
40#ifndef _GLS_EYEPOINT_H
41#define _GLS_EYEPOINT_H
42
43#include "display.h"
44#include "disti_metadata.h"
45#include "gls_color.h"
46#include "gls_cpp_lang_support.h"
47#include "gls_include.h"
48#include "gls_metadata_attributes.h"
49
50 namespace disti
51{
52/**
53 Eye Point Initializers
54*/
55 typedef enum
56{
57 GLS_EYEPOINT_FOV = GLS_LAST_INITIALIZER + 1,
58 GLS_EYEPOINT_ORTHOGRAPHIC,
59 GLS_EYEPOINT_ORTHO_SIZE,
60 GLS_EYEPOINT_FOV_IS_HORIZONTAL,
61 GLS_EYEPOINT_ASPECT,
62 GLS_EYEPOINT_NEAR_CLIP,
63 GLS_EYEPOINT_FAR_CLIP,
64 GLS_EYEPOINT_MAINTAIN_ASPECT,
65 GLS_EYEPOINT_VIEW_VECTORS
66} GLS_EyePoint_Initializers;
67
68 class GlsEyePoint;
69
70/// The EyePointCalcViewCallbackBase class.
71 class EyePointCalcViewCallbackBase
72{
73 public:
74 virtual ~EyePointCalcViewCallbackBase() {}
75
76 /// The callback method interface, used for custom user callbacks to configure the eyepoint's view.
77 /// \param viewWidth The view width in pixels.
78 /// \param viewHeight The view height in pixels.
79 /// \param thisEye The GlsEyePoint associated with this callback.
80 /// \param rval1 Returned user defined value.
81 /// \param rval2 Another returned user defined value.
82 virtual void Call( int viewWidth, int viewHeight, GlsEyePoint* thisEye, double& rval1, double& rval2 ) = 0;
83};
84
85/// The EyePointCalcViewCallback class.
86 template<class T>
87 class EyePointCalcViewCallback : public EyePointCalcViewCallbackBase
88{
89 public:
90 typedef void ( T::*MethodType )( int viewWidth, int viewHeight, GlsEyePoint* thisEye, double& rval1, double& rval2 ); ///< Typedef for the callback function pointer.
91
92 T* _container; ///< The object which contains the method to call.
93 MethodType _method; ///< The callback method function pointer.
94
95 /// Construct a new EyePointCalcViewCallback object.
96 /// \param container The object containing the callback method.
97 /// \param method The callback function pointer to call.
98 EyePointCalcViewCallback( T* container, MethodType method )
99 : _container( container )
100 , _method( method )
101 {
102 }
103
104 void Call( int viewWidth, int viewHeight, GlsEyePoint* thisEye, double& rval1, double& rval2 ) DISTI_METHOD_OVERRIDE
105 {
106 if( _container )
107 {
108 ( _container->*( _method ) )( viewWidth, viewHeight, thisEye, rval1, rval2 );
109 }
110 }
111};
112
113/**
114 The GlsEyePoint class. Implements Eyepoints
115*/
116 class GlsEyePoint : public DisplayObject
117{
118 public:
119 DISTI_DEPRECATED( "This identifier is forbidden by the C++ standard. Use BaseClass instead." )
120 typedef DisplayObject _BaseClass; ///< Deprecated typedef for the base class.
121 typedef DisplayObject BaseClass; ///< Typedef for the base class.
122 friend class GlsEyePointEditor;
123
124 /// The FovConstraintType enum. Defines view constraint behavior.
125 typedef enum
126 {
127 FOV_CONSTRAINT_NONE,
128 FOV_CONSTRAINT_GREATER,
129 FOV_CONSTRAINT_LESS,
130 FOV_CONSTRAINT_EXACTLY
131 } FovConstraintType;
132
133 private:
134 static bool _drawDebugGeometry; /** Causes eyepoints to draw debugging geometry. Defaults to false. */
135
136 protected:
137 double _fov; /** Field of view of eyepoint in Degrees, if _fovIsHorizontal is true, this is horizontal */
138 double _otherFov; /** Field of view for the other direction, based on _fovIsHorizontal */
139 bool _orthographic; /** True if orthographic projection, else perspective projection */
140 double _orthoSize; /** Size of ortho projection in logical units, if _fovIsHorizontal is true, this is horizontal */
141 double _otherOrthoSize; /** Size of ortho projection for the other direction, based on _fovIsHorizontal */
142 bool _fovIsHorizontal; /** True if field of view measurement is along horizonal axis, else along vertical axis */
143 FovConstraintType _horizontalConstraint; /** The type of constraint in the horizontal direction */
144 FovConstraintType _verticalConstraint; /** The type of constraint in the vertical direction */
145 double _nearClip; /** Distance from eyepoint to near clipping plane */
146 double _farClip; /** Distance from eyepoint to far clipping plane */
147 Vector _viewVectors[ 3 ]; /** 3 vectors used to set the orientation of the eyepoint */
148
149 EyePointCalcViewCallbackBase* _alternateCalcOrthographicView; /** Alternate callback for calculating the orthographic view */
150 EyePointCalcViewCallbackBase* _alternateCalcPerspectiveView; /** Alternate callback for calculating the perspective view */
151
152#ifdef GLES
153 /** Set a single attribute from the GLO file.
154 * \param data The attribute to set and its associated data.
155 */
156 virtual GLS_EXPORT void SetFromGloData( GlsGloFileAttribute& data ) DISTI_METHOD_OVERRIDE;
157#endif
158
159 public:
160 /// Set DrawDebugGeometry to true to cause eyepoints to draw at runtime.
161 /// \note This affects all eyepoint instances.
162 /// \param draw The new debug state to set.
163 static GLS_EXPORT void DrawDebugGeometry( bool draw ) { _drawDebugGeometry = draw; }
164
165 virtual GLS_EXPORT DisplayObject* CloneObject( bool generateNames = false ) DISTI_METHOD_OVERRIDE;
166
167 /** Allocate a (blank) EyePoint object */
168 GLS_EXPORT GlsEyePoint();
169
170 /** The copy constructor for GlsEyePoint
171 *
172 * \param that The GlsEyePoint object that is being copied
173 * \param generateNames Whether or not to generate a new instance name
174 */
175 GLS_EXPORT GlsEyePoint( const GlsEyePoint& that, const bool generateNames );
176
177 /** Destroy an Eyepoint object */
178 virtual GLS_EXPORT ~GlsEyePoint();
179
180 virtual GLS_EXPORT void SetAvailableAttributes( unsigned int value ) DISTI_METHOD_OVERRIDE;
181
182 /** Draws does nothing because this object is not a visible object,
183 * unless DrawDebugGeometry() is true, then it draws the view frustum. */
184 virtual GLS_EXPORT void Draw() DISTI_METHOD_OVERRIDE;
185
186#ifndef GLES
187 /// Draws a representation of the frustum. This is done primarily for the editor.
188 /// but is available at runtime. The specific values can be specified to avoid
189 /// making the editor set them and set them back.
190 /// \param selected If true, this object is currently selected.
191 /// \param orthographic If true, this eyepoint is orthographic, otherwise it is perspective.
192 /// \param fovIsHorizontal If true the field of view is horizontal, otherwise it is vertical.
193 /// \param orthoSize The width of the orthographic view in pixels.
194 /// \param otherOrthoSize The height of the orthographic view in pixels.
195 /// \param fov The width of the view in degrees, height if fovIsHorizontal is true.
196 /// \param otherFov The height of the view in degrees, width if fovIsHorizontal is true.
197 /// \param horizontalConstraint The horizontal constraint behavior.
198 /// \param verticalConstraint The vertical constraint behavior.
199 /// \param farClip The far clip distance.
200 /// \param nearClip The near clip distance.
201 virtual GLS_EXPORT void DrawFrustum(
202 bool selected,
203 bool orthographic,
204 bool fovIsHorizontal,
205 double orthoSize,
206 double otherOrthoSize,
207 double fov,
208 double otherFov,
209 FovConstraintType horizontalConstraint,
210 FovConstraintType verticalConstraint,
211 double farClip,
212 double nearClip );
213#endif
214
215 virtual GLS_EXPORT void CopyGeometry( DisplayObject* src ) DISTI_METHOD_OVERRIDE;
216 virtual GLS_EXPORT void CopyProperties( DisplayObject* src ) DISTI_METHOD_OVERRIDE;
217
218#ifndef GLES
219 virtual GLS_EXPORT InterfaceListType* GetCppInterfaceDescription( InterfaceListType* addToThisList ) DISTI_METHOD_OVERRIDE;
220 virtual GLS_EXPORT void GetCppInterfaceDescriptionFree( InterfaceListType* list ) DISTI_METHOD_OVERRIDE;
221#endif
222
223 /* Unhides base class implementation. */
224 using BaseClass::Rotate;
225 virtual GLS_EXPORT void Rotate( const Vector& orig, float angle, const Vector& axis ) DISTI_METHOD_OVERRIDE;
226
227 virtual GLS_EXPORT void SetValue( int spec, va_list& args ) DISTI_METHOD_OVERRIDE;
228
229 /** Sets the Field Of View for this eyepoint.
230 * If FovIsHorizontal, this is the horizontal fov.
231 * \param fovDeg The new field of view, in degrees
232 */
233 GLS_EXPORT void FOV( double fovDeg );
234
235 /** Sets the Field Of View for this eyepoint.
236 * If FovIsHorizontal, this is the vertical fov.
237 * \param fovDeg The new field of view, in degrees
238 */
239 GLS_EXPORT void OtherFOV( double fovDeg );
240
241 /** Sets whether or not the field of view measurement is along horizontal or vertical axis
242 * \param val True if FOV measurement is along horizonal axis of eyepoint
243 */
244 GLS_EXPORT void FovIsHorizontal( bool val );
245
246 /** Sets whether the eyepoint uses an orthographic projection or a perspective projection
247 * \param val True if the eypoint uses an orthographic projection. False if it uses a perspective projection.
248 */
249 GLS_EXPORT void Orthographic( bool val );
250
251 /** Sets the size of the orthographic projection, in logical units.
252 * The direction this controls is set by FovIsHorizontal. If true, it is horizontal.
253 * \param val The size of the orthographic projection, in logical units
254 */
255 GLS_EXPORT void OrthoSize( double val );
256
257 /** Sets the size of the orthographic projection, in logical units.
258 * The direction this controls is set by FovIsHorizontal. If true, it is vertical.
259 * \param val The size of the orthographic projection, in logical units
260 */
261 GLS_EXPORT void OtherOrthoSize( double val );
262
263 /** Sets the distance to the near clipping plane from the eyepoint
264 * \param val Distance to the near clipping plane from the eyepoint in logical units
265 */
266 GLS_EXPORT void NearClip( double val );
267
268 /** Sets the distance to the far clipping plane from the eyepoint
269 * \param val Distance to the far clipping plane from the eyepoint in logical units
270 */
271 GLS_EXPORT void FarClip( double val );
272
273 /// Sets the constraint for the horizontal direction.
274 /// \param val The new horizontal constraint behavior to set.
275 GLS_EXPORT void HorizontalConstraint( FovConstraintType val );
276
277 /// Sets the constraint for the vertical direction.
278 /// \param val The new vertical constraint behavior to set.
279 GLS_EXPORT void VerticalConstraint( FovConstraintType val );
280
281 /// Allows the view vectors to be set directly.
282 /// \note These are normally controlled by the Orientation call.
283 /// \param x The new X view vector to set.
284 /// \param y The new Y view vector to set.
285 /// \param z The new Z view vector to set.
286 GLS_EXPORT void SetViewVectors( const Vector& x, const Vector& y, const Vector& z );
287
288 /** Gets the Field Of View for this eyepoint.
289 * If FovIsHorizontal is true, this is the horizontal fov.
290 * \return The field of view, in degrees
291 */
292 GLS_EXPORT double FOV();
293
294 /** Gets the Field Of View for this eyepoint.
295 * If FovIsHorizontal is true, this is the vertical fov.
296 * \return The field of view, in degrees
297 */
298 GLS_EXPORT double OtherFOV();
299
300 /** Gets whether or not the field of view measurement is along horizontal or vertical axis
301 * \return True if FOV measurement is along horizonal axis of eyepoint
302 */
303 GLS_EXPORT bool FovIsHorizontal();
304
305 /** Gets whether the eyepoint uses an orthographic projection or a perspective projection
306 * \return True if the eypoint uses an orthographic projection. False if it uses a perspective projection.
307 */
308 GLS_EXPORT bool Orthographic();
309
310 /// The direction this returns is set by FovIsHorizontal. If true, it is horizontal.
311 /// \return The size of the orthographic projection, in logical units.
312 GLS_EXPORT double OrthoSize();
313
314 /// The direction this returns is set by FovIsHorizontal. If true, it is vertical.
315 /// \return The size of the orthographic projection, in logical units.
316 GLS_EXPORT double OtherOrthoSize();
317
318 /** Gets the distance to the near clipping plane from the eyepoint
319 * \return Distance to the near clipping plane from the eyepoint in logical units
320 */
321 GLS_EXPORT double NearClip();
322
323 /** Gets the distance to the far clipping plane from the eyepoint
324 * \return Distance to the far clipping plane from the eyepoint in logical units
325 */
326 GLS_EXPORT double FarClip();
327
328 /// \return the constraint for the horizontal direction
329 GLS_EXPORT FovConstraintType HorizontalConstraint();
330
331 /// \return the constraint for the vertical direction
332 GLS_EXPORT FovConstraintType VerticalConstraint();
333
334 /// Returns the current view vectors.
335 /// \param x The returned X view vector.
336 /// \param y The returned Y view vector.
337 /// \param z The returned Z view vector.
338 GLS_EXPORT void GetViewVectors( Vector& x, Vector& y, Vector& z );
339
340 /** Sets the orientation of the eyepoint
341 * \param direction A direction vector
342 * \param roll A roll value about the direction vector, in degrees
343 * \param upVector defines the "up" direction for the purposes of calculating roll.
344 */
345 GLS_EXPORT void Orientation( const Vector& direction, float roll, const Vector& upVector = Vector( 0, 1, 0 ) /* Y Axis */ );
346
347 /** Gets the current direction vector of the eyepoint
348 * \return The direction vector
349 */
350 GLS_EXPORT Vector Direction();
351
352 /** Gets the current roll angle of the eyepoint
353 * \return The current roll
354 * \param upVector The "up" direction used for determining roll.
355 */
356 GLS_EXPORT float Roll( const Vector upVector = Vector( 0, 1, 0 ) /* Y Axis */ );
357
358 /// Called by ApplyViewMatrices() to do the sizing logic.
359 /// \param viewWidth The width of the view in pixels.
360 /// \param viewHeight The height of the view in pixels.
361 /// \param thisEye The associated eyepoint (this).
362 /// \param fovY The vertical field of view in degrees.
363 /// \param aspect The aspect ratio width / height.
364 virtual GLS_EXPORT void CalcOrthographicView( int viewWidth, int viewHeight, GlsEyePoint* thisEye, double& fovY, double& aspect );
365
366 /// Called by ApplyViewMatrices() to do the sizing logic.
367 /// \param viewWidth The width of the view in pixels.
368 /// \param viewHeight The height of the view in pixels.
369 /// \param thisEye The associated eyepoint (this).
370 /// \param fovY The vertical field of view in degrees.
371 /// \param aspect The aspect ratio width / height.
372 virtual GLS_EXPORT void CalcPerspectiveView( int viewWidth, int viewHeight, GlsEyePoint* thisEye, double& fovY, double& aspect );
373
374#ifdef GLES
375 /** Calculates and applies the projection and modelview matrices for this eyepoint
376 * \param proj The projection matrix (returned)
377 * \param modelView The modelview matrix (returned)
378 * \param width The current view width
379 * \param height The current view height
380 */
381 virtual GLS_EXPORT void ApplyViewMatrices( GlsMatrixType& proj, GlsMatrixType& modelView, int width, int height );
382#else
383 /** Calculates and applies the projection and modelview matrices for this eyepoint */
384 virtual GLS_EXPORT void ApplyViewMatrices();
385#endif
386
387 /** Returns the modelview matrix for this eyepoint.
388 * \param modelview Output
389 * \param includeEyeToWorld If true, will include all transforms up to the top of the hierarcy.
390 */
391 virtual GLS_EXPORT void GetModelViewMatrix( GlsMatrixType& modelview, bool includeEyeToWorld = true );
392 /** Returns the projection matrix for this eyepoint
393 * \param proj The requested projection matrix
394 * \param viewW The width of the view in pixels
395 * \param viewH The height of the view in pixels
396 */
397 virtual GLS_EXPORT void GetProjectionMatrix( GlsMatrixType& proj, int viewW, int viewH );
398
399 /// Assigns a custom user defined callback to be called to configure the orthographic view instead of GlsEyePoint's default behavior.
400 /// \param eye The associated eyepoint.
401 /// \param container The object containing the callback method.
402 /// \param method The callback function pointer to call.
403 template<class T>
404 static void SetAlternateCalcOrthographicView( GlsEyePoint* eye, T* container, typename EyePointCalcViewCallback<T>::MethodType method )
405 {
406 if( !eye )
407 return;
408 if( eye->_alternateCalcOrthographicView )
409 delete eye->_alternateCalcOrthographicView;
410 eye->_alternateCalcOrthographicView = new EyePointCalcViewCallback<T>( container, method );
411 }
412
413 /// Assigns a custom user defined callback to be called to configure the perspective view instead of GlsEyePoint's default behavior.
414 /// \param eye The associated eyepoint.
415 /// \param container The object containing the callback method.
416 /// \param method The callback function pointer to call.
417 template<class T>
418 static void SetAlternateCalcPerspectiveView( GlsEyePoint* eye, T* container, typename EyePointCalcViewCallback<T>::MethodType method )
419 {
420 if( !eye )
421 return;
422 if( eye->_alternateCalcPerspectiveView )
423 delete eye->_alternateCalcPerspectiveView;
424 eye->_alternateCalcPerspectiveView = new EyePointCalcViewCallback<T>( container, method );
425 }
426
427 private:
428 // Returns the 16 doubles representing the ModelView matrix
429 // Must set with bool_includeEyeToWorld before reading
430 GLS_EXPORT GlsPropString GetModelViewMatrix();
431 GLS_EXPORT void GetModelViewMatrix( const GlsPropString& bool_includeEyeToWorld );
432 bool _getModelViewMatrixIncludeEyeToWorld;
433
434 // Returns the 16 doubles representing the Projection matrix
435 // Must set with int_width_height before reading
436 GLS_EXPORT GlsPropString GetProjectionMatrix();
437 GLS_EXPORT void GetProjectionMatrix( const GlsPropString& int_width_height );
438 int _getProjectionMatrixWidth;
439 int _getProjectionMatrixHeight;
440
441 /** Assignment operator not implemented. Use CloneObject() or the copy constructor instead. */
442 GlsEyePoint& operator=( const GlsEyePoint& that ) DISTI_SPECIAL_MEM_FUN_DELETE;
443 GlsEyePoint( const GlsEyePoint& ) DISTI_SPECIAL_MEM_FUN_DELETE;
444};
445
446///////////////////////////////////////////////////////////
447// DistiAttributeFovConstraintTypeEnum
448///////////////////////////////////////////////////////////
449/// The DistiAttributeFovConstraintTypeEnum class.
450 class DistiAttributeFovConstraintTypeEnum : public DistiAttributeEnum<GlsEyePoint, GlsEyePoint::FovConstraintType, GlsEyePoint::FovConstraintType>
451{
452 public:
453 /// Create a new DistiAttributeFovConstraintTypeEnum object.
454 /// \param frame The GlsEyePoint object holding the Fov constraint property.
455 /// \param setMethod The set method function pointer.
456 /// \param getMethod The get method function pointer.
457 /// \param name The name of the associated property.
458 GLS_EXPORT DistiAttributeFovConstraintTypeEnum( GlsEyePoint* frame, SetMethodType setMethod, GetMethodType getMethod, const AttributeName& name );
459
460 virtual GLS_EXPORT ~DistiAttributeFovConstraintTypeEnum();
461
462 std::string Type() const DISTI_METHOD_OVERRIDE;
463};
464
465} // namespace disti
466
467#endif
disti::AttributeName
Definition: disti_metadata.h:87
disti::DisplayObject
Definition: display.h:96
disti::DisplayObject::Rotate
virtual void Rotate(float angle, int axis=Z_AXIS)
disti::DistiAttributeEnum
Definition: disti_metadata.h:1021
disti::DistiAttributeEnum< GlsEyePoint, GlsEyePoint::FovConstraintType, GlsEyePoint::FovConstraintType >::SetMethodType
void(containerClass::* SetMethodType)(GlsEyePoint::FovConstraintType)
Typedef for the set method function pointer.
Definition: disti_metadata.h:1023
disti::DistiAttributeEnum< GlsEyePoint, GlsEyePoint::FovConstraintType, GlsEyePoint::FovConstraintType >::GetMethodType
GlsEyePoint::FovConstraintType(containerClass::* GetMethodType)()
Typedef for the get method function pointer.
Definition: disti_metadata.h:1024
disti::DistiAttributeFovConstraintTypeEnum
The DistiAttributeFovConstraintTypeEnum class.
Definition: gls_eyepoint.h:451
disti::DistiAttributeFovConstraintTypeEnum::Type
std::string Type() const override
disti::DistiAttributeFovConstraintTypeEnum::DistiAttributeFovConstraintTypeEnum
DistiAttributeFovConstraintTypeEnum(GlsEyePoint *frame, SetMethodType setMethod, GetMethodType getMethod, const AttributeName &name)
disti::DynamicArray
Definition: dynamic_array.h:79
disti::EyePointCalcViewCallbackBase
The EyePointCalcViewCallbackBase class.
Definition: gls_eyepoint.h:72
disti::EyePointCalcViewCallbackBase::Call
virtual void Call(int viewWidth, int viewHeight, GlsEyePoint *thisEye, double &rval1, double &rval2)=0
disti::EyePointCalcViewCallback
The EyePointCalcViewCallback class.
Definition: gls_eyepoint.h:88
disti::EyePointCalcViewCallback::Call
void Call(int viewWidth, int viewHeight, GlsEyePoint *thisEye, double &rval1, double &rval2) override
Definition: gls_eyepoint.h:104
disti::EyePointCalcViewCallback::MethodType
void(T::* MethodType)(int viewWidth, int viewHeight, GlsEyePoint *thisEye, double &rval1, double &rval2)
Typedef for the callback function pointer.
Definition: gls_eyepoint.h:90
disti::EyePointCalcViewCallback::EyePointCalcViewCallback
EyePointCalcViewCallback(T *container, MethodType method)
Definition: gls_eyepoint.h:98
disti::EyePointCalcViewCallback::_container
T * _container
The object which contains the method to call.
Definition: gls_eyepoint.h:92
disti::EyePointCalcViewCallback::_method
MethodType _method
The callback method function pointer.
Definition: gls_eyepoint.h:93
disti::GlsEyePoint
Definition: gls_eyepoint.h:117
disti::GlsEyePoint::DrawDebugGeometry
static void DrawDebugGeometry(bool draw)
Definition: gls_eyepoint.h:163
disti::GlsEyePoint::FOV
void FOV(double fovDeg)
disti::GlsEyePoint::CalcPerspectiveView
virtual void CalcPerspectiveView(int viewWidth, int viewHeight, GlsEyePoint *thisEye, double &fovY, double &aspect)
disti::GlsEyePoint::Orthographic
bool Orthographic()
disti::GlsEyePoint::VerticalConstraint
void VerticalConstraint(FovConstraintType val)
disti::GlsEyePoint::CloneObject
virtual DisplayObject * CloneObject(bool generateNames=false) override
disti::GlsEyePoint::SetFromGloData
virtual void SetFromGloData(GlsGloFileAttribute &data) override
disti::GlsEyePoint::_verticalConstraint
FovConstraintType _verticalConstraint
Definition: gls_eyepoint.h:144
disti::GlsEyePoint::_alternateCalcPerspectiveView
EyePointCalcViewCallbackBase * _alternateCalcPerspectiveView
Definition: gls_eyepoint.h:150
disti::GlsEyePoint::_orthoSize
double _orthoSize
Definition: gls_eyepoint.h:140
disti::GlsEyePoint::Roll
float Roll(const Vector upVector=Vector(0, 1, 0))
disti::GlsEyePoint::_otherFov
double _otherFov
Definition: gls_eyepoint.h:138
disti::GlsEyePoint::Rotate
virtual void Rotate(const Vector &orig, float angle, const Vector &axis) override
disti::GlsEyePoint::SetAvailableAttributes
virtual void SetAvailableAttributes(unsigned int value) override
disti::GlsEyePoint::OrthoSize
double OrthoSize()
disti::GlsEyePoint::_orthographic
bool _orthographic
Definition: gls_eyepoint.h:139
disti::GlsEyePoint::_alternateCalcOrthographicView
EyePointCalcViewCallbackBase * _alternateCalcOrthographicView
Definition: gls_eyepoint.h:149
disti::GlsEyePoint::FarClip
double FarClip()
disti::GlsEyePoint::GlsEyePoint
GlsEyePoint()
disti::GlsEyePoint::Orthographic
void Orthographic(bool val)
disti::GlsEyePoint::SetValue
virtual void SetValue(int spec, va_list &args) override
disti::GlsEyePoint::_fovIsHorizontal
bool _fovIsHorizontal
Definition: gls_eyepoint.h:142
disti::GlsEyePoint::NearClip
double NearClip()
disti::GlsEyePoint::NearClip
void NearClip(double val)
disti::GlsEyePoint::_viewVectors
Vector _viewVectors[3]
Definition: gls_eyepoint.h:147
disti::GlsEyePoint::OrthoSize
void OrthoSize(double val)
disti::GlsEyePoint::FOV
double FOV()
disti::GlsEyePoint::_horizontalConstraint
FovConstraintType _horizontalConstraint
Definition: gls_eyepoint.h:143
disti::GlsEyePoint::SetAlternateCalcPerspectiveView
static void SetAlternateCalcPerspectiveView(GlsEyePoint *eye, T *container, typename EyePointCalcViewCallback< T >::MethodType method)
Definition: gls_eyepoint.h:418
disti::GlsEyePoint::CopyProperties
virtual void CopyProperties(DisplayObject *src) override
disti::GlsEyePoint::GetModelViewMatrix
virtual void GetModelViewMatrix(GlsMatrixType &modelview, bool includeEyeToWorld=true)
disti::GlsEyePoint::_fov
double _fov
Definition: gls_eyepoint.h:137
disti::GlsEyePoint::SetAlternateCalcOrthographicView
static void SetAlternateCalcOrthographicView(GlsEyePoint *eye, T *container, typename EyePointCalcViewCallback< T >::MethodType method)
Definition: gls_eyepoint.h:404
disti::GlsEyePoint::OtherOrthoSize
double OtherOrthoSize()
disti::GlsEyePoint::CalcOrthographicView
virtual void CalcOrthographicView(int viewWidth, int viewHeight, GlsEyePoint *thisEye, double &fovY, double &aspect)
disti::GlsEyePoint::Orientation
void Orientation(const Vector &direction, float roll, const Vector &upVector=Vector(0, 1, 0))
disti::GlsEyePoint::VerticalConstraint
FovConstraintType VerticalConstraint()
disti::GlsEyePoint::HorizontalConstraint
FovConstraintType HorizontalConstraint()
disti::GlsEyePoint::Draw
virtual void Draw() override
disti::GlsEyePoint::Direction
Vector Direction()
disti::GlsEyePoint::OtherOrthoSize
void OtherOrthoSize(double val)
disti::GlsEyePoint::FovIsHorizontal
void FovIsHorizontal(bool val)
disti::GlsEyePoint::GetProjectionMatrix
virtual void GetProjectionMatrix(GlsMatrixType &proj, int viewW, int viewH)
disti::GlsEyePoint::_otherOrthoSize
double _otherOrthoSize
Definition: gls_eyepoint.h:141
disti::GlsEyePoint::GetViewVectors
void GetViewVectors(Vector &x, Vector &y, Vector &z)
disti::GlsEyePoint::SetViewVectors
void SetViewVectors(const Vector &x, const Vector &y, const Vector &z)
disti::GlsEyePoint::HorizontalConstraint
void HorizontalConstraint(FovConstraintType val)
disti::GlsEyePoint::FovConstraintType
FovConstraintType
The FovConstraintType enum. Defines view constraint behavior.
Definition: gls_eyepoint.h:126
disti::GlsEyePoint::FovIsHorizontal
bool FovIsHorizontal()
disti::GlsEyePoint::OtherFOV
void OtherFOV(double fovDeg)
disti::GlsEyePoint::ApplyViewMatrices
virtual void ApplyViewMatrices(GlsMatrixType &proj, GlsMatrixType &modelView, int width, int height)
disti::GlsEyePoint::CopyGeometry
virtual void CopyGeometry(DisplayObject *src) override
disti::GlsEyePoint::OtherFOV
double OtherFOV()
disti::GlsEyePoint::FarClip
void FarClip(double val)
disti::GlsEyePoint::_farClip
double _farClip
Definition: gls_eyepoint.h:146
disti::GlsEyePoint::_nearClip
double _nearClip
Definition: gls_eyepoint.h:145
disti::GlsGloFileAttribute
Definition: gls_glo_file.h:1243
disti::GlsMatrixAffine< double >
disti::GlsPropString
Definition: util.h:1607
disti::VertexNoColor
Definition: vertex.h:85
display.h
The disti::DisplayObject class and global enumerations.
disti_metadata.h
The disti metadata.
gls_color.h
The Color class: Implements a 4 component RGBA color.
gls_cpp_lang_support.h
Macros and helper code to determine what subset of C++11/14/17 is available.
DISTI_SPECIAL_MEM_FUN_DELETE
#define DISTI_SPECIAL_MEM_FUN_DELETE
Macro to wrap function deletion, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:246
DISTI_DEPRECATED
#define DISTI_DEPRECATED(msg)
Defines whether this compiler supports the C++14 deprecated attribute.
Definition: gls_cpp_lang_support.h:488
DISTI_METHOD_OVERRIDE
#define DISTI_METHOD_OVERRIDE
Macro to wrap the override keyword, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:222
gls_include.h
A file for all GL Studio files to include.
GLS_EXPORT
#define GLS_EXPORT
Macro denoting which functions should be visible from the runtime library.
Definition: gls_include.h:52
gls_metadata_attributes.h
Defines templated metadata classes for DisplayObjects and other uses.
disti
Definition: bmpimage.h:47
disti::Vector
VertexNoColor Vector
Definition: gls_font_base.h:69
disti::GLS_EyePoint_Initializers
GLS_EyePoint_Initializers
Definition: gls_eyepoint.h:56