Bindings: Rust¶
557 public names in bindings/rust/sona/src/lib.rs, bindings/.
Functions and constants¶
| Declaration | What it does |
|---|---|
const MANIFEST_BYTES: usize = sys::SONA_MANIFEST_BYTES |
The value of SONA_MANIFEST_BYTES: an AvatarDescription |
const JOINTS: usize = sys::SONA_JOINTS |
The value of SONA_JOINTS: palette slots; the avatar rig animates 71 |
const PALETTE_FLOATS: usize = sys::SONA_PALETTE_FLOATS |
The value of SONA_PALETTE_FLOATS: 72 joints x 3 float4 |
const VERTEX_STRIDE: usize = sys::SONA_VERTEX_STRIDE |
The value of SONA_VERTEX_STRIDE: the runtime vertex, see sona_mesh |
fn version() -> &'static str |
The library's version, "1.1.0". Calls sona_version. |
fn platform() -> &'static str |
The binary platform id compiled into the library: "linux-x64", "windows-x64", Calls sona_platform. |
fn check_layout() -> Result<usize> |
Compares every struct size and field offset sona360-sys mirrors with the library's own tables. |
fn interaction_defaults(kind: u32) -> sys::sona_interaction_desc |
A desc for one kind (sona_sys:: Calls sona_interaction_defaults. |
fn seat_defaults(kind: u32) -> sys::sona_seat |
size set and a seat of that kind: height 0.45 (0 for GROUND), depth 0.45 (unlimited for GROUND), width 0.5 for a chair, 1.4 for a bench and unlimited on the ground. Calls sona_seat_defaults. |
fn interaction_layout(desc: &sys::sona_interaction_desc) -> Result<sys::sona_interaction_plan> |
Where the interaction would stand its avatars and where the contacts meet. Calls sona_interaction_layout. |
fn skeleton_bone(skeleton: Skeleton, joint: u32) -> Option<&'static str> |
The bone a joint is in that skeleton; None for a joint it has none for. Calls sona_skeleton_bone. |
fn skeleton_joint(skeleton: Skeleton, bone: &str) -> Option<u32> |
The joint a bone of that skeleton is. Calls sona_skeleton_joint. |
fn joint_find(name: &str) -> Option<u32> |
A joint by name: "Hips", "Head", "PropRight", "shape_04", "joint_33". Calls sona_joint_find. |
fn joint_name(joint: u32) -> Option<&'static str> |
None past the last joint. Calls sona_joint_name. |
fn ik_target_defaults() -> sys::sona_ik_target |
The defaults Context:: Calls sona_ik_target_defaults. |
fn ik_feet_defaults() -> sys::sona_ik_feet |
SONA_IK_GROUND_PLANE with the plane y = 0, weight 1, hips offset at most 0.45 m, tilt at most 35 degrees, and the smoothing a default of 0.1 s. Calls sona_ik_feet_defaults. |
fn ik_look_defaults() -> sys::sona_ik_look |
Its defaults are head and eyes, weight 1, yaw 70, up 35, down 45 degrees, smoothing by default 0.15 s, a turn rate of 360 degrees a second, eyes past 10. Calls sona_ik_look_defaults. |
fn ik_limits_defaults() -> sys::sona_ik_limits |
Elbows 145, knees 150, wrists 75 swing and 80 twist, ankles 45 and 30 degrees, hips 120 forward, 25 behind, 45 out and 25 in, shoulders 45 behind (held level) and 50 across, reach easing from 0.97, a 0.02 m body margin, Calls sona_ik_limits_defaults. |
fn ragdoll_defaults() -> sys::sona_ragdoll_options |
size set; coverage 0.9. Calls sona_ragdoll_defaults. |
fn sway_defaults() -> sys::sona_sway |
Parts SONA_SWAY_DEFAULT, medium quality, stiffness and damping 0.5, wind scale 1, 48 minimum pixels. Calls sona_sway_defaults. |
fn sway_world_defaults() -> sys::sona_sway_world |
Gravity 0 -9.81 0, no wind, gust 0.35 with a period of 1.5 s. Calls sona_sway_world_defaults. |
fn lod_defaults() -> LodOptions |
The level-of-detail defaults, with sprites on at 48 px. Calls sona_lod_defaults. |
fn placeholder_defaults() -> sys::sona_placeholder_options |
The loading placeholders' defaults (sona.h 3.8d). Calls sona_placeholder_defaults. |
fn preview_defaults() -> PreviewOptions |
Fills the defaults above. Calls sona_preview_defaults. |
fn stock_clip_count() -> u32 |
The clips in the library: 100 (SONA_STOCK_CLIP_COUNT). Calls sona_stock_clip_count. |
fn stock_clip(id: u32) -> Option<StockClip> |
The clip with this id (SONA_STOCK_*: bytes 4 to 7 of its asset id). Calls sona_stock_clip_get. |
fn stock_clip_at(index: u32) -> Option<StockClip> |
The clip at index, in id order. Calls sona_stock_clip_at. |
fn stock_clip_find(name: &str) -> Option<u32> |
By name ("wave"), asset id or a key of Context::clips ("GenericWave"). Calls sona_stock_clip_find. |
fn stock_clip_for_body(id: u32, body: u32) -> u32 |
The clip of id's family made for body (1 male, 2 female). Calls sona_stock_clip_for_body. |
fn stock_clips_tagged(all: u32, none: u32, body: u32) -> Vec<StockClip> |
Clips with every tag of all and none of none that suit body (0 any, 1 male, 2 female), by id. Calls sona_stock_clips_tagged. |
fn clip_tag_name(tag: u32) -> Option<&'static str> |
The name of one tag bit ("idle", "travel",...); NULL for 0, several bits or an unknown bit. Calls sona_clip_tag_name. |
fn clip_tag_find(name: &str) -> u32 |
The bit for a tag name; 0 when none. Calls sona_clip_tag_find. |
fn idle_defaults() -> IdleOptions |
size set, parts SONA_IDLE_ALL, seed 0, amount 1, face_px 240. Calls sona_idle_defaults. |
fn idle_sample(o: &IdleOptions, seconds: f64) -> Result<IdleState> |
The idle's channels at seconds for o.seed and o.parts, before amount. Calls sona_idle_sample. |
fn pixel_defaults() -> PixelOptions |
size set, height 32, colours 16, flags SONA_PIXEL_OUTLINE, outline 0 (from the palette), alpha_cut 0.5, no palette. Calls sona_pixel_defaults. |
fn sticker_defaults() -> StickerOptions |
size set, pixels 512, time -1, framing SONA_PRESET_FULL, outline_px 10, outline 0xffffffff, shadow 0x59000000 (off while shadow_px is 0), padding 8. Calls sona_sticker_defaults. |
fn sheet_defaults() -> SheetOptions |
size set, 8 frames, 8 directions, px_per_metre 64, padding 2, max_page 4096, draw_flags SONA_DRAW_NO_BLOOM; every other field 0 (the whole clip, facing the camera first, side on, orthographic, packed and trim Calls sona_sheet_defaults. |
fn style_defaults() -> Style |
Style with its size set: the original look, no outline. Calls sona_style_defaults. |
fn quality_defaults() -> Quality |
The web SDK's: automatic MSAA, MIPS | CUTOUT_MIPS. Calls sona_quality_defaults. |
fn lighting_defaults() -> Lighting |
A key and fill switched off, the built-in environment, a fitted shadow map. Calls sona_lighting_defaults. |
fn environment_defaults() -> sys::sona_environment |
size set; kind BUILTIN, skin_red 1.2 (the built-in's). Calls sona_environment_defaults. |
fn environment_irradiance(sh9: &[f32; 27]) -> Option<[f32; 27]> |
The irradiance the lit shader evaluates for 9 RGB SH coefficients of radiance. |
fn shader_source(lang: sys::sona_shader_lang, prog: sys::sona_program, stage: i32) -> Option<&'static [u8]> |
Text, or SPIR-V bytes; None when that language is not in this build. Calls sona_shader_source. |
fn view_defaults() -> View |
The web's full-body framing. Calls sona_view_defaults. |
fn camera_orbit(view: &mut View, target: [f64; 3], yaw_deg: f64, pitch_deg: f64, distance: f64) |
Places the eye on an orbit around target. |
fn view_matrices(view: &View) -> ([f32; 16], [f32; 16]) |
Row-vector (view, projection), D3D depth 0..1. |
fn guid_parse(text: &str) -> Result<Guid> |
Parses the 36-character text form. Calls sona_guid_parse. |
fn guid_format(id: &Guid) -> String |
The id in its lowercase 36-character form. Calls sona_guid_format. |
fn slot_of(id: &Guid) -> (Route, u32) |
Where an item goes, and its slot mask. Calls sona_slot_of. |
fn base64_decode(text: &str) -> Result<Vec<u8>> |
The bytes the base64 text holds. Calls sona_base64_decode. |
fn section_name(section: u32) -> Option<&'static str> |
"shirt", "facialHair", Calls sona_catalogue_section_name. |
fn prop_attach_defaults() -> sys::sona_prop_attach |
The defaults of a prop attachment (joint SONA_PROP_JOINT_AUTO, no offset, no second hand). Calls sona_prop_attach_defaults. |
fn prop_part_defaults() -> sys::sona_prop_part |
size set; colour 0xffffffff. Calls sona_prop_part_defaults. |
fn prop_pets() -> Vec<String> |
The catalogue's pets, as the site's pet mode lists them. Calls sona_prop_pet_count, sona_prop_pet, sona_guid_format. |
fn prop_is_pet(item_id: &str) -> bool |
1 when the item id is one of the pets. Calls sona_prop_is_pet. |
fn mask_preset(preset: Mask) -> [f32; sys::SONA_JOINT_COUNT] |
Fills a mask: SONA_MASK_NONE, _FULL, _UPPER_BODY (Spine and below it), _LOWER_BODY (the hips and legs), _HEAD (from the Neck), _LEFT_ARM, _RIGHT_ARM, _ARMS (from the shoulders). |
fn mask_branch(mask: &mut [f32; sys::SONA_JOINT_COUNT], joint: u32, weight: f32) -> Result<()> |
Sets joint and every joint below it to weight. |
fn phoneme_mouth(symbol: &str) -> Option<u8> |
The mouth for a phoneme symbol (ARPAbet, IPA, viseme names or ids); None when it is none of them. Calls sona_phoneme_mouth. |
fn lipsync_phonemes(phonemes: &[(&str, f32, f32)]) -> Result<Vec<MouthKey>> |
Timed phonemes (symbol, start, end) to mouth keys. Calls sona_lipsync_phonemes. |
fn lipsync_text(text: &str, pcm: Option<&[f32]>, sample_rate: u32) -> Result<Vec<MouthKey>> |
Text to mouth keys, aligned to mono float audio at sample_rate when given, else at an even pace. Calls sona_lipsync_text. |
fn mouth_keys_sample(keys: &[MouthKey], t: f64) -> LipSyncFrame |
The mouth at time t of a key list. Calls sona_mouth_keys_sample. |
fn headless_devices(backend: sys::sona_backend) -> Vec<HeadlessDevice> |
Every device a headless renderer can open (backend 0: all of them). Calls sona_headless_devices. |
fn video_formats(ffmpeg: Option<&str>) -> u32 |
Bit 1 << SONA_VIDEO_* for each format this machine can write. Calls sona_video_formats. |
fn outfit_check(manifest: &[u8], maker: Option<&Maker<'_>>) -> Result<OutfitReport> |
Every issue of a manifest, errors first. Calls sona_outfit_check. |
fn outfit_fix(manifest: &mut [u8], maker: Option<&Maker<'_>>) -> Result<OutfitReport> |
Mends every error but a missing body in place; the report is the check after. Calls sona_outfit_fix. |
fn outfit_clash(a: &Guid, b: &Guid, maker: Option<&Maker<'_>>) -> (u32, u32) |
sona_sys:: Calls sona_outfit_clash. |
fn region_name(region: u32) -> Option<&'static str> |
None past the last region. Calls sona_region_name. |
fn view_ray(view: &View, x: f64, y: f64) -> Result<([f32; 3], [f32; 3])> |
The ray through (x, y) of the view's picture, pixels from its top left: (origin, unit direction). |
fn abi() -> Result<sys::sona_abi_info> |
The loaded library's ABI: abi, oldest_abi (the oldest a caller may be built against) and its version. Calls sona_abi_query. |
fn tier_defaults() -> sys::sona_tier_options |
size set; target_fps 60, avatars 20. Calls sona_tier_defaults. |
fn ik_foot_lock_defaults() -> sys::sona_ik_foot_lock |
size set; weight 1, max_slide 0.25, release_seconds 0.15. Calls sona_ik_foot_lock_defaults. |
fn ik_spine_defaults() -> sys::sona_ik_spine |
size set; weight 1, max_bend_deg 35, max_twist_deg 40, hips_share 0.2. Calls sona_ik_spine_defaults. |
fn ik_fingers_defaults() -> sys::sona_ik_fingers |
size set; spread 0, weight 1, fade_seconds 0.15. Calls sona_ik_fingers_defaults. |
fn ik_eyes_defaults() -> sys::sona_ik_eyes |
size set; max_speed_deg 400, smoothing 0.05, lead_seconds 0.08. Calls sona_ik_eyes_defaults. |
fn emote_from_text(text: &str) -> Result<sys::sona_emote> |
A sentence to stock clips (with weights to blend), a speed and a face. Calls sona_emote_from_text. |
Code¶
struct Code(pub i32): A sona_result.
| Declaration | What it does |
|---|---|
fn name(self) -> &'static str |
The web SDK's word for it: "licence", "gate",... Calls sona_result_name. |
fn is_error(self) -> bool |
True for a failed result (a negative sona_result). |
Error¶
struct Error: An error: the code, what happened and what to do about it.
| Declaration | What it does |
|---|---|
fn new(code: Code, message: impl Into<String>, fix: impl Into<String>) -> Error |
An Error from a code, a message and a fix. |
Request¶
struct Request: One read in flight.
| Declaration | What it does |
|---|---|
fn id(&self) -> RequestId |
The read's id, as the source was given it. |
fn complete(self, bytes: &[u8]) |
The container bytes as stored (YTGR, raw STRB or an STFS package); the core copies them. |
fn not_found(self) |
This source does not have it; the next source is asked. |
fn failed(self) |
It failed; the core retries later. |
fn finish(self, status: Code, bytes: &[u8]) |
Finishes one read, exactly once, also after cancel; the request stays valid until then. Calls sona_complete. |
Config¶
struct Config: What Context::open needs.
| Declaration | What it does |
|---|---|
fn new() -> Config |
Sets abi and leaves everything else at its default. Calls sona_config_defaults. |
fn app_id(mut self, id: &str) -> Self |
None (the default): the app id stamped into this build. |
fn licence(mut self, bytes: impl Into<Vec<u8>>) -> Self |
The bytes of sona-licence. |
fn licence_file(self, path: impl AsRef<Path>) -> std::io::Result<Self> |
Reads the licence from a file into the config. |
fn dir(mut self, path: impl AsRef<Path>) -> Self |
A folder of item files you own, laid out as the gate serves them. |
fn console(mut self, content_root: impl AsRef<Path>) -> Self |
A console's Content root, or a PC folder holding a copy of one. |
fn gate(mut self, base: Option<&str>) -> Self |
The 360sona gate; None for https:/ |
fn source(mut self, s: impl Source + 'static) -> Self |
A host-written source. The C type sona_source. |
fn worker_threads(mut self, n: i32) -> Self |
-1: cores - 1 (default); 0: none, work runs inside update. |
fn seed(mut self, seed: u32) -> Self |
0: from the clock. |
fn max_avatars(mut self, n: u32) -> Self |
Default 256, at most 16384. The C field sona_config. |
fn build_budget_ms(mut self, ms: f32) -> Self |
owner-thread loading work per sona_update (steps, commits; builds run on the workers); default 6. The C field sona_config. |
fn face_size(mut self, px: u32) -> Self |
0: auto; or 128, 256, 512. |
fn flags(mut self, flags: u32) -> Self |
sona_sys:: |
fn budget(mut self, b: Budget) -> Self |
The C field sona_config. |
fn check_host(mut self, host: &str) -> Self |
NULL: https:/ |
fn log(mut self, f: impl Fn(LogLevel, &str) + Send + Sync + 'static) -> Self |
Called from any thread. |
Context¶
struct Context: Owns a sona_ctx.
| Declaration | What it does |
|---|---|
fn open(cfg: Config) -> Result<Context> |
Checks the struct layout, then the licence. Calls sona_open. |
fn raw(&self) -> *mut sys::sona_ctx |
The native pointer this value wraps, for a call through sona360-sys that the safe layer does not cover. |
fn app_id(&self) -> String |
The app id this context runs as. Calls sona_app_id. |
fn last_error(&self) -> Option<Error> |
The last error on a ctx. Calls sona_last_error. |
fn frame(&self) -> Result<Frame<'_>> |
The context's one frame: updating and posing. |
fn add(&self, manifest: &[u8], opts: &AddOptions) -> Result<Avatar<'_>> |
Queues an avatar from its 1000 manifest bytes. Calls sona_avatar_add. |
fn add_manifest(&self, m: &Manifest, opts: &AddOptions) -> Result<Avatar<'_>> |
Adds an avatar from a Manifest (sona_avatar_add); it builds in the background. |
fn add_base64(&self, b64: &str, opts: &AddOptions) -> Result<Avatar<'_>> |
The same from base64 text (at most 4096 characters). Calls sona_avatar_add_base64. |
fn add_waiting(&self, opts: &AddOptions) -> Result<Avatar<'_>> |
An avatar whose manifest is not known: QUEUED, a neutral figure while placeholders are on, until Avatar:: Calls sona_avatar_add_waiting. |
fn poll_event(&self) -> Option<Event> |
The next event, or None when there are none; call it until it is None. Calls sona_poll_event, sona_avatar_id. |
fn clips(&self) -> Vec<ClipInfo> |
How many clips the context knows. Calls sona_clip_count, sona_clip_get. |
fn stats(&self) -> SceneStats |
The scene statistics. Calls sona_stats. |
fn shading(&self) -> Result<Option<Shading>> |
None until the data files have loaded (SONA_PENDING). Calls sona_shading_get. |
fn credit(&self, scale: u32) -> Result<Credit> |
The badge and its words. Calls sona_credit_get. |
fn png_encode(&self, rgba: &[u8], width: u32, height: u32) -> Result<Vec<u8>> |
PNG bytes with the web's three tEXt chunks (Software, Source, Comment). Calls sona_png_encode, sona_free. |
fn fit_crowd(&self, view: &mut View) |
Fits every ready avatar (the web preset "crowd"). Calls sona_camera_fit_crowd. |
fn set_lod(&self, o: Option<&LodOptions>) -> Result<()> |
Level of detail and sprites from the next update. Calls sona_lod_set. |
fn set_sway_world(&self, w: Option<&sys::sona_sway_world>) -> Result<()> |
The gravity and wind every swaying avatar feels; None for the defaults. Calls sona_sway_world_set. |
fn lod(&self) -> Result<LodOptions> |
Copies the current options: before any sona_lod_set, thresholds 120 and 40 and no sprites (sprite_px 0). Calls sona_lod_get. |
fn lod_stats(&self) -> LodStats |
The level-of-detail statistics: avatars in view at each step, those fading, the baked looks and the bakes of the last draw. Calls sona_lod_stats_get. |
fn set_placeholders(&self, o: Option<&sys::sona_placeholder_options>) -> Result<()> |
Loading placeholders from the next update; None: placeholder_defaults. Calls sona_placeholder_set. |
fn placeholders(&self) -> Result<Option<sys::sona_placeholder_options>> |
The options in use; None while placeholders are off. Calls sona_placeholder_get. |
fn placeholders_off(&self) -> Result<()> |
Figures shown now fade out over appear_seconds. Calls sona_placeholder_off. |
fn placeholder_stats(&self) -> sys::sona_placeholder_stats |
Figures in view at the last sona_update (by phase, and how many as sprites), how many were posed and the time that took, and the figure draws of the last sona_draw or sona_snapshot. Calls sona_placeholder_stats_get. |
fn pixel_art(&self, rgba: &[u8], width: u32, height: u32, opts: &PixelOptions) -> Result<Picture> |
Crisp pixel art from a straight RGBA8 picture (sona.h 3.12d): opaque or clear pixels, a small palette. Calls sona_pixel_art. |
fn pixel_palette(&self, pictures: &[(&[u8], u32, u32)], colours: u32) -> Result<Vec<u32>> |
One palette (0xFFRRGGBB, darkest first) for several (rgba, width, height) pictures. Calls sona_pixel_palette. |
fn add_item_preview(&self, item_id: &str, opts: &PreviewOptions) -> Result<Avatar<'_>> |
One item worn alone on a grey stand-in body, framed by its slot. Calls sona_item_preview_add. |
fn start_interaction(&self, desc: &sys::sona_interaction_desc) -> Result<Interaction<'_>> |
Starts an interaction; fill the desc from interaction_defaults and set a and b (or b null for SIT) from Avatar::raw. Calls sona_interaction_start. |
fn param_id(&self, name: &str) -> Option<u32> |
The id of a parameter name, numbered from 0 in the order first asked for; None for a bad name or past 32. Calls sona_param_id. |
fn blend_space(&self, param_x: &str, param_y: Option<&str>, samples: &[BlendSample<'_>], unsynced: bool, smooth_seconds: f32,) -> Result<BlendSpace<'_>> |
A blend space over param_x (and param_y when 2D); one serves every avatar of the context. Calls sona_blend_space_defaults, sona_blend_space_create. |
fn state_machine(&self, states: &[StateSpec<'_>], transitions: &[TransitionSpec<'_>], initial: Option<&str>,) -> Result<StateMachine<'_>> |
A state machine; one serves every avatar of the context. Calls sona_state_machine_defaults, sona_state_machine_create. |
fn prop_mesh(&self, parts: &[sys::sona_prop_part]) -> Result<PropMesh<'_>> |
A prop mesh from triangles; the parts' pointers need to live only for the call. Calls sona_prop_mesh_create. |
fn prop_mesh_load(&self, bytes: &[u8], options: Option<&sys::sona_prop_load_options>) -> Result<PropMesh<'_>> |
A glTF 2.0 file (.glb, or.gltf with embedded buffers) as a prop mesh. Calls sona_prop_mesh_load. |
fn prop_mesh_stock(&self, item_id: &str) -> Result<PropMesh<'_>> |
A stock prop item (a carryable) of the catalogue; its state is SONA_PENDING until it has loaded. Calls sona_prop_mesh_stock. |
fn pick_ray(&self, origin: [f32; 3], dir: [f32; 3], o: &PickOptions) -> Result<Option<PickHit>> |
The nearest hit along the ray; None when nothing is hit. |
fn pick_screen(&self, view: &View, x: f64, y: f64, o: &PickOptions) -> Result<Option<PickHit>> |
The nearest hit under (x, y) of the view's picture, sprites facing that view. Calls sona_pick_screen. |
fn pick_ray_all(&self, origin: [f32; 3], dir: [f32; 3], cap: usize, o: &PickOptions) -> Vec<PickHit> |
Every avatar the ray hits, its nearest hit each, nearest first (at most cap). |
fn tier_apply(&self, renderer: Option<*mut sys::sona_renderer>, o: Option<&sys::sona_tier_options>) -> Result<()> |
Quality for a class of device on the ctx and, with one, a renderer. Calls sona_tier_apply. |
fn item_colourways(&self, item_id: &str) -> Result<Option<Vec<[u32; 3]>>> |
An item's colourways (0xFFRRGGBB primary, secondary, tertiary). |
fn custom_item_pack_mesh(&self, m: &MeshItem) -> Result<Option<Vec<u8>>> |
A.sonaitem (format 1.1) from your own skinned glTF binary. Calls sona_mesh_item_spec_defaults, sona_custom_item_pack_mesh, sona_free. |
fn award_define(&self, key: &str, title: &str, description: &str, item: &str, developer_key: &str) -> Result<u32> |
Defines an award item for the app (tools only: it takes the developer key). Calls sona_award_def_defaults, sona_award_define. |
fn award_unlock(&self, player_token: &str, key: &str) -> Result<u32> |
Unlocks an award for a signed-in player. Calls sona_award_unlock. |
fn award_poll(&self, ticket: u32) -> Result<bool> |
Ok(false) while it runs, then Ok(true) once, or how it failed. Calls sona_award_poll. |
Interaction¶
struct Interaction<'c>: A running two-avatar interaction or seat.
| Declaration | What it does |
|---|---|
fn raw(&self) -> *mut sys::sona_interaction |
The native pointer this value wraps, for a call through sona360-sys that the safe layer does not cover. |
fn end(&mut self) -> Result<()> |
Begins the end phase: letting go, standing up. Calls sona_interaction_end. |
fn move_to(&mut self, position: [f32; 3], turn_deg: f32) -> Result<()> |
Moves the place (or the seat) while it runs. |
fn status(&self) -> Result<sys::sona_interaction_status> |
Where an interaction is: its kind and phase, the time in the phase and how far through it, whether the contacts are together, the widest gap at a contact, the clearance between the two bodies (negative: into each other), Calls sona_interaction_status_get. |
fn events(&mut self) -> Vec<sys::sona_interaction_event> |
The events since the last call, oldest first. Calls sona_interaction_events. |
Frame¶
struct Frame<'c>: Updating and posing.
| Declaration | What it does |
|---|---|
fn update(&mut self, dt_seconds: f64, view: Option<&View>) -> Result<FrameStats> |
Advances every avatar by dt (clamped to 0..0.1 s), builds inside the budget, culls and poses. Calls sona_update. |
fn pose<'a>(&'a self, avatar: &'a mut Avatar<'c>) -> Result<Pose<'a>> |
The avatar's pose as of the last update. Calls sona_pose. |
fn pose_vertices(&self, avatar: &mut Avatar<'c>, mesh: u32, space: Space, positions: &mut [f32], normals: Option<&mut [f32]>, stride_floats: usize,) -> Result<()> |
CPU skinning of one mesh. Calls sona_pose_vertices. |
AvatarState¶
enum AvatarState: The C type sona_avatar_state.
| Declaration | What it does |
|---|---|
fn settled(self) -> bool |
Ready or failed: nothing more will happen without a new clip or manifest. |
AddOptions¶
struct AddOptions: The C type sona_add_options.
| Declaration | What it does |
|---|---|
fn clip(mut self, clip: &str) -> Self |
A clip key, a raw clip id, "prop", "idle" or "still"; NULL: "idle". The C field sona_add_options. |
fn start_at(mut self, seconds: f32) -> Self |
Seconds; negative means random, to desynchronise a crowd. The C field sona_add_options. |
Avatar¶
struct Avatar<'c>: One avatar in a context.
| Declaration | What it does |
|---|---|
fn raw(&self) -> *mut sys::sona_avatar |
The native pointer this value wraps, for a call through sona360-sys that the safe layer does not cover. |
fn id(&self) -> u32 |
Unique within the context; events name avatars by it. Calls sona_avatar_id. |
fn state(&self) -> AvatarState |
The avatar's state. Calls sona_avatar_state_of. |
fn export(&self, opts: &ExportOptions) -> Result<(Vec<u8>, ExportReport)> |
The avatar as a.vrm (1.0 or 0.x) or.glb file, and what went into it. Calls sona_export_defaults, sona_export_avatar, sona_free. |
fn play(&mut self, clip: &str, opts: &PlayOptions) -> Result<()> |
Before READY it is remembered and applied when the avatar appears. Calls sona_avatar_play. |
fn stop(&mut self) |
Holds the current pose. Calls sona_avatar_stop. |
fn move_to(&mut self, to: &Placement, over_seconds: f32) |
Moves the avatar to a new placement over over_seconds. Calls sona_avatar_move. |
fn set_visible(&mut self, visible: bool) |
Shows or hides it. Calls sona_avatar_set_visible. |
fn bounds(&self) -> ([f32; 3], f32) |
(centre, radius) |
fn camera_preset(&self, preset: Preset, view: &mut View) -> Result<()> |
Sets view.eye and view.target to one of the console's framings on this (ready) avatar. Calls sona_camera_preset. |
fn remove(self) |
Frees what only it used. |
fn joint_world(&self, joint: u32) -> Result<[f32; 16]> |
A joint's world matrix at the last update: row-vector, metres, the placement applied. |
fn set_override(&mut self, joint: u32, rotation: Option<[f32; 4]>, weight: f32, mode: OverrideMode) -> Result<()> |
A pose override, applied after the clip each frame. |
fn clear_overrides(&mut self) |
Clears every override of the avatar. Calls sona_avatar_clear_overrides. |
fn crossfade(&mut self, clip: &str, opts: &PlayOptions, seconds: f32) -> Result<()> |
Avatar::play, blending from the current pose over seconds (0: a cut). Calls sona_avatar_crossfade. |
fn queue(&mut self, clip: &str, opts: &PlayOptions, fade_seconds: f32) -> Result<()> |
Plays clip when the current one ends. Calls sona_avatar_queue. |
fn queued(&self) -> u32 |
How many clips are waiting in the queue. Calls sona_avatar_queued. |
fn capsule(&self) -> Result<Capsule> |
A vertical capsule around the posed body, in world space. Calls sona_avatar_capsule. |
fn set_expression(&mut self, values: Option<[u8; 5]>) -> Result<()> |
mouth, left eyebrow, right eyebrow, left eye, right eye: a shape index, or 255 to leave that part to the clip. |
fn attach_prop(&mut self, mesh: &PropMesh<'_>, options: Option<&sys::sona_prop_attach>) -> Result<u32> |
Attaches a prop mesh; returns its id on this avatar. Calls sona_avatar_prop_attach. |
fn set_prop(&mut self, id: u32, options: &sys::sona_prop_attach) -> Result<()> |
New placement, flags or hand for an attached prop (each frame for one that moves on the joint). Calls sona_avatar_prop_set. |
fn swap_prop(&mut self, id: u32, mesh: &PropMesh<'_>) -> Result<()> |
Another mesh in the same place: a sword for a stick, an item for a placeholder. Calls sona_avatar_prop_swap. |
fn detach_prop(&mut self, id: u32) -> Result<()> |
Takes the prop off at once (its hand's IK target eases off). Calls sona_avatar_prop_detach. |
fn detach_all_props(&mut self) |
Takes every prop off the avatar at once. Calls sona_avatar_prop_detach_all. |
fn props(&self) -> Vec<u32> |
The ids of the avatar's props, in attach order. Calls sona_avatar_prop_list. |
fn prop_frame(&self, id: u32) -> Result<sys::sona_prop_frame> |
One prop as the last update posed it (its palette pointer is valid until the next update). Calls sona_avatar_prop_frame. |
fn set_ik_target(&mut self, limb: u32, target: Option<&sys::sona_ik_target>) -> Result<()> |
A hand or foot target (sona_sys:: Calls sona_avatar_ik_target. |
fn set_ik_feet(&mut self, feet: Option<&sys::sona_ik_feet>) -> Result<()> |
Foot planting; None turns it off. Calls sona_avatar_ik_feet. |
fn set_ik_ground(&mut self, foot: u32, ground: Option<([f32; 3], [f32; 3])>) -> Result<()> |
SONA_IK_GROUND_POINTS: the ground under one foot; None for no ground there. |
fn set_style(&mut self, style: Option<&Style>) -> Result<()> |
The avatar's own art style; None clears it and the renderer's applies. Calls sona_avatar_set_style. |
fn style(&self) -> Result<Style> |
The avatar's own art style (style_defaults when it has none). Calls sona_avatar_style. |
fn set_ik_look(&mut self, look: Option<&sys::sona_ik_look>) -> Result<()> |
Look-at; None eases back to the clip. Calls sona_avatar_ik_look. |
fn set_ik_limits(&mut self, limits: Option<&sys::sona_ik_limits>) -> Result<()> |
Joint limits and the body checks; None for the defaults. Calls sona_avatar_ik_limits. |
fn clear_ik(&mut self) |
Every target, the planting and the look-at off at once. Calls sona_avatar_ik_clear. |
fn set_placeholder(&mut self, mode: i32) -> Result<()> |
Its loading placeholder: -1 follows the context, 0 never, 1 always. Calls sona_avatar_placeholder. |
fn placeholder(&self) -> Result<sys::sona_placeholder_info> |
The avatar's figure at the last sona_update: its phase, opacity, height, which figure (male, female or neutral), whether it plays the avatar's clip, the seconds since the avatar was added and whether it is drawn as a s Calls sona_avatar_placeholder_info. |
fn set_manifest(&mut self, manifest: &[u8]) -> Result<()> |
The manifest of an avatar added with Context:: Calls sona_avatar_set_manifest. |
fn set_manifest_base64(&mut self, b64: &str) -> Result<()> |
sona_avatar_set_manifest with the manifest as base64 text. Calls sona_avatar_set_manifest_base64. |
fn ik_status(&self) -> Result<sys::sona_ik_status> |
What the last pose did. Calls sona_avatar_ik_status. |
fn ragdoll(&mut self, options: Option<&sys::sona_ragdoll_options>) -> Result<Vec<sys::sona_ragdoll_body>> |
The ragdoll bodies fitted to this avatar now (colliders, masses, joints and limits), for any physics engine; starts the pose history ragdoll_state takes velocities from. Calls sona_avatar_ragdoll. |
fn ragdoll_state(&self) -> Result<Vec<sys::sona_ragdoll_state>> |
The bodies at the last pose with their velocities. Calls sona_avatar_ragdoll_state. |
fn ragdoll_drive(&mut self, bodies: Option<&[sys::sona_ragdoll_state]>, weight: f32, flags: u32) -> Result<()> |
The host's simulated bodies onto the avatar from the next pose; weight 0..1 blends from the clip; None stops. Calls sona_avatar_ragdoll_drive. |
fn ragdoll_release(&mut self, blend_seconds: f32) -> Result<()> |
Back to the clip, blending from the last ragdoll pose over blend_seconds. Calls sona_avatar_ragdoll_release. |
fn ragdoll_info(&self) -> Result<sys::sona_ragdoll_info> |
The mode, the blend, where it lies and how to get up. Calls sona_avatar_ragdoll_info. |
fn ragdoll_clear(&mut self) |
Off at once: no tracking, no drive, no blend. Calls sona_avatar_ragdoll_clear. |
fn set_sway(&mut self, o: Option<&sys::sona_sway>) -> Result<()> |
Hair and cloth sway; None turns it off. Calls sona_avatar_sway. |
fn reset_sway(&mut self) |
Back to the modelled shape at the next pose. Calls sona_avatar_sway_reset. |
fn sway_info(&self) -> Result<sys::sona_sway_info> |
What sways and what the last pose did. Calls sona_avatar_sway_info. |
fn sway_mesh_parts(&self, mesh: u32) -> u32 |
The SONA_SWAY_* kinds one of the pose's meshes sways with. Calls sona_avatar_sway_mesh_parts. |
fn set_mouth(&mut self, shape: u8) -> Result<()> |
Only the mouth: a SONA_MOUTH_* or shape index, or 255 to hand it back to the clip. Calls sona_avatar_mouth. |
fn voice(&mut self, state: &mut VoiceMouth, level: f32, dt: f32) -> Result<()> |
Voice chat: this speaker's audio level (linear RMS) moves the mouth. Calls sona_avatar_voice. |
fn expression_counts(&self) -> Result<[u32; 3]> |
Shapes this face has: mouths, eyebrows, eyes. |
fn clip_events(&mut self) -> Vec<ClipEvent> |
What happened on the clip since the last call, oldest first. Calls sona_avatar_clip_events. |
fn mark(&mut self, seconds: f32, id: u32) -> Result<()> |
A ClipEventKind:: Calls sona_avatar_mark. |
fn clear_marks(&mut self) |
Removes the avatar's marks. Calls sona_avatar_clear_marks. |
fn set_root_motion(&mut self, mode: RootMotion) -> Result<()> |
What happens to the clip's sideways travel of the hips. Calls sona_avatar_root_motion. |
fn take_root_motion(&mut self) -> Result<[f32; 3]> |
The travel collected since the last call, in world metres; clears it. |
fn lod(&self) -> (Lod, f32) |
The step at the last update, and how far it is from mesh (0) to sprite (1). Calls sona_avatar_lod. |
fn layer_play(&mut self, layer: u32, clip: &str, opts: &LayerOptions) -> Result<()> |
Plays a clip key or raw clip id on a layer (0..7), over the avatar's own clip. Calls sona_avatar_layer_play. |
fn layer_blend(&mut self, layer: u32, blend: &BlendSpace<'c>, opts: &LayerOptions) -> Result<()> |
Plays a blend space of the same ctx on the layer. Calls sona_avatar_layer_blend. |
fn layer_machine(&mut self, layer: u32, machine: &StateMachine<'c>, opts: &LayerOptions) -> Result<()> |
Runs a state machine of the same ctx on the layer from its initial state (a STATE event with from_state -1). Calls sona_avatar_layer_machine. |
fn layer_goto(&mut self, layer: u32, state: u32, fade_seconds: f32) -> Result<()> |
Sends a machine layer to a state now, crossfading over fade_seconds. Calls sona_avatar_layer_goto. |
fn layer_weight(&mut self, layer: u32, weight: f32, over_seconds: f32) -> Result<()> |
Moves the layer's weight linearly to weight (0..1) over over_seconds; 0 or less sets it at once. Calls sona_avatar_layer_weight. |
fn layer_mask(&mut self, layer: u32, mask: Option<&[f32; sys::SONA_JOINT_COUNT]>) -> Result<()> |
None: every joint. |
fn layer_stop(&mut self, layer: u32, fade_seconds: f32) -> Result<()> |
Fades the layer out over fade_seconds and then empties it (a STOPPED event); 0 empties it now. Calls sona_avatar_layer_stop. |
fn layer_info(&self, layer: u32) -> Result<LayerInfo> |
The layer now: kind, mode, state (machines, else -1), clip (the sona_clip_get index, -1 for a raw id), weight with fades, time and normalized through the clip or cycle, ready (its clips have loaded) and Calls sona_avatar_layer_info. |
fn layer_events(&mut self) -> Vec<LayerEvent> |
What happened on the layers since the last call, oldest first. Calls sona_avatar_layer_events. |
fn set_param(&mut self, param: u32, value: f32) -> Result<()> |
Sets one parameter on the avatar; read at the next sona_update. Calls sona_avatar_set_param. |
fn set_params(&mut self, first: u32, values: &[f32]) -> Result<()> |
Parameters first.. Calls sona_avatar_set_params. |
fn param(&self, param: u32) -> f32 |
A parameter's value; 0 when unset or unknown. Calls sona_avatar_param. |
fn preview_bounds(&mut self) -> Result<([f32; 3], [f32; 3])> |
The previewed item's world box (lo, hi). |
fn preview_view(&mut self, width: u32, height: u32) -> Result<View> |
The framed camera for a width x height picture of this preview. Calls sona_item_preview_view. |
fn play_stock(&mut self, id: u32, opts: Option<&PlayOptions>, fade_seconds: f32) -> Result<()> |
A stock clip (an id from stock_clip_find), the variant for this avatar's body; fade_seconds > 0 crossfades. Calls sona_avatar_play_stock. |
fn set_idle(&mut self, o: Option<&IdleOptions>) -> Result<()> |
The procedural idle (blinks, glances, weight shifts, breathing over any clip); None turns it off. Calls sona_avatar_idle. |
fn idle_options(&self) -> Result<IdleOptions> |
The idle's options in use, seed resolved; parts 0 when off. Calls sona_avatar_idle_get. |
fn idle_state(&self) -> Result<IdleState> |
What the idle gave the last pose. Calls sona_avatar_idle_state. |
fn pick(&self, origin: [f32; 3], dir: [f32; 3], o: &PickOptions) -> Result<Option<PickHit>> |
The ray against this avatar alone; None when it misses. |
fn ik_foot_lock(&mut self, o: Option<&sys::sona_ik_foot_lock>) -> Result<()> |
Foot locking: planted feet stay where they landed. Calls sona_avatar_ik_foot_lock. |
fn ik_spine(&mut self, o: Option<&sys::sona_ik_spine>) -> Result<()> |
Spine assist for hand targets past reach. Calls sona_avatar_ik_spine. |
fn ik_fingers(&mut self, hand: u32, o: Option<&sys::sona_ik_fingers>) -> Result<()> |
Finger curl over the clip's, for SONA_IK_LEFT_HAND or SONA_IK_RIGHT_HAND. Calls sona_avatar_ik_fingers. |
fn ik_eyes(&mut self, o: Option<&sys::sona_ik_eyes>) -> Result<()> |
Eye turns under look-at. Calls sona_avatar_ik_eyes. |
fn ragdoll_motors(&self) -> Result<Vec<sys::sona_ragdoll_motor>> |
The joint motor targets of the last pose, in ragdoll's order. Calls sona_avatar_ragdoll_motors. |
fn emote(&mut self, e: &sys::sona_emote, fade_seconds: f32) -> Result<()> |
Plays an emote_from_text answer on the emote layers, faded in over fade_seconds. Calls sona_avatar_emote. |
StockClip¶
struct StockClip: One stock clip.
| Declaration | What it does |
|---|---|
fn tag_names(&self) -> Vec<&'static str> |
The tag names, in bit order. |
Pose¶
struct Pose<'a>: A view over sona_pose_data, valid until the next Frame::update.
| Declaration | What it does |
|---|---|
fn raw(&self) -> &'a sys::sona_pose_data |
The native pointer this value wraps, for a call through sona360-sys that the safe layer does not cover. |
fn build_version(&self) -> u32 |
Bumps when meshes, materials or textures change. |
fn world(&self) -> &'a [f32; 16] |
W = scale * rotateY(turn) * translate(position), row-vector. |
fn palette(&self) -> &'a [f32] |
864 floats: per joint 3 float4, columns 0..2 of the row-vector skin matrix, avatar space. |
fn view_joints(&self) -> &'a [f32] |
72 * 3 floats: each joint's translation before W. |
fn meshes(&self) -> &'a [Mesh] |
In draw order. |
fn materials(&self) -> &'a [Material] |
The C field sona_pose_data. |
fn textures(&self) -> &'a [Texture] |
The face sheet is one of them (its material has SONA_MAT_FACE). The C field sona_pose_data. |
fn props(&self) -> &'a [PropPalette] |
Size arrays by prop_count, which can pass 4. The C field sona_pose_data. |
fn expression(&self) -> [u8; 5] |
mouth, left eyebrow, right eyebrow, left eye, right eye |
Mesh¶
struct Mesh(sys::sona_mesh): One mesh: 76-byte vertices in host byte order and a u16 triangle list.
| Declaration | What it does |
|---|---|
fn raw(&self) -> &sys::sona_mesh |
The native pointer this value wraps, for a call through sona360-sys that the safe layer does not cover. |
fn item(&self) -> &str |
The item it came from. The C field sona_mesh.item (text (UTF-8)). |
fn mask(&self) -> u32 |
The item's AssetMask. The C field sona_mesh.mask (bit flags). |
fn batch(&self) -> u32 |
The C field sona_mesh.batch (count). |
fn material(&self) -> u32 |
Index into Pose:: |
fn pass(&self) -> Pass |
The C field sona_mesh.pass (sona_pass value). |
fn palette(&self) -> Option<usize> |
None: the body palette; else an index into Pose::props. |
fn vertex_count(&self) -> u32 |
The C field sona_mesh. |
fn index_count(&self) -> u32 |
The C field sona_mesh. |
fn vertices(&self) -> &[u8] |
Vertex_count * 76 bytes. The C field sona_mesh. |
fn indices(&self) -> &[u16] |
Triangle list. The C field sona_mesh. |
fn key(&self) -> u32 |
Stable while the geometry lives; shared by avatars wearing the same item. |
Texture¶
struct Texture: The C type sona_texture.
| Declaration | What it does |
|---|---|
fn raw(&self) -> &sys::sona_texture |
The native pointer this value wraps, for a call through sona360-sys that the safe layer does not cover. |
fn key(&self) -> u32 |
Stable while the texture lives; use it to cache uploads. |
fn version(&self) -> u32 |
Bumps when the pixels change (the face sheet). |
fn format(&self) -> i32 |
sona_sys:: |
fn width(&self) -> u32 |
The C field sona_texture. |
fn height(&self) -> u32 |
The C field sona_texture. |
fn data(&self) -> &[u8] |
Width * height * 4 bytes for RGBA8. The C field sona_texture. |
PropPalette¶
struct PropPalette: The C type sona_prop_palette.
| Declaration | What it does |
|---|---|
fn item(&self) -> &str |
The C field sona_prop_palette. |
fn playing(&self) -> bool |
While the prop's own clip plays; when false its meshes are not drawn. |
fn palette(&self) -> &[f32] |
864 floats. The C field sona_prop_palette. |
Manifest¶
struct Manifest: An avatar's description and its edit verbs: wear, take off, colours, gender, body shape.
| Declaration | What it does |
|---|---|
fn parse(bytes: &[u8]) -> Result<Manifest> |
Reads 1000 bytes into a sona_manifest. Calls sona_manifest_parse. |
fn from_base64(text: &str) -> Result<Manifest> |
A manifest from base64 text, as the web SDK and the lookup routes give them. |
fn to_bytes(&self) -> Result<Vec<u8>> |
Byte-exact: parse Calls sona_manifest_write. |
fn raw(&self) -> &sys::sona_manifest |
The native pointer this value wraps, for a call through sona360-sys that the safe layer does not cover. |
fn raw_mut(&mut self) -> &mut sys::sona_manifest |
The C struct sona_manifest, to change it field by field. |
fn gender(&self) -> u32 |
1 male, 2 female, 0 unknown. |
fn valid(&self) -> bool |
Derived: IsValid. The C field sona_manifest. |
fn wear(&mut self, item: &Guid, colours: [u32; 3], flags: u32) -> Result<()> |
sona_sys:: |
fn unwear(&mut self, slot_mask: u32, flags: u32) -> Result<()> |
Takes off what is in the slots of slot_mask. Calls sona_manifest_unwear. |
fn undress_all(&mut self) -> Result<()> |
Takes everything off. Calls sona_manifest_undress_all. |
fn set_colour(&mut self, colour_slot: u32, argb: u32) -> Result<()> |
Sets one of the nine body colours, by its index in colours. Calls sona_manifest_set_colour. |
fn set_gender(&mut self, gender: u32, flags: u32) -> Result<()> |
Sets the gender: 1 male, 2 female. Calls sona_manifest_set_gender. |
fn set_shape(&mut self, weight: f32, height: f32) -> Result<()> |
Sets the weight and height. Calls sona_manifest_set_shape. |
fn ready_for_xbox(&self) -> bool |
1 when the body (and so the gender) is known and the editor's Xbox clean-up would change nothing: the manifest can be saved to Xbox as it is. Calls sona_manifest_ready_for_xbox. |
Renderer¶
struct Renderer<'c>: Owns a sona_renderer over a device the host owns.
| Declaration | What it does |
|---|---|
unsafe fn new(ctx: &'c Context, dev: &sys::sona_device_desc) -> Result<Option<Renderer<'c>>> |
Ok(None) while the shading data has not arrived (SONA_PENDING): update and try again. Calls sona_renderer_create. |
fn raw(&self) -> *mut sys::sona_renderer |
The native pointer this value wraps, for a call through sona360-sys that the safe layer does not cover. |
unsafe fn draw(&mut self, view: &View, target: &sys::sona_target, opts: Option<&DrawOptions>) -> Result<Code> |
Draws every visible ready avatar into the target. Calls sona_draw. |
fn snapshot(&mut self, view: &View, width: u32, height: u32, opts: Option<&DrawOptions>) -> Result<Vec<u8>> |
Straight RGBA8, row 0 at the top. Calls sona_snapshot. |
fn frame_index(&self) -> u64 |
The index of the last frame recorded (0 before the first). Calls sona_renderer_frame_index. |
fn frame_done(&mut self, completed_frame: u64) |
Vulkan, D3D12 and Metal: every frame up to and including completed_frame has finished on the GPU. Calls sona_renderer_frame_done. |
fn lost(&mut self) |
After a device loss: forget every GPU object. Calls sona_renderer_lost. |
unsafe fn reset(&mut self, dev: &sys::sona_device_desc) -> Result<()> |
Makes the renderer's GPU objects again on a device after a loss; unsafe as Renderer::new is. Calls sona_renderer_reset. |
fn set_style(&mut self, style: Option<&Style>) -> Result<()> |
The art style of every avatar without its own (with SONA_STYLE_OVERRIDE, of every avatar); None clears it. Calls sona_renderer_set_style. |
fn style(&self) -> Result<Style> |
The renderer's style; Err(SONA_E_UNSUPPORTED) when its backend draws no styles. Calls sona_renderer_style. |
fn set_quality(&mut self, q: Option<&Quality>) -> Result<()> |
From the next draw or snapshot. Calls sona_renderer_set_quality. |
fn quality(&self) -> Result<Quality> |
What the renderer uses: msaa is the sample count this device draws with. Calls sona_renderer_quality. |
fn set_lighting(&mut self, l: Option<&Lighting>) -> Result<()> |
The host's lights from the next draw; None: the original look again. Calls sona_renderer_set_lighting. |
fn lighting(&self) -> Result<Option<Lighting>> |
The lighting set, or None. Calls sona_renderer_lighting. |
fn snapshot_lit(&mut self, view: &View, width: u32, height: u32, opts: Option<&DrawOptions>, l: &Lighting) -> Result<Vec<u8>> |
Renderer:: Calls sona_snapshot_lit. |
fn set_environment_sh(&mut self, sh9: Option<&[f32; 27]>, skin_red: f32) -> Result<()> |
The lit avatars' environment: 9 RGB SH coefficients of radiance; None: the built-in cube. |
unsafe fn set_host_shadow(&mut self, s: Option<&sys::sona_host_shadow>) -> Result<()> |
The host's shadow map, which the lit avatars receive; None: none. Calls sona_renderer_set_host_shadow. |
fn shadow_map(&self) -> Result<Option<sys::sona_shadow_map>> |
The renderer's own shadow map after its last lit frame with shadows, or None before one. Calls sona_renderer_shadow_map. |
unsafe fn preview_draw(&mut self, preview: &mut Avatar<'c>, view: Option<&View>, target: &sys::sona_target, opts: Option<&DrawOptions>,) -> Result<Code> |
Renderer::draw with only this preview in the frame. Calls sona_item_preview_draw. |
fn preview_snapshot(&mut self, preview: &mut Avatar<'c>, width: u32, height: u32, opts: Option<&DrawOptions>,) -> Result<Vec<u8>> |
Straight RGBA8 of only this preview, framed for width x height, row 0 at the top. Calls sona_item_preview_snapshot. |
fn sticker(&mut self, avatar: &mut Avatar<'c>, opts: &StickerOptions, clip: Option<&str>) -> Result<Option<Picture>> |
A transparent, outlined cut-out (sona.h 3.12d). Calls sona_sticker. |
fn sheet(&mut self, avatar: &mut Avatar<'c>, opts: &SheetOptions, clip: Option<&str>, name: Option<&str>, pixel: Option<&PixelOptions>,) -> Result<Option<Sheet<'c>>> |
A sprite sheet of the clip at frames x directions (sona.h 3.12d). Calls sona_sheet_render. |
fn pick_gpu(&mut self, view: &View, x: f64, y: f64, o: &PickOptions) -> Result<Option<PickHit>> |
The pick through the GPU id buffer (Vulkan, GL, GLES; UNSUPPORTED elsewhere). Calls sona_pick_gpu. |
fn pick_gpu_ids(&mut self, view: &View, x: u32, y: u32, w: u32, h: u32, o: &PickOptions) -> Result<(Vec<u32>, Vec<u16>)> |
The id buffer of a region of the view's picture: (avatar ids, mesh index + 1), w * h each, row 0 on top. Calls sona_pick_gpu_ids. |
Sheet¶
struct Sheet<'c>: A rendered sprite sheet: pages, frames and their atlases.
| Declaration | What it does |
|---|---|
fn raw(&self) -> *mut sys::sona_sheet |
The native pointer this value wraps, for a call through sona360-sys that the safe layer does not cover. |
fn page_count(&self) -> u32 |
The number of pages; 0 for NULL. Calls sona_sheet_page_count. |
fn page(&self, page: u32) -> Result<(&[u8], u32, u32)> |
One page's pixels (straight RGBA8), its width and height; owned by the sheet. Calls sona_sheet_page. |
fn frame_count(&self) -> u32 |
frames * directions; 0 for NULL. Calls sona_sheet_frame_count. |
fn frame(&self, index: u32) -> Result<SheetFrame> |
One frame (index = direction * frames + frame): its page and rectangle, where the rectangle sits in the full cell (trim_x, trim_y), the cell's size, the pivot (the avatar's feet) in the cell, its direction, facing, t Calls sona_sheet_frame_get. |
fn atlas(&self, format: u32, page: u32, image: &str) -> Result<String> |
The atlas JSON: sys:: Calls sona_sheet_atlas, sona_free. |
Catalogue¶
struct Catalogue: sona-catalogue.bin, loaded: every item id with its name, slots, game and source.
| Declaration | What it does |
|---|---|
fn load(path: impl AsRef<Path>) -> Result<Catalogue> |
Errors come back as codes only (Catalogue:: |
fn load_with(ctx: &Context, path: impl AsRef<Path>) -> Result<Catalogue> |
With the context's allocator; errors carry its message and fix. |
fn from_bytes(bytes: &[u8]) -> Result<Catalogue> |
A copy of the file's bytes; the catalogue keeps its own. Calls sona_catalogue_load_memory. |
fn raw(&self) -> *mut sys::sona_catalogue |
The native pointer this value wraps, for a call through sona360-sys that the safe layer does not cover. |
fn len(&self) -> u32 |
Items, sorted by id. Calls sona_catalogue_count. |
fn is_empty(&self) -> bool |
True when the catalogue holds no item. |
fn get(&self, index: u32) -> Option<Item<'_>> |
One item. Calls sona_catalogue_get. |
fn iter(&self) -> impl Iterator<Item = Item<'_>> + '_ |
Every item, in the catalogue's order. |
fn find(&self, id: &str) -> Option<u32> |
32 hex digits, with or without dashes, braces or spaces, any case. Calls sona_catalogue_find. |
fn find_guid(&self, id: &Guid) -> Option<u32> |
The same from a parsed GUID. Calls sona_catalogue_find_guid. |
fn search(&self, q: &Query, max: u32) -> Result<(Vec<u32>, u32)> |
Up to max matching indexes in id order, after q.offset, and the count of every match. Calls sona_catalogue_search. |
fn games(&self) -> Vec<(&str, u32)> |
The games items come from, sorted by name, each with its item count. Calls sona_catalogue_game_count, sona_catalogue_game. |
fn generated(&self) -> &str |
When its data was made, ISO 8601. Calls sona_catalogue_generated. |
fn languages(&self) -> Vec<&str> |
The BCP 47 tags of every language item names come in, sorted; "en" is always one. Calls sona_catalogue_language_count, sona_catalogue_language. |
fn item_name(&self, index: u32, lang: &str) -> Result<Option<&str>> |
An item's name in lang; None when it has none there (show Item::name). Calls sona_catalogue_item_name. |
PropMesh¶
struct PropMesh<'c>: A prop mesh of one context.
| Declaration | What it does |
|---|---|
fn raw(&self) -> *mut sys::sona_prop_mesh |
The native pointer this value wraps, for a call through sona360-sys that the safe layer does not cover. |
fn state(&self) -> c_int |
SONA_OK, SONA_PENDING (a stock prop still loading), or why it failed. Calls sona_prop_mesh_state. |
fn info(&self) -> Option<sys::sona_prop_mesh_info> |
None while it loads. Calls sona_prop_mesh_info_get. |
fn data(&self) -> Option<sys::sona_prop_data> |
The meshes in the data API's form, valid while the mesh lives; None while it loads. Calls sona_prop_mesh_data. |
BlendSpace¶
struct BlendSpace<'c>: A blend space of one context.
| Declaration | What it does |
|---|---|
fn raw(&self) -> *mut sys::sona_blend_space |
The native pointer this value wraps, for a call through sona360-sys that the safe layer does not cover. |
fn weights(&self, x: f32, y: f32) -> Vec<f32> |
Each sample's weight at (x, y). Calls sona_blend_space_weights. |
StateMachine¶
struct StateMachine<'c>: A state machine of one context.
| Declaration | What it does |
|---|---|
fn raw(&self) -> *mut sys::sona_state_machine |
The native pointer this value wraps, for a call through sona360-sys that the safe layer does not cover. |
fn find(&self, state: &str) -> Option<u32> |
A state's index by name, -1 if unknown. Calls sona_state_machine_find. |
fn state_name(&self, state: u32) -> Option<String> |
A state's name, NULL past the last. Calls sona_state_machine_state_name. |
LipSync¶
struct LipSync: Audio in, mouths out: PCM in any chunks, a frame every 10 ms, the same frames however it is chunked.
| Declaration | What it does |
|---|---|
fn new(sample_rate: u32, channels: u32) -> Result<LipSync> |
Float samples in -1..1 (interleaved when channels > 1). |
fn with_format(sample_rate: u32, channels: u32, s16: bool) -> Result<LipSync> |
s16: 16-bit samples, for LipSync:: Calls sona_lipsync_create. |
fn feed(&mut self, pcm: &[f32]) -> Result<()> |
frames: samples per channel. Calls sona_lipsync_feed. |
fn feed_i16(&mut self, pcm: &[i16]) -> Result<()> |
For an analyser made with s16. Calls sona_lipsync_feed. |
fn read(&mut self) -> Vec<LipSyncFrame> |
The frames made since the last read, oldest first. Calls sona_lipsync_read. |
fn current(&self) -> LipSyncFrame |
The newest frame. Calls sona_lipsync_current. |
fn latency(&self) -> f64 |
Seconds from a sample being fed to the first frame that hears it. Calls sona_lipsync_latency. |
fn reset(&mut self) |
Back to time 0: hints and frames waiting to be read are dropped. Calls sona_lipsync_reset. |
fn hint(&mut self, phonemes: &[(&str, f32, f32)]) -> Result<()> |
Phonemes the host's TTS reported (symbol, start, end), on the fed audio's clock. Calls sona_lipsync_hint. |
VoiceMouth¶
struct VoiceMouth(pub sys::sona_voice_mouth): Voice chat: one speaker's mouth from its audio level alone.
| Declaration | What it does |
|---|---|
fn new(seed: u32) -> VoiceMouth |
Sets size and starts the state from seed. Calls sona_voice_mouth_init. |
fn step(&mut self, level: f32, dt: f32) -> (u8, f32) |
(mouth, open) after dt seconds at this level (linear RMS). Calls sona_voice_mouth_step. |
HeadlessOptions¶
struct HeadlessOptions(pub sys::: How to open a headless renderer; Default is sona_headless_defaults.
| Declaration | What it does |
|---|---|
fn device(mut self, kind: sys::sona_device_kind) -> Self |
SONA_DEVICE_AUTO, _GPU or _SOFTWARE. |
fn backend(mut self, b: sys::sona_backend) -> Self |
0 (Vulkan, then GL), SONA_BACKEND_VULKAN or SONA_BACKEND_GL. |
fn batch_in_flight(mut self, n: u32) -> Self |
Avatars a batch builds ahead; 0: 8, at most 32. The C field sona_headless_options. |
SequenceOptions¶
struct SequenceOptions(pub sys::: Frames of a clip at a fixed rate; its Default is what sona_sequence_defaults sets (frames 0: the clip's length).
| Declaration | What it does |
|---|---|
fn turntable(frames: u32) -> Self |
A turntable: frames pictures over one turn. |
Headless¶
struct Headless<'c>: A renderer on the library's own device: the best GPU, or lavapipe or llvmpipe.
| Declaration | What it does |
|---|---|
fn open(ctx: &'c Context, o: &HeadlessOptions) -> Result<Headless<'c>> |
Makes the device and a renderer on it, waiting up to wait_seconds for the ctx's shading data. Calls sona_headless_open. |
fn raw(&self) -> *mut sys::sona_headless |
The native pointer this value wraps, for a call through sona360-sys that the safe layer does not cover. |
fn info(&self) -> HeadlessDevice |
The device it drew on. Calls sona_headless_info_get. |
fn render(&self, a: &Avatar<'c>, o: &RenderOptions) -> Result<Vec<u8>> |
One picture of an avatar of the context, alone. Calls sona_headless_render. |
fn render_manifest(&self, manifest: &[u8], o: &RenderOptions) -> Result<Vec<u8>> |
Adds the avatar (hidden, standing still or playing clip from time), draws it and removes it. Calls sona_headless_render_manifest. |
fn batch(&self, manifests: &[&[u8]], o: &RenderOptions) -> Result<Vec<(Code, Option<Vec<u8>>)>> |
One (result, pixels) per manifest, in order; a bad manifest gives its code and no pixels. Calls sona_headless_batch. |
fn sequence(&self, a: &Avatar<'c>, o: &RenderOptions, s: &SequenceOptions) -> Result<Vec<Vec<u8>>> |
Every frame: frame i at the clip's start + i / fps, turned turn_deg * i / frames. Calls sona_headless_sequence. |
fn record(&self, a: &Avatar<'c>, o: &RenderOptions, s: &SequenceOptions, v: &mut Video<'c>) -> Result<()> |
sona_headless_sequence into a video. Calls sona_headless_record. |
fn tier_detect(&self) -> Result<u32> |
The tier (SONA_TIER_LOW.. Calls sona_tier_detect, sona_headless_renderer. |
Video¶
struct Video<'c>: A PNG sequence, GIF, MP4 or WebM.
| Declaration | What it does |
|---|---|
fn open(ctx: &'c Context, path: Option<&Path>, o: &sys::sona_video_options, ffmpeg: Option<&str>) -> Result<Video<'c>> |
o: sona_video_defaults with width and height set (and anything else). Calls sona_video_open. |
fn defaults(width: u32, height: u32) -> sys::sona_video_options |
sona_video_defaults at this size. Calls sona_video_defaults. |
fn frame(&mut self, rgba: &[u8]) -> Result<()> |
One frame of width * height straight RGBA8, row 0 at the top. Calls sona_video_frame. |
fn finish(mut self) -> Result<Option<Vec<u8>>> |
Ends the file: the bytes of an in-memory video, else None. Calls sona_video_finish, sona_free. |
Players¶
struct Players: Friends, lobby members and leaderboard rows by id: a gamertag, "a:<account>/<slot>" or "w:<case key>".
| Declaration | What it does |
|---|---|
fn open(o: &PlayersOptions) -> Result<Players> |
Zeroes the config and sets size; zero fields take the defaults (2048 looks, an interval of 600 s, 60 an hour, 4 at once, a timeout of 15 s). Calls sona_players_defaults, sona_players_open. |
fn watch(&mut self, ids: &[&str], priority: i32) -> Result<()> |
Ok, or the first problem (an id that is not an id, over max_players); the others are watched all the same. Calls sona_players_watch. |
fn unwatch(&mut self, ids: Option<&[&str]>) -> Result<()> |
None: every id. Calls sona_players_unwatch. |
fn refresh(&mut self, ids: Option<&[&str]>) -> Result<()> |
None: every watched id. Calls sona_players_refresh. |
fn update(&mut self) -> u32 |
Each frame. Calls sona_players_update. |
fn poll(&mut self) -> Vec<PlayerEvent> |
Every event waiting, oldest first; an empty list when there are none. Calls sona_players_poll. |
fn look(&mut self, id: &str) -> (PlayerLook, Result<()>) |
Always a look to draw; Err(NOT_FOUND) for an id never watched nor cached, Err(ARGUMENT) for one that is not an id. Calls sona_players_look. |
fn forget(&mut self, id: &str) -> Result<()> |
Drops the id's look from memory and, at the next write, from the cache file, and stops watching it. Calls sona_players_forget. |
fn stats(&self) -> sys::sona_players_stats |
Looks kept, ids watched, requests in flight and due, and counts since open: requests, changed, the same, 304s, gone, failed, read from disk, disk writes, waits for per_hour; paused_until. Calls sona_players_stats_get. |
fn placeholder() -> Vec<u8> |
The built-in placeholder look. Calls sona_players_placeholder. |
Maker¶
struct Maker<'a>: A catalogue's outfit rules, indexed once: seeded random avatars, dress like, clashes, matched sets and the outfit check.
| Declaration | What it does |
|---|---|
fn new(catalogue: &'a Catalogue) -> Result<Maker<'a>> |
Indexes a catalogue's outfit rules once: candidate items per body and section, gender variants and matched sets. Calls sona_maker_create. |
fn raw(&self) -> *const sys::sona_maker |
The native pointer this value wraps, for a call through sona360-sys that the safe layer does not cover. |
fn random(&self, seed: u32, o: &RandomOptions<'_>) -> Result<RandomAvatar> |
A seeded random avatar: the same seed and options give the same bytes. Calls sona_random_defaults, sona_make_random. |
fn dress_like(&self, body: &[u8], like: &[u8], parts: u32, match_: u32, layer: bool) -> Result<DressedLike> |
body wearing like's parts (sona_sys:: Calls sona_like_defaults, sona_make_dress_like. |
fn variant(&self, item: &Guid, body: u32, match_: u32) -> (u32, Option<Guid>) |
What body (1 or 2) wears for item: sona_sys:: Calls sona_make_variant. |
fn conflicts(&self, manifest: &[u8], item: &Guid) -> Result<Vec<Guid>> |
The ids wearing item would take off manifest. Calls sona_outfit_conflicts. |
fn set_count(&self) -> u32 |
How many matched sets (outfits sold as one) the maker knows. Calls sona_outfit_set_count. |
fn set(&self, index: u32) -> Option<OutfitSet<'_>> |
Set set: its item count, which bodies wear it, the sections it has items in and the slots it covers. Calls sona_outfit_set_get. |
fn set_of(&self, item: &Guid) -> Option<u32> |
The matched set an item belongs to, or -1 when it is in none. Calls sona_outfit_set_of. |
fn set_items(&self, set: u32, body: u32) -> Vec<u32> |
Catalogue indexes of a set's items a body wears (0: every item). Calls sona_outfit_set_items. |
fn check(&self, manifest: &[u8]) -> Result<OutfitReport> |
Checks a manifest's outfit for clashes and missing pieces (sona_outfit_check). |
fn fix(&self, manifest: &mut [u8]) -> Result<OutfitReport> |
As outfit_fix with this maker: repairs the manifest in place and reports what it changed. |
PickHit¶
struct PickHit: One pick: the avatar (by id and handle), the item, mesh and triangle, the joint and body region, and where.
| Declaration | What it does |
|---|---|
fn avatar_id(&self) -> u32 |
Sona_avatar_id. The C field sona_pick_hit. |
fn avatar(&self) -> *mut sys::sona_avatar |
The native handle, to compare with Avatar::raw. |
fn item(&self) -> String |
The item's id ("" for a bounds hit). |
fn mesh(&self) -> Option<u32> |
Index into sona_pose_data. |
fn joint(&self) -> Option<u32> |
The named joint (sona_joint_name) that moves the point most; -1 for a prop. The C field sona_pick_hit. |
fn region(&self) -> &'static str |
Sona_body_region of that joint. The C field sona_pick_hit. |
fn distance(&self) -> f32 |
Metres from the ray's origin, along its unit direction. The C field sona_pick_hit. |
fn point(&self) -> [f32; 3] |
World. The C field sona_pick_hit. |
fn normal(&self) -> [f32; 3] |
World, unit, toward the ray: the triangle's, or the sprite's for a picture. The C field sona_pick_hit. |
Theme¶
struct Theme<'a>: The game's colours (0xAARRGGBB), corner radius, scale and font.
| Declaration | What it does |
|---|---|
fn dark() -> Theme<'static> |
The console slate. |
fn light() -> Theme<'static> |
360sona.com's editor. |
Control¶
struct Control: One control on screen, for a screen reader or the host's own hit tests.
| Declaration | What it does |
|---|---|
fn focused(&self) -> bool |
The control has the focus. |
fn selected(&self) -> bool |
The control is the chosen one: a worn item, the current tab. |
Editor¶
struct Editor<'c>: The player editor.
| Declaration | What it does |
|---|---|
fn open(ctx: &'c Context, cat: &'c Catalogue, o: &Options, theme: Option<&Theme>) -> Result<Editor<'c>> |
theme None: the light theme. Calls sona_editor_defaults, sona_editor_open. |
fn raw(&self) -> *mut sys::sona_editor |
The native pointer, for a sona-editor-sys call this crate does not wrap. |
fn feed(&mut self, input: &sys::sona_editor_input) -> Result<()> |
One input event as sona_editor.h has it; the calls below make them. Calls sona_editor_feed. |
fn button(&mut self, b: Pad, down: bool) -> Result<()> |
A gamepad button pressed (down true) or released. |
fn press(&mut self, b: Pad, dt: f64) -> Result<Status> |
Down, an update, up, an update. |
fn axis(&mut self, a: Axis, value: f32) -> Result<()> |
A stick's or a trigger's position. |
fn key(&mut self, k: Key, down: bool, mods: u32) -> Result<()> |
mods: sys:: |
fn text(&mut self, s: &str) -> Result<()> |
Typed text, for the search box. |
fn pointer(&mut self, x: f32, y: f32, down: Option<bool>, id: u32) -> Result<()> |
x, y in the editor's pixels; down Some(true) pressed, Some(false) released, None moved; id a touch or 0. |
fn wheel(&mut self, x: f32, y: f32, lines: f32) -> Result<()> |
lines: + is up. |
fn update(&mut self, dt: f64) -> Status |
Advances dt seconds (and, unless HOST_UPDATES, updates the context). Calls sona_editor_update. |
fn status(&self) -> Status |
SONA_EDITOR_RUNNING, _DONE or _CANCELLED, as the last sona_editor_update returned. Calls sona_editor_status. |
fn result(&self) -> Result<[u8; MANIFEST_BYTES]> |
The avatar as it stands; after Cancelled, the start manifest. |
fn screen(&self) -> Screen |
The screen shown now. Calls sona_editor_screen_get. |
fn set_screen(&mut self, s: Screen) -> Result<()> |
Refused (ARGUMENT) for a screen the mode does not have. Calls sona_editor_set_screen. |
fn screens(&self) -> Vec<Screen> |
The mode's screens in tab order. Calls sona_editor_screens. |
fn set_search(&mut self, text: Option<&str>) -> Result<()> |
The search box, for a host with its own on-screen keyboard; None clears it. Calls sona_editor_set_search. |
fn set_theme(&mut self, t: &Theme) -> Result<()> |
Changes the colours and sizes from the next frame. Calls sona_editor_set_theme. |
fn resize(&mut self, width: u32, height: u32) -> Result<()> |
The editor's size in pixels, the size of the target it is drawn into. Calls sona_editor_resize. |
fn size(&self) -> (u32, u32) |
The editor's size in pixels. |
fn busy(&self) -> bool |
True while an avatar is still building. Calls sona_editor_busy. |
fn build_failures(&self) -> u32 |
How many avatar builds failed since open (the screen reader is told each time). Calls sona_editor_build_failures. |
fn undo(&mut self, redo: bool) -> bool |
Undo (or redo) one step; false when there is none. Calls sona_editor_undo. |
fn can_undo(&self, redo: bool) -> bool |
1 when sona_editor_undo with the same redo would step: use it to grey out the buttons. Calls sona_editor_can_undo. |
fn zoom(&self) -> f64 |
1 is the editor's framing. Calls sona_editor_zoom. |
fn set_zoom(&mut self, zoom: f64) -> f64 |
0.6 to 3. Calls sona_editor_zoom. |
fn turn(&mut self, degrees: f64) |
Positive turns the avatar to its left. Calls sona_editor_turn. |
fn view(&self) -> Result<View> |
The camera the avatar layer is drawn with. Calls sona_editor_view. |
unsafe fn draw(&mut self, r: &mut Renderer<'_>, target: &sona_sys::sona_target, opts: Option<&DrawOptions>) -> Result<Code> |
The whole editor into the target: the avatar with the renderer, the UI over it. Calls sona_editor_draw. |
unsafe fn draw_avatar(&mut self, r: &mut Renderer<'_>, target: &sona_sys::sona_target, opts: Option<&DrawOptions>) -> Result<Code> |
The avatar layer alone, for a host that draws the UI with its own 2D pass (Editor:: Calls sona_editor_draw_avatar. |
fn thumbnails(&mut self, r: &mut Renderer<'_>, budget: u32) -> u32 |
Renders up to budget pending item pictures, for a host that draws the avatar with its own sona_draw. Calls sona_editor_thumbnails. |
fn snapshot(&mut self, r: &mut Renderer<'_>) -> Result<Vec<u8>> |
The whole picture at the editor's size, straight RGBA8. Calls sona_editor_snapshot. |
fn render_ui(&mut self, width: u32, height: u32) -> Result<Vec<u8>> |
The UI layer on the CPU, straight RGBA8 on a transparent clear. Calls sona_editor_render_ui. |
fn render_ui_over(&mut self, rgba: &mut [u8], width: u32, height: u32) -> Result<()> |
The UI layer blended over a picture of the avatar layer (width x height straight RGBA8). Calls sona_editor_render_ui. |
fn draw_data(&mut self) -> Result<DrawData<'_>> |
The UI layer's triangles; they borrow the editor until the next update. Calls sona_editor_draw_data_get. |
fn texture(&mut self, id: u32) -> Result<Texture<'_>> |
A texture the draw data names by id, with its pixels (straight RGBA8, owned by the editor) and the rectangle that changed since an older revision, for a host that draws the UI layer itself. Calls sona_editor_texture_get. |
fn controls(&self) -> Vec<Control> |
Every control on screen, in reading order. Calls sona_editor_control_count, sona_editor_control_get. |
fn focus(&self) -> Option<Control> |
None when nothing has focus (pointer-only use). Calls sona_editor_focus_get. |
fn announcement(&mut self) -> Option<String> |
What a screen reader should say since the last call; None when nothing changed. Calls sona_editor_announcement. |
Types¶
| Declaration | What it does |
|---|---|
type Result<T> = std::result::Result<T, Error> |
The C type sona_result. |
enum ReadKind |
The C type sona_read_kind. |
struct RequestId(usize) |
Identifies one read, so cancel can match it. |
trait Source: Send |
A host-written source. |
enum LogLevel |
How serious a log line is: debug, info, warn, error (SONA_LOG_*). |
type Budget = sys::sona_budget |
Memory budget in bytes. The C type sona_budget. |
struct Placement |
The C type sona_placement. |
struct PlayOptions |
The C type sona_play_options. |
enum Preset |
The C type sona_preset. |
enum Space |
Which space a pose or target is given in: world or the avatar's own (SONA_SPACE_*). |
enum OverrideMode |
How a joint override applies: replace the clip's rotation or add to it (SONA_OVERRIDE_*). |
enum RootMotion |
What happens to a clip's root motion: off, extract or apply (SONA_ROOT_MOTION_*). |
enum Lod |
The level of detail an avatar was drawn at: full, sampled, quarter, sprite (SONA_LOD_*). |
enum ClipEventKind |
The C type sona_clip_event_kind. |
struct ClipEvent |
The C type sona_clip_event. |
enum Skeleton |
The skeletons the rig's joints map onto. |
struct ExportOptions |
What Avatar::export writes. |
type ExportReport = sys::sona_export_report |
The C type sona_export_report. |
type IdleOptions = sys::sona_idle_options |
The C type sona_idle_options. |
type IdleState = sys::sona_idle_state |
The C type sona_idle_state. |
struct Picture |
A straight RGBA8 picture, row 0 at the top. |
type Style = sys::sona_style |
An art style: the original look, no outline, every parameter at its default; set kind and flags after. |
enum EventKind |
What an event says: ready, failed, an error, the licence checked (SONA_EVENT_*). |
struct Event |
The C type sona_event. |
struct ClipInfo |
The C type sona_clip_info. |
type FrameStats = sys::sona_frame_stats |
The C type sona_frame_stats. |
type SceneStats = sys::sona_scene_stats |
The C type sona_scene_stats. |
type View = sys::sona_view |
The C struct sona_view under its Rust name: A camera: the eye, the target, the vertical field of view in degrees, near and far, and the target size in pixels, kept in doubles. |
type Material = sys::sona_material |
Address modes: bit 0 set = U wraps, bit 1 set = V wraps; clear = clamp. The C type sona_material. |
type DrawOptions = sys::sona_draw_options |
The C type sona_draw_options. |
type Guid = sys::sona_guid |
The C type sona_guid. |
type Capsule = sys::sona_capsule |
A vertical capsule around the posed body, in world space, for collisions: the segment a..b and its radius. The C type sona_capsule. |
type LodOptions = sys::sona_lod_options |
Each sona_update gives every avatar in view a step by its height on screen in pixels: FULL (posed every frame), SAMPLED (posed when the clip reaches a new frame), QUARTER (also at most every 4th frame) and SPRITE (a pict The C type sona_lod_options. |
type LodStats = sys::sona_lod_stats |
The C type sona_lod_stats. |
type PreviewOptions = sys::sona_preview_options |
The C type sona_preview_options. |
type Quality = sys::sona_quality |
The C type sona_quality. |
type Lighting = sys::sona_lighting |
sona.h 3.12e: the host's lights and shadows. |
type PixelOptions = sys::sona_pixel_options |
The C type sona_pixel_options. |
type StickerOptions = sys::sona_sticker_options |
The C type sona_sticker_options. |
type SheetOptions = sys::sona_sheet_options |
The C type sona_sheet_options. |
type SheetFrame = sys::sona_sheet_frame |
One frame of a sheet. The C type sona_sheet_frame. |
struct Shading |
The fixed shading inputs, for hosts that rebuild our look in their own shaders. The C type sona_shading. |
struct Credit |
The C type sona_credit. |
enum Pass |
The C type sona_pass. |
enum Route |
The C type sona_route. |
struct Query |
What Catalogue:: |
struct Item<'a> |
One item. |
enum LayerKind |
What a layer plays: a clip, a blend space or a state machine. |
struct LayerOptions |
What a layer plays and how: Avatar:: |
struct LayerInfo |
The C type sona_layer_info. |
enum LayerEventKind |
The C type sona_layer_event_kind. |
struct LayerEvent |
The C type sona_layer_event. |
struct BlendSample<'a> |
The C type sona_blend_sample. |
enum Motion<'a> |
What a state plays: a clip by key or a blend space. |
struct StateSpec<'a> |
One state of a state machine: its name, what it plays, its loop and speed (sona_state_desc). |
enum Cond |
A transition's condition on a parameter: greater, less, equal, or a trigger (sona_condition). |
struct TransitionSpec<'a> |
A transition between states: where to, its fade, its exit time and conditions (sona_transition_desc). |
enum Mask |
The joint masks layers play on: a preset or a branch from a joint (sona_mask_preset, sona_mask_branch). |
type LipSyncFrame = sys::sona_lipsync_frame |
One step of the lip sync analysis of a LipSync: time, mouth, open, level and the shape weights (sona_lipsync_frame). |
type MouthKey = sys::sona_mouth_key |
A mouth from time on. |
struct HeadlessDevice |
One device a headless renderer can open. |
struct RenderOptions |
What one picture looks like. |
enum PlayerState |
Where an id's look stands. |
struct PlayerLook |
The look to draw for an id: the player's, or the placeholder. |
enum PlayerEvent |
What changed for an id since the last poll. |
struct PlayersOptions |
The options of Players::open; zero fields take the library's defaults. |
struct RandomOptions<'f> |
The options of Maker::random. |
struct RandomAvatar |
What Maker::random made. |
struct LikeItem |
One item Maker:: |
struct DressedLike |
What sona_make_dress_like kept, varied, swapped and dropped (sona_like_report). |
struct OutfitSet<'a> |
One matched set. |
struct OutfitIssue |
One issue of outfit_check. |
struct OutfitReport |
The C type sona_outfit_report. |
struct PickOptions |
Which avatars a pick considers and how far it looks. |
struct MeshItem |
A custom item of your own skinned mesh (format 1.1): what Context:: |
enum Mode |
Which editor opens: the full one, the quick creator or the wardrobe picker. |
enum Status |
What the editor answers each update; Done and Cancelled stay. |
enum Screen |
A screen of the editor. |
enum Pad |
A gamepad button. |
enum Axis |
A stick axis (-1 to 1, +y down) or a trigger (0 to 1). |
enum Key |
A keyboard key the editor takes (text for the search box comes through Editor::text). |
struct Options<'a> |
How the editor opens. |
struct DrawData<'e> |
The UI layer as triangles for the host's own 2D pass, as of the last update. |
This page as Markdown · All the docs as one file (llms-full.txt)