Coverage Report

Created: 2026-08-29 06:21

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/ogre/OgreMain/include/OgreCommon.h
Line
Count
Source
1
/*
2
-----------------------------------------------------------------------------
3
This source file is part of OGRE
4
    (Object-oriented Graphics Rendering Engine)
5
For the latest info, see http://www.ogre3d.org/
6
7
Copyright (c) 2000-2014 Torus Knot Software Ltd
8
9
Permission is hereby granted, free of charge, to any person obtaining a copy
10
of this software and associated documentation files (the "Software"), to deal
11
in the Software without restriction, including without limitation the rights
12
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
copies of the Software, and to permit persons to whom the Software is
14
furnished to do so, subject to the following conditions:
15
16
The above copyright notice and this permission notice shall be included in
17
all copies or substantial portions of the Software.
18
19
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
THE SOFTWARE.
26
-----------------------------------------------------------------------------
27
*/
28
#ifndef __Common_H__
29
#define __Common_H__
30
// Common stuff
31
32
#include "OgreVector.h"
33
#include "OgreHeaderPrefix.h"
34
#include "OgreMurmurHash3.h"
35
36
namespace Ogre {
37
38
    /** \addtogroup Core
39
    *  @{
40
    */
41
    /** \addtogroup General
42
    *  @{
43
    */
44
45
    /// Fast general hashing algorithm
46
0
    inline uint32 FastHash (const char * data, size_t len, uint32 hashSoFar = 0) {
47
0
        uint32 ret;
48
0
        MurmurHash3_x86_32(data, len, hashSoFar, &ret);
49
0
        return ret;
50
0
    }
51
    /// Combine hashes with same style as boost::hash_combine
52
    template <typename T>
53
    uint32 HashCombine (uint32 hashSoFar, const T& data)
54
    {
55
        return FastHash((const char*)&data, sizeof(T), hashSoFar);
56
    }
57
58
59
    /** Comparison functions used for the depth/stencil buffer operations and 
60
        others. */
61
    enum CompareFunction : uint8
62
    {
63
        CMPF_ALWAYS_FAIL,  //!< Never writes a pixel to the render target
64
        CMPF_ALWAYS_PASS,  //!< Always writes a pixel to the render target
65
        CMPF_LESS,         //!< Write if (new_Z < existing_Z)
66
        CMPF_LESS_EQUAL,   //!< Write if (new_Z <= existing_Z)
67
        CMPF_EQUAL,        //!< Write if (new_Z == existing_Z)
68
        CMPF_NOT_EQUAL,    //!< Write if (new_Z != existing_Z)
69
        CMPF_GREATER_EQUAL,//!< Write if (new_Z >= existing_Z)
70
        CMPF_GREATER       //!< Write if (new_Z >= existing_Z)
71
    };
72
73
    /** High-level filtering options providing shortcuts to settings the
74
        minification, magnification and mip filters. */
75
    enum TextureFilterOptions
76
    {
77
        /// No filtering or mipmapping is used. 
78
        /// Equal to: min=Ogre::FO_POINT, mag=Ogre::FO_POINT, mip=Ogre::FO_NONE
79
        TFO_NONE,
80
        /// 2x2 box filtering is performed when magnifying or reducing a texture, and a mipmap is picked from the list but no filtering is done between the levels of the mipmaps. 
81
        /// Equal to: min=Ogre::FO_LINEAR, mag=Ogre::FO_LINEAR, mip=Ogre::FO_POINT
82
        TFO_BILINEAR,
83
        /// 2x2 box filtering is performed when magnifying and reducing a texture, and the closest 2 mipmaps are filtered together. 
84
        /// Equal to: min=Ogre::FO_LINEAR, mag=Ogre::FO_LINEAR, mip=Ogre::FO_LINEAR
85
        TFO_TRILINEAR,
86
        /// This is the same as ’trilinear’, except the filtering algorithm takes account of the slope of the triangle in relation to the camera rather than simply doing a 2x2 pixel filter in all cases.
87
        /// Equal to: min=Ogre::FO_ANISOTROPIC, max=Ogre::FO_ANISOTROPIC, mip=Ogre::FO_LINEAR
88
        TFO_ANISOTROPIC
89
    };
90
91
    enum FilterType
92
    {
93
        /// The filter used when shrinking a texture
94
        FT_MIN,
95
        /// The filter used when magnifying a texture
96
        FT_MAG,
97
        /// The filter used when determining the mipmap
98
        FT_MIP
99
    };
100
    /** Filtering options for textures / mipmaps. */
101
    enum FilterOptions : uint8
102
    {
103
        /// No filtering, used for FT_MIP to turn off mipmapping
104
        FO_NONE,
105
        /// Use the closest pixel
106
        FO_POINT,
107
        /// Average of a 2x2 pixel area, denotes bilinear for MIN and MAG, trilinear for MIP
108
        FO_LINEAR,
109
        /// Similar to FO_LINEAR, but compensates for the angle of the texture plane. Note that in
110
        /// order for this to make any difference, you must also set the
111
        /// TextureUnitState::setTextureAnisotropy attribute too.
112
        FO_ANISOTROPIC
113
    };
114
115
    /** Texture addressing modes - default is TAM_WRAP.
116
    */
117
    enum TextureAddressingMode : uint8
118
    {
119
        /// %Any value beyond 1.0 wraps back to 0.0. %Texture is repeated.
120
        TAM_WRAP,
121
        /// %Texture flips every boundary, meaning texture is mirrored every 1.0 u or v
122
        TAM_MIRROR,
123
        /// Values beyond 1.0 are clamped to 1.0. %Texture ’streaks’ beyond 1.0 since last line
124
        /// of pixels is used across the rest of the address space. Useful for textures which
125
        /// need exact coverage from 0.0 to 1.0 without the ’fuzzy edge’ wrap gives when
126
        /// combined with filtering.
127
        TAM_CLAMP,
128
        /// %Texture coordinates outside the range [0.0, 1.0] are set to the border colour.
129
        TAM_BORDER
130
    };
131
132
    /// Strategies for allocating and managing render buffers.
133
    enum RenderBufferPool : uint16
134
    {
135
        /// No automatic allocation. Use this when the buffer is not needed, or when it will be managed explicitly by the user.
136
        RBP_NONE    = 0,
137
        /// Automatically allocated and managed from the default shared pool (pool ID = 1)
138
        RBP_DEFAULT = 1
139
    };
140
141
    /** %Light shading modes. */
142
    enum ShadeOptions : uint8
143
    {
144
        SO_FLAT, //!< No interpolation takes place. Each face is shaded with a single colour determined from the first vertex in the face.
145
        SO_GOURAUD, //!< Colour at each vertex is linearly interpolated across the face.
146
        SO_PHONG //!< Vertex normals are interpolated across the face, and these are used to determine colour at each pixel. Gives a more natural lighting effect but is more expensive and works better at high levels of tessellation. Not supported on all hardware.
147
    };
148
149
    /** Fog modes. */
150
    enum FogMode : uint8
151
    {
152
        /// No fog. Duh.
153
        FOG_NONE,
154
        /// Fog density increases  exponentially from the camera (fog = 1/e^(distance * density))
155
        FOG_EXP,
156
        /// Fog density increases at the square of FOG_EXP, i.e. even quicker (fog = 1/e^(distance * density)^2)
157
        FOG_EXP2,
158
        /// Fog density increases linearly between the start and end distances
159
        FOG_LINEAR
160
    };
161
162
    /** Hardware culling modes based on vertex winding.
163
        This setting applies to how the hardware API culls triangles it is sent. */
164
    enum CullingMode : uint8
165
    {
166
        /// Hardware never culls triangles and renders everything it receives.
167
        CULL_NONE = 1,
168
        /// Hardware culls triangles whose vertices are listed clockwise in the view (default).
169
        CULL_CLOCKWISE = 2,
170
        /// Hardware culls triangles whose vertices are listed anticlockwise in the view.
171
        CULL_ANTICLOCKWISE = 3
172
    };
173
174
    /** Manual culling modes based on vertex normals.
175
        This setting applies to how the software culls triangles before sending them to the 
176
        hardware API. This culling mode is used by scene managers which choose to implement it -
177
        normally those which deal with large amounts of fixed world geometry which is often 
178
        planar (software culling movable variable geometry is expensive). */
179
    enum ManualCullingMode : uint8
180
    {
181
        /// No culling so everything is sent to the hardware.
182
        MANUAL_CULL_NONE = 1,
183
        /// Cull triangles whose normal is pointing away from the camera (default).
184
        MANUAL_CULL_BACK = 2,
185
        /// Cull triangles whose normal is pointing towards the camera.
186
        MANUAL_CULL_FRONT = 3
187
    };
188
189
    /** Enumerates the wave types usable with the Ogre engine. */
190
    enum WaveformType
191
    {
192
        /// Standard sine wave which smoothly changes from low to high and back again.
193
        WFT_SINE,
194
        /// An angular wave with a constant increase / decrease speed with pointed peaks.
195
        WFT_TRIANGLE,
196
        /// Half of the time is spent at the min, half at the max with instant transition between.
197
        WFT_SQUARE,
198
        /// Gradual steady increase from min to max over the period with an instant return to min at the end.
199
        WFT_SAWTOOTH,
200
        /// Gradual steady decrease from max to min over the period, with an instant return to max at the end.
201
        WFT_INVERSE_SAWTOOTH,
202
        /// Pulse Width Modulation. Works like WFT_SQUARE, except the high to low transition is controlled by duty cycle. 
203
        /// With a duty cycle of 50% (0.5) will give the same output as WFT_SQUARE.
204
        WFT_PWM
205
    };
206
207
    /** The polygon mode to use when rasterising. */
208
    enum PolygonMode : uint8
209
    {
210
        /// Only the points of each polygon are rendered.
211
        PM_POINTS = 1,
212
        /// Polygons are drawn in outline only.
213
        PM_WIREFRAME = 2,
214
        /// The normal situation - polygons are filled in.
215
        PM_SOLID = 3
216
    };
217
218
    /** An enumeration of broad shadow techniques */
219
    enum ShadowTechnique
220
    {
221
        /** No shadows */
222
        SHADOWTYPE_NONE = 0x00,
223
        /** Mask for additive shadows (not for direct use, use  SHADOWTYPE_ enum instead)
224
        */
225
        SHADOWDETAILTYPE_ADDITIVE = 0x01,
226
        /** Mask for modulative shadows (not for direct use, use  SHADOWTYPE_ enum instead)
227
        */
228
        SHADOWDETAILTYPE_MODULATIVE = 0x02,
229
        /** Mask for integrated shadows (not for direct use, use SHADOWTYPE_ enum instead)
230
        */
231
        SHADOWDETAILTYPE_INTEGRATED = 0x04,
232
        /** Mask for stencil shadows (not for direct use, use  SHADOWTYPE_ enum instead)
233
        */
234
        SHADOWDETAILTYPE_STENCIL = 0x10,
235
        /** Mask for texture shadows (not for direct use, use  SHADOWTYPE_ enum instead)
236
        */
237
        SHADOWDETAILTYPE_TEXTURE = 0x20,
238
        
239
        /** Stencil shadow technique which renders all shadow volumes as
240
            a modulation after all the non-transparent areas have been 
241
            rendered. This technique is considerably less fillrate intensive 
242
            than the additive stencil shadow approach when there are multiple
243
            lights, but is not an accurate model. 
244
        */
245
        SHADOWTYPE_STENCIL_MODULATIVE = SHADOWDETAILTYPE_STENCIL | SHADOWDETAILTYPE_MODULATIVE,
246
        /** Stencil shadow technique which renders each light as a separate
247
            additive pass to the scene. This technique can be very fillrate
248
            intensive because it requires at least 2 passes of the entire
249
            scene, more if there are multiple lights. However, it is a more
250
            accurate model than the modulative stencil approach and this is
251
            especially apparent when using coloured lights or bump mapping.
252
        */
253
        SHADOWTYPE_STENCIL_ADDITIVE = SHADOWDETAILTYPE_STENCIL | SHADOWDETAILTYPE_ADDITIVE,
254
        /** Texture-based shadow technique which involves a monochrome render-to-texture
255
            of the shadow caster and a projection of that texture onto the 
256
            shadow receivers as a modulative pass. 
257
        */
258
        SHADOWTYPE_TEXTURE_MODULATIVE = SHADOWDETAILTYPE_TEXTURE | SHADOWDETAILTYPE_MODULATIVE,
259
        
260
        /** Texture-based shadow technique which involves a render-to-texture
261
            of the shadow caster and a projection of that texture onto the 
262
            shadow receivers, built up per light as additive passes. 
263
            This technique can be very fillrate intensive because it requires numLights + 2 
264
            passes of the entire scene. However, it is a more accurate model than the 
265
            modulative approach and this is especially apparent when using coloured lights 
266
            or bump mapping.
267
        */
268
        SHADOWTYPE_TEXTURE_ADDITIVE = SHADOWDETAILTYPE_TEXTURE | SHADOWDETAILTYPE_ADDITIVE,
269
270
        /** Texture-based shadow technique which involves a render-to-texture
271
        of the shadow caster and a projection of that texture on to the shadow
272
        receivers, with the usage of those shadow textures completely controlled
273
        by the materials of the receivers.
274
        This technique is easily the most flexible of all techniques because 
275
        the material author is in complete control over how the shadows are
276
        combined with regular rendering. It can perform shadows as accurately
277
        as SHADOWTYPE_TEXTURE_ADDITIVE but more efficiently because it requires
278
        less passes. However it also requires more expertise to use, and 
279
        in almost all cases, shader capable hardware to really use to the full.
280
        @note The 'additive' part of this mode means that the colour of
281
        the rendered shadow texture is by default plain black. It does
282
        not mean it does the adding on your receivers automatically though, how you
283
        use that result is up to you.
284
        */
285
        SHADOWTYPE_TEXTURE_ADDITIVE_INTEGRATED = SHADOWTYPE_TEXTURE_ADDITIVE | SHADOWDETAILTYPE_INTEGRATED,
286
        /** Texture-based shadow technique which involves a render-to-texture
287
            of the shadow caster and a projection of that texture on to the shadow
288
            receivers, with the usage of those shadow textures completely controlled
289
            by the materials of the receivers.
290
            This technique is easily the most flexible of all techniques because 
291
            the material author is in complete control over how the shadows are
292
            combined with regular rendering. It can perform shadows as accurately
293
            as SHADOWTYPE_TEXTURE_ADDITIVE but more efficiently because it requires
294
            less passes. However it also requires more expertise to use, and 
295
            in almost all cases, shader capable hardware to really use to the full.
296
            @note The 'modulative' part of this mode means that the colour of
297
            the rendered shadow texture is by default the 'shadow colour'. It does
298
            not mean it modulates on your receivers automatically though, how you
299
            use that result is up to you.
300
        */
301
        SHADOWTYPE_TEXTURE_MODULATIVE_INTEGRATED = SHADOWTYPE_TEXTURE_MODULATIVE | SHADOWDETAILTYPE_INTEGRATED
302
    };
303
304
    /** An enumeration describing which material properties should track the vertex colours */
305
    typedef int TrackVertexColourType;
306
    enum TrackVertexColourEnum {
307
        TVC_NONE        = 0x0,
308
        TVC_AMBIENT     = 0x1,        
309
        TVC_DIFFUSE     = 0x2,
310
        TVC_SPECULAR    = 0x4,
311
        TVC_EMISSIVE    = 0x8
312
    };
313
314
    /** Function used compute the camera-distance for sorting objects */
315
    enum SortMode : uint8
316
    {
317
318
        /** Sort by direction of the camera.
319
         * The distance along the camera view as in `cam->getDerivedDirection().dotProduct(diff)`
320
         * Best for @ref PT_ORTHOGRAPHIC
321
         */
322
        SM_DIRECTION,
323
        /** Sort by distance from the camera.
324
         * The euclidean distance as in `diff.squaredLength()`
325
         * Best for @ref PT_PERSPECTIVE
326
         */
327
        SM_DISTANCE
328
    };
329
330
    /** Defines the frame buffer types. */
331
    enum FrameBufferType {
332
        FBT_COLOUR  = 0x1,
333
        FBT_DEPTH   = 0x2,
334
        FBT_STENCIL = 0x4
335
    };
336
  
337
  /** Defines the colour buffer types. */
338
    enum ColourBufferType
339
    {
340
      CBT_BACK = 0x0,
341
      CBT_BACK_LEFT,
342
      CBT_BACK_RIGHT
343
    };
344
345
    /** Flags for the Instance Manager when calculating ideal number of instances per batch */
346
    enum InstanceManagerFlags
347
    {
348
        /** Forces an amount of instances per batch low enough so that vertices * numInst < 65535
349
            since usually improves performance. In HW instanced techniques, this flag is ignored
350
        */
351
        IM_USE16BIT     = 0x0001,
352
353
        /** The num. of instances is adjusted so that as few pixels as possible are wasted
354
            in the vertex texture */
355
        IM_VTFBESTFIT   = 0x0002,
356
357
        /** Use a limited number of skeleton animations shared among all instances. 
358
        Update only that limited amount of animations in the vertex texture.*/
359
        IM_VTFBONEMATRIXLOOKUP = 0x0004,
360
361
        IM_USEBONEDUALQUATERNIONS = 0x0008,
362
363
        /** Use one weight per vertex when recommended (i.e. VTF). */
364
        IM_USEONEWEIGHT = 0x0010,
365
366
        /** All techniques are forced to one weight per vertex. */
367
        IM_FORCEONEWEIGHT = 0x0020,
368
369
        IM_USEALL       = IM_USE16BIT|IM_VTFBESTFIT|IM_USEONEWEIGHT
370
    };
371
    
372
    class Light;
373
    typedef std::vector<Light*> LightList;
374
375
376
    /// Constant blank string, useful for returning by ref where local does not exist
377
    const String BLANKSTRING;
378
379
    typedef std::map<String, bool> UnaryOptionList;
380
    typedef std::map<String, String> BinaryOptionList;
381
382
    /// Name / value parameter pair (first = name, second = value)
383
    typedef std::map<String, String> NameValuePairList;
384
385
    /// Alias / Texture name pair (first = alias, second = texture name)
386
    typedef std::map<String, String> AliasTextureNamePairList;
387
388
        template< typename T > struct TRect
389
        {
390
          T left, top, right, bottom;
391
          TRect() : left(0), top(0), right(0), bottom(0) {}
392
          TRect( T const & l, T const & t, T const & r, T const & b )
393
            : left( l ), top( t ), right( r ), bottom( b )
394
          {
395
          }
396
          T width() const
397
          {
398
            return right - left;
399
          }
400
          T height() const
401
          {
402
            return bottom - top;
403
          }
404
          bool isNull() const
405
          {
406
              return width() == 0 || height() == 0;
407
          }
408
          void setNull()
409
          {
410
              left = right = top = bottom = 0;
411
          }
412
          TRect & merge(const TRect& rhs)
413
          {
414
              assert(right >= left && bottom >= top);
415
              assert(rhs.right >= rhs.left && rhs.bottom >= rhs.top);
416
              if (isNull())
417
              {
418
                  *this = rhs;
419
              }
420
              else if (!rhs.isNull())
421
              {
422
                  left = std::min(left, rhs.left);
423
                  right = std::max(right, rhs.right);
424
                  top = std::min(top, rhs.top);
425
                  bottom = std::max(bottom, rhs.bottom);
426
              }
427
428
              return *this;
429
430
          }
431
432
          /**
433
           * Returns the intersection of the two rectangles.
434
           *
435
           * Note that the rectangles extend downwards. I.e. a valid box will
436
           * have "right > left" and "bottom > top".
437
           * @param rhs Another rectangle.
438
           * @return The intersection of the two rectangles. Zero size if they don't intersect.
439
           */
440
          TRect intersect(const TRect& rhs) const
441
          {
442
              assert(right >= left && bottom >= top);
443
              assert(rhs.right >= rhs.left && rhs.bottom >= rhs.top);
444
              TRect ret;
445
              if (isNull() || rhs.isNull())
446
              {
447
                  // empty
448
                  return ret;
449
              }
450
              else
451
              {
452
                  ret.left = std::max(left, rhs.left);
453
                  ret.right = std::min(right, rhs.right);
454
                  ret.top = std::max(top, rhs.top);
455
                  ret.bottom = std::min(bottom, rhs.bottom);
456
              }
457
458
              if (ret.left > ret.right || ret.top > ret.bottom)
459
              {
460
                  // no intersection, return empty
461
                  ret.left = ret.top = ret.right = ret.bottom = 0;
462
              }
463
464
              return ret;
465
466
          }
467
          bool operator==(const TRect& rhs) const
468
          {
469
              return left == rhs.left && right == rhs.right && top == rhs.top && bottom == rhs.bottom;
470
          }
471
          bool operator!=(const TRect& rhs) const { return !(*this == rhs); }
472
        };
473
        template <typename CharT, typename TraitsT, typename T>
474
        std::basic_ostream<CharT, TraitsT>& operator<<(std::basic_ostream<CharT, TraitsT>& o, const TRect<T>& r)
475
        {
476
          o << "TRect<>(l:" << r.left << ", t:" << r.top << ", r:" << r.right << ", b:" << r.bottom << ")";
477
          return o;
478
        }
479
480
        /** Structure used to define a rectangle in a 2-D floating point space.
481
        */
482
        typedef TRect<float> FloatRect;
483
484
        /** Structure used to define a rectangle in a 2-D floating point space, 
485
            subject to double / single floating point settings.
486
        */
487
        typedef TRect<Real> RealRect;
488
489
        /** Structure used to define a rectangle in a 2-D integer space.
490
        */
491
        typedef TRect< int32 > Rect;
492
493
        /** Structure used to define a box in a 3-D integer space.
494
            Note that the left, top, and front edges are included but the right,
495
            bottom and back ones are not.
496
         */
497
        struct Box
498
        {
499
            uint32 left, top, right, bottom, front, back;
500
            /// Parameterless constructor for setting the members manually
501
            Box()
502
                : left(0), top(0), right(1), bottom(1), front(0), back(1)
503
0
            {
504
0
            }
505
            /** Define a box from left, top, right and bottom coordinates
506
                This box will have depth one (front=0 and back=1).
507
                @param  l   x value of left edge
508
                @param  t   y value of top edge
509
                @param  r   x value of right edge
510
                @param  b   y value of bottom edge
511
                @note @copydetails Ogre::Box
512
            */
513
            Box( uint32 l, uint32 t, uint32 r, uint32 b ):
514
                left(l),
515
                top(t),   
516
                right(r),
517
                bottom(b),
518
                front(0),
519
                back(1)
520
0
            {
521
0
                assert(right >= left && bottom >= top && back >= front);
522
0
            }
523
524
            /// @overload
525
            template <typename T> explicit Box(const TRect<T>& r) : Box(r.left, r.top, r.right, r.bottom) {}
526
527
            /** Define a box from left, top, front, right, bottom and back
528
                coordinates.
529
                @param  l   x value of left edge
530
                @param  t   y value of top edge
531
                @param  ff  z value of front edge
532
                @param  r   x value of right edge
533
                @param  b   y value of bottom edge
534
                @param  bb  z value of back edge
535
                @note @copydetails Ogre::Box
536
            */
537
            Box( uint32 l, uint32 t, uint32 ff, uint32 r, uint32 b, uint32 bb ):
538
                left(l),
539
                top(t),   
540
                right(r),
541
                bottom(b),
542
                front(ff),
543
                back(bb)
544
0
            {
545
0
                assert(right >= left && bottom >= top && back >= front);
546
0
            }
547
548
            /// @overload
549
            explicit Box(const Vector3i& size)
550
                : left(0), top(0), right(size[0]), bottom(size[1]), front(0), back(size[2])
551
0
            {
552
0
            }
553
554
            /// Return true if the other box is a part of this one
555
            bool contains(const Box &def) const
556
0
            {
557
0
                return (def.left >= left && def.top >= top && def.front >= front &&
558
0
                    def.right <= right && def.bottom <= bottom && def.back <= back);
559
0
            }
560
            
561
            /// Get the width of this box
562
0
            uint32 getWidth() const { return right-left; }
563
            /// Get the height of this box
564
0
            uint32 getHeight() const { return bottom-top; }
565
            /// Get the depth of this box
566
0
            uint32 getDepth() const { return back-front; }
567
568
            /// origin (top, left, front) of the box
569
0
            Vector3i getOrigin() const { return Vector3i(left, top, front); }
570
            /// size (width, height, depth) of the box
571
0
            Vector3i getSize() const { return Vector3i(getWidth(), getHeight(), getDepth()); }
572
        };
573
574
    
575
    
576
    /** Locate command-line options of the unary form '-blah' and of the
577
        binary form '-blah foo', passing back the index of the next non-option.
578
    @param numargs, argv The standard parameters passed to the main method
579
    @param unaryOptList Map of unary options (i.e. those that do not require a parameter).
580
        Should be pre-populated with, for example '-e' in the key and false in the 
581
        value. Options which are found will be set to true on return.
582
    @param binOptList Map of binary options (i.e. those that require a parameter
583
        e.g. '-e afile.txt').
584
        Should be pre-populated with, for example '-e' and the default setting. 
585
        Options which are found will have the value updated.
586
    */
587
    int _OgreExport findCommandLineOpts(int numargs, char** argv, UnaryOptionList& unaryOptList, 
588
        BinaryOptionList& binOptList);
589
590
    /// Generic result of clipping
591
    enum ClipResult
592
    {
593
        /// Nothing was clipped
594
        CLIPPED_NONE = 0,
595
        /// Partially clipped
596
        CLIPPED_SOME = 1, 
597
        /// Everything was clipped away
598
        CLIPPED_ALL = 2
599
    };
600
601
    /// Render window creation parameters.
602
    struct RenderWindowDescription
603
    {
604
        String              name;
605
        unsigned int        width;
606
        unsigned int        height;
607
        bool                useFullScreen;
608
        NameValuePairList   miscParams;
609
    };
610
611
    /// Render window creation parameters container.
612
    typedef std::vector<RenderWindowDescription> RenderWindowDescriptionList;
613
614
    /// Render window container.
615
    typedef std::vector<RenderWindow*> RenderWindowList;
616
617
    /** @} */
618
    /** @} */
619
}
620
621
#include "OgreHeaderSuffix.h"
622
623
#endif