Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Mapping collision object with entities


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   -  Reputation: 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


Sponsor:

#2 Dirk Gregorius   Members   -  Reputation: 817

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   -  Reputation: 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.



PARTNERS