hit

Contact information, normally set up by c_trace when SCAN_TEXTURE is set and USE_AABB is not set. The following parameters can be used in subsequent code:

Parameters:

hit.v D3DVERTEX* pointer with interpolated coordinate values at the contact position.
hit.x,y,z Contact position.
hit.nx,ny,nz Contact surface normal.
hit.u1,v1  A7.20  Texture coordinates of the contact position, in pixels.
hit.u2,v2  A7.20  Lightmap coordinates of the contact position, in pixels.
hit.blue,green,red Pixel color of the second texture (f.i. a lightmap) at the contact position, for 24-bit textures only.
hit.vertex Vertex number closest to the contact.
hit.triangle Surface number of the contact.
hit.chunk Mesh number in case of multi-mesh entities such as chunked terrain.
hit.flags Flags 9 or 10 set when something was hit; can be evaluated by if (HIT_TARGET) ... (see example).
hit.model Internal mesh information.
hit.entity ENTITY* pointer, or NULL when a level surface was hit.
hit.skin1,skin2 BMAP* pointers of the first and second texture of the hit surface.
hit.texname Name of the hit texture (skin1 or skin2) for models, blocks, or sprites. Terrain texture names are not yet implemented.

Type:

CONTACT* (defined in atypes.h)

Modified by:

c_trace, c_move, wait

Example:

See ent_decal

See also:

ENTITY, my, c_trace, normal, bounce, hit

► latest version online