Mochi.PhysX icon indicating copy to clipboard operation
Mochi.PhysX copied to clipboard

Add transformation to handle PxClientID

Open PathogenDavid opened this issue 3 years ago • 0 comments

PxClientID is a typedef used for IDs assigned by PxScene. Right now I'm pretty sure that they don't get translated at all (or maybe they're completely untyped.)

We should transform the PxClientID typedef from this:

typedef PxU8 PxClientID;
static const PxClientID PX_DEFAULT_CLIENT = 0;
static const PxClientID PX_MAX_CLIENTS = 128;

Into something like this:

struct PxClientID
{
    public readonly ubyte Id;

    private PxClientId(ubyte id)
        => Id = id;

    //TODO: Operators?

    public static readonly PxClientID Default = new PxClientID(0);
    public static readonly PxClientID MaxValue = new PxClientId(128);
}

PathogenDavid avatar Sep 10 '20 02:09 PathogenDavid