Build · Formats
.hsda: source
An .hsda file is the hand-written source of an HSD (Hyper-Space Document) document.
It is written in RON (Rusty Object Notation), and compiles to an .hsdz package.
The format may change between releases.
Prims
A file is a list of prims.
Each prim has attributes and a list of children, which are more prims.
The simplest example is a single prim with a script.
asset.hsdahsd/unavi-spawner
[
(
attributes: (
name: "spawner",
script: "./Cargo.toml",
),
children: [],
),
]Attributes
| Attribute | Value |
|---|---|
name | A name, used to find the prim and to refer to it from other attributes |
xform | Position, rotation, and scale |
material | A standard PBR (physically based rendering) material |
shader | A path to an .hss shader graph, used instead of material |
image | An image and how it is sampled |
collider | A physics collider shape |
rigid_body | How the prim moves in the physics simulation |
gravity_scale | How strongly gravity pulls on the prim |
script | A path to a script crate's Cargo.toml |
reference | A path to another .hsda file, included as its own document |
spawn | A region, by radius, where people arrive in a space |
Texture fields in a material name another prim by its name.
The default home space uses several of these together.
asset.hsdahsd/unavi-default-home
[
(
attributes: (
name: "gate",
reference: "../unavi-gate/asset.hsda",
xform: (
translation: [
0.0,
0.0,
-10.0,
],
),
),
children: [],
),
(
attributes: (
image: (
data: "../../crates/unavi-app/assets/image/dev-white.png",
address_mode_u: Repeat,
address_mode_v: Repeat,
address_mode_w: Repeat,
mag_filter: Nearest,
min_filter: Nearest,
srgb: true,
),
name: "ground_tex",
),
children: [],
),
(
attributes: (
material: (
base_color_texture: "ground_tex",
),
name: "ground",
),
children: [],
),
(
attributes: (
name: "unavi-default-home",
script: "./Cargo.toml",
),
children: [],
),
(
attributes: (
name: "spawn",
spawn: (
radius: 4.0,
),
xform: (
translation: [
0.0,
0.5,
0.0,
],
),
),
children: [],
),
]Children
Children nest prims inside a parent.
unavi-gate uses two named children as attachment points for its script to find.
asset.hsdahsd/unavi-gate
[
(
attributes: (
name: "gate",
script: "./Cargo.toml",
),
children: [
(
attributes: (
name: "portal",
xform: (
translation: [
0.0,
1.3090171,
0.0,
],
),
),
children: [],
),
(
attributes: (
name: "receptor",
xform: (
translation: [
-1.618034,
0.809017,
0.0,
],
),
),
children: [],
),
],
),
]Formatting
hsd format <file> rewrites a file in place, pretty-printed.
Run hsd from the unavi workspace.