collision_mode

Determines the behavior of the c_... collision instructions and the creation of a collision model for entities.

Range:

0 When set to 0 before level loading, the OBB collision system and PRV lighting is disabled for the whole level. Levels load faster this way, so this is the preferred method for viewing an unlitlevel.
0

8.05 When set to 0 after level loading, all subsequent entities are created with PASSABLE flag and without a collision model. They are created faster and consume less memory this way, but can't be used as colliders or obstacles. When setting collision_mode to nonzero and resetting PASSABLE, the entity's collision model is created afterwards in the next frame cycle. The entities can then perform normal collision detection.

1 OBB collision system and PRV lighting enabled (default). By default, entity collision ellipsoids have two fixed sizes depending on their FAT and NARROW flags, which are automatically set or reset dependent on the entity size. The standard walking functions require this setup for actors.
2 OBB collision and PRV lighting enabled, and the WED BBox flag enforced. By default, entity collision ellipsoids are set to the real size of the entity, and the FAT and NARROW flags are both set. This has the same effect as calling c_setminmax for all entities.

Type:

var

Remarks:

This variable replaces the old enable_polycollision variable of A6 and A7.

Example:

function main()
{
  level_load("terrain.hmp");
  collision_mode = 0; // disable collision for placing passable grass sprites 
  var i;
  for (i=0; i < 1000; i++)
    ent_create("grass.dds",NULL,place_grass);
  collision_mode = 1; // enable collision again
  ...

See also:

physics, collision, c_move, c_setminmax, ent_create

► latest version online