Archived

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

flashlaser

Positions

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) {
updateBounding(dst);
createDestination(car.position, temp);
updateCar(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