vec_for_min (VECTOR*, ENTITY*)

vec_for_max(VECTOR*, ENTITY*)

Sets the vector to the minimum resp. maximum vertex coordinates of the current model, terrain, or map entity mesh (in entity coordinates, i.e. without consideration of the entity origin and scale) . For a model the coordinates of its current vertex frame is used. This instruction can be used to set an entities' bounding box to it's real size instead of using the default min_x..max_x parameters.

Returns:

VECTOR*

Parameters:

VECTOR* Vector pointer to to be set to the minimum or maximum coordinates, or NULL for returning a temporary vector
ENTITY* Entity pointer

Speed:

Medium

Example:

// set the bounding box to the real size of its first frame
my.frame = 1;
vec_for_min(my.min_x, my);
vec_for_max(my.max_x, my); vec_mul(my.min_x,my.scale_x);
vec_mul(my.max_x,my.scale_x);

See also:

ent_vertices, vec_for_vertex, vec_for_mesh, min_x, c_setminmax

► latest version online