Because this thread deserved its answers, even if @practicing01 lurks…
#include <Urho3D/Container/FlagSet.h>
enum class Flag : unsigned int {
none = 0
, env = (1 << 0), obj = (1 << 1), character = (1 << 2), particle = (1 << 3), projectile = (1 << 4)
, all = Urho3D::M_MAX_UNSIGNED
};
/* bit shift expression to binary (digits presumably corresponding to editor checkboxes)
1 << 0 == 000001 (01)
1 << 1 == 000010 (02)
1 << 2 == 000100 (04)
1 << 3 == 001000 (08)
1 << 4 == 010000 (16)
1 << 5 == 100000 (32)
*/
// Using Urho3D FlagSet without macros.
namespace Urho3D {
/// Type trait which enables Enum to be used as FlagSet template parameter. Bitwise operators (| & ^ ~) over enabled Enum will result in FlagSet<Enum>.
template<> struct IsFlagSet<ObjectLayer> {
inline static constexpr bool value_ = true;
};
}
using Flags = Urho3D::FlagSet<Flag>;
// ...
// Raycast query for not character or particle or pickup or projectile.
Flags viewMask(~(Flag::character|Flag::particle|Flag::pickup|Flag::projectile));
RayOctreeQuery query(results, revRay, RAY_TRIANGLE, distance, DRAWABLE_GEOMETRY, viewMask);