| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
#pragma once |
| 6 |
|
| 7 |
JPH_NAMESPACE_BEGIN |
| 8 |
|
| 9 |
|
| 10 |
enum class EAllowedDOFs : uint8 |
| 11 |
{ |
| 12 |
None = 0b000000, |
| 13 |
All = 0b111111, |
| 14 |
TranslationX = 0b000001, |
| 15 |
TranslationY = 0b000010, |
| 16 |
TranslationZ = 0b000100, |
| 17 |
RotationX = 0b001000, |
| 18 |
RotationY = 0b010000, |
| 19 |
RotationZ = 0b100000, |
| 20 |
Plane2D = TranslationX | TranslationY | RotationZ, |
| 21 |
}; |
| 22 |
|
| 23 |
|
| 24 |
constexpr EAllowedDOFs operator | (EAllowedDOFs inLHS, EAllowedDOFs inRHS) |
| 25 |
{ |
| 26 |
return EAllowedDOFs(uint8(inLHS) | uint8(inRHS)); |
| 27 |
} |
| 28 |
|
| 29 |
|
| 30 |
constexpr EAllowedDOFs operator & (EAllowedDOFs inLHS, EAllowedDOFs inRHS) |
| 31 |
{ |
| 32 |
return EAllowedDOFs(uint8(inLHS) & uint8(inRHS)); |
| 33 |
} |
| 34 |
|
| 35 |
|
| 36 |
constexpr EAllowedDOFs operator ^ (EAllowedDOFs inLHS, EAllowedDOFs inRHS) |
| 37 |
{ |
| 38 |
return EAllowedDOFs(uint8(inLHS) ^ uint8(inRHS)); |
| 39 |
} |
| 40 |
|
| 41 |
|
| 42 |
constexpr EAllowedDOFs operator ~ (EAllowedDOFs inAllowedDOFs) |
| 43 |
{ |
| 44 |
return EAllowedDOFs(~uint8(inAllowedDOFs)); |
| 45 |
} |
| 46 |
|
| 47 |
|
| 48 |
constexpr EAllowedDOFs & operator |= (EAllowedDOFs &ioLHS, EAllowedDOFs inRHS) |
| 49 |
{ |
| 50 |
ioLHS = ioLHS | inRHS; |
| 51 |
return ioLHS; |
| 52 |
} |
| 53 |
|
| 54 |
|
| 55 |
constexpr EAllowedDOFs & operator &= (EAllowedDOFs &ioLHS, EAllowedDOFs inRHS) |
| 56 |
{ |
| 57 |
ioLHS = ioLHS & inRHS; |
| 58 |
return ioLHS; |
| 59 |
} |
| 60 |
|
| 61 |
|
| 62 |
constexpr EAllowedDOFs & operator ^= (EAllowedDOFs &ioLHS, EAllowedDOFs inRHS) |
| 63 |
{ |
| 64 |
ioLHS = ioLHS ^ inRHS; |
| 65 |
return ioLHS; |
| 66 |
} |
| 67 |
|
| 68 |
JPH_NAMESPACE_END |