Hi! This is a simple issue i have but i can not solve it yet...
I have a class which has an atlas sprite.
When creating the box2d body/shape i add the whole instance of the class as userData (as opposite as in every example i have seen that the sprite is used as userData)
Now i would have to change the stpe function to get the atlasSprite FROM the whole class:
AtlasSprite* myActor = (AtlasSprite*)b->GetUserData();
it should be something like:
AtlasSprite* myActor = (AtlasSprite*)b->GetUserData()->mySprite;
AtlasSprite* myActor = (AtlasSprite*)b->GetUserData().mySprite;
(i get: error: request for member 'mySprite' in 'b-> b2Body::GetUserData()', which is of non-class type 'void*'
)
Neither of them works... how would i do that?
Thanks!