Skip to content

PhysicsAPI reference

Struct BodyId

Namespace: MicroEngine.Physics
Assembly: MicroEngine.Physics.dll
Guide: Physics worlds

A body of an IPhysicsWorld2D: a slot index and the generation of the body that held the slot when the id was made. A destroyed body’s slot is reused with a new generation, so an old id never reaches the new body. default is None (generation 0 is never issued).

C#
public readonly struct BodyId : IEquatable<BodyId>

Implements

IEquatable<BodyId>

Constructors

BodyId(uint, uint)

A body of an IPhysicsWorld2D: a slot index and the generation of the body that held the slot when the id was made. A destroyed body’s slot is reused with a new generation, so an old id never reaches the new body. default is None (generation 0 is never issued).

C#
public BodyId(uint Index, uint Generation)

Parameters

Index uint

The slot.

Generation uint

The generation of the slot’s body; 0 only for None.

Properties

Generation

The generation of the slot’s body; 0 only for None.

C#
public uint Generation { get; init; }

Property Value

uint

Index

The slot.

C#
public uint Index { get; init; }

Property Value

uint

IsNone

Whether this is None.

C#
public bool IsNone { get; }

Property Value

bool

None

The id of no body.

C#
public static BodyId None { get; }

Property Value

BodyId

Methods

Deconstruct(out uint, out uint)

C#
public void Deconstruct(out uint Index, out uint Generation)

Parameters

Index uint

Generation uint

Equals(object)

C#
public override bool Equals(object obj)

Parameters

obj object

Returns

bool

Equals(BodyId)

C#
public bool Equals(BodyId other)

Parameters

other BodyId

Returns

bool

GetHashCode()

C#
public override int GetHashCode()

Returns

int

ToString()

C#
public override string ToString()

Returns

string

Operators

operator ==(BodyId, BodyId)

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

Parameters

left BodyId

right BodyId

Returns

bool

operator !=(BodyId, BodyId)

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

Parameters

left BodyId

right BodyId

Returns

bool