nova help *o*

This commit is contained in:
ethan merchant 2024-04-18 12:32:58 -04:00
parent f8c43b0a69
commit 78d50e42d1
2 changed files with 44 additions and 2 deletions

13
readme.md Normal file
View file

@ -0,0 +1,13 @@
# braille_xr
xyz -> rgb
° color picker that you can move around in a color_cube
when you pull the color picker out of the cube it will pick colors from your environment
while showing you where that color is in the color_cube
useful cmds
```shell
cargo doc --open
```

View file

@ -1,9 +1,11 @@
use std::collections::{HashMap, HashSet};
use manifest_dir_macros::directory_relative_path;
use mint::{Vector2, Vector3};
use stardust_xr_fusion::{
client::{Client, RootHandler}, core::values::ResourceID, drawable::Model, fields::BoxField, input::{InputData, InputDataType, InputHandler}, spatial::{SpatialAspect, Transform}, HandlerWrapper
client::{Client, RootHandler}, core::values::ResourceID, data, drawable::Model, fields::BoxField, input::{InputData, InputDataType, InputHandler, InputHandlerHandler, UnknownInputMethod}, spatial::{SpatialAspect, Transform}, HandlerWrapper
};
use stardust_xr_molecules::{input_action::{BaseInputAction, InputActionHandler}, Grabbable, GrabbableSettings};
use stardust_xr_molecules::{input_action::{BaseInputAction, InputActionHandler}, Grabbable, GrabbableSettings, PointerMode};
#[derive(Debug, Clone, Copy)]
struct State {
@ -19,6 +21,33 @@ struct Root {
pub hover_color: Vector3<f32>,
}
struct OtherStruct {
model: Model,
handler: InputHandler,
inputs: HashMap<InputData, UnknownInputMethod>,
}
impl OtherStruct {
fn update(&mut self, info: &stardust_xr_fusion::client::FrameInfo) {
for (data, method) in self.inputs.iter() {
data.datamap.with_data(|data| {
data.idx("color_hover").as_f32()
});
data.captured = true;
method.capture(&self.handler).unwrap();
}
self.inputs.clear();
}
}
impl InputHandlerHandler for OtherStruct {
fn input(&mut self, input: stardust_xr_fusion::input::UnknownInputMethod, data: InputData) {
self.inputs.insert(data);
}
}
impl Root {
async fn create(client: &Client) -> Self {
// stardust_xr_fusion::drawable::Model