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