OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SSE2/Single/OgreBooleanMask.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 
29 #ifndef __SSE2_BooleanMask_H__
30 #define __SSE2_BooleanMask_H__
31 
32 #ifndef __BooleanMask_H__
33  #error "Don't include this file directly. include Math/Array/OgreBooleanMask.h"
34 #endif
35 
36 namespace Ogre
37 {
38  class BooleanMask4
39  {
40  public:
41  enum
42  {
43  MASK_NONE = 0,
44  MASK_X = 1,
45 
46  MASK_Y = 2,
47  MASK_XY = 3, //MASK_X|MASK_Y
48 
49  MASK_Z = 4,
50  MASK_XZ = 5, //MASK_X|MASK_Z
51  MASK_YZ = 6, //MASK_Y|MASK_Z
52  MASK_XYZ = 7, //MASK_X|MASK_Y|MASK_Z
53 
54  MASK_W = 8,
55  MASK_XW = 9, //MASK_X|MASK_W
56  MASK_YW =10, //MASK_Y|MASK_W
57  MASK_XYW =11, //MASK_X|MASK_Y|MASK_W
58  MASK_ZW =12, //MASK_Z|MASK_W
59  MASK_XZW =13, //MASK_X|MASK_Z|MASK_W
60  MASK_YZW =14, //MASK_Y|MASK_Z|MASK_W
61  MASK_XYZW =15, //MASK_X|MASK_Y|MASK_Z|MASK_W
62 
63  NUM_MASKS =16
64  };
65  private:
66  static const ArrayMaskR mMasks[NUM_MASKS];
67  public:
68  inline static ArrayMaskR getMask( bool x, bool y, bool z, bool w );
69  inline static ArrayMaskR getMask( bool booleans[ARRAY_PACKED_REALS] );
70 
72  inline static bool allBitsSet( bool mask0[4], bool mask1[4] );
73 
79  inline static uint32 getScalarMask( ArrayMaskR mask );
80 
81  inline static uint32 getScalarMask( ArrayInt mask );
82  };
83 }
84 
85 #include "OgreBooleanMask.inl"
86 
87 #endif
bool ArrayMaskR
unsigned int uint32
Definition: OgrePlatform.h:420
static uint32 getScalarMask(ArrayMaskR mask)
Converts a SIMD mask into a mask that fits in 32-bit number.
#define ARRAY_PACKED_REALS
static bool allBitsSet(bool mask0[1], bool mask1[1])
Returns true if alls bit in mask0[i] and mask1[i] are set.
static ArrayMaskR getMask(bool x)
static const ArrayMaskR mMasks[NUM_MASKS]
uint32 ArrayInt