Quaamik, on 09 February 2016 - 05:56 PM, said:
Then why not raise the height of the invisible pill shaped collider for each mech by some amount determined by how high you want it to appear to be able to step? While I'm not a coder, that seems the simplest solution.
The problem is the player rests on that pill-shaped collider, so if you were to raise it up, then the mech's feet would sink into the ground.
Troutmonkey, on 09 February 2016 - 08:07 PM, said:
LBX yes, Machine guns no. They are hit scan and thus don't have any "bullets" to track.
As for collisions it's much cheaper to check if something has collided at all than it is to check at what angle the collision occurred at. Especially when it come to complex geometry that might have multiple collision points
Really? I hadn't noticed that. I'll be sure to pay attention next time I use a machine gun.
I don't have a ton of experience with collisions. Most of my knowledge comes from using them in Unity. When there is a collision, there is a structure that contains a bunch of info about the collision and the programmer can use it as he or she sees fit. However, I'm pretty sure all of that is happening behind the scenes whether or not the script asks for that information.
Checking where a collision takes place isn't that hard, though. You just to an inverse transform on the world coordinates to turn them into local space, and then work from there. Admittedly, I don't know the math behind this, so it could actually be pretty hard. I'm spoiled because it's easy to just call a method in an API and let the unicorns do their thing.
Anyway, the easiest thing to do is use simple colliders, just a bunch of them set up to approximate the shape of the model. As soon as you bring mesh-based colliders into the mix things start to get weird, which I'm pretty sure PGI has been abusing in their maps. It also helps if the level designed understands the limitations of the engine and maps accordingly.
If you are referring to the player ground-detection collision, then I'm pretty sure all that info is there for the taking, just like it is in Unity. All you need to do is check the collisions that take place and look at the angles of the normals to determine if you're touching something you can stand on (too steep, can't stand on it). I can't imagine it's that expensive, but again I don't know the math behind the curtain.
Edited by Product9, 12 February 2016 - 06:05 AM.