Archived

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

Positions

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

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 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?

Share on other sites
Hey,
coelurus what does creatDesination do in your code?
Thanks

Share on other sites
Hey,
coelurus what does creatDesination do in your code?
Can you explain your code more.
Thanks

Share on other sites
Try to add the velocity vector to the vertices before doing the collision detection.

1. 1
2. 2
Rutin
21
3. 3
JoeJ
17
4. 4
5. 5

• 37
• 23
• 13
• 13
• 17
• Forum Statistics

• Total Topics
631705
• Total Posts
3001823
×