spacegaier
09-07-2008 21:07:13
Hello,
I'm implementing a CharacterHitReport. If my character hits an item, the item shall change the colour. But how can I identify which item was hit.
I can check via the ActorGroup that is given by the onActor() funtion whether the hit actor is an item (as all items are in the same group), but how can I get now the item to call the cangeItemColour() function?
PS: Sorry for the bad title, but I don't find a better one.
I'm implementing a CharacterHitReport. If my character hits an item, the item shall change the colour. But how can I identify which item was hit.
I can check via the ActorGroup that is given by the onActor() funtion whether the hit actor is an item (as all items are in the same group), but how can I get now the item to call the cangeItemColour() function?
class CPlayerHitReporter : public NxOgre::CharacterHitReport
{
public:
NxOgre::CharacterHitReport::Response onActor(NxOgre::Character *, NxOgre::Actor *actor, NxOgre::Shape *, NxOgre::ActorGroup *actorGrp, const NxControllerShapeHit &)
{
if(actorGrp->getName() == "ItemGrp")
{
// Change colour here //
}
}
private:
};
PS: Sorry for the bad title, but I don't find a better one.