Scripting API

Scripting API

MeshId

Record struct in Abyss.Core, from Abyss.Core.

The id of a mesh the engine created, which is what a caller holds instead of a handle.

public readonly record struct MeshId

Remarks

Everything else this engine carries across the boundary is plain data at a byte offset. A Bevy Handle<Mesh> is not: it is reference-counted, it has a destructor, and dropping the last one unloads the asset. So the engine keeps the handle and hands back this, which is a number and can go wherever numbers go — a command buffer, a component of your own, a save file.

The world keeps what it gave an id to until it is let go of, with World.Release. Even then the asset stays while anything else holds it — an entity drawn with it, a material using an image — and the id with it; once nothing does, it goes, and the id is refused from then on with an error saying it was released. An id is never given out twice, so a number kept from before can never come to name something else.

default is no mesh: every id says its kind in its top byte, and no kind is zero.

Constructors

MeshId

public MeshId(ulong Value)

The id of a mesh the engine created, which is what a caller holds instead of a handle.

Parameters

  • Value: The engine's id: its kind in the top byte, its number among that kind below.

Everything else this engine carries across the boundary is plain data at a byte offset. A Bevy Handle<Mesh> is not: it is reference-counted, it has a destructor, and dropping the last one unloads the asset. So the engine keeps the handle and hands back this, which is a number and can go wherever numbers go — a command buffer, a component of your own, a save file.

The world keeps what it gave an id to until it is let go of, with World.Release. Even then the asset stays while anything else holds it — an entity drawn with it, a material using an image — and the id with it; once nothing does, it goes, and the id is refused from then on with an error saying it was released. An id is never given out twice, so a number kept from before can never come to name something else.

default is no mesh: every id says its kind in its top byte, and no kind is zero.

Properties

Value

public ulong Value { get; init; }

The engine's id: its kind in the top byte, its number among that kind below.

Methods

ToString

public override string ToString()

The id as a person reads it: mesh 3.