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 Professional Discussion / Object Collision Positioning

Author
Message
APEXnow
Retired Moderator
23
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 3rd May 2003 20:35
Now that I've finally got somewhere with BSP management and collision, I wanted to know whether my assumptions about object collision are correct or not.

If I had an object such as a sphere placed at the world origin (0, 0, 0) and a BSP platform, or floor, 1 unit below the sphere, moving the sphere down two units obviously creates a collision condition. The thing is that if during one frame cycle, I move this sphere down two units, the sphere's actual position is 1 unit below the platform. Am I right in assuming that the sphere's new position is only updated when the frame is refreshed or SYNC'd.

Also, if the sphere is actually touching, or intersecting the platform, does BSP COLLISION HIT only return true if the sphere is moved, in otherwords if a call to:

POSITION OBJECT 1, OBJECT POSITION X(1), OBJECT POSITION Y(1) - fGravity, OBJECT POSITION Z(1)

..and fGravity is Zero, meaning that the sphere isn't actually moved, does COLLISION HIT return True?

I've been testing these assumptions to see that my understanding of the collision commands are correct or incorrect, but having feed back from people who have used them in real situations is extremely helpful.
"Man who looses key to woman's appartment...... He get no nookie" - A wise chinese man.
APEXnow
Retired Moderator
23
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 4th May 2003 01:53
.. Well, after test after test etc. I'm finally beginning to understand it. Have to say, what would really be a nice feature of DBPro is if there were a command that would return the Normal vector of the collided surface of the BSP geometry. I think that this could actually be achieved by calculating the vector from the center of an object to it's collision point and then using three intersecting line of site lines in the same direction. Using the three intersected points would be able to calculate the line perpendicular to the BSP surface.

Anybody already tried this?

"Man who looses key to woman's appartment...... He get no nookie" - A wise chinese man.
APEXnow
Retired Moderator
23
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 4th May 2003 02:34
Ok, for those of you interested, I will plan to create a test application which will simulate a bouncing ball which utilizes BSP collision. This can easily be achieved with normal object collisions but BSP collisions is a slightly different matter. The trick is to know what the normal vectors are for faces collided with the ball. I've a pretty good idea how it can be done. Once I've written the program, I will post it here or in the code snippets forum. I need to ensure that I supply the BSP aswell so that people don't have trouble creating their own.

Any thoughts on the above entries are welcome and obviously benefitial for other users

"Man who looses key to woman's appartment...... He get no nookie" - A wise chinese man.
APEXnow
Retired Moderator
23
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 4th May 2003 14:18
D'know, I must be on drugs or something, only occured to me last night that you can determine the surface normal by obtaining the vector from the centre of the collision sphere to the actual collision point and then reversing the vector signs and then making it a unit vector. Thats the same thing aint it?

"Man who looses key to woman's appartment...... He get no nookie" - A wise chinese man.

Login to post a reply

Server time is: 2026-07-11 04:23:08
Your offset time is: 2026-07-11 04:23:08