sholder sheathe system

This commit is contained in:
ethan merchant 2024-12-21 14:02:34 -05:00
parent 7f466ffe4b
commit 35425b7a16

View file

@ -97,6 +97,27 @@ static class Rig
if (ax > ay && ax > az) new_dir = new(Maths.sign(fullstick.x), 0, 0);
if (ay > ax && ay > az) new_dir = new(0, Maths.sign(fullstick.y), 0);
if (az > ax && az > ay) new_dir = new(0, 0, Maths.sign(fullstick.z));
// sheathe grabs
// shoulders
// put hand in head space
// if behind head then handedness = left or right sheathe
// else check for left or right of head to grab at left or right sheathe
for (int i = 0; i < (int)Handed.Max; i++)
{
if (!holding[i])
{
Vec3 local_pos = head.orientation.Inverse * (pose_hld[i].position - head.position);
Handed side = local_pos.x < 0 ? Handed.Left : Handed.Right;
if (upper_sheathes[(int)side])
{
if (btn_grip[i].delta == +1)
{
upper_sheathes[(int)side] = false;
holding[i] = true;
}
}
}
}
}
}