Player Collision Box

Locked
menorian
Posts: 12
Joined: Sun Sep 14, 2008 12:23 pm

Player Collision Box

Post 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,
Last edited by menorian on Fri Oct 17, 2008 7:48 pm, edited 1 time in total.
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Re: Player Collision Box

Post 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.
menorian
Posts: 12
Joined: Sun Sep 14, 2008 12:23 pm

Re: Player Collision Box

Post by menorian »

well i manage to find it myself, it's done in: PM_CheckDuck in bg_pmove.c
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Re: Player Collision Box

Post 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.
JPL
Posts: 13
Joined: Sun Nov 11, 2007 1:17 am

Re: Player Collision Box

Post 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
metalmodman
Posts: 4
Joined: Thu Jun 25, 2009 5:06 am

Re: Player Collision Box

Post 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?
JPL
Posts: 13
Joined: Sun Nov 11, 2007 1:17 am

Re: Player Collision Box

Post 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.
Locked