summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-02-18 00:09:43 +0100
committermetamuffin <metamuffin@disroot.org>2025-02-18 00:09:43 +0100
commit948bc7fb91e1a39acf92b3f205678073da69c299 (patch)
tree5abd83de6c763cc21a2a880e5a04240f11dd922c
parentaa6158cb24785871b21e60eed378e3205d1be0b6 (diff)
downloadweareserver-948bc7fb91e1a39acf92b3f205678073da69c299.tar
weareserver-948bc7fb91e1a39acf92b3f205678073da69c299.tar.bz2
weareserver-948bc7fb91e1a39acf92b3f205678073da69c299.tar.zst
draft animation resources
-rw-r--r--doc/resources.md48
1 files changed, 47 insertions, 1 deletions
diff --git a/doc/resources.md b/doc/resources.md
index 4c7743a..a7683e3 100644
--- a/doc/resources.md
+++ b/doc/resources.md
@@ -5,6 +5,9 @@
- `Matrix3`: 3x3 matrix of `Float` in columns
- `Vec3`: 3 component `Float` vector
- `Affine3`: `Matrix3` and `Vec3` translation
+- `Res`: 256-bit resource id
+- `[T; N]`: Type `T` repeated `N`-times.
+- `[T]`: Type `T` repeated until end of data.
## Dictionary format
@@ -32,6 +35,8 @@
| `light` | `Vec3`, `Res<LightPart>` | Multi key |
| `armature` | `Res<ArmaturePart>` | Multi key |
| `particles` | `Res<ParticlesPart>` | Multi key |
+| `animation` | `Res<AnimationPart>` | Multi key |
+| `avatar` | `Res<AvatarInfoPart>` | |
| `environment` | `Res<EnvironmentPart>` | |
## MeshPart
@@ -169,7 +174,48 @@ inherited. Attribute values are zipped similar to vertex attributes.
| `velocity` | `Vec3` | |
| `velocity_spread` | `Vec3` | |
-**Spread**: Expressed as the standard deviation from the center/bias value.
+- **Spread**: Expressed as the standard deviation from the center/bias value.
+
+## AnimationPart
+
+| Key | Value Type | |
+| ---------- | ------------------ | --------- |
+| `channel` | `AnimationChannel` | Multi key |
+| `duration` | `f32` | |
+
+## AnimationChannel
+
+| Key | Value Type | |
+| --------------------- | ------------- | - |
+| `t_mesh_translation` | `u32` | |
+| `t_mesh_rotation` | `u32` | |
+| `t_mesh_scale` | `u32` | |
+| `t_mesh_morph_weight` | `u32`, `u32` | |
+| `t_joint_translation` | `u32`, `u32` | |
+| `t_joint_rotation` | `u32`, `u32` | |
+| `t_joint_scale` | `u32`, `u32` | |
+| `t_light_translation` | `u32` | |
+| `time` | `Res<[f32]>` | |
+| `value` | `Res<[Vec3]>` | |
+
+- **Joint targets**: Index into armature array of the prefab and index into
+ joint array of that armature.
+- **Mesh targets**: Index into mesh array of the prefab.
+- **Mesh morph targets**: Index into mesh array of the prefab and index into
+ morph targets array of that mesh.
+- **Time & Values**: Time and value arrays contain corresponding elements. Every
+ point is a keyframe and lineraly interpolated by default.
+
+## AvatarInfoPart
+
+| Key | Value Type | |
+| --------------------- | ---------- | -------------- |
+| `armature` | `u32` | Armature index |
+| `camera_mount` | `u32` | Bone index |
+| `camera_mount_offset` | `Vec3` | |
+| `a_walk` | `u32` | |
+| `a_run` | `u32` | |
+| `a_sit` | `u32` | |
## Texture