Night Elf
23-01-2007 14:18:32
I've subclassed BasicRayCast like this:
This class filters bodies based on their body type. The problem is that BodyTypeFilteredRayCast::userPreFilterCallback never gets called, Raycast::userPreFilterCallback is called instead... Am I doing something wrong?
class BodyTypeFilteredRayCast : public OgreNewt::BasicRaycast
{
private:
int _bodyType;
public:
BodyTypeFilteredRayCast(int bodyType, const OgreNewt::World* world, const Ogre::Vector3& startpt, const Ogre::Vector3& endpt)
: BasicRaycast(world, startpt, endpt), _bodyType(bodyType) { }
bool userPreFilterCallback(OgreNewt::Body* body);
};
bool BodyTypeFilteredRayCast::userPreFilterCallback(OgreNewt::Body* body)
{
int bodyType = body->getType();
return bodyType == _bodyType;
}
This class filters bodies based on their body type. The problem is that BodyTypeFilteredRayCast::userPreFilterCallback never gets called, Raycast::userPreFilterCallback is called instead... Am I doing something wrong?