feat: initial IDL

This commit is contained in:
Nova
2024-02-03 04:53:19 -05:00
parent f0200be990
commit 6eb36516b0
26 changed files with 945 additions and 186 deletions

View File

@@ -1,7 +1,7 @@
use crate::{
core::{client::Client, registry::Registry},
nodes::{
spatial::{find_spatial_parent, parse_transform, Spatial},
spatial::{find_spatial_parent, parse_transform, Spatial, Transform},
Message, Node,
},
};
@@ -12,7 +12,7 @@ use parking_lot::Mutex;
use portable_atomic::{AtomicBool, Ordering};
use prisma::{Flatten, Lerp, Rgba};
use serde::Deserialize;
use stardust_xr::{schemas::flex::deserialize, values::Transform};
use stardust_xr::schemas::flex::deserialize;
use std::{collections::VecDeque, sync::Arc};
use stereokit::{bounds_grow_to_fit_pt, Bounds, Color128, LinePoint as SkLinePoint, StereoKitDraw};

View File

@@ -4,7 +4,7 @@ use crate::core::node_collections::LifeLinkedNodeMap;
use crate::core::registry::Registry;
use crate::core::resource::ResourceID;
use crate::nodes::drawable::Drawable;
use crate::nodes::spatial::{find_spatial_parent, parse_transform, Spatial};
use crate::nodes::spatial::{find_spatial_parent, parse_transform, Spatial, Transform};
use crate::nodes::Message;
use crate::SK_MULTITHREAD;
use color_eyre::eyre::{bail, ensure, eyre, Result};
@@ -16,7 +16,7 @@ use portable_atomic::{AtomicBool, Ordering};
use rustc_hash::FxHashMap;
use serde::Deserialize;
use stardust_xr::schemas::flex::deserialize;
use stardust_xr::values::Transform;
use std::ffi::OsStr;
use std::path::PathBuf;
use std::sync::{Arc, Weak};

View File

@@ -2,7 +2,7 @@ use crate::{
core::{client::Client, destroy_queue, registry::Registry, resource::ResourceID},
nodes::{
drawable::Drawable,
spatial::{find_spatial_parent, parse_transform, Spatial},
spatial::{find_spatial_parent, parse_transform, Spatial, Transform},
Message, Node,
},
};
@@ -14,7 +14,7 @@ use parking_lot::Mutex;
use portable_atomic::{AtomicBool, Ordering};
use prisma::{Flatten, Rgba};
use serde::Deserialize;
use stardust_xr::{schemas::flex::deserialize, values::Transform};
use stardust_xr::schemas::flex::deserialize;
use std::{ffi::OsStr, path::PathBuf, sync::Arc};
use stereokit::{named_colors::WHITE, Color128, StereoKitDraw, TextAlign, TextFit, TextStyle};
@@ -150,7 +150,9 @@ impl Text {
_calling_client: Arc<Client>,
message: Message,
) -> Result<()> {
let Some(Drawable::Text(text)) = node.drawable.get() else {bail!("Not a drawable??")};
let Some(Drawable::Text(text)) = node.drawable.get() else {
bail!("Not a drawable??")
};
text.data.lock().character_height = deserialize(message.as_ref())?;
Ok(())
@@ -161,7 +163,9 @@ impl Text {
_calling_client: Arc<Client>,
message: Message,
) -> Result<()> {
let Some(Drawable::Text(text)) = node.drawable.get() else {bail!("Not a drawable??")};
let Some(Drawable::Text(text)) = node.drawable.get() else {
bail!("Not a drawable??")
};
text.data.lock().text = deserialize(message.as_ref())?;
Ok(())