Benthic Logo

Optional

This component is an optional feature in the metaverse_client crate. Projects that don't require this can compile with the feature disabled in Cargo.toml

Rendering

Model generation is handled by the metaverse_mesh crate.
Its main entrypoint is through the generate_skinned_mesh() function. It also has C and C# wrappers, called generate_skinned_mesh_legacy.

Generate Skinned Mesh

AvatarObject

The function accepts an AvatarObject, which contains one JSON serialized skeleton object, and a list of paths to its component RenderObjects.
AvatarObject

{
    "objects": ["/home/skclark/.local/share/benthic/agent/fb2e5541-66ba-4019-a5de-e8b9286b0914/5ac91189-43a4-4c00-97b3-badab08b551e_t-shirt.json", 
                "/home/skclark/.local/share/benthic/agent/fb2e5541-66ba-4019-a5de-e8b9286b0914/91f0232f-e9e1-45d0-8b88-ddf01a715fbf_overalls.json", 
                "/home/skclark/.local/share/benthic/agent/fb2e5541-66ba-4019-a5de-e8b9286b0914/44a3f658-bf47-4767-8450-6c9042efac5f_Curves.json", 
                "/home/skclark/.local/share/benthic/agent/fb2e5541-66ba-4019-a5de-e8b9286b0914/7e6d3d00-6ad8-4041-a809-7fda0fc4a4fb_body.json"],
    "global_skeleton": {
        "joints": {
            "Butt": {
                "name": "Butt",
                "transforms": [{
                    "name": "Default",
                    "id": "00000000-0000-0000-0000-000000000000",
                    "transform": [3.802805e-8, -1.0000001, 1.6506195e-7, -0.0, -1.0000001, -3.8027313e-8, 0.00000114482, 0.0, -0.0000011448196, -3.207441e-8, -1.0000004, 0.0, -0.00000185084, -0.055000454, -1.7398628, 1.0],
                    "rank": 0
                }],...
        

RenderObject

The RenderObject contains the mesh data and local skeleton for each component object.
RenderObject

[{
        "name": "t-shirt",
        "id": "5ac91189-43a4-4c00-97b3-badab08b551e",
        "vertices": [
                [0.04588852, -0.16824126, 0.7088021],
                [0.04042725, -0.1912551, 0.71027595],
                [0.04245572, -0.1912551, 0.7064233],
                [0.0685799, -0.056631688, 0.71403205],
                [0.061838612, -0.0696567, 0.7208681],
                [0.06817527, -0.07142272, 0.71457577],,...
        
Example rust usage of this crate can be found in the tests directory.
The goal of this is to create a standardized way of generating GLTF files from open metaverse server data that can be used by any project in any language.

C and C#

To build for use with C# run
cargo build --release
The rust shared library will be created in the target/release/ directory. The resulting shared library will be different on each platform.

Linux

libmetaverse_gltf.so

Mac

libmetaverse_gltf.dylib

Windows

libmetaverse_gltf.dll