Crates.io | vmc |
lib.rs | vmc |
version | |
source | src |
created_at | 2023-08-11 02:56:56.179791 |
updated_at | 2024-10-28 21:50:11.193799 |
description | Implementation of Virtual Motion Capture protocol for virtual avatar tracking. |
homepage | |
repository | https://github.com/pykeio/vmc |
max_upload_size | |
id | 941537 |
Cargo.toml error: | TOML parse error at line 19, column 1 | 19 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
vmc
An asynchronous implementation of the Virtual Motion Capture Protocol in Rust.
While this crate is intended specifically for Virtual Motion Capture, it can also be used as an implementation of the Open Sound Control protocol which VMC is based on.
See examples/
for more detailed examples.
use vmc::{
VMCApplyBlendShapes, VMCBlendShape, VMCModelState, VMCResult, VMCStandardVRMBlendShape, VMCState, VMCTime
};
#[tokio::main]
async fn main() -> VMCResult<()> {
let socket = vmc::performer!("127.0.0.1:39539").await?;
loop {
socket
.send(VMCBlendShape::new(VMCStandardVRMBlendShape::Joy, 1.0))
.await?;
socket.send(VMCApplyBlendShapes).await?;
socket.send(VMCState::new(VMCModelState::Loaded)).await?;
socket.send(VMCTime::elapsed()).await?;
}
}
use tokio_stream::StreamExt;
use vmc::{VMCMessage, VMCResult};
#[tokio::main]
async fn main() -> VMCResult<()> {
let mut socket = vmc::marionette!("127.0.0.1:39539").await?;
while let Some(packet) = socket.next().await {
let (packet, _) = packet?;
for message in vmc::parse(packet)? {
match message {
VMCMessage::BoneTransform(transform) => {
println!("\tTransform bone: {} (pos {:?}; rot {:?})", transform.bone, transform.position, transform.rotation)
}
_ => {}
}
}
}
Ok(())
}
❤️ This package is based on rosc
by Andreas Linz and async-osc
by Franz Heinzmann. Licensed under MIT License or Apache-2.0.