Skip to Content

trace_filter_t

Trace filter: interaction mask, collision group, entity iteration and an optional should_hit predicate.


trace_filter_t(interacts_with, collision_group, iterate_entities, should_hit?)

interacts_with must be a whole number and iterate_entities a boolean. When entity iteration is enabled, should_hit(entity) runs during the trace. Returning false skips that entity; any other value keeps it. Omit should_hit rather than pass nil.

If the predicate raises, the error is reported once and the predicate is removed. That entity and later ones are treated as hittable by the predicate.

Fields, readable and writable: interacts_with, interacts_exclude, interacts_as, object_set_mask (numbers), collision_group (number), iterate_entities (boolean). interacts_with and collision_group must be whole numbers in the constructor; another type matches no form and raises.

trace_filter_base_t is the engine filter type trace_filter_t derives from: the same six fields and no constructor. trace.line and trace.shape accept either.