Jump to content
  • Advertisement
Sign in to follow this  
Spa8nky

[C#] Overwriting entries in a list based on classes.

This topic is 2975 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've been writing down some ideas for my collision/response process and I've come up with the following.

- Quadtree/Octree tests all pairwise collisions (Object 'A' vs Object 'B')
- If the time of collision is soonest for both 'A' AND 'B' then store contact in a list, otherwise don't store the contact data
- For each contact data stored in the list, 'A' reacts to collision and 'B' reacts to collision

I've come unstuck when it comes to overwriting contact data stored in the list though and would like some help. Because the closest time is always stored, how can I overwrite the current closest contact time if one of the objects hits another object sooner in a later pairwise test?

E.g.

'A' collides with 'B' at time 0.8, collision data for the pair is stored in a list.

In a later pairwise test during the same frame 'A' collides with 'C' at time 0.4.
Now the entry for 'A' and 'B' must be erased and replaced with 'A' and 'C'.

Is my idea for the collision process sound in your view?

Thank you.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!