OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreCommon.h
Go to the documentation of this file.
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 
33 
34 #if OGRE_CPU == OGRE_CPU_X86
35  #include <xmmintrin.h>
36  #include <emmintrin.h>
37 #elif OGRE_CPU == OGRE_CPU_ARM
38  #include <arm_neon.h>
39 #endif
40 
41 #if defined ( OGRE_GCC_VISIBILITY )
42 # pragma GCC visibility push(default)
43 #endif
44 
45 #if defined ( OGRE_GCC_VISIBILITY )
46 # pragma GCC visibility pop
47 #endif
48 
49 #include "OgreHeaderPrefix.h"
50 
51 namespace Ogre {
52 
54 
62  uint32 _OgreExport FastHash (const char * data, int len, uint32 hashSoFar = 0);
65  template <typename T>
66  uint32 HashCombine (uint32 hashSoFar, const T& data)
67  {
68  return FastHash((const char*)&data, sizeof(T), hashSoFar);
69  }
70 
71 
75  {
84  };
85 
88  {
105  };
106 
110  {
119  };
120 
122  {
129  };
132  {
141  };
142 
145  {
149  };
150 
152  enum FogMode
153  {
162  };
163 
167  {
174  };
175 
182  {
189  };
190 
193  {
207  };
208 
211  {
218  };
219 
223  TVC_NONE = 0x0,
224  TVC_AMBIENT = 0x1,
225  TVC_DIFFUSE = 0x2,
228  };
229 
231  enum SortMode
232  {
237  };
238 
241  FBT_COLOUR = 0x1,
242  FBT_DEPTH = 0x2,
244  };
245 
248  {
252  IM_USE16BIT = 0x0001,
253 
256  IM_VTFBESTFIT = 0x0002,
257 
261 
263 
265  IM_USEONEWEIGHT = 0x0010,
266 
269 
271  };
272 
319  {
323  };
324 
327  template <typename T>
329  {
330  public:
331  typedef std::vector<T, STLAllocator<T, GeneralAllocPolicy> > VectorImpl;
332  protected:
334  mutable uint32 mListHash;
335  mutable bool mListHashDirty;
336 
337  void addToHash(const T& newPtr) const
338  {
339  mListHash = FastHash((const char*)&newPtr, sizeof(T), mListHash);
340  }
341  void recalcHash() const
342  {
343  mListHash = 0;
344  for (const_iterator i = mList.begin(); i != mList.end(); ++i)
345  addToHash(*i);
346  mListHashDirty = false;
347 
348  }
349 
350  public:
351  typedef typename VectorImpl::value_type value_type;
352  typedef typename VectorImpl::pointer pointer;
353  typedef typename VectorImpl::reference reference;
354  typedef typename VectorImpl::const_reference const_reference;
355  typedef typename VectorImpl::size_type size_type;
356  typedef typename VectorImpl::difference_type difference_type;
357  typedef typename VectorImpl::iterator iterator;
358  typedef typename VectorImpl::const_iterator const_iterator;
359  typedef typename VectorImpl::reverse_iterator reverse_iterator;
360  typedef typename VectorImpl::const_reverse_iterator const_reverse_iterator;
361 
362  void dirtyHash()
363  {
364  mListHashDirty = true;
365  }
366  bool isHashDirty() const
367  {
368  return mListHashDirty;
369  }
370 
372  {
373  // we have to assume that hash needs recalculating on non-const
374  dirtyHash();
375  return mList.begin();
376  }
377  iterator end() { return mList.end(); }
378  const_iterator begin() const { return mList.begin(); }
379  const_iterator end() const { return mList.end(); }
381  {
382  // we have to assume that hash needs recalculating on non-const
383  dirtyHash();
384  return mList.rbegin();
385  }
386  reverse_iterator rend() { return mList.rend(); }
387  const_reverse_iterator rbegin() const { return mList.rbegin(); }
388  const_reverse_iterator rend() const { return mList.rend(); }
389  size_type size() const { return mList.size(); }
390  size_type max_size() const { return mList.max_size(); }
391  size_type capacity() const { return mList.capacity(); }
392  bool empty() const { return mList.empty(); }
394  {
395  // we have to assume that hash needs recalculating on non-const
396  dirtyHash();
397  return mList[n];
398  }
399  const_reference operator[](size_type n) const { return mList[n]; }
401  {
402  // we have to assume that hash needs recalculating on non-const
403  dirtyHash();
404  return mList.const_iterator(n);
405  }
406  const_reference at(size_type n) const { return mList.at(n); }
409  HashedVector(size_type n, const T& t) : mList(n, t), mListHash(0), mListHashDirty(n > 0) {}
412 
413  template <class InputIterator>
414  HashedVector(InputIterator a, InputIterator b)
415  : mList(a, b), mListHash(0), mListHashDirty(false)
416  {
417  dirtyHash();
418  }
419 
422  {
423  mList = rhs.mList;
424  mListHash = rhs.mListHash;
426  return *this;
427  }
428 
429  void reserve(size_t t) { mList.reserve(t); }
431  {
432  // we have to assume that hash needs recalculating on non-const
433  dirtyHash();
434  return mList.front();
435  }
436  const_reference front() const { return mList.front(); }
438  {
439  // we have to assume that hash needs recalculating on non-const
440  dirtyHash();
441  return mList.back();
442  }
443  const_reference back() const { return mList.back(); }
444  void push_back(const T& t)
445  {
446  mList.push_back(t);
447  // Quick progressive hash add
448  if (!isHashDirty())
449  addToHash(t);
450  }
451  void pop_back()
452  {
453  mList.pop_back();
454  dirtyHash();
455  }
457  {
458  mList.swap(rhs.mList);
459  dirtyHash();
460  }
461  iterator insert(iterator pos, const T& t)
462  {
463  bool recalc = (pos != end());
464  iterator ret = mList.insert(pos, t);
465  if (recalc)
466  dirtyHash();
467  else
468  addToHash(t);
469  return ret;
470  }
471 
472  template <class InputIterator>
473  void insert(iterator pos,
474  InputIterator f, InputIterator l)
475  {
476  mList.insert(pos, f, l);
477  dirtyHash();
478  }
479 
480  void insert(iterator pos, size_type n, const T& x)
481  {
482  mList.insert(pos, n, x);
483  dirtyHash();
484  }
485 
487  {
488  iterator ret = mList.erase(pos);
489  dirtyHash();
490  return ret;
491  }
493  {
494  iterator ret = mList.erase(first, last);
495  dirtyHash();
496  return ret;
497  }
498  void clear()
499  {
500  mList.clear();
501  mListHash = 0;
502  mListHashDirty = false;
503  }
504 
505  void resize(size_type n, const T& t = T())
506  {
507  bool recalc = false;
508  if (n != size())
509  recalc = true;
510 
511  mList.resize(n, t);
512  if (recalc)
513  dirtyHash();
514  }
515 
517  { return mListHash == b.mListHash; }
518 
519  bool operator<(const HashedVector<T>& b)
520  { return mListHash < b.mListHash; }
521 
522 
524  uint32 getHash() const
525  {
526  if (isHashDirty())
527  recalcHash();
528 
529  return mListHash;
530  }
531  public:
532 
533 
534 
535  };
536 
537  class Light;
539 
542  {
543  Light const *light;
544  size_t globalIndex; //Index to SceneManager::mGlobalLightList
546 
547  LightClosest() : light( 0 ),globalIndex(0),distance( 0.0f ) {}
548  LightClosest( Light *_light, size_t _globalIndex, Real _distance ) :
549  light( _light ), globalIndex( _globalIndex ),
550  distance( _distance ) {}
551 
552  inline bool operator < ( const LightClosest &right ) const;
553  };
556  {
561 
564  {
567  }
568  };
572 
575 
578 
581 
584 
585  template< typename T > struct TRect
586  {
588  TRect() : left(0), top(0), right(0), bottom(0) {}
589  TRect( T const & l, T const & t, T const & r, T const & b )
590  : left( l ), top( t ), right( r ), bottom( b )
591  {
592  }
593  TRect( TRect const & o )
594  : left( o.left ), top( o.top ), right( o.right ), bottom( o.bottom )
595  {
596  }
597  TRect & operator=( TRect const & o )
598  {
599  left = o.left;
600  top = o.top;
601  right = o.right;
602  bottom = o.bottom;
603  return *this;
604  }
605  T width() const
606  {
607  return right - left;
608  }
609  T height() const
610  {
611  return bottom - top;
612  }
613  bool isNull() const
614  {
615  return width() == 0 || height() == 0;
616  }
617  void setNull()
618  {
619  left = right = top = bottom = 0;
620  }
621  TRect & merge(const TRect& rhs)
622  {
623  if (isNull())
624  {
625  *this = rhs;
626  }
627  else if (!rhs.isNull())
628  {
629  left = std::min(left, rhs.left);
630  right = std::max(right, rhs.right);
631  top = std::min(top, rhs.top);
632  bottom = std::max(bottom, rhs.bottom);
633  }
634 
635  return *this;
636 
637  }
638  TRect intersect(const TRect& rhs) const
639  {
640  TRect ret;
641  if (isNull() || rhs.isNull())
642  {
643  // empty
644  return ret;
645  }
646  else
647  {
648  ret.left = std::max(left, rhs.left);
649  ret.right = std::min(right, rhs.right);
650  ret.top = std::max(top, rhs.top);
651  ret.bottom = std::min(bottom, rhs.bottom);
652  }
653 
654  if (ret.left > ret.right || ret.top > ret.bottom)
655  {
656  // no intersection, return empty
657  ret.left = ret.top = ret.right = ret.bottom = 0;
658  }
659 
660  return ret;
661 
662  }
663 
664  };
665  template<typename T>
666  std::ostream& operator<<(std::ostream& o, const TRect<T>& r)
667  {
668  o << "TRect<>(l:" << r.left << ", t:" << r.top << ", r:" << r.right << ", b:" << r.bottom << ")";
669  return o;
670  }
671 
675 
680 
684 
689  struct Box
690  {
693  Box()
694  : left(0), top(0), right(1), bottom(1), front(0), back(1)
695  {
696  }
706  Box( uint32 l, uint32 t, uint32 r, uint32 b ):
707  left(l),
708  top(t),
709  right(r),
710  bottom(b),
711  front(0),
712  back(1)
713  {
714  assert(right >= left && bottom >= top && back >= front);
715  }
727  Box( uint32 l, uint32 t, uint32 ff, uint32 r, uint32 b, uint32 bb ):
728  left(l),
729  top(t),
730  right(r),
731  bottom(b),
732  front(ff),
733  back(bb)
734  {
735  assert(right >= left && bottom >= top && back >= front);
736  }
737 
739  bool contains(const Box &def) const
740  {
741  return (def.left >= left && def.top >= top && def.front >= front &&
742  def.right <= right && def.bottom <= bottom && def.back <= back);
743  }
744 
746  uint32 getWidth() const { return right-left; }
748  uint32 getHeight() const { return bottom-top; }
750  uint32 getDepth() const { return back-front; }
751  };
752 
753 
754 
766  int _OgreExport findCommandLineOpts(int numargs, char** argv, UnaryOptionList& unaryOptList,
767  BinaryOptionList& binOptList);
768 
771  {
778  };
779 
782  {
784  unsigned int width;
785  unsigned int height;
788  };
789 
792 
795 
806  template<typename T>
807  typename T::iterator efficientVectorRemove( T& container, typename T::iterator& iterator )
808  {
809  const size_t idx = iterator - container.begin();
810  *iterator = container.back();
811  container.pop_back();
812 
813  return container.begin() + idx;
814  }
815 
816 #if OGRE_CPU == OGRE_CPU_X86
817  //VS 2012 translates this to a single maxss/maxpd instruction! :)
818  //(plus some memory loading if arguments weren't loaded)
819  inline float min( const float &left, const float &right )
820  {
821  float retVal;
822  _mm_store_ss( &retVal, _mm_min_ss( _mm_set_ss( left ), _mm_set_ss( right ) ) );
823  return retVal;
824  }
825  inline float max( const float &left, const float &right )
826  {
827  float retVal;
828  _mm_store_ss( &retVal, _mm_max_ss( _mm_set_ss( left ), _mm_set_ss( right ) ) );
829  return retVal;
830  }
831  inline double min( const double &left, const double &right )
832  {
833  double retVal;
834  _mm_store_sd( &retVal, _mm_min_sd( _mm_set_sd( left ), _mm_set_sd( right ) ) );
835  return retVal;
836  }
837  inline double max( const double &left, const double &right )
838  {
839  double retVal;
840  _mm_store_sd( &retVal, _mm_max_sd( _mm_set_sd( left ), _mm_set_sd( right ) ) );
841  return retVal;
842  }
843 #else
844  //At least VS 2012 translates this to conditional moves. Using
845  //"const float" instead of "const float&" and becomes a jump
846  inline const float& min( const float &a, const float &b )
847  {
848  return a < b ? a : b;
849  }
850 
851  inline const float& max( const float &a, const float &b )
852  {
853  return a > b ? a : b;
854  }
855 
856  inline const double& min( const double &a, const double &b )
857  {
858  return a < b ? a : b;
859  }
860 
861  inline const double& max( const double &a, const double &b )
862  {
863  return a > b ? a : b;
864  }
865 #endif
866 }
867 
868 #include "OgreHeaderSuffix.h"
869 
870 #endif
Leave the stencil buffer unchanged.
Definition: OgreCommon.h:90
FastArray< Light * > LightArray
Definition: OgreCommon.h:537
HashedVector(const HashedVector< T > &rhs)
Definition: OgreCommon.h:410
VectorImpl::const_reference const_reference
Definition: OgreCommon.h:354
iterator erase(iterator first, iterator last)
Definition: OgreCommon.h:492
TRect & operator=(TRect const &o)
Definition: OgreCommon.h:597
const_iterator end() const
Definition: OgreCommon.h:379
uint32 bottom
Definition: OgreCommon.h:691
uint32 _OgreExport FastHash(const char *data, int len, uint32 hashSoFar=0)
Fast general hashing algorithm.
bool operator==(const HashedVector< T > &b)
Definition: OgreCommon.h:516
uint32 front
Definition: OgreCommon.h:691
Pulse Width Modulation.
Definition: OgreCommon.h:206
ManualCullingMode
Manual culling modes based on vertex normals.
Definition: OgreCommon.h:181
float Real
Software floating point type.
iterator end()
Definition: OgreCommon.h:377
unsigned int uint32
Definition: OgrePlatform.h:420
#define _OgreExport
Definition: OgrePlatform.h:255
std::vector< T, A > type
FastArray< LightClosest > LightClosestArray
Definition: OgreCommon.h:571
Increase the stencil value by 1, wrapping back to 0 when incrementing the maximum value...
Definition: OgreCommon.h:100
vector< LightClosest >::type LightClosestVec
Definition: OgreCommon.h:570
map< String, String >::type NameValuePairList
Name / value parameter pair (first = name, second = value)
Definition: OgreCommon.h:580
FogMode
Fog modes.
Definition: OgreCommon.h:152
T height() const
Definition: OgreCommon.h:609
A hashed vector.
Definition: OgreCommon.h:328
std::string _StringBase
const float & max(const float &a, const float &b)
Definition: OgreCommon.h:851
bool isHashDirty() const
Definition: OgreCommon.h:366
TrackVertexColourEnum
Definition: OgreCommon.h:222
WaveformType
Enumerates the wave types usable with the Ogre engine.
Definition: OgreCommon.h:192
uint32 *RESTRICT_ALIAS visibilityMask
Copy from lights[i]->getVisibilityFlags(), this copy avoids one level of indirection.
Definition: OgreCommon.h:559
uint32 getDepth() const
Get the depth of this box.
Definition: OgreCommon.h:750
Equal to: min=FO_LINEAR, mag=FO_LINEAR, mip=FO_POINT.
Definition: OgreCommon.h:114
void resize(size_type n, const T &t=T())
Definition: OgreCommon.h:505
The filter used when magnifying a texture.
Definition: OgreCommon.h:126
Similar to FO_LINEAR, but compensates for the angle of the texture plane.
Definition: OgreCommon.h:140
LightClosest(Light *_light, size_t _globalIndex, Real _distance)
Definition: OgreCommon.h:548
TRect(TRect const &o)
Definition: OgreCommon.h:593
Equal to: min=FO_POINT, mag=FO_POINT, mip=FO_NONE.
Definition: OgreCommon.h:112
VectorImpl::size_type size_type
Definition: OgreCommon.h:355
Render window creation parameters.
Definition: OgreCommon.h:781
FilterType
Definition: OgreCommon.h:121
An angular wave with a constant increase / decrease speed with pointed peaks.
Definition: OgreCommon.h:197
Set the stencil value to zero.
Definition: OgreCommon.h:92
The filter used when determining the mipmap.
Definition: OgreCommon.h:128
HashedVector(size_type n)
Definition: OgreCommon.h:408
bool contains(const Box &def) const
Return true if the other box is a part of this one.
Definition: OgreCommon.h:739
TRect(T const &l, T const &t, T const &r, T const &b)
Definition: OgreCommon.h:589
Fog density increases linearly between the start and end distances.
Definition: OgreCommon.h:161
Hardware culls triangles whose vertices are listed anticlockwise in the view.
Definition: OgreCommon.h:173
Average of a 2x2 pixel area, denotes bilinear for MIN and MAG, trilinear for MIP. ...
Definition: OgreCommon.h:138
size_type size() const
Definition: OgreCommon.h:389
uint32 getWidth() const
Get the width of this box.
Definition: OgreCommon.h:746
VectorImpl::reference reference
Definition: OgreCommon.h:353
T width() const
Definition: OgreCommon.h:605
reference at(size_type n)
Definition: OgreCommon.h:400
HashedVector(size_type n, const T &t)
Definition: OgreCommon.h:409
Box()
Parameterless constructor for setting the members manually.
Definition: OgreCommon.h:693
const String BLANKSTRING
Constant blank string, useful for returning by ref where local does not exist.
Definition: OgreCommon.h:574
void insert(iterator pos, InputIterator f, InputIterator l)
Definition: OgreCommon.h:473
iterator erase(iterator pos)
Definition: OgreCommon.h:486
const_reverse_iterator rend() const
Definition: OgreCommon.h:388
void swap(HashedVector< T > &rhs)
Definition: OgreCommon.h:456
VectorImpl::iterator iterator
Definition: OgreCommon.h:357
size_type max_size() const
Definition: OgreCommon.h:390
#define RESTRICT_ALIAS
Definition: OgrePlatform.h:448
Equal to: min=FO_ANISOTROPIC, max=FO_ANISOTROPIC, mip=FO_LINEAR.
Definition: OgreCommon.h:118
CullingMode
Hardware culling modes based on vertex winding.
Definition: OgreCommon.h:166
iterator begin()
Definition: OgreCommon.h:371
Holds all lights in SoA after being culled over all frustums.
Definition: OgreCommon.h:555
TRect< Real > RealRect
Structure used to define a rectangle in a 2-D floating point space, subject to double / single floati...
Definition: OgreCommon.h:679
No fog. Duh.
Definition: OgreCommon.h:155
TRect< long > Rect
Structure used to define a rectangle in a 2-D integer space.
Definition: OgreCommon.h:683
reference operator[](size_type n)
Definition: OgreCommon.h:393
HashedVector(InputIterator a, InputIterator b)
Definition: OgreCommon.h:414
Use one weight per vertex when recommended (i.e.
Definition: OgreCommon.h:265
vector< RenderWindow * >::type RenderWindowList
Render window container.
Definition: OgreCommon.h:794
Representation of a dynamic light source in the scene.
Definition: OgreLight.h:70
Structure used to define a box in a 3-D integer space.
Definition: OgreCommon.h:689
void setNull()
Definition: OgreCommon.h:617
uint32 right
Definition: OgreCommon.h:691
VectorImpl::const_reverse_iterator const_reverse_iterator
Definition: OgreCommon.h:360
HashedVector< LightClosest > LightList
Definition: OgreCommon.h:569
Equal to: min=FO_LINEAR, mag=FO_LINEAR, mip=FO_LINEAR.
Definition: OgreCommon.h:116
No filtering, used for FT_MIP to turn off mipmapping.
Definition: OgreCommon.h:134
map< String, String >::type BinaryOptionList
Definition: OgreCommon.h:577
Half of the time is spent at the min, half at the max with instant transition between.
Definition: OgreCommon.h:199
bool empty() const
Definition: OgreCommon.h:392
bool isNull() const
Definition: OgreCommon.h:613
Cull triangles whose normal is pointing away from the camera (default).
Definition: OgreCommon.h:186
reference back()
Definition: OgreCommon.h:437
map< String, bool >::type UnaryOptionList
Definition: OgreCommon.h:576
const_reverse_iterator rbegin() const
Definition: OgreCommon.h:387
ShadeOptions
Light shading modes.
Definition: OgreCommon.h:144
reference front()
Definition: OgreCommon.h:430
Solid polygons are rendered.
Definition: OgreCommon.h:217
Gradual steady decrease from max to min over the period, with an instant return to max at the end...
Definition: OgreCommon.h:203
Box(uint32 l, uint32 t, uint32 ff, uint32 r, uint32 b, uint32 bb)
Define a box from left, top, front, right, bottom and back coordinates.
Definition: OgreCommon.h:727
VectorImpl::difference_type difference_type
Definition: OgreCommon.h:356
void push_back(const T &t)
Definition: OgreCommon.h:444
reverse_iterator rend()
Definition: OgreCommon.h:386
uint32 getHash() const
Get the hash value.
Definition: OgreCommon.h:524
void insert(iterator pos, size_type n, const T &x)
Definition: OgreCommon.h:480
Sphere *RESTRICT_ALIAS boundingSphere
Definition: OgreCommon.h:560
SortMode
Sort mode for billboard-set and particle-system.
Definition: OgreCommon.h:231
Sort by direction of the camera.
Definition: OgreCommon.h:234
std::vector< T, STLAllocator< T, GeneralAllocPolicy > > VectorImpl
Definition: OgreCommon.h:331
const_iterator begin() const
Definition: OgreCommon.h:378
A sphere primitive, mostly used for bounds checking.
Definition: OgreSphere.h:51
Sort by distance from the camera.
Definition: OgreCommon.h:236
Only points are rendered.
Definition: OgreCommon.h:213
FrameBufferType
Defines the frame buffer types.
Definition: OgreCommon.h:240
Standard sine wave which smoothly changes from low to high and back again.
Definition: OgreCommon.h:195
const_reference operator[](size_type n) const
Definition: OgreCommon.h:399
const float & min(const float &a, const float &b)
Definition: OgreCommon.h:846
uint32 getHeight() const
Get the height of this box.
Definition: OgreCommon.h:748
void reserve(size_t t)
Definition: OgreCommon.h:429
Box(uint32 l, uint32 t, uint32 r, uint32 b)
Define a box from left, top, right and bottom coordinates This box will have depth one (front=0 and b...
Definition: OgreCommon.h:706
const double & max(const double &a, const double &b)
Definition: OgreCommon.h:861
Forces an amount of instances per batch low enough so that vertices * numInst < 65535 since usually i...
Definition: OgreCommon.h:252
Gradual steady increase from min to max over the period with an instant return to min at the end...
Definition: OgreCommon.h:201
#define OGRE_FREE_SIMD(ptr, category)
Free the memory allocated with either OGRE_MALLOC_SIMD or OGRE_ALLOC_T_SIMD. Category is required to ...
iterator insert(iterator pos, const T &t)
Definition: OgreCommon.h:461
NameValuePairList miscParams
Definition: OgreCommon.h:787
VectorImpl::reverse_iterator reverse_iterator
Definition: OgreCommon.h:359
uint32 HashCombine(uint32 hashSoFar, const T &data)
Combine hashes with same style as boost::hash_combine.
Definition: OgreCommon.h:66
HashedVector< T > & operator=(const HashedVector< T > &rhs)
Definition: OgreCommon.h:421
InstanceManagerFlags
Flags for the Instance Manager when calculating ideal number of instances per batch.
Definition: OgreCommon.h:247
std::map< K, V, P, A > type
Use a limited number of skeleton animations shared among all instances.
Definition: OgreCommon.h:260
StencilOperation
Enum describing the various actions which can be taken on the stencil buffer.
Definition: OgreCommon.h:87
uint32 top
Definition: OgreCommon.h:691
Decrease the stencil value by 1, clamping at 0.
Definition: OgreCommon.h:98
VectorImpl::const_iterator const_iterator
Definition: OgreCommon.h:358
Fog density increases exponentially from the camera (fog = 1/e^(distance * density)) ...
Definition: OgreCommon.h:157
Hardware culls triangles whose vertices are listed clockwise in the view (default).
Definition: OgreCommon.h:171
Decrease the stencil value by 1, wrapping when decrementing 0.
Definition: OgreCommon.h:102
T::iterator efficientVectorRemove(T &container, typename T::iterator &iterator)
Used for efficient removal in std::vector and std::deque (like an std::list) However it assumes the o...
Definition: OgreCommon.h:807
const_reference back() const
Definition: OgreCommon.h:443
const double & min(const double &a, const double &b)
Definition: OgreCommon.h:856
The filter used when shrinking a texture.
Definition: OgreCommon.h:124
Used as the light list, sorted.
Definition: OgreCommon.h:541
Use the closest pixel.
Definition: OgreCommon.h:136
No culling so everything is sent to the hardware.
Definition: OgreCommon.h:184
SceneMemoryMgrTypes
The types of NodeMemoryManager & ObjectMemoryManagers.
Definition: OgreCommon.h:318
All techniques are forced to one weight per vertex.
Definition: OgreCommon.h:268
const_reference front() const
Definition: OgreCommon.h:436
size_type capacity() const
Definition: OgreCommon.h:391
VectorImpl::pointer pointer
Definition: OgreCommon.h:352
PolygonMode
The polygon mode to use when rasterising.
Definition: OgreCommon.h:210
Increase the stencil value by 1, clamping at the maximum value.
Definition: OgreCommon.h:96
TRect intersect(const TRect &rhs) const
Definition: OgreCommon.h:638
void recalcHash() const
Definition: OgreCommon.h:341
Fog density increases at the square of FOG_EXP, i.e. even quicker (fog = 1/e^(distance * density)^2) ...
Definition: OgreCommon.h:159
TRect & merge(const TRect &rhs)
Definition: OgreCommon.h:621
reverse_iterator rbegin()
Definition: OgreCommon.h:380
ClipResult
Generic result of clipping.
Definition: OgreCommon.h:770
_StringBase String
Definition: OgreCommon.h:53
Wireframe models are rendered.
Definition: OgreCommon.h:215
vector< RenderWindowDescription >::type RenderWindowDescriptionList
Render window creation parameters container.
Definition: OgreCommon.h:791
Invert the bits of the stencil buffer.
Definition: OgreCommon.h:104
TRect< float > FloatRect
Structure used to define a rectangle in a 2-D floating point space.
Definition: OgreCommon.h:674
const_reference at(size_type n) const
Definition: OgreCommon.h:406
FilterOptions
Filtering options for textures / mipmaps.
Definition: OgreCommon.h:131
Hardware never culls triangles and renders everything it receives.
Definition: OgreCommon.h:169
map< String, String >::type AliasTextureNamePairList
Alias / Texture name pair (first = alias, second = texture name)
Definition: OgreCommon.h:583
LightArray lights
Definition: OgreCommon.h:557
CompareFunction
Comparison functions used for the depth/stencil buffer operations and others.
Definition: OgreCommon.h:74
int TrackVertexColourType
An enumeration describing which material properties should track the vertex colours.
Definition: OgreCommon.h:221
Cull triangles whose normal is pointing towards the camera.
Definition: OgreCommon.h:188
int _OgreExport findCommandLineOpts(int numargs, char **argv, UnaryOptionList &unaryOptList, BinaryOptionList &binOptList)
Locate command-line options of the unary form '-blah' and of the binary form '-blah foo'...
VectorImpl mList
Definition: OgreCommon.h:333
Partially clipped.
Definition: OgreCommon.h:775
void addToHash(const T &newPtr) const
Definition: OgreCommon.h:337
VectorImpl::value_type value_type
Definition: OgreCommon.h:351
Everything was clipped away.
Definition: OgreCommon.h:777
TextureFilterOptions
High-level filtering options providing shortcuts to settings the minification, magnification and mip ...
Definition: OgreCommon.h:109
bool operator<(const LightClosest &right) const
uint32 back
Definition: OgreCommon.h:691
Set the stencil value to the reference value.
Definition: OgreCommon.h:94
Light const * light
Definition: OgreCommon.h:543
Nothing was clipped.
Definition: OgreCommon.h:773
uint32 left
Definition: OgreCommon.h:691