From Quake Wiki
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision |
Your text |
Line 1: |
Line 1: |
− | ''void'' '''setsize'''(''entity'' e, ''vector'' minSize, ''vector'' maxSize)
| + | Syntax:<br/> |
− | | + | <code>void setsize(entity e, vector mins, vector maxs)</code> |
− | == Usage ==
| |
− | 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. <code>setmodel()</code> will automatically set their size information.
| |
− | | |
− | '''Warning:''' For collisions with BSPs, the Minkowski sum is pre-calculated, but only for the <code>VEC_HULL_MIN/MAX</code> and <code>VEC_HULL2_MIN/MAX</code> 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 ===
| |
− | *''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 ==
| |
− | // Sets the non-BSP entity to the standard collision size
| |
− | setsize(e, VEC_HULL_MIN, VEC_HULL_MAX);
| |
| | | |
| + | Sets the size of the entity <code>e</code>'s bounding box. This is calculated from the origin (<code>'0 0 0'</code>). <code>mins</code> must be smaller than <code>maxs</code>. |
| [[Category:QuakeC Function]] | | [[Category:QuakeC Function]] |