Skip to content

armgit / raea

Public Imported from GitHub
0

Render Anything Engine: tell your AI what to make. Videos, motion graphics, 3D and games as React and TypeScript, rendered on your own GPU. Rust + Bevy, macOS, Linux and Windows.

HG17: the palm's height read in one chain of samples (the thumb's ball joined before the heights are taken).

shinyobjectz760aea017d65
diff --git a/systems/body/src/rig.rs b/systems/body/src/rig.rs
index da680237..eb6a424e 100644
--- a/systems/body/src/rig.rs
+++ b/systems/body/src/rig.rs
@@ -213,15 +213,15 @@ pub fn hand_rest(skel: &Skeleton, s: Side) -> Option<HandRest> {
let middle = reach * 0.55;
// and the ball of the thumb, which is the palm's too though the thumb's first bone carries it: a face the palm
// lies on meets it first (left out, it sat 6 to 9 mm inside a held box with the thumb as far open as it goes)
- let ball = skel.skin_of(skel.finger("thumb", s)?[0]).filter(|x| x.normal.dot(palm) > 0.5).map(|x| (x.at - h).dot(palm));
+ let ball = skel.skin_of(skel.finger("thumb", s)?[0]).filter(|x| x.normal.dot(palm) > 0.5);
let skin = skel
.skin_of(hand)
// (skin the hand mostly carries itself: the web to the thumb stands 13 mm proud of the palm and goes with the thumb)
.filter(|x| x.part == "palm" && x.normal.dot(palm) > 0.5 && x.joints.first().is_some_and(|j| j.1 >= 0.8))
+ .filter(|x| (x.at - h - middle).reject_from_normalized(palm).length() < 0.025)
+ .chain(ball)
.map(|x| x.at - h)
- .filter(|o| (*o - middle).reject_from_normalized(palm).length() < 0.025)
.map(|o| o.dot(palm))
- .chain(ball)
.fold(f32::MIN, f32::max);
Some(HandRest { along, palm, mid: middle + palm * if skin > 0.0 { skin } else { 0.012 } })
}