Skip to content

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.

C#
public readonly struct SensorEvent : IEquatable<SensorEvent>

Implements

IEquatable<SensorEvent>

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.

C#
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.

C#
public SensorEventKind Kind { get; init; }

Property Value

SensorEventKind

Sensor

The sensor shape.

C#
public ShapeId Sensor { get; init; }

Property Value

ShapeId

SensorOwner

The entity owning the sensor’s body.

C#
public EntityId SensorOwner { get; init; }

Property Value

EntityId

Visitor

The shape that entered or left.

C#
public ShapeId Visitor { get; init; }

Property Value

ShapeId

VisitorOwner

The entity owning the visitor’s body.

C#
public EntityId VisitorOwner { get; init; }

Property Value

EntityId

Methods

Deconstruct(out SensorEventKind, out ShapeId, out ShapeId, out EntityId, out EntityId)

C#
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)

C#
public override bool Equals(object obj)

Parameters

obj object

Returns

bool

Equals(SensorEvent)

C#
public bool Equals(SensorEvent other)

Parameters

other SensorEvent

Returns

bool

GetHashCode()

C#
public override int GetHashCode()

Returns

int

ToString()

C#
public override string ToString()

Returns

string

Operators

operator ==(SensorEvent, SensorEvent)

C#
public static bool operator ==(SensorEvent left, SensorEvent right)

Parameters

left SensorEvent

right SensorEvent

Returns

bool

operator !=(SensorEvent, SensorEvent)

C#
public static bool operator !=(SensorEvent left, SensorEvent right)

Parameters

left SensorEvent

right SensorEvent

Returns

bool