Not sure if this is a bug or it was intended this way but
Inside CSceneCollisionManager, the method
void getPickedNodeBB(...)
if you have an octTree game Level, this method will almost always pick the octTree as the closest (when in fact it is not) and the collision detection then doesn't work very well.
i personally just turned it off at the end of the method but that's a pretty bad implimentation, but i thought you guy might want to take notice of it.
if(current->getType() != 7)
if (distance < outbestdistance)
{
outbestnode = current;
outbestdistance = distance;
}
Inside CSceneCollisionManager
Inside CSceneCollisionManager
irrlicht game character project
http://picasaweb.google.com/juliusctw/FinishedArt
http://picasaweb.google.com/juliusctw/FinishedArt
If the camera is inside a box, then that box will likely be picked first. That is why you have the bitmask parameters. You can tell the scene manager which nodes, or node types, that you want to exclude from picking.
All you need to do is specify a bit that indicates nodes that are pickable, and set the id for nodes that you want to be pickable to include this bitmask. Remove the bit from nodes that you don't want to be pickable.
Another thing that you could do would be to apply the scene node filter patch that I wrote up a while back. It allows more fine grained control over the scene nodes that are pickable.
Travis
All you need to do is specify a bit that indicates nodes that are pickable, and set the id for nodes that you want to be pickable to include this bitmask. Remove the bit from nodes that you don't want to be pickable.
Code: Select all
#define PICKABLE 0x800000000
// set node1 to be pickable
node1->setID(node1->getID() | PICKABLE);
// set node2 to not be pickable
node2->setID(node2->getID() & ~PICKABLE);
// select from the pickable nodes
scene::ISceneNode* picked =
cmgr->getSceneNodeFromScreenCoordinatesBB(mouse, PICKABLE);
Travis
Check out this thread here. It explains alot about using Bitmasks to pick objects.