1 int SmashPcItem::PlayerCollision(cpArbiter *arb, struct cpSpace *space, void *data) 2 { 3 SmashPcItem *pItem; 4 SmashPcPlayer *pPlayer; 5 cpShape *pItemShape, *pPlayerShape; 6 cpArbiterGetShapes(arb, &pItemShape, &pPlayerShape); 7 8 pPlayer = reinterpret_cast(pPlayerShape->data); 9 pItem = reinterpret_cast(pItemShape->data); 10 11 // We have the player that hit, and the item he hit 12 pItem->NotifyHit(pPlayer); 13 14 }