Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!

setsize

From Quake Wiki

void setsize(entity e, vector minSize, vector maxSize)

Usage[edit]

Sets the extents of the entity's bounding box relative to its origin. This is axis aligned meaning it does not rotate with the entity. Sets the mins, maxs, and size fields. These should not be modified manually since the entity needs to be properly relinked to the world after changing size.

For BSP entities, do not use this function. setmodel() will automatically set their size information.

Warning: For collisions with BSPs, the Minkowski sum is pre-calculated, but only for the VEC_HULL_MIN/MAX and VEC_HULL2_MIN/MAX sizes. Collisions with other entities will work fine if you deviate from these, but collisions with BSP models specifically will become imprecise. Use caution when going outside these.

Parameters[edit]

  • e
The entity whose size is being set.
  • minSize
The size of the box from the origin pointing down towards the left. These should use negative values or they will not be offset from the origin correctly.
  • maxSize
The size of the box from the origin pointing up towards the right. These should use positive values or they will not be offset from the origin correctly.

Example[edit]

// Sets the non-BSP entity to the standard collision size
setsize(e, VEC_HULL_MIN, VEC_HULL_MAX);