normal

Surface normal vector, set by several instructions. A surface normal is a vector of length 1, pointing perpendicularly away from the surface. It can be used to determine the surface orientation. For instance, if normal.z is near 1, the surface is a ground plane; if normal.z is near -1, it's a ceiling plane; if normal.z is near 0, it's a vertical wall.

Type:

VECTOR

Remarks:

Modified by many functions, thus will only remain valid until the next wait instruction.

Modified by:

c_trace, c_move

Example:

// puts an entity on a surface below
function place_me_on_ground
{	
  vec_set(temp, my.x);
 	temp.z -= 1000; // 1000 Quants down
 	c_trace(my.x, temp, IGNORE_ME); 
 	vec_set(my.x, target); // put on surface
 	vec_to_angle(my.pan, normal); // look upwards
}	 

See Also:

Entity, my, c_trace, target, bounce ► latest version online