Collisions and meshes?
Blitz3D Forums/Blitz3D Beginners Area/Collisions and meshes?
| ||
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! |
| ||
Hi. http://www.blitzbasic.com/b3ddocs/command.php?name=Collisions |
| ||
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 |
| ||
The problem with normal collisions is that it makes the center of the mesh collide able, but not the map itself. |
| ||
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. |
| ||
Yeah, if the player has an EntityRadius() set, then Collisions(PlayerType,TerrainType,2,2) should do the trick. |