Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Docs for the benthic project.
This is meant to give a high level overview of how the project goes together, along with descriptions of gotchas and confusing aspects of the opensim/secondlife protocol.

# Getting Started

run

`Jekyll serve `
1 change: 1 addition & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@
<li><a href="/inventory">Inventory</a></li>
<li><a href="/agent">Agent</a></li>
<li><a href="/rendering">Rendering</a></li>
<li><a href="/animation">Animation</a></li>
</ul>
</nav>

Expand Down
103 changes: 103 additions & 0 deletions animation.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---
layout: default
title: Animation
---

{% include happy_benthic.html %}
<div class="bubble">
<h1>Animation</h1>
<p>
Animation packets are sent shortly after the session is established with the
viewer. These packets identify an animation to play based on UUID, which
either represents the UUID of a default animation, or one that needs to be
retrieved from a capability endpoint.
</p>
<p>
<a
href="https://github.com/benthic-mmo/benthic_default_assets/blob/main/src/default_animations.rs"
>This file</a
>
in the default assets project contains the UUIDs of the default animations,
and associates them with their corresponding playable animation files. These
animation files can be viewed
<a
href="https://github.com/benthic-mmo/benthic_default_assets/tree/main/Animations"
>here</a
>
with software such as
<a href="https://www.blender.org/download/"> Blender</a>. These default
animation files contain only the joints with no mesh, to save on storage
space.
</p>
</div>
<div class="bubble">
<h1>The Reskeletonizer</h1>
All animations must be able to play on all possible avatar skeletons. In order
to do this, all animations must be stored with every possible bento bone, and
then pared down to a subset of those bones in order to apply them to specific
avatars. Applying a full bento skeleton animation to an avatar using only some
of the bento bones does not work in any engine. The solution to this is the
<a href="https://github.com/benthic-mmo/reskeletonizerreskeletonizer"
>reskeletonizer</a
>
project, which takes in rust struct representations of animations, and then
outputs new GLTF files with unused bones removed.
</div>

<div class="bubble">
<h1>Animation Flow</h1>
<div class="center">
<div class="bubble-column" style="max-width: 700px">
<div class="bubble contrast small">
<h3>1.</h3>
<p>
At compile time, the
<a href="https://github.com/benthic-mmo/benthic_asset_pipeline"
>Benthic Asset Pipeline</a
>
runs its build.rs. This uses the
<a href="https://github.com/benthic-mmo/benthic_default_assets"
>Benthic Default Assets</a
>
project to retrieve the default bento skeleton and default animations.
It then generates rust files from the defaults that can be imported
and used by the reskeletonizer.
</p>
</div>
<div class="bubble contrast small">
<h3>2.</h3>
<p>
The animation packet is received from the server in the
<a
href="https://github.com/benthic-mmo/metaverse_client/tree/main/crates/core"
>Metaverse Core</a
>
crate, including which user is playing the animation.
</p>
</div>
<div class="bubble contrast small">
<h3>3.</h3>
<p>
Determine if the animation is a default animation, and if not,
download the animation
</p>
</div>
<div class="bubble contrast small">
<h3>4.</h3>
<p>
Store the generated rust struct representation of the animation, and
pass that to the reskeletonizer along with the skeleton of the model
you want to retarget the animation to.
</p>
</div>
<div class="bubble contrast small">
<h3>5.</h3>
<p>
Send a message to the UI containing the on-disk location of the
generated .gltf file, which can be applied to the agent's model
in-world.
</p>
</div>
</div>
</div>
</div>
22 changes: 20 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ <h2>Testability</h2>
<div class="bubble">
<h1>Getting Started</h1>
<p>
<h3>The benthic project stretches across several repos, containing several different crates. There are four primary
crates that contain the majority of the project's code.</h3>
<h3>The benthic project stretches across several repos, containing several different crates. These are the crates required for running the benthic project.</h3>
<div class="bubble-row">
<div class="bubble contrast">
<a href="https://github.com/benthic-mmo/metaverse_client">
Expand Down Expand Up @@ -144,6 +143,22 @@ <h1>Metaverse Mesh</h1>
<h1>Serde LLSD</h1>
</a> A fork of John Nagle's <a href="https://github.com/John-Nagle/serde-llsd">serde-llsd</a>, containing extra serializing and deserializing functions that include non-documented protocols, and somewhat niche types used by the project like XMLRPC.
</div>
<div class="bubble contrast">
<a href="https://github.com/benthic-mmo/reskeletonizer">
<h1>Reskeletonizer</h1>
</a> Accepts animations built on the full bento skeleton, and removes bones not included in the target avatar, outputting GLTF files with compatable skeletons. This allows for easy animation retargeting for other game engines.
</div>
<div class="bubble contrast">
<a href="https://github.com/benthic-mmo/benthic_default_assets">
<h1>Benthic Default Assets</h1>
</a> This repo contains all of the default assets that the protocol expects the user to have pre-downloaded. This includes textures, shaders, animations, sounds, and 3d models. This is meant to be a standalone project that can be imported by other viewer projects who need the full default asset kit.
</div>
<div class="bubble contrast">
<a href="https://github.com/benthic-mmo/benthic_asset_pipeline">
<h1>Benthic Asset Pipeline</h1>
</a>
This is a very small repo that includes a build script that generates certain default files into rust structs from the default assets dir, such as the default skeleton and animations to be imported into other crates.
</div>
</div>
<br>
The recommended project layout for developing looks like this:
Expand All @@ -152,6 +167,9 @@ <h1>Serde LLSD</h1>
├── metaverse_client/
├── metaverse_gltf/
├── benthic_viewer/
├── reskeletonizer/
├── benthic_default_assets/
├── benthic_asset_pipeline/
└── serde-llsd/

OpenSimulator
Expand Down
22 changes: 22 additions & 0 deletions objects.html
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,25 @@ <h1>ImprovedTerseObjectUpdate</h1>
>ObjectUpdate</a
>, packet.
</div>
<div class="bubble">
<h1>Rendering Parented Objects</h1>

A primary concept in open metaverse worlds is object hierarchies. Object
update packets with parents don't come from the server with their global
transforms, but their local transforms relative to the parent object. When
placing objects with parents, their position must be calculated from their
parent's position and rotation using these formulas:

<div class="bubble good">
<h2>Child Position</h2>
<h3>parent_position * (child_object_position * parent_rotation)</h3>
</div>
<div class="bubble good">
<h2>Child Rotation</h2>
<h3>parent_rotation * child_rotation</h3>
</div>

It is important to mention that if you store the object's position as a Vec3,
you cannot simply multiply it by a quaternion. Use built-in functions like
mul_vec3 in glam to apply the scale properly.
</div>