Prefab.
typedef struct Prefab { uint sig; void *wobj; } Prefab;

Prefab node.
typedef struct PrefabNode { uint sig; byte wobj[192]; } PrefabNode;

Load namespace callback.
typedef void (*FPrefabLoadNamespaceCB) (Prefab prefab, wcstr name, M4f pPos, uint count, void *ref);

Load node callback.
typedef void (*FPrefabLoadNodesCB) (Prefab prefab, M4f pPos, uint count, void *ref);

Prefab node type.
typedef enum PrefabNodeType

Empty node.
PREFAB_NODE_NONE,

Namespace node.
PREFAB_NODE_NAMESPACE,

Marker node.
PREFAB_NODE_MARKER,

Light node.
PREFAB_NODE_LIGHT,

Mesh node.
PREFAB_NODE_MESH,

Collision sphere node.
PREFAB_NODE_COL_SPHERE,

Collision cube node.
PREFAB_NODE_COL_CUBE,

Collision cone node.
PREFAB_NODE_COL_CONE,

Collision cylinder node.
PREFAB_NODE_COL_CYLYNDER,

Collision capsule node.
PREFAB_NODE_COL_CAPSULE,

Collision mesh node.
PREFAB_NODE_COL_MESH

End block 'Prefab node type'
} PrefabNodeType;

Check type.
API bool PrefabNodeIsType(PrefabNode *node, wcstr name, PrefabNodeType type);
node: Node.
name: Name.
type: Type.
returns: True if node matches type.

Get type.
API PrefabNodeType PrefabNodeGetType(PrefabNode *node);
node: Node.
returns: Node type.

Get position.
API M4f PrefabNodeGetPos(PrefabNode *node);
node: Node.
returns: Position.

Get namespace.
API wcstr PrefabNodeGetNS(PrefabNode *node);
node: Node.
returns: Namespace name.

Get name.
API wcstr PrefabNodeGetName(PrefabNode *node);
node: Node.
returns: Node name.

Get path to node's mesh.
API wcstr PrefabNodeGetPath(PrefabNode *node);
node: Node.
returns: Path to node's mesh.

Check child count and throw exception if count is unexpected.
API void PrefabNodeCheckCount(PrefabNode *node, uint count, uint expect);
node: Node.
count: Child count.
expect: Excpected child count.

Load node.
API void PrefabNodeLoad(PrefabNode *node, M4f pPos);
node: Node.
pPos: Parent position.

If node type is unhandled call this function to throw node unknown exception.
API void PrefabNodeUnknown(PrefabNode *node);
node: Node.

Init node.
API void PrefabNodeInit(PrefabNode *node, Prefab prefab);
node: Node.
prefab: Prefab node belongs to.

Release node.
API void PrefabNodeRel(PrefabNode *node);
node: Node.

Check if marker exists.
API bool PrefabIsMarker(Prefab prefab, wcstr name);
prefab:
name:

Load marker.
API void PrefabLoadMarker(Prefab prefab, PrefabNode *node);
prefab: Prefab.
node: Node.

Get marker.
API M4f PrefabGetMarker(Prefab prefab, wcstr name);
prefab: Prefab.
name: Name.
returns: Position.

Load namespace.
API void PrefabLoadNS(Prefab prefab, wcstr name, M4f pos, uint count, void *ref);
prefab: Prefab.
name: Namespace name.
pos: Position to place namespace.
count: Child node count.
ref: Caller defined reference.

Load prefab.
API void PrefabLoad(wcstr path, M4f pos, FPrefabLoadNamespaceCB LoadNamespace, FPrefabLoadNodesCB LoadNodes, void *ref);
path: Path to prefab in data folder.
pos: Position to place prefab.
LoadNamespace: Load namespace callback.
LoadNodes: Load node callback.
ref: Caller defined reference.