c_updatehull(ENTITY* ent, var frame)
Recalculates the collision hull for the given entity to match the vertex
positions of a certain frame
or of the current bones position.
Also sets the bounding box to the size of the collision hull.
Call this function
when you need the collision hull of a certain frame, or when you have applied
mesh manipulation functions to a frame.
ent - entity pointer.
to be used for the hull, starting at 1 for the first frame. Not used for bones frames.
min_x/y/z, max_x/y/z, FAT / NARROW
- The default bounding box of an entity is calculated in the first frame
after it's created. Thus, wait one frame (wait(1)) before
changing the bounding box the first time.
- c_updatehull does not check for intersections, thus you should make
sure that there is enough space when selecting a larger frame. Choosing
a smaller frame does not pose any problems.
For bones animated models, c_updatehull updates the hull to the current skeleton position. The frame parameter has no effect in this case.
- c_updatehull can take
some time to execute because it needs to reload the vertices of the specified
frame. Thus you should not call c_updatehull every single
frame but only for major animation changes such as a standing character who
The state of the polygonal collision hull is not saved by game_save. Therefore c_updatehull should be called again after loading when a different frame should be used for the collision hull.
wait(1); // wait 1 frame after creation
min_x, max_x, FAT, NARROW, POLYGON