Table of Contents

Property UserData

Namespace
Box3D
Assembly
Box3D.NET.dll

UserData

Gets or sets the application identifier attached to this body.

public ulong UserData { get; set; }

Property Value

ulong

Examples

body.UserData = entityId;
// ...
ulong entity = hit.Shape.Body.UserData;

Remarks

An entity id or an array index, not an object reference. See Box3D.UserData for why, and for the pattern this exists to support: getting from a contact event or a ray cast back to whatever your game calls this body.