Collisions problems

Blitz3D Forums/Blitz3D Programming/Collisions problems

jtassinari(Posted 2008) [#1]
Hi there,

i have a little problem with Blitz3D internal Collisions scripting.
I'm doing a little test to improve my skills, and, well, i need help =)

The basic fact:

graphics3D...
Cam...
Light...
Pivot...

P = sphere (12)
G = cube ()
scale g, 5, .5, 5

entitytype P, TCha
entitytype G, TScen
collisions TChar, TScen, 2, 2

while not keydown(ESC)
Fake-gravity applied at P -.1 on y
...
if keydown(30) then rX# = rX# - .2
if keydown(32) then rX# = rX# +.2
....
TurnEntity g, rX#, 0, rZ#
...
updateworld
renderworld
flip
wend


when the script start, the collisions stops the Sphere on the Cube, but when i make the Cube rotate along X or Z, the sphere pass thru the main Cube.
Am i doing (or missing) something?
any suggestion?

thanks indeed,

JTassinari
-[ http://www.absolute-line.net ] -


IPete2(Posted 2008) [#2]
You are doing nothing wrong. Blitz collisions aren't really meant to handle moving collisions.

Moving collisions such as this and in particular rotation collisions should really be handled by using one of the many (and very nice) physics libraries which integrate with B3d.Check out the toolbox, Vipr has a great library but there are others too, such as Ageia and Newton.

Otherwise you could look through the code archives and find some code which would do this more slowly.

IPete2.


jtassinari(Posted 2008) [#3]
Thanks IPete2 for the fast and clear reply,

let me ask u one more think.
Is there any of these libs, that you know, that could handel non "basic" shapes?
I mean, to detect a collision amog a 3ds or b3d shape and a sphere for instance?

thansk indeed,

cheers,

JTassinari
-[ http://www.absolute-line.net ] -


IPete2(Posted 2008) [#4]
Yes -

I believe that all of them can - not sure about animated meshes though - for skinned rigged and animated character models you'd probably be better using a second sphereical collision shape which was invisible, positioned in the same place as the character (character has no collision, sphere collides with any other objects in level).

The best advise is always found with the people who create the software library - so email them and ask for advise.

IPete2.