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

Editing setsize

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:====
 +
<code>void setsize(entity e, vector mins, vector maxs)</code>
  
== Usage ==
+
Sets the size of the entity's bounding box, relative to the entity origin. The size box is rotated by the current angle of the entity.
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.
+
====Parameters:====
 
+
:<code>e</code> - The entity who's model is being set
For BSP entities, do not use this function. <code>setmodel()</code> will automatically set their size information.
+
:<code>mins</code> - The coordinates of the minimum corner of the bounding box (ex: [[VEC_HULL2_MIN]])
 
+
:<code>maxs</code> - The coordinates of the maximum corner of the bounding box (must be larger than mins) (ex: [[VEC_HULL2_MIN]])
'''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.
+
====Returns:====
 
+
:void
=== 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);
 
  
 
[[Category:QuakeC Function]]
 
[[Category:QuakeC Function]]

Please note that all contributions to Quake Wiki are considered to be released under the GNU Free Documentation License 1.3 or later (see Quake Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel | Editing help (opens in new window)