[Questions] Collision with projectiles

NoodlesOnMyBack

27-03-2008 02:20:31

Im creating a multiplayer game wich consist of players fighting each other on a map with bows throwing arrows, when i hit other players they get into ragdoll mode and drop dead, this is working fine, but i want to have a more accurate collision information, actually this is not the only problem:

1>The primitives surrouding the characters looks nice for ragdolls physics, but not to make the collision look accurate.Say i want to make sure that the arrow is hitting the mesh and not the actor, so i can atach it to it.
Also i want to have speciffic information as areas of body, as headshot or torso hit, etc etc.

2>So whats the best way of doing this? It came to my mind to have some bounding boxes around the limbs (separate from the actors of course) and make a subcheck if any of the arrows enter those primitives and make a raycasting inside that bounding box to see if the arrow REALLY touch the mesh.

3>Another problem is that the arrow its just a small projectile and not really an arrow, so i want to create a custom projectile that looks like an arrow because i must have total control over the trajectory, and allways looking straight forward.

So, any thoughts will be very much appreciate it, and btw thanks in advance for the previous help from different people specially to betajaen.

NoodlesOnMyBack

09-04-2008 18:21:18

Sorry to bump this thread, but anyone have experience with this? come on
im just looking for suggestions really, not actual code, basically an idea of how to get a precise collision detection with ragdolls

reptor

09-04-2008 23:16:17

I don't have a solution, but I say I am interested to hear what it would be.

I was also thinking about this. Haven't used ragdolls yet, but this problem came to my mind quickly when looking at how ragdolls are done.

fassihi

10-04-2008 09:56:39

How about using Trimesh for the physical representation of your models? It is performance wise costly though.

Or maybe once you know something is going to hit, do the final raycasting in OGRE to see if it hits the mesh, check out raycasting to the polygon level in OGRE wiki.

betajaen

10-04-2008 10:43:23

You could always have a very thin capsule shape attached to a kinematic actor you would move it as you want to.

Another way is just to let PhysX handle it, it may behave more like a dumb missile and probably or won't have any special air effects but I wouldn't imagine if it's noticeable. Oblivion has arrows in it's game and it appears it uses the second option along with sweeping

Like how the Character Controller works you could use a sweep (a bit like a intersection but along a specific path) which will tell you if it will hit something and where. From that you could decide if the arrow should penetrate (flesh or wood) or bounce off (stone or metal armor). For penetration obviously an Actor will not do that, so at the point it collides with the other actor quickly switch it to kinematic and just carry on inwards otherwise for bouncing off just leave it as it is.