select(trigger or the a btn) and back btn for consistent understandable input across devices
This commit is contained in:
parent
5b69e88859
commit
dce6cf6c14
1 changed files with 6 additions and 3 deletions
|
@ -6,8 +6,9 @@ static class Rig
|
||||||
{
|
{
|
||||||
public static Pose head = Pose.Identity;
|
public static Pose head = Pose.Identity;
|
||||||
|
|
||||||
public static DeltaBool btn_trigger = new(false);
|
public static DeltaBool btn_select = new(false);
|
||||||
public static DeltaBool btn_grip = new(false);
|
public static DeltaBool btn_grip = new(false);
|
||||||
|
public static DeltaBool btn_back = new(false);
|
||||||
|
|
||||||
public static Vec3 fullstick = Vec3.Up;
|
public static Vec3 fullstick = Vec3.Up;
|
||||||
public static Pose r_con_stick = Pose.Identity;
|
public static Pose r_con_stick = Pose.Identity;
|
||||||
|
@ -26,7 +27,8 @@ static class Rig
|
||||||
// flatscreen dev controls
|
// flatscreen dev controls
|
||||||
if (Device.Name == "Simulator")
|
if (Device.Name == "Simulator")
|
||||||
{
|
{
|
||||||
btn_trigger.Step(Input.Key(Key.MouseLeft).IsActive());
|
btn_select.Step(Input.Key(Key.MouseLeft).IsActive());
|
||||||
|
btn_back.Step(Input.Key(Key.MouseRight).IsActive());
|
||||||
|
|
||||||
if (Input.Key(Key.A).IsJustActive()) new_dir = new(-1, 0, 0);
|
if (Input.Key(Key.A).IsJustActive()) new_dir = new(-1, 0, 0);
|
||||||
if (Input.Key(Key.S).IsJustActive()) new_dir = new(+1, 0, 0);
|
if (Input.Key(Key.S).IsJustActive()) new_dir = new(+1, 0, 0);
|
||||||
|
@ -46,8 +48,9 @@ static class Rig
|
||||||
// bool hand_tracked = Input.HandSource(Handed.Right) > HandSource.None;
|
// bool hand_tracked = Input.HandSource(Handed.Right) > HandSource.None;
|
||||||
if (con_tracked)
|
if (con_tracked)
|
||||||
{
|
{
|
||||||
btn_trigger.Step(r_con.trigger > 0.5f);
|
btn_select.Step(r_con.x1.IsActive() || r_con.trigger > 0.5f);
|
||||||
btn_grip.Step(r_con.grip > 0.5f);
|
btn_grip.Step(r_con.grip > 0.5f);
|
||||||
|
btn_back.Step(r_con.x2.IsActive());
|
||||||
|
|
||||||
Vec2 stick = r_con.stick;
|
Vec2 stick = r_con.stick;
|
||||||
Quat stick_rot = Quat.FromAngles(stick.y * -90, 0, stick.x * +90);
|
Quat stick_rot = Quat.FromAngles(stick.y * -90, 0, stick.x * +90);
|
||||||
|
|
Loading…
Add table
Reference in a new issue