Skip to main content
gamedev.net
🔒 Locked

Positions

Started by flashlaser Oct 19, 2001 at 8:46 AM 3 replies 200+ views
Original Post
flashlaser
flashlaser
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
coelurus
coelurus
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!
flashlaser
flashlaser
Hey,
coelurus what does creatDesination do in your code?
Thanks
flashlaser
flashlaser
Hey,
coelurus what does creatDesination do in your code?
Can you explain your code more.
Thanks

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.