Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Mapping collision object with entities

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 juako   Members   

100
Like
0Likes
Like

Posted 26 July 2011 - 04:51 PM

Hi im trying to develop a generic 2d collision system. The system should inform if a collision took place and separate the collision objects(rectangle or circle).
On the other hand i have my game objects,that have a collision objects (composition). Now the problem comes when a collision take palace and i have to know with which game object im colliding, i know the collision object but not the owner(game object).

I could do something dirty and add information about the owner to the collision object but that makes the collision system dependent of the game implementation. I dont know how physics engine solve this problem but i think when you use one you have the same problem of not knowing who owns the collision object.

Any help would be great


#2 Dirk Gregorius   Members   

2707
Like
1Likes
Like

Posted 26 July 2011 - 07:42 PM

Physic engine usually have a concept of user data which is basically a void*. You can attach your game object to the collision shape using this approach

#3 juako   Members   

100
Like
0Likes
Like

Posted 26 July 2011 - 08:57 PM

thanks Dirk Gregorius, that looks like a simple solution. I think i gave it too much thought




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.