B3D collision & Line pick with Physics Library

Blitz3D Forums/Blitz3D Programming/B3D collision & Line pick with Physics Library

RustyKristi(Posted 2016) [#1]
I was wondering how I can setup blitz3d's collision linepicking with a physics library. For example, hitting an object with linepick and make it react.

I still would like to use b3d collision and linepicking on most parts and have the external physics work on particular entities.


Guy Fawkes(Posted 2016) [#2]
If you mean the animated line pick, ask Remi. He knows EVERYTHING! =D XD


Naughtical(Posted 2016) [#3]
How do you ask a certain person something though? Is that a thing on the blitz forums?


RemiD(Posted 2016) [#4]
Of course you can use linepick and pickables and a physics system at the same time.
By "pickables" i mean the low details meshes, that you will pick (which can be not rendered by setting their alpha to 0)

If you want to pick a physics body, the idea is to use the same low details shape for the body and for the pickable, for example you could have the physics engine update the behavior of the body and then either set this mesh as pickable, or position rotate another low details mesh (the same shape) (with alpha 0) at the same position with the same orientation.

The linepick is a vector with a start point and a direction and a length, and the result of the pick will give you the picked point and the picked normal (if something is picked).
With these infos, you can add a force to the body which corresponds to the vector direction and length. (or you can only use the direction and add the force you want, hence the usefulness of a normalised vector)

I know that with Bullet physics system there are some functions to add a force, and there are also some functions to cast a ray (which probably will give you the same results than linepick)

Open the decls file with a text file and you can see all the functions...
search for
"Ray"
"Force"


RustyKristi(Posted 2016) [#5]
Thanks RemiD, I'm thinking about using miniODE by Yasha as it looks less complicated. I'm not sure if it would work though with its current feature set. Bullet is another good library that I'm looking into.


Rick Nasher(Posted 2016) [#6]
Why is no one using the PhysX wrapper instead? I think it has some pretty nice stuff and is free.


RustyKristi(Posted 2016) [#7]
PhysX wrapper is nice but the sdk version for that wrapper is outdated, so you have to force your users to install that specific sdk for the dll to work.