[ODE] FPS Player again
Megan Fox
shalinor at gmail.com
Tue Aug 8 08:14:16 MST 2006
Simple way of handling all of this: collision spaces.
In my engine, I built a system wherein you could:
1.) Create a space (it gave back a handle rather than the actual
SpaceID, because I persist this data out)
2.) Define what other spaces that space collides with
3.) Add any geom to any created space
So I throw all of my trimesh / static world geometry into space 0.
Space 1 has become my catch-all for dynamic objects. Collisions
happen between 0 and 1. I throw "hit volumes" into space 2, and
weapon volumes into space 3. In my game, only spaces 2 and 3 collide
- they don't collide with 0 or 1.
Space 1 also contains a player's "physical volume" - which I create as
a floating cylinder large enough to encompass most of their
animations.
For an FPS, you'd put your "bullet rays" into space 3 instead of
weapon volumes (I had a melee combat system going), but the concept is
identical.
I also hand all of my geoms a user data structure that includes,
amongst other things, an ID vlaue. I use that ID value to label a
given volume as a "head", or as a "leg", and I make sure my ragdoll
volumes have the appropriate names per limb. This is how I get near
per-pixel hit detection.
When a character dies or is stunned, I remove all of the hit geoms
from space 2 and put them into space 1. If they're dead and not going
to come back, I also remove their physical bounding cylinder -
otherwise, the ragdoll is actually jointed to the (still floating)
cylinder, and I use the cylinder to reserve the space I'll need when
re-animating the ragdoll back to a standing position.
On 8/8/06, David Walters <hidden.asbestos at googlemail.com> wrote:
> > afaik most fps use collision boxes for the player. Modern fps use
> > several boxes which may collide. I am not sure, how to prevent the boxes
> > from colliding in ode.
>
> If you tag a geom with some user data which says if it's a hit box or
> not, you can use that to simply _not_ create contact joints for
> collsions involving those geoms. Remember all dCollide does is report
> collsions, it's the contact joints that actually affect change in the
> world - and it's up to your code whether they get created or not!
>
> Regards,
> Dave.
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
>
--
-Megan Fox
Idyllon, LLC
http://shalinor.circustent.us/megan/resume/
More information about the ODE
mailing list