Page 1 of 1

Player Collision Box

Posted: Fri Oct 17, 2008 5:44 pm
by menorian
Hello,

i'm just wondering if someone here knows where to set the actual collision box for the player?
i have move the camera height to 128 (#define DEFAULT_VIEWHEIGHT 128 in bg_public.h) and that works fine, and i have changed the player bounding box by modifying playerMins and playerMaxs in g_client.c. But the player "collision box" is actually the same, 32x32x56 units.
does anyone know where this is done?

(i need to change this to be able to map more correctly to real life units)

thanks,

Re: Player Collision Box

Posted: Fri Oct 17, 2008 6:52 pm
by ^misantropia^
It is more or less hard coded. If you want to change it, you'll need to dive into lengthy assembler code in the engine.

Re: Player Collision Box

Posted: Fri Oct 17, 2008 10:10 pm
by menorian
well i manage to find it myself, it's done in: PM_CheckDuck in bg_pmove.c

Re: Player Collision Box

Posted: Sat Oct 18, 2008 9:51 am
by ^misantropia^
That's only part of it. To really change the bounding box you also need to patch the collision detection code, most of which lives in qcommon/cm_trace.c. In VQ3 said file consists of bits of C code intermingled with lots of assembler. In ioquake3, the assembler has been rewritten in C for the sake of readability and portability.

Re: Player Collision Box

Posted: Sat Oct 18, 2008 6:00 pm
by JPL
My project is based on ioQ3 and I was able to do this fairly easily with some code changes to completely centralize the definitions of the player's size. Search for "PLAYER_WIDTH" in my SVN for how I did this (it may still have bugs, so anyone who spots one please tell me).

Project page:

https://sourceforge.net/projects/purityq3

Re: Player Collision Box

Posted: Thu Jun 25, 2009 5:24 am
by metalmodman
is the box used for level collision the same as the one used for hit detection?

what kind of mod are you working on?

Re: Player Collision Box

Posted: Tue Jul 21, 2009 1:16 am
by JPL
"is the box used for level collision the same as the one used for hit detection?"

Yes, I believe so. Though it's been a while since I looked at the code.

My project is an abstract shooter. It's on hiatus right now.