Collisions and meshes?

Blitz3D Forums/Blitz3D Beginners Area/Collisions and meshes?

kantuno(Posted 2015) [#1]
I used maplet to create the interior to a building. How can I make collisions with the walls so you can't just walk right out of the wall? Thanks!


Yue(Posted 2015) [#2]
Hi.

http://www.blitzbasic.com/b3ddocs/command.php?name=Collisions


RemiD(Posted 2015) [#3]
To detect obstacles and reposition an entity so that it does not go through an obstacle, you can use linepicks and pickables (see entitypickmode(), linepick(), pickedentity()) or the Blitz3d collision system with ellipsoids and collidables (see entityradius(), entitytype(), collisions(), countcollisions(), collisionentity())

For a simple example with the Blitz3d collision system :
http://www.blitzbasic.com/codearcs/codearcs.php?code=3141


kantuno(Posted 2015) [#4]
The problem with normal collisions is that it makes the center of the mesh collide able, but not the map itself.


RemiD(Posted 2015) [#5]
With Blitz3d collision system you have the choice to have collision detection and response between :
ellipsoid and ellipsoid
ellipsoid and box
ellipsoid and mesh

so usually, the turning moving entities (characters, vehicles, projectiles) use one or several ellipsoids, and the static entities (terrain, trees, rocks, buildings, furnitures, machines, etc...) use low tris meshes.


Irvau(Posted 2015) [#6]
Yeah, if the player has an EntityRadius() set, then Collisions(PlayerType,TerrainType,2,2) should do the trick.