Scene
What’s in the game: entities, each a kind and a stable key, with their components. Setting one makes the entity. It goes when removed, with the plugin, or after a couple of seconds of the plugin’s frames without being set. Wraith never moves the game itself. Any thread.
Get it with Api.scene().
set(entity: import("salamander").Given<Wraith.Scene.Id>, component: import("salamander").Given<Wraith.Scene.Component>): voidclear(entity: import("salamander").Given<Wraith.Scene.Id>, kind: Wraith.Scene.ComponentKind | Wraith.Scene.ComponentKindName): voidremove(entity: import("salamander").Given<Wraith.Scene.Id>): voidhandle(kind: Wraith.Scene.ComponentKind | Wraith.Scene.ComponentKindName, add: Wraith.Scene.Add | null, rename: Wraith.Scene.Rename | null, show: Wraith.Scene.Show | null): voidset(entity: Wraith.Scene.Id, component: Wraith.Scene.Component)clear(entity: Wraith.Scene.Id, kind: Wraith.Scene.ComponentKind|Wraith.Scene.ComponentKindName)remove(entity: Wraith.Scene.Id)handle(kind: Wraith.Scene.ComponentKind|Wraith.Scene.ComponentKindName, add: Wraith.Scene.Add|nil, rename: Wraith.Scene.Rename|nil, show: Wraith.Scene.Show|nil)void Set(Wraith.Scene.Id entity, Wraith.Scene.Component component)void Clear(Wraith.Scene.Id entity, Wraith.Scene.ComponentKind kind)void Remove(Wraith.Scene.Id entity)void Handle(Wraith.Scene.ComponentKind kind, Wraith.Scene.Add? add, Wraith.Scene.Rename? rename, Wraith.Scene.Show? show)void set(Wraith::Scene_Id entity, Wraith::Scene_Component component) constvoid clear(Wraith::Scene_Id entity, Wraith::Scene_ComponentKind kind) constvoid remove(Wraith::Scene_Id entity) constvoid handle(Wraith::Scene_ComponentKind kind, Wraith::Scene_Add add, Wraith::Scene_Rename rename, Wraith::Scene_Show show) constpub fn set(&self, entity: wraith::SceneId, component: wraith::SceneComponent)pub fn clear(&self, entity: wraith::SceneId, kind: wraith::SceneComponentKind)pub fn remove(&self, entity: wraith::SceneId)pub fn handle(&self, kind: wraith::SceneComponentKind, add: wraith::SceneAdd, rename: wraith::SceneRename, show: wraith::SceneShow)fn set(self: Wraith.Scene, entity: Wraith.Scene.Id, component: Wraith.Scene.Component) voidfn clear(self: Wraith.Scene, entity: Wraith.Scene.Id, kind: Wraith.Scene.ComponentKind) voidfn remove(self: Wraith.Scene, entity: Wraith.Scene.Id) voidfn handle(self: Wraith.Scene, kind: Wraith.Scene.ComponentKind, add: ?Wraith.Scene.Add, rename: ?Wraith.Scene.Rename, show: ?Wraith.Scene.Show) voidvoid Wraith_Scene_set(Wraith_Scene self, Wraith_Scene_Id entity, Wraith_Scene_Component component)void Wraith_Scene_clear(Wraith_Scene self, Wraith_Scene_Id entity, Wraith_Scene_ComponentKind kind)void Wraith_Scene_remove(Wraith_Scene self, Wraith_Scene_Id entity)void Wraith_Scene_handle(Wraith_Scene self, Wraith_Scene_ComponentKind kind, Wraith_Scene_Add add, Wraith_Scene_Rename rename, Wraith_Scene_Show show)Gives the entity the component, or changes it.
Uses Scene.Id, Scene.Component.
Uses Scene.Id, Scene.ComponentKind.
remove
Section titled “remove”It and every component it has.
Uses Scene.Id.
handle
Section titled “handle”What the plugin does when asked, for its entities with a kind component. Each callback adds a
button; a later call replaces them.
Uses Scene.ComponentKind, Scene.Add, Scene.Rename, Scene.Show.
Scene.Kind
Section titled “Scene.Kind”What an entity is, so ids of different kinds never clash: camera 0 and character 0 are two.
An enum of u8.
| Value | Name | |
|---|---|---|
| 0 | camera |
|
| 1 | character |
|
| 2 | object |
Anything else, like a prop or a weapon |
Scene.Id
Section titled “Scene.Id”An entity, unique among the plugin’s.
A struct, 0x10 bytes, aligned to 8.
| Offset | Field | Type | |
|---|---|---|---|
| 0x0 | kind |
Scene.Kind |
|
| 0x8 | key |
u64 |
The plugin’s own, stable while the thing’s around, like its address |
kind: Wraith.Scene.Kind | Wraith.Scene.KindNamekey: bigintkind: Wraith.Scene.Kind|Wraith.Scene.KindNamekey: integerWraith.Scene.Kind Kindulong KeyWraith::Scene_Kind kinduint64_t keypub kind: wraith::SceneKindpub key: u64kind: Wraith.Scene.Kindkey: u64Wraith_Scene_Kind kinduint64_t keyScene.Bone
Section titled “Scene.Bone”A struct, 0x18 bytes, aligned to 8.
| Offset | Field | Type | |
|---|---|---|---|
| 0x0 | name |
string |
Kept by it, so keep it stable across frames |
| 0x10 | parent |
i32 |
Its parent’s index, which must come before it, or -1 |
name: stringparent: numbername: stringparent: integerstring Nameint Parentsal::String nameint32_t parentpub name: salamander::Strpub parent: i32name: []const u8parent: i32sal_string nameint32_t parentScene.Shape
Section titled “Scene.Shape”One blend shape, or morph target, on one of a character’s meshes.
A struct, 0x28 bytes, aligned to 8.
| Offset | Field | Type | |
|---|---|---|---|
| 0x0 | name |
string |
Edits are kept by it and its mesh, so keep both stable |
| 0x10 | mesh |
string |
Which mesh it’s on, like the face or the body |
| 0x20 | toggle |
bool |
Only ever on or off: a checkbox, and its weight’s 0 or 1 |
name: stringmesh: stringtoggle: booleanname: stringmesh: stringtoggle: booleanstring Namestring Meshbool Togglesal::String namesal::String meshbool togglepub name: salamander::Strpub mesh: salamander::Strpub toggle: boolname: []const u8mesh: []const u8toggle: boolsal_string namesal_string meshbool toggleScene.Camera
Section titled “Scene.Camera”What the game projects its view through. Its transform is where it is, the view’s inverse.
A struct, 0x4c bytes, aligned to 4.
| Offset | Field | Type | |
|---|---|---|---|
| 0x0 | projection |
Mat4 |
The game’s own, exactly, row-vector style, since each engine’s differs |
| 0x40 | fov |
f32 |
Vertical, in radians |
| 0x44 | near |
f32 |
|
| 0x48 | far |
f32 |
projection: Wraith.Mat4fov: numbernear: numberfar: numberprojection: Wraith.Mat4fov: numbernear: numberfar: numberWraith.Mat4 Projectionfloat Fovfloat Nearfloat FarWraith::Mat4 projectionfloat fovfloat nearfloat farpub projection: wraith::Mat4pub fov: f32pub near: f32pub far: f32projection: Wraith.Mat4fov: f32near: f32far: f32Wraith_Mat4 projectionfloat fovfloat nearfloat farScene.ComponentKind
Section titled “Scene.ComponentKind”An enum of u8.
| Value | Name | |
|---|---|---|
| 0 | name |
|
| 1 | parent |
|
| 2 | transform |
|
| 3 | skeleton |
|
| 4 | attachment |
|
| 5 | camera |
|
| 6 | shapes |
Scene.Component
Section titled “Scene.Component”A struct, 0x58 bytes, aligned to 8.
| Offset | Field | Type | |
|---|---|---|---|
| 0x0 | tag |
Scene.ComponentKind |
|
| 0x8 | payload |
Scene.Component.Members |
tag: Wraith.Scene.ComponentKind | Wraith.Scene.ComponentKindNamepayload: Wraith.Scene.Component.Memberstag: Wraith.Scene.ComponentKind|Wraith.Scene.ComponentKindNamepayload: Wraith.Scene.Component.MembersWraith.Scene.ComponentKind TagWraith.Scene.Component.Members PayloadWraith::Scene_ComponentKind tagWraith::Scene_Component_Members payloadpub tag: wraith::SceneComponentKindpub payload: wraith::SceneComponentMemberstag: Wraith.Scene.ComponentKindpayload: Wraith_Scene_Component_MembersWraith_Scene_ComponentKind tagWraith_Scene_Component_Members payloadScene.Add
Section titled “Scene.Add”The player asked for a new one, like a camera where the view is. Render thread.
Wraith.Scene.AddWraith.Scene.AddWraith.Scene.AddWraith::Scene_Addwraith::SceneAddWraith.Scene.AddWraith_Scene_AddScene.Rename
Section titled “Scene.Rename”The player renamed entity. Set its new name. Render thread.
Wraith.Scene.RenameWraith.Scene.RenameWraith.Scene.RenameWraith::Scene_Renamewraith::SceneRenameWraith.Scene.RenameWraith_Scene_RenameScene.Show
Section titled “Scene.Show”The player wants entity in use, or key 0 for the game’s own. Render thread.
Wraith.Scene.ShowWraith.Scene.ShowWraith.Scene.ShowWraith::Scene_Showwraith::SceneShowWraith.Scene.ShowWraith_Scene_Showwraith.io · Mods on the Hub · Get Wraith
Made with ♥ by Asgard
