From 5e6f555bb3434d2cc5324f821fcb0f53666c0f50 Mon Sep 17 00:00:00 2001 From: spatialfree Date: Tue, 23 Nov 2021 00:47:49 -0500 Subject: [PATCH] ready for first dof network test --- Program.cs | 20 ++++++++------------ README.md | 21 +++++++++++---------- SpatialCursor.cs | 10 ++++++++++ 3 files changed, 29 insertions(+), 22 deletions(-) diff --git a/Program.cs b/Program.cs index 06e3b2e..19f157d 100644 --- a/Program.cs +++ b/Program.cs @@ -41,19 +41,17 @@ public static class Mono { // Console.WriteLine("Your IP is: " + publicIP); } - Peer peer0 = new Peer("peer0"); - Peer peer1 = new Peer("peer1"); - peer0.Start(false); - peer1.Start(false); + Peer peer = new Peer("ego"); ColorCube cube = new ColorCube(); OrbitalView.strength = 4; OrbitalView.distance = 0.4f; cube.thickness = 0.01f; - ReachCursor reachCursor = new ReachCursor(); - SupineCursor supineCursor = new SupineCursor(); - ClawCursor clawCursor = new ClawCursor(); + StretchCursor stretchCursor = new StretchCursor(); + // ReachCursor reachCursor = new ReachCursor(); + // SupineCursor supineCursor = new SupineCursor(); + // ClawCursor clawCursor = new ClawCursor(); Oriel oriel = new Oriel(); @@ -65,11 +63,9 @@ public static class Mono { offHand = Input.Controller(Handed.Left); mainHand = Input.Controller(Handed.Right); - peer0.cursor = offHand.aim.position * new Vec3(1,1,-1); - peer1.cursor = mainHand.aim.position * new Vec3(1,1,-1); - - model.Draw(Matrix.TS(peer0.peerCursor, 0.1f)); - model.Draw(Matrix.TS(peer1.peerCursor, 0.1f)); + stretchCursor.Step(offHand.aim, mainHand.aim); + peer.cursor = stretchCursor.pos; + model.Draw(Matrix.TS(peer.peerCursor, 0.1f)); // if (offHand.trigger.) { // lerper.t = 0; diff --git a/README.md b/README.md index f31aa67..23b899a 100644 --- a/README.md +++ b/README.md @@ -14,18 +14,19 @@ ## increment - ~~merge networking prototypes~~ +- fixed latency, now for multiple clients - architect interfaces for navigation - implement all dofs from site ## stream -- ~~refactor cursors to pose data 30m~~ -- ~~claw cursor 30m~~ -- ~~refactor networking code to async based on video 1hr~~ -- ~~haul the networking into stereokit 30m~~ -- ~~do something spatial with the data 48m~~ - -- why is the latency 20s? (client side?) // though the server needs a refactor pass *send then receive* -- make a batch script for niko so he can test things easily 32m (+script that does the "install") - - dead simple press to step through dofs -- gif maker \ No newline at end of file +- gif maker + +## override +15 days left for the sterokit comp + +1/3 mvp: + +2/3 polish: + +3/3 accessibility: \ No newline at end of file diff --git a/SpatialCursor.cs b/SpatialCursor.cs index a79476b..72d86b1 100644 --- a/SpatialCursor.cs +++ b/SpatialCursor.cs @@ -9,6 +9,16 @@ public abstract class SpatialCursor { public static Model model = Model.FromFile("cursor.glb", Shader.Default); } +public class StretchCursor : SpatialCursor { + public void Step(Pose offPose, Pose mainPose) { + float stretch = (offPose.position - mainPose.position).Magnitude; + stretch = Math.Max(stretch - 0.1f, 0); + pos = mainPose.position + mainPose.Forward * stretch * 3; + + model.Draw(Matrix.TS(pos, 0.06f)); + } +} + // this is just a stretch cursor derivative public class ReachCursor : SpatialCursor { static Vec3 origin;