^SK preview 5

This commit is contained in:
spatialfree 2022-10-19 02:43:43 -04:00
parent 90b058786d
commit 845d0d03ea
2 changed files with 118 additions and 125 deletions

View file

@ -10,7 +10,8 @@ public class Mono {
public Material matHolo;
public Rig rig = new Rig();
public Scene scene = new Scene();
public Space space = new Space();
public Compositor compositor = new Compositor();
// -------------------------------------------------
@ -18,8 +19,6 @@ public class Mono {
int dofIndex = 0;
dof dof => dofs[dofIndex];
public Oriel oriel = new Oriel(); // -> array ?
public ColorCube colorCube = new ColorCube();
public Glove rGlove = new Glove(true), lGlove = new Glove(false);
@ -55,38 +54,46 @@ public class Mono {
}
public void Init() {
compositor.Init();
dofs[0].Init();
dofs[1].Init();
dofs[2].Init();
dofs[3].Init();
// dofs[0].Init();
// dofs[1].Init();
// spaceMono.Init();
greenyard.Init();
matDev = Material.Default.Copy();
matDev.SetTexture("diffuse", Tex.DevTex);
matHolo = Material.Default.Copy();
matHolo.Transparency = Transparency.Add;
matHolo.DepthWrite = false;
matHolo.DepthTest = DepthTest.Less;
matHolo.DepthTest = DepthTest.Always;
matHolo.SetTexture("diffuse", Tex.DevTex);
}
// -------------------------------------------------
// Space.Mono spaceMono = new Space.Mono();
Greenyard.Mono greenyard = new Greenyard.Mono();
// -------------------------------------------------
public void Frame() {
// Input.HandClearOverride(Handed.Left);
Input.HandClearOverride(Handed.Right);
// store hand pre override in rig
rig.Step();
// Hand hand = Input.Hand(Handed.Right);
// Controller con = Input.Controller(Handed.Right);
// Mesh.Cube.Draw(
// Material.Default,
// hand.IsJustPinched
// )
// Con -> Hand
// lGlove.Step();
// rGlove.Step();
compositor.Frame();
// -------------------------------------------------
// dof.Frame();
// // dof.Frame();
dofs[0].Frame();
dofs[1].Frame();
dofs[2].Frame();
@ -103,43 +110,29 @@ public class Mono {
Mesh.Cube.Draw(Mono.inst.matHolo,
Matrix.TRS(
lwc.cursor.position,
ltb.ori,
0.04f
Quat.Identity, // ltb.ori,
0.015f
),
new Color(1, 0, 0)
new Color(0, 1, 1)
);
Mesh.Cube.Draw(Mono.inst.matHolo,
Matrix.TRS(
rwc.cursor.position,
rtb.ori,
0.04f
Quat.Identity, // rtb.ori,
0.015f
),
new Color(1, 0, 0)
new Color(0, 1, 1)
);
// rGlove.Step(); lGlove.Step();
// rBlock.Step(); lBlock.Step();
// cubicCon.Step();
// colorCube.Palm(lCon.device);
oriel.Frame();
scene.Step(); // after! (render scene after oriel)
// -------------------------------------------------
// spaceMono.Frame();
greenyard.Frame();
// -------------------------------------------------
oriel.Render();
net.me.Step();
net.send = true;
@ -156,20 +149,20 @@ public class Mono {
// if (UI.Button("Scale w/Height")) { oriel.scaleWithHeight = !oriel.scaleWithHeight; }
// UI.HSlider("Scale", ref oriel.scale, 0.1f, 1f, 0.1f);
// UI.HSlider("Multiplier", ref oriel.multiplier, 0.1f, 1f, 0.1f);
// UI.Label("Player.y");
// UI.HSlider("Player.y", ref greenyard.height, 0.1f, 1.5f, 0.1f);
// // UI.Label("Player.y");
// UI.HSlider("Player.y", ref greenyard.height, 1f, 6f, 0.2f);
UI.Label("pos.y");
UI.HSlider("pos.y", ref playerY, -1f, 1f, 0.1f);
// UI.Label("pos.y");
// UI.HSlider("pos.y", ref playerY, -1f, 1f, 0.1f);
UI.Label("trail.length");
UI.HSlider("trail.length", ref trailLen, 0.1f, 1f, 0.1f);
// UI.Label("trail.length");
// UI.HSlider("trail.length", ref trailLen, 0.1f, 1f, 0.1f);
UI.Label("trail.scale");
UI.HSlider("trail.str", ref trailScl, 0.1f, 2f, 0.1f);
// UI.Label("trail.scale");
// UI.HSlider("trail.str", ref trailScl, 0.1f, 2f, 0.1f);
UI.Label("str");
UI.HSlider("str", ref stretchStr, 0.1f, 1f, 0.1f);
// UI.Label("str");
// UI.HSlider("str", ref stretchStr, 0.1f, 1f, 0.1f);
@ -180,9 +173,9 @@ public class Mono {
UI.WindowEnd();
}
public float trailLen = 0.5f;
public float trailLen = 0.666f;
public float trailScl = 0.2f;
public float stretchStr = 0.333f;
public float stretchStr = 0.5f;
public float playerY = 0;
}

View file

@ -15,7 +15,7 @@ class StretchCursor : dof {
float mag = (vTo - vFrom).Magnitude;
stretch = MathF.Max(mag - deadzone, 0);
Vec3 dir = PullRequest.Direction(vTo, vFrom);
Vec3 dir = Vec3.Direction(vTo, vFrom);
cursor = vTo + dir * stretch * strength;
// draw