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: 5223
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 16 2005 at 04: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 05 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
knock knock
General | News
By: omega | Dec 22 2016
 
knock knock
General | News
By: MIFUNE | Oct 10 2015
 
New HL HUD Message System
Half-Life | Coding | Shared Tutorials
By: chbrules | Dec 31 2011
 
knock knock
General | News
By: Whistler | Nov 05 2011
 
Particle Engine tutorial part 4
Half-Life | Coding | Client Side Tutorials
By: darkPhoenix | Feb 18 2010
 
Particle Engine tutorial part 2
Half-Life | Coding | Client Side Tutorials
By: darkPhoenix | Feb 11 2010
 
Particle Engine tutorial part 3
Half-Life | Coding | Client Side Tutorials
By: darkPhoenix | Feb 11 2010
 
Game Movement Series #2: Analog Jumping and Floating
Half-Life 2 | Coding | Shared Tutorials
By: mars3554 | Oct 26 2009
 
Particle Engine tutorial part 5
Half-Life | Coding | Client Side Tutorials
By: Deadpool | Aug 02 2009
 
Particle Engine tutorial part 5
Half-Life | Coding | Client Side Tutorials
By: Persuter | Aug 02 2009
 

Site Info
297 Approved Articless
8 Pending Articles
3940 Registered Members
0 People Online (4 guests)
About - Credits - Contact Us

Wavelength version: 3.0.0.9
Valid XHTML 1.0! Valid CSS!