lefty
This commit is contained in:
parent
39c00e1dd1
commit
f5517e926e
2 changed files with 16 additions and 15 deletions
18
Program.cs
18
Program.cs
|
@ -18,13 +18,13 @@ class Program {
|
|||
|
||||
public class Mono {
|
||||
public Mic mic;
|
||||
public Controller lHand, rHand;
|
||||
public Controller domCon, subCon; public bool lefty;
|
||||
|
||||
public void Run() {
|
||||
// mic = new Mic();
|
||||
Vec3 pos = new Vec3(0, 0, 0);
|
||||
|
||||
Cursors cursors = new Cursors();
|
||||
Cursors cursors = new Cursors(this);
|
||||
|
||||
MonoNet net = new MonoNet(this);
|
||||
net.Start();
|
||||
|
@ -38,24 +38,24 @@ public class Mono {
|
|||
// cube.thickness = 0.01f;
|
||||
|
||||
while (SK.Step(() => {
|
||||
lHand = Input.Controller(Handed.Left);
|
||||
rHand = Input.Controller(Handed.Right);
|
||||
if (lefty) { domCon = Input.Controller(Handed.Left); subCon = Input.Controller(Handed.Right); }
|
||||
else { domCon = Input.Controller(Handed.Right); subCon = Input.Controller(Handed.Left); }
|
||||
if (subCon.IsX2JustPressed) { lefty = !lefty; }
|
||||
|
||||
SpatialCursor cursor = cursors.Step(lHand.aim, rHand.aim);
|
||||
SpatialCursor cursor = cursors.Step(domCon.aim, subCon.aim);
|
||||
|
||||
if (lHand.IsX1JustPressed) {
|
||||
pos = new Vec3(0, 0, 0);
|
||||
if (domCon.IsX1JustPressed) {
|
||||
pos = cursor.p0;
|
||||
}
|
||||
// pos.x = (float)Math.Sin(Time.Total * 0.1f) * 0.5f;
|
||||
Renderer.CameraRoot = Matrix.T(pos);
|
||||
|
||||
|
||||
// cursor.Step(lHand.aim, rHand.aim); cursor.DrawSelf();
|
||||
// net.me.cursorA = Vec3.Up * (float)Math.Sin(Time.Total);
|
||||
net.me.cursorA = cursor.p0; net.me.cursorB = cursor.p1;
|
||||
net.me.cursorC = cursor.p2; net.me.cursorD = cursor.p3;
|
||||
net.me.headset = Input.Head;
|
||||
net.me.offHand = lHand.aim; net.me.mainHand = rHand.aim;
|
||||
net.me.mainHand = domCon.aim; net.me.offHand = subCon.aim;
|
||||
for (int i = 0; i < net.peers.Length; i++) {
|
||||
MonoNet.Peer peer = net.peers[i];
|
||||
if (peer != null) {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
using System;
|
||||
using StereoKit;
|
||||
|
||||
// build this out tentatively
|
||||
public abstract class SpatialCursor {
|
||||
public Vec3 p0, p1, p2, p3;
|
||||
public float min, str, max;
|
||||
|
@ -13,13 +12,15 @@ public abstract class SpatialCursor {
|
|||
}
|
||||
|
||||
public class Cursors {
|
||||
SpatialCursor[] oneHanded = new SpatialCursor[] { new ReachCursor(), new TwistCursor() }; int oneIndex = 0;
|
||||
Mono mono;
|
||||
public Cursors(Mono mono) {
|
||||
this.mono = mono;
|
||||
}
|
||||
SpatialCursor[] oneHanded = new SpatialCursor[] { new ReachCursor(), new TwistCursor() }; int oneIndex = 1;
|
||||
SpatialCursor[] twoHanded = new SpatialCursor[] { new StretchCursor(), new CubicFlow(), new SupineCursor() }; int twoIndex = 0;
|
||||
|
||||
public SpatialCursor Step(Pose lHand, Pose rHand) {
|
||||
Pose domHand = rHand; Pose subHand = lHand;
|
||||
|
||||
SpatialCursor cursor = oneHanded[oneIndex];
|
||||
public SpatialCursor Step(Pose domHand, Pose subHand) {
|
||||
SpatialCursor cursor = oneHanded[oneIndex];
|
||||
cursor.Step(new Pose[] { domHand, subHand });
|
||||
return cursor;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue