Archived

This topic is now archived and is closed to further replies.

jimmynelson

Collision Detection, Wanna help us both?

Recommended Posts

I am just looking for someone to share ideas in finishing this collision detection stuff. I am pretty far but I keep running into trouble. I am using Dx9 with Opcode, but all that really doesn''t matter. My code is pretty much portable to anything (plus a few changes). Basically I just need 2 eyes on this and in turn we both end up getting a nice little collision system (even if you don''t do much, I would share the entire collision code). I am working on just a Sphere-Triangle collision system which runs off of OPCODE (in is a pretty fast AABB tree system - you can find it through google). So far I have it "kinda" working. It just acts really strange since the math itself isn''t too complex, so it makes me more and more frustrated. But after you look at something too long you just need another perspective. This is just gonna be the basic FPS collision, with the recursive sliding and shooting decal stuff. I can also help you with other things if you''d like (skeletal meshes, partical effects, etc.). Ciao

Share this post


Link to post
Share on other sites
I''m not sure I understand, but according to the spec sheet for opcode 1.3, it does absolutely everything you''d need for a collision detection, so, are you re-writing some part of it? You just use its AABBtree structures?

Well, I''d be happy to help.



- Oli.




Home

rigid body demo

Simple Z-fail Stencil shadows demo

Sphere/cube/Triangle Collision And Physics demo




Share this post


Link to post
Share on other sites
It will detect a collision or return a list of possible colliding primitives (what I use). So say you want a bullet to hit a wall, if you use a fast moving bullet with Opcode it will miss 90% of the walls because you didn''t call it when the bullet was against it you called it when the bullet was behind and then in front.

So you get a AABB around the bullet and use that. Get the possible colliders and then you a sphere-tri test to find the exact collision, as well as the exact time of collision. Makes sense now?

Also say you want the bullet to ricochet, you need to do that youself, so in fact Opcode does very little to help with a game exact collision system.

Share this post


Link to post
Share on other sites
Opcode does not use swept volumes? nevermind...

To model a bullet, a segment (from last frame position to new frame position plus a small amount for safety) would be sufficient, simpler, and surely more efficient than a large ABBox to get the colliders and then doing a swept sphere/triangle intersection test. All you need is a ray/box test through the ABBtree to get the potential triangles, a ray/sphere possibly (if you have spheres as collision volumes in your game) and then do a segment/tri test. The ray/box test is also quite simple.

Also, from that, you''d get a full segment collision detection system, useful for A.I. line of sight tests and other things (railguns anyone?). You can also plug the segment collision detection system into a particle physics system, like blood splats, fragments, shell casing, bullets obviously, rockets, pickups, cloth simulation, grenades, flamethowers...

Share this post


Link to post
Share on other sites
Well say you wanted the bullet to be any size, a rocket for instance or a Max Payned super slow bullet. In a normal game I would surely use a ray, but this is kinda a generic code to cover any fast moving projectile.

Share this post


Link to post
Share on other sites
Also particles systems usually refer to a texture mapped over a quad polygon. So a particle system wouldn''t cover bullets or shells, but it would cover blood, fire, explosions, fragments, etc.

Also would you like to discuss this through email. I would like help and if you don''t already have a collision system setup we would definitely help each other out. It is totally up too you, it might take a month but finished we should have a nice little system setup.

email: sleep123@hotmail.com

Share this post


Link to post
Share on other sites