> Hulls are defined as boxes in the SDK code, and all collision in the PM
code
> is performed on a box. Is there a restriction in the BSP format or in the
> engine somewhere that requires this be the case, or (assuming that we
wanted
> to completely rewrite the BSP collision code) would it be possible to
> implement another hull size, such as a right circular cylinder or a
sphere?
>
> Yes, there IS a reason I'm asking this, and it does make sense...

Yes, you can implement your own collision detection if you want to.  To
collide with a world brush, you would need to read in the BSP file and store
this information yourself (since the Half-Life engine doesn't allow you to
access this data directly).  To collide with other entities, you already
have all the information you need server side (the entities origin and the
bounding box, assuming you wanted to do bounding box collisions).  The
bounding box for entities could be rectangles (hulls) or cylinders, or
spheres, or any arbitrary shape as long as you handle the code necessary to
check for two objects occupying the same space at the same time (a
collision).

The Quake I source code uses SV_RecursiveHullCheck() for collision detection
(and for TraceLines).  Quake uses the 3 hulls to create "areas" where things
would collide.  If I understand what they are doing correctly, you can think
of it as though the walls (or surfaces) of objects get much "thicker" so
that they take up more space.  This makes it easy to use the origins to see
if two objects would occupy the same space at the same time.  It's REALLY
hard to explain and the code it not trivial to walk through.

I've got some simple TraceLine source code in the BSP viewer that I released
a week or so ago (part of my BSP tools package) that shows how to do a
TraceLine in the BSP world.  It's REAL inefficient.  It gets the starting
BSP leaf node and moves along a normalized vector 1 unit at a time until it
hits another leaf node, at which point it knows it has hit a solid surface
in the world.

There are many discussions on collision detection on game development sites
like www.gamasutra.com or www.gamedev.net.  You might want to take a look at
some of those discussions/tutorials for some ideas on collision detection.

Jeffrey "botman" Broome

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to