Talk:$bbox

From Valve Developer Community
Jump to: navigation, search

bbox = hull ?

I'm confused. I'd got the idea from CollisionProperty that the "Surrounding Bounds" (== "Bounding Box" == $bbox right?) enclosed all the collision geometry, including the collision hull (as in NPC Hull and Player Hull), hitboxes, etc and is used for a preliminary collision-test filter before testing against specific bits of the model? --Beeswax 16:31, 28 Apr 2008 (PDT)

A bounding box is a general term for the cubic dimensions of the entity extents. It can be used for multiple purposes, including collision and early-out trace testing. There's no contradiction. This command is used infrequently anyway. --JeffLane 18:14, 28 Apr 2008 (PDT)
So the bounding box's geometry is often the same as the collision hull's geometry, but not always? I was interpreting the bbox and hull as different properties of a model, which would help understanding when and why they might have different dimensions ... presumably a model's bbox is calculated by StudioMDL, so $bbox is only used as an override by people who know what effect it has in game ? --Beeswax 19:53, 28 Apr 2008 (PDT)
I think they're one and the same, actually. --TomEdwards 01:37, 29 Apr 2008 (PDT)
This is the line in CollisionProperty#Surrounding bounds that makes me think bbox and hull are different things:
  • By default the surrounding bounds are computed as a box that surrounds the collision hull. If the collision hull is smaller than the hitboxes, the surrounding bounds must be enlarged to guarantee a proper hitbox test. It can be customized by calling: ...
Does that mean the collision hull must be enlarged to surround the hitboxes ? ie hitboxes outside the collision hull cannot be hit by bullets ? --Beeswax 08:38, 29 Apr 2008 (PDT)
I believe using $bbox in the to QC is used for early-out ray tracing tests (such as for hit traces). The AI hulls are defined in code and specified per NPC (also in code). I can check on that to make sure, but I believe that is the case. --JeffLane 18:12, 29 Apr 2008 (PDT)
My guess is that the bbox is used for all early-out collision tests : including Bullet and LOS/Rendering ray-traces, as well as Vphysics collisions; a vphys projectile with a complex collision model (eg a human ragdoll) that didn't use some kind of early-out collision test would go insane! My theory was that the movement collision detection system treats NPC Hulls, etc exactly like (crude) vphys collisionmodels inside the bbox. If the bbox and hull geometry are identical, that's just coincidence. (This would mean that 2 tests are done where 1 would have been sufficient, but this "waste" is probably cheaper than the "fix") --Beeswax 19:31, 29 Apr 2008 (PDT)
If setting the $bbox for an NPC_model overrides the dimensions of its NPC_hull in game, we will have an answer. --Beeswax 19:31, 29 Apr 2008 (PDT)
There appears to be an undocumented $cbox QC command (see Category_talk:QC_Commands#Checklist) - my guess would have been that this allows configuration of the Collision Box (Hull) as distinct from from the $bbox and $hbox ... ? --Beeswax 09:12, 29 Apr 2008 (PDT)
If this were the case: (1) imagine the parameters it would take to modify a ragdoll collision model! (2) its probably from HL1 and disabled in Source.--Beeswax 19:31, 29 Apr 2008 (PDT)
BTW you wouldn't happen to know why NPC Hulls define 2 nested boxes per Hull? (see Talk:NPC_Hull) I assume the larger one is the collision hull, but the other ? --Beeswax 19:53, 28 Apr 2008 (PDT)