Index  

trap_SetBrushModel

Description

Sets mins and maxs based on the brushmodel name.

Prototype

    void trap_SetBrushModel(
        gentity_t *ent,
        const char *name
    );

Parameters

Remarks

This function does several special things to an entity which should not be done any other way.
It sets the clipping bounds of the entity to use the collision map contained in the brush model specified.
Brush models have a complex collision map which is far more detailed than a regular bounding-box (doors, plats, movers etc). The mins and maxes of a brush-model entity may differ wildly from reality.

It sets the entity to have the SOLID_BMODEL type which serves to alert clients that the modelindex used to render this entity is not in the regular list, but instead is the index into the cgs.inlineDrawModel list which is built on start-up. This list is zero-indexed from *1 and therefore does not contain the map itself.
Another method must be used to get the client to render the map a second time.

It sets the "bmodel" member of the entityShared_t structure to 1 (entityShared_t is the "r" member of the gentity_t structure). This allows a simple method of checking if an entity uses a brush model.
There is nothing to prevent an entity from using a brush model which is not built into the map (not inline). However this ability is not used anywhere in Q3A or Q3TA. The map compilers have special command-line switches to build BSPs which are externally lit and designed to be stand-alone models.
If this is attempted the cgame QVM will require special code (a bit-flag or similar) to allow it to know the difference between a brush-model index that is inline and one that is external.

And thats' the last function in the game list!!

Originally posted by ydnar
This is news to me. Which switches are you referring to?

Return value

This function has no return value.

See also

Author(s)

D!ABLO


QuakeIII trap calls reference