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.
Parameters:
ent - entity pointer.
frame -
vertex frame
to be used for the hull, starting at 1 for the first frame. Not used for bones frames.
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.
- A8.06
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
now kneels.
-
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.
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