Skip to content

PhysicsAPI reference

Struct ShapeId

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

A shape of an IPhysicsWorld2D (a box, a tile grid, or a shape of a declared capability), attached to one body. Generation-checked like BodyId; default is None.

C#
public readonly struct ShapeId : IEquatable<ShapeId>

Implements

IEquatable<ShapeId>

Constructors

ShapeId(uint, uint)

A shape of an IPhysicsWorld2D (a box, a tile grid, or a shape of a declared capability), attached to one body. Generation-checked like BodyId; default is None.

C#
public ShapeId(uint Index, uint Generation)

Parameters

Index uint

The slot.

Generation uint

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

Properties

Generation

The generation of the slot’s shape; 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 shape.

C#
public static ShapeId None { get; }

Property Value

ShapeId

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(ShapeId)

C#
public bool Equals(ShapeId other)

Parameters

other ShapeId

Returns

bool

GetHashCode()

C#
public override int GetHashCode()

Returns

int

ToString()

C#
public override string ToString()

Returns

string

Operators

operator ==(ShapeId, ShapeId)

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

Parameters

left ShapeId

right ShapeId

Returns

bool

operator !=(ShapeId, ShapeId)

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

Parameters

left ShapeId

right ShapeId

Returns

bool