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).
public readonly struct BodyId : IEquatable<BodyId>Implements
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).
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.
public uint Generation { get; init; }Property Value
Index
The slot.
public uint Index { get; init; }Property Value
IsNone
Whether this is None.
public bool IsNone { get; }Property Value
None
The id of no body.
public static BodyId None { get; }Property Value
Methods
Deconstruct(out uint, out uint)
public void Deconstruct(out uint Index, out uint Generation)Parameters
Index uint
Generation uint
Equals(object)
public override bool Equals(object obj)Parameters
obj object
Returns
Equals(BodyId)
public bool Equals(BodyId other)Parameters
other BodyId
Returns
GetHashCode()
public override int GetHashCode()Returns
ToString()
public override string ToString()Returns
Operators
operator ==(BodyId, BodyId)
public static bool operator ==(BodyId left, BodyId right)Parameters
left BodyId
right BodyId
Returns
operator !=(BodyId, BodyId)
public static bool operator !=(BodyId left, BodyId right)Parameters
left BodyId
right BodyId