Raycasting with Filtering - is this possible?

This is my callback
Code:
// This class captures the closest hit shape.
class RayCastCallback : public b2RayCastCallback
   {
   public:
      RayCastCallback()
      {
         m_fixture = NULL;
      }
      
      float32 ReportFixture(   b2Fixture* fixture, const b2Vec2& point, const b2Vec2& normal, float32 fraction)
      {
         m_fixture = fixture;
         m_point = point;
         m_normal = normal;
         
         return fraction;
      }
      
      b2Fixture* m_fixture;
      b2Vec2 m_point;
      b2Vec2 m_normal;
   };


This function returns the first body the raycast hits... however I would like to add a mask to the raycast
so it behaves like filter masks ie

uint16 rayMask = levelCat | playerCat | enemyCat;

... only test ray against level, player and enemy categories as I might have bodies doing other tasks i dont want to test against

Code:
b2Body* RayCast(float x1, float y1 , float x2, float y2)
{
   
   // Ray points
   b2Vec2 p1(x1/UNIT, y1/UNIT);
   b2Vec2 p2(x2/UNIT, y2/UNIT);
   
   // Get callback
   RayCastCallback callback;
   world->RayCast(&callback, p1, p2);
   
   // Gets first shape only
   b2Fixture *fixture = callback.m_fixture;
   if (fixture != NULL)
   {
      return fixture->GetBody();
   }
   return NULL;
}


Any suggestions are gratefully recieved as my tinkering here seems to only make things worse.
Erin provides a good example here: viewtopic.php?f=3&t=4343
Thank you, I did search but just didn't see that one.

Original thread: https://box2d.org/forum/viewtopic.php?t=4487