News:

One Minute Game Review by The Happy Friar: https://ugetube.com/@OneMinteGameReviews
Also on Rumble: https://rumble.com/c/c-1115371

idTech 4 (aka Doom 3 tech) Discord Server! https://discord.gg/9wtCGHa

Main Menu

Bounding box and hitbox

Started by bitterman, July 05, 2015, 09:05:05 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bitterman

I have new model of player with two anims - idle and walk. Anims are played with script.

But I see there is a incorrect position for hitbox:

1. When it's idle hitbox is asymmetric (see pic.1).

2. After begin of walk cycle hitbox makes very little and then moving down (see pic. 2 - 3).

And I can't change size of bounding box for player model via "size", "mins" and "maxs" into player.def.

Is bbox for player hardcoded?

In walk anim "origin" bone is moving along +x if it's make sense.

Screenshots with g_showCollisionModels 1:




bitterman

#1
Ok, I found pm_bbox CVARS and they needs some tests.

How about hitbox?

http://www.kot-in-action.com/tutorials/blender2dp.html

Some troubles with "origin" bone orientation (axis) in Blender, hmm...

bitterman

#2
The blue box around player model (g_showcollisionModels 1) is not hitbox (my mistake).

It's unknown (for me) 'DebugBounds' and I still don't understrand how it works (see line 1633):


1613 ============
1614 idClip::DrawClipModels
1615 ============
1616 */
1617 void idClip::DrawClipModels(const idVec3 &eye, const float radius, const idEntity *passEntity){
1618       int i, num;
1619       idBounds bounds;
1620       idClipModel *clipModelList[MAX_GENTITIES];
1621       idClipModel *clipModel;
1622
1623       bounds = idBounds( eye ).Expand( radius );
1624
1625       num = idClip::ClipModelsTouchingBounds( bounds, -1, clipModelList, MAX_GENTITIES );
1626
1627 for ( i = 0; i < num; i++ ) {
1628        clipModel = clipModelList[i];
1629        if ( clipModel->GetEntity() == passEntity ) {
1630        continue;
1631        }
1632        if ( clipModel->renderModelHandle != -1 ) {
1633        gameRenderWorld->DebugBounds( colorCyan, clipModel->GetAbsBounds() );
1634        } else {
1635        collisionModelManager->DrawModel( clipModel->Handle(), clipModel->GetOrigin(),     clipModel->GetAxis(), eye, radius );
1636        }
1637    }
1638 }



1869 ====================
1870 idRenderWorldLocal::DebugBounds
1871 ====================
1872 */
1873 void idRenderWorldLocal::DebugBounds( const idVec4 &color, const idBounds &bounds, const idVec3 &org, const int lifetime ) {
1874       int i;
1875       idVec3 v[8];
1876
1877       if ( bounds.IsCleared() ) {
1878       return;
1879       }
1880
1881       for ( i = 0; i < 8; i++ ) {
1882       v[i][0] = org[0] + bounds[(i^(i>>1))&1][0];
1883       v[i][1] = org[1] + bounds[(i>>1)&1][1];
1884       v[i][2] = org[2] + bounds[(i>>2)&1][2];
1885       }
1886       for ( i = 0; i < 4; i++ ) {
1887       DebugLine( color, v[i], v[(i+1)&3], lifetime );
1888       DebugLine( color, v[4+i], v[4+((i+1)&3)], lifetime );
1889       DebugLine( color, v[i], v[4+i], lifetime );
1890       }
1891 }


This box is moving with 'origin' bone and change size.

Now I believe that (unlike other models) player's model does not have to moving bone 'origin' for moves animations (walk, run etc).

Red box is still bounding box and it's well documented.

D3 has also many others colored boxes (green, yellow etc) and they are poor or not documented. Need more information.

bitterman