ODECollision-How to differentiate between diff types of obj?

I’m having problems with Collision Detection using ODE in C++ and Panda3D.

My current code can check if any 2 objects have collided and then do an action.

But how can I make it such that I can do different actions for different types of objects?

e.g if the player collides with an item, the item disappears but if he collides with an enemy, the player will disappear instead.

Here is my current code for collision

void myNearCallback (void *data, dGeomID o1, dGeomID o2){
    simpleWorldState* GameWorld;
    GameWorld = reinterpret_cast<simpleWorldState*>(data);
    const int N = 100;
    dContactGeom contact[N];
    int n;
    n = dCollide(o1,o2,N,contact,sizeof(dContactGeom));
    if (n > 0) { //collision!
      std::cout << "Collision!!" << std::endl;
      GameWorld->collided = true;
      //Get the item Id
      unsigned int* n = reinterpret_cast<unsigned int*>(dGeomGetData(o1));
      if (!(*n)) { 
        n = reinterpret_cast<unsigned int*>(dGeomGetData(o2));
      GameWorld->itemCollided = *n;
// In another update function
void updatePhysics(float dt,simpleWorldState& GameWorld){    	
    GameWorld.collided = false;
    //remove the item if there was collision
    if (GameWorld.collided){		
      item* tItem = gameItems[GameWorld.itemCollided];

ODE is not part of panda you noe…?
But here is how i did it, set an Id for each geom and make sure they are all different. dGeomSetData (<>, <>); Then when you detect collision you can check if n is which id, then code accordingly.

Don’t say that too quickly. There is an ODE directory in panda3d source, and I´ve heard they were implementing ODE into Panda3d a few months ago. I don’t know the status of implementing that, though.