Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Rotated Collision Help please!

Author
Message
SlayrUK
20
Years of Service
User Offline
Joined: 10th Apr 2005
Location:
Posted: 15th Apr 2005 05:55
Hi,

I have a simple maze, made up of long, thin boxes to mark the 3D walls. I want to add collision detection so that your maze vehicle cannot go through the walls (obviously!)

However, i've been having some problems. I made the level editor OK and the maps now position fine in the game - but I cannot get collision to work.

Some boxes are rotated slightly to add diagonal coridors or awkard shaped corners - so its not just all left and rights! I used the YRotate command to do this - this is done before the main loop as during the gameplay, these walls do not rotate.
When adding collision or making a collision box, it seems that the detection isn't accounting for this rotation. In fact, I can sometimes hit a rotated wall in the position it would be without the rotation - and this is not good!

So how can I add collision to work and take into account my Yrotations of some walls? Anyone have any code or ideas on how to achieve this.

Thanks guys!

SlayrUK
20
Years of Service
User Offline
Joined: 10th Apr 2005
Location:
Posted: 17th Apr 2005 06:19
So im the only one whos ever had to use collision in a game with a rotated object?

Please, does anyone know how to do this- I would have thought its a common question.

Thanks and sorry for sounding impatient- this one has got me confused tho.

Login to post a reply

Server time is: 2025-05-23 10:50:26
Your offset time is: 2025-05-23 10:50:26