Jump to content
Posted 01 August 2012 - 06:32 AM
Posted 01 August 2012 - 06:40 AM
Sorry, but this is the way to go, everything else will be a very painful experience.
I'd like to avoid using a full 3d physics engine since it seems like overkill,
Even when using a phyiscs engine, you can control a character without using forces. In this case you only utilise the collision detection features of a physics engine.
and I'd like to avoid having a physically based character controller.
Projectiles are a very good example of objects which can be simulated with a physics engine.
The projectiles seem like they should be pretty easy to handle to me.
Though this is a valid option, it is still a physics engine (you project the 3d environment on a pseudo 2d environment, still you need collision detection and your projectiles will need special handling).
What I'm not sure about is handling collision detection/response between the player and the level. One idea I had was to use a sort of "navmesh" for determining where the player could walk. I would constrain the player's movement to the "navmesh" by tracking the triangle that they are currently on, and using BFS to find a path to their target location. I'd probably put the navmesh triangles into a grid/octree as well, to aid in finding the starting triangle when the player is spawned, for example. Having the navmesh might also be useful for when I get to NPCs.
Edited by Ashaman73, 01 August 2012 - 06:43 AM.
Posted 01 August 2012 - 07:57 AM
Favourite datatype: unsinged int
Posted 01 August 2012 - 10:54 AM
Which part of Bullet would I use for doing that? It looks like maybe ContactTest mentioned here? https://code.google....acksAndTriggers The issue with only using the collision detection features is that then I have to implement sliding collision myself, and I'm not entirely sure how that would work. A specific issue that comes to mind is how to handle corners where the angle between the walls is acute. Simply pushing the character out of one wall would push them into the other wall. I don't think I would run into that issue with the navmesh which is one of the reasons I was considering it, but the problem there is how to offset the navmesh from the walls.
Even when using a phyiscs engine, you can control a character without using forces. In this case you only utilise the collision detection features of a physics engine
Good to know, thanks.
They *can* also be used for your main character physics, providing you are willing to put up with a lot of limitations. This kind of approach is very valid for e.g. a mobile phone, where you can save yourself a lot of CPU using this approach.
Posted 02 August 2012 - 06:02 AM
Posted 02 August 2012 - 06:31 AM
I understand that, but how would you handle the cases where moving the object out along the normal causes it to collide with something else. For example, if the character tries to move into a corner with an angle of less than 90 degrees. Moving the character out of one wall could push them into the other wall.
Wall sliding is done by moving the colliding object along the collision normal until he stops colliding.
I assume any physics engine gives a collision listener which also feeds the collision "force", which is just the penetration vector's length.