PhysicsAPI reference
Struct QueryFilter
Namespace: MicroEngine.Physics
Assembly: MicroEngine.Physics.dll
Guide: Physics worlds
Which shapes a query (RayCast, Overlap) or a
Move considers. A shape matches when its category is in the filter’s
Mask and the filter’s Category is in the shape’s mask. default is
Default: category Default, every layer, sensors left out.
public readonly struct QueryFilter : IEquatable<QueryFilter>Implements
Constructors
QueryFilter(ulong, ulong)
A filter in category that sees mask.
public QueryFilter(ulong category, ulong mask)Parameters
category ulong
mask ulong
Properties
Category
The layers the query is in (shapes whose mask lacks them ignore it).
public ulong Category { get; init; }Property Value
Default
The default filter: category Default, every layer, no sensors.
public static QueryFilter Default { get; }Property Value
IncludeSensors
Whether ray casts and overlaps return sensor shapes (false by default). Sensors never block Move, whatever this says.
public bool IncludeSensors { get; init; }Property Value
Mask
The layers the query sees.
public ulong Mask { get; init; }Property Value
PassOneWay
Whether one-way platforms are passed through (dropping down through a platform); false by default.
public bool PassOneWay { get; init; }Property Value
Methods
Accepts(ulong, ulong)
Whether a shape in category colliding with mask matches the filter’s layers.
public bool Accepts(ulong category, ulong mask)Parameters
category ulong
mask ulong
Returns
Equals(object)
public override bool Equals(object obj)Parameters
obj object
Returns
Equals(QueryFilter)
public bool Equals(QueryFilter other)Parameters
other QueryFilter
Returns
For(in ShapeDescription)
The filter that moves or queries as shape would collide: its category and mask.
public static QueryFilter For(in ShapeDescription shape)Parameters
shape ShapeDescription
Returns
GetHashCode()
public override int GetHashCode()Returns
ToString()
public override string ToString()Returns
Operators
operator ==(QueryFilter, QueryFilter)
public static bool operator ==(QueryFilter left, QueryFilter right)Parameters
left QueryFilter
right QueryFilter
Returns
operator !=(QueryFilter, QueryFilter)
public static bool operator !=(QueryFilter left, QueryFilter right)Parameters
left QueryFilter
right QueryFilter