PhysicsAPI reference
Struct SensorEvent
Namespace: MicroEngine.Physics
Assembly: MicroEngine.Physics.dll
Guide: Physics worlds
A shape entered or left a sensor during the latest Step. The ids and owners are copied when the event is made, so an exit caused by destroying a shape still names it.
public readonly struct SensorEvent : IEquatable<SensorEvent>Implements
Constructors
SensorEvent(SensorEventKind, ShapeId, ShapeId, EntityId, EntityId)
A shape entered or left a sensor during the latest Step. The ids and owners are copied when the event is made, so an exit caused by destroying a shape still names it.
public SensorEvent(SensorEventKind Kind, ShapeId Sensor, ShapeId Visitor, EntityId SensorOwner, EntityId VisitorOwner)Parameters
Kind SensorEventKind
Entry or exit.
Sensor ShapeId
The sensor shape.
Visitor ShapeId
The shape that entered or left.
SensorOwner EntityId
The entity owning the sensor’s body.
VisitorOwner EntityId
The entity owning the visitor’s body.
Properties
Kind
Entry or exit.
public SensorEventKind Kind { get; init; }Property Value
Sensor
The sensor shape.
public ShapeId Sensor { get; init; }Property Value
SensorOwner
The entity owning the sensor’s body.
public EntityId SensorOwner { get; init; }Property Value
Visitor
The shape that entered or left.
public ShapeId Visitor { get; init; }Property Value
VisitorOwner
The entity owning the visitor’s body.
public EntityId VisitorOwner { get; init; }Property Value
Methods
Deconstruct(out SensorEventKind, out ShapeId, out ShapeId, out EntityId, out EntityId)
public void Deconstruct(out SensorEventKind Kind, out ShapeId Sensor, out ShapeId Visitor, out EntityId SensorOwner, out EntityId VisitorOwner)Parameters
Kind SensorEventKind
Sensor ShapeId
Visitor ShapeId
SensorOwner EntityId
VisitorOwner EntityId
Equals(object)
public override bool Equals(object obj)Parameters
obj object
Returns
Equals(SensorEvent)
public bool Equals(SensorEvent other)Parameters
other SensorEvent
Returns
GetHashCode()
public override int GetHashCode()Returns
ToString()
public override string ToString()Returns
Operators
operator ==(SensorEvent, SensorEvent)
public static bool operator ==(SensorEvent left, SensorEvent right)Parameters
left SensorEvent
right SensorEvent
Returns
operator !=(SensorEvent, SensorEvent)
public static bool operator !=(SensorEvent left, SensorEvent right)Parameters
left SensorEvent
right SensorEvent