c_setminmax (ENTITY* ent)
Sets the collision ellipsiod and bounding box coordinates
of the entity to it's real proportions, and sets both the entities'
FAT and NARROW flags.
Parameters:
ent - entity pointer.
Modifies:
min_xyz, max_xyz,
FAT / NARROW
Remarks:
- When a model is first loaded, its bounding
box values
are set to the fat or narrow standard hull by default, depending on the model's
size. Use c_setminmax
to set the bounding box coordinates to the real size if the entity is not
an actor.
Because the default bounding box is calculated in the first frame
after creation, wait one frame (wait(1))
before changing the bounding box the first time.
- The bounding box can be changed during runtime, but care must be taken to
not extend it into other obstacles while doing so.
- c_setminmax uses only the vertex extents of a model's
first frame. To use extents from a different frame n,
call c_updatehull(my,n) instead.
While
c_setminmax is essentially free (very little time required
to update the hull size), 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 only the change of the bounding box is required, call c_setminmax(my) instead
of c_updatehull(my,1) -
both produce the same bounding box,
but c_setminmax will be much
faster. If you know your entity's
dimensions, the fastest way to change the bounding box is to set min_xyz/max_xyz directly.
Speed:
Fast
Example:
wait(1); // wait 1 frame after creation
c_setminmax(me);
See also:
min_x, max_x, c_updatehull,
FAT, NARROW, collision
► latest
version online