feat(suis/hand): distance per joint
This commit is contained in:
4
Cargo.lock
generated
4
Cargo.lock
generated
@@ -2063,9 +2063,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "stardust-xr-schemas"
|
name = "stardust-xr-schemas"
|
||||||
version = "1.5.2"
|
version = "1.5.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f6c9d64628296b42a49f86a1523e9c7dca81d723a1a07bd7d56b1a9798f0a762"
|
checksum = "68d1cc2732943497bc7ae6a55630d18bb2efdcfd0ea9462340ac703724bf1372"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"flatbuffers",
|
"flatbuffers",
|
||||||
"flexbuffers",
|
"flexbuffers",
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ rustc-hash = "1.1.0"
|
|||||||
tokio = { version = "1.27.0", features = ["rt-multi-thread", "signal"] }
|
tokio = { version = "1.27.0", features = ["rt-multi-thread", "signal"] }
|
||||||
send_wrapper = "0.6.0"
|
send_wrapper = "0.6.0"
|
||||||
prisma = "0.1.1"
|
prisma = "0.1.1"
|
||||||
stardust-xr = "0.14.0"
|
stardust-xr = "0.14.1"
|
||||||
directories = "5.0.0"
|
directories = "5.0.0"
|
||||||
serde = { version = "1.0.160", features = ["derive"] }
|
serde = { version = "1.0.160", features = ["derive"] }
|
||||||
serde_repr = "0.1.16"
|
serde_repr = "0.1.16"
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ impl InputSpecialization for Hand {
|
|||||||
}
|
}
|
||||||
fn serialize(
|
fn serialize(
|
||||||
&self,
|
&self,
|
||||||
_distance_link: &DistanceLink,
|
distance_link: &DistanceLink,
|
||||||
local_to_handler_matrix: Mat4,
|
local_to_handler_matrix: Mat4,
|
||||||
) -> InputDataType {
|
) -> InputDataType {
|
||||||
let mut hand = self.base;
|
let mut hand = self.base;
|
||||||
@@ -68,6 +68,10 @@ impl InputSpecialization for Hand {
|
|||||||
let (_, rotation, position) = joint_matrix.to_scale_rotation_translation();
|
let (_, rotation, position) = joint_matrix.to_scale_rotation_translation();
|
||||||
joint.position = position.into();
|
joint.position = position.into();
|
||||||
joint.rotation = rotation.into();
|
joint.rotation = rotation.into();
|
||||||
|
joint.distance = distance_link
|
||||||
|
.handler
|
||||||
|
.field
|
||||||
|
.distance(&distance_link.handler.spatial, position.into());
|
||||||
}
|
}
|
||||||
|
|
||||||
InputDataType::Hand(Box::new(hand))
|
InputDataType::Hand(Box::new(hand))
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ fn convert_joint(joint: HandJoint) -> Joint {
|
|||||||
position: joint.position.into(),
|
position: joint.position.into(),
|
||||||
rotation: joint.orientation.into(),
|
rotation: joint.orientation.into(),
|
||||||
radius: joint.radius,
|
radius: joint.radius,
|
||||||
|
distance: 0.0,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user