Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.



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

Since no one understood my collision detection problem I have made a site with pictures, etc. The pictures are big and might take long to load. Plz check it out and if you can help me.:-) The url is - http://home.iprimus.com.au/laser1/help.htm

Share this post

Link to post
Share on other sites
I''m not working with DirectX, but I''ll try give some tips on this (haven''t replied to you before...).

Since it really is a 2D game (3D only to give some virtual depth), why not use only 4 vertices to bounding box?

You say you have the bounding box, but you still don''t use it. A nice loop, calculatong the destination for each bounding vertex and making the collision detection... I don''t see where it all fails:

// Bounding vertices (source - destination)
vertex src[4], dst[4];
// Result flag
char result = 1;
// Destination of car
vertex temp;

// Loop through them all!
for (i = 0; i < 4; i++) {
createDestination(src, &dst[i]);
if (intersect("how you know use this...")) then result = 0;

if (result) {
createDestination(car.position, temp);

This should overcome the problem with different signs, right? In any case, try to avoid that. Only use the positive part of the space. All you have to do is save all data (car, houses etc) with positive values, or?

Hope this will turn away from the read of crazyness onto the road of happiness instead!

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
Try to add the velocity vector to the vertices before doing the collision detection.

Share this post

Link to post
Share on other sites

  • 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!