Sign in to follow this  

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

This topic is 2667 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

This topic is 2667 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this