c_updatehull(ENTITY* ent, var frame)
Recalculates collision hulls for the given entity to match the vertex
positions of a certain frame (starting at 1 for the first frame).
Call this function
when you need the collision hull of a certain frame, or when you have applyied
mesh manipulation functions to a frame.
Parameters:
ent - entity pointer.
frame - number of frame
to use for the hull.
Modifies:
min_x/y/z, max_x/y/z, FAT / NARROW
Remarks:
- 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.
-
c_updatehull does not update the bounding box for bones frames.
- 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
now kneels. If possible, call c_setminmax(my) instead of c_updatehull(my,1) -
both give the same result, but c_setminmax will be much
faster. If you know your entities' dimensions, the fastest way to change
the hull size is to set min_xyz/max_xyz directly.
Speed:
slow
Example:
wait(1); // wait 1 frame after creation
c_updatehull(my,10);
See also:
c_setminmax,
min_x, max_x, FAT, NARROW, POLYGON
► latest
version online