c_content(VECTOR* pos,var mode)

Checks the block material at the position given by the vector. The instruction returns a value of 1 if empty space, 2 if a passable block, or 3 if a solid block is detected at the given position. Blocks in the level as well as in map entities are detected - but no other entities. You is set to the entity detected at the position, if any.


pos - position to be checked
mode - not used yet


1 within empty space
2 within a passable block
3 within an unpassable block


you - If the position is within a map entity, the you pointer is set to it.




Abandoned function; only for non-mesh-based levels and the AABB collision system. Do not use this function for new projects.


// check if the camera position is under water in the current level
 result = c_content(camera.x,0);
 if (result == 2) // under water
 	fog_color = 2; // set global fog to 2, blue fog
 	fog_color = 0; // switch global fog off

See also:

c_trace, c_move, c_rotate ► latest version online