Box collision problems

Blitz3D Forums/Blitz3D Beginners Area/Box collision problems

Robert Cummings(Posted 2007) [#1]
Hi,

I've got sphere to box collision problems. I rotate my box and position it after a call to entitybox and the collision area appears to be stuck where it used to be?


big10p(Posted 2007) [#2]
I don't think collision boxes are rotatable. They have to be axis aligned, I think.

You could always use a proxy mesh (cube) and do collisions against that, instead, using sphere-to-poly collisions. As a cube is only 12 tris, it should be plenty fast enough.


Bankie(Posted 2007) [#3]
The collision box does rotate with the entity automatically. Perhaps if you post some code, someone will be able to shed some light.


Shambler(Posted 2007) [#4]
UpdateWorld() ?


Robert Cummings(Posted 2007) [#5]
The collision box does rotate with the entity automatically. Perhaps if you post some code, someone will be able to shed some light.
Ah good so long as they can be rotated and positioned after being applied. I'll blame my own code and take a further look.


Stevie G(Posted 2007) [#6]
Using positionentity does actually envoke collision detection as it moves the entity from 0,0,0 to the new position. To prevent this use hideentity before positioning and showentity after or use ResetEntity after positioning.

Stevie


Robert Cummings(Posted 2007) [#7]
Thank you steve, lots of tricky little gotchas.


Stevie G(Posted 2007) [#8]
Yip, I gave up on my first racing game as a result of that one ... couldn't figure out why the wheels started under the track while the car on top ... eventually figured it out though ;)

p.s I don't think box collisions rotate with the entity .. may be wrong. Remember to define entity box correctly. A box of 2x2x2 should be defined as entitybox MyBox, -1,-1,-1,2,2,2.


Robert Cummings(Posted 2007) [#9]
it's all sort of working -- and they work rotated, surprisingly! thanks for help everyone.