Welcome, Guest! Login | Register

Display player bounding box [Print this Article]
Posted by: Beamish
Date posted: Mar 08 2005
User Rating: N/A
Number of views: 2836
Number of comments: 1
Description: Adds a console command to output the players bounding box mins & maxs to the console, and also draw's the bounding box in the world.
Not so much of a Tutorial, more of a this might be useful to someone....

I have been playing with player bounding boxes recently, and have been getting all kinds of strange things happen, so I needed a way to check the boundingbox settings.

I added a console command "beamish_show_bbox", which outputs the min & max vectors to the console, and also draws the players bounding box in the world for a period of 5 secs.

Here is the code:

Add this to: src\dlls\client.cpp (around line 294 should be good, just before this :
CON_COMMAND_F( cast_hull, "Tests hull collision detection", FCVAR_CHEAT )


CON_COMMAND_F( beamish_show_bbox, "Shows player's bounding box", FCVAR_CHEAT )
{
CBasePlayer *pPlayer = UTIL_GetCommandClient();
Vector orig = pPlayer->GetAbsOrigin();
Vector mins = pPlayer->GetPlayerMins();
Vector maxs = pPlayer->GetPlayerMaxs();
DevMsg( "Mins: x:%.2f, y:%.2f, z:%.2f\n", mins.x, mins.y, mins.z);
DevMsg( "Maxs: x:%.2f, y:%.2f, z:%.2f\n", maxs.x, maxs.y, maxs.z);
NDebugOverlay::Box( orig, mins, maxs, 255, 0, 0, 255, 15.0);
}

Cheers,

Beamish.

Rate This Article
This article has not yet been rated.

You have to register to rate this article.
User Comments Showing comments 1-1

Posted By: imatard on Apr 15 2005 at 22:09:52
beautiful


You must register to post a comment. If you have already registered, you must login.

Latest Articles
3rd person View in Multiplayer
Half-Life 2 | Coding | Client Side Tutorials
How to enable it in HL2DM

By: cct | Nov 13 2006

Making a Camera
Half-Life 2 | Level Design
This camera is good for when you join a map, it gives you a view of the map before you join a team

By: slackiller | Mar 04 2006

Making a camera , Part 2
Half-Life 2 | Level Design
these cameras are working monitors that turn on when a button is pushed.

By: slackiller | Mar 04 2006

Storing weapons on ladder
Half-Life 2 | Coding | Snippets
like Raven Sheild or BF2

By: British_Bomber | Dec 24 2005

Implementation of a string lookup table
Half-Life 2 | Coding | Snippets
A string lookup table is a set of functions that is used to convert strings to pre-defined values

By: deathz0rz | Nov 13 2005


Latest Comments
Spinning Corpses Simple Fix
Half-Life | Coding | Snippets
By: darkPhoenix | Sep 05 2008
 
Where do we go from here
General | News
By: MIFUNE | Jun 09 2008
 
The Input/Output system
Half-Life 2 | Level Design
By: nazitaco | Dec 23 2007
 
Where do we go from here
General | News
By: Rob_F | Nov 22 2007
 
Rescaling Half-Life
Half-Life | Coding | Shared Tutorials
By: christoph | Nov 12 2007
 
GameUI
Half-Life 2 | Coding | Client Side Tutorials
By: Evil_j | Oct 29 2007
 
3 State Zoom For Any Weapon
Half-Life 2 | Coding | Server Side Tutorials
By: Ennuified | Oct 18 2007
 
Storing weapons on ladder
Half-Life 2 | Coding | Snippets
By: cct | Sep 07 2007
 
CTF Gameplay Part 1
Half-Life | Coding | Shared Tutorials
By: DarkNight | Aug 28 2007
 
CTF Gameplay Part 1
Half-Life | Coding | Shared Tutorials
By: deedok | Aug 20 2007
 

Site Info
296 Approved Articless
5 Pending Articles
3940 Registered Members
0 People Online (11 guests)
About - Credits - Contact Us

Wavelength version: 3.0.0.9
Valid XHTML 1.0! Valid CSS!