Stepf up
This commit is contained in:
parent
28f9c7e8ca
commit
54d72a1fa7
13 changed files with 47 additions and 47 deletions
|
@ -106,7 +106,7 @@ public class DriftGrind {
|
||||||
// pos = -(rCon.pos - Input.Head.position) + grindPos - (Input.Head.position - pos);
|
// pos = -(rCon.pos - Input.Head.position) + grindPos - (Input.Head.position - pos);
|
||||||
// vel = Vec3.Zero;
|
// vel = Vec3.Zero;
|
||||||
|
|
||||||
// railT += Time.Elapsedf * grindVel.Magnitude * grindDir; // scale based on length of rail * calculate and cache on place
|
// railT += Time.Stepf * grindVel.Magnitude * grindDir; // scale based on length of rail * calculate and cache on place
|
||||||
// // bool clamped = false;
|
// // bool clamped = false;
|
||||||
// // float railTpreClamp = railT;
|
// // float railTpreClamp = railT;
|
||||||
// // if
|
// // if
|
||||||
|
@ -124,7 +124,7 @@ public class DriftGrind {
|
||||||
|
|
||||||
// cube.Draw(mat, Matrix.TS(grindPos, new Vec3(0.1f, 0.1f, 0.1f)));
|
// cube.Draw(mat, Matrix.TS(grindPos, new Vec3(0.1f, 0.1f, 0.1f)));
|
||||||
// // cube.Draw(mat, Matrix.TS(toPos, new Vec3(0.1f, 0.1f, 0.1f) * 0.333f));
|
// // cube.Draw(mat, Matrix.TS(toPos, new Vec3(0.1f, 0.1f, 0.1f) * 0.333f));
|
||||||
// // pos = Vec3.Lerp(pos, Bezier.Sample(net.me.cubics[0].p0, net.me.cubics[0].p1, net.me.cubics[0].p2, net.me.cubics[0].p3, railT) - (subCon.aim.position - pos), Time.Elapsedf * 6f);
|
// // pos = Vec3.Lerp(pos, Bezier.Sample(net.me.cubics[0].p0, net.me.cubics[0].p1, net.me.cubics[0].p2, net.me.cubics[0].p3, railT) - (subCon.aim.position - pos), Time.Stepf * 6f);
|
||||||
// // how to reliably determine and control which direction to go? (velocity)
|
// // how to reliably determine and control which direction to go? (velocity)
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
@ -149,12 +149,12 @@ public class DriftGrind {
|
||||||
|
|
||||||
// pos.x = (float)Math.Sin(Time.Total * 0.1f) * 0.5f;
|
// pos.x = (float)Math.Sin(Time.Total * 0.1f) * 0.5f;
|
||||||
|
|
||||||
// pos += vel * Time.Elapsedf;
|
// pos += vel * Time.Stepf;
|
||||||
|
|
||||||
// float preX = pos.x; pos.x = Math.Clamp(pos.x, -scene.scale / 2, scene.scale / 2); if (pos.x != preX) { vel.x = 0; }
|
// float preX = pos.x; pos.x = Math.Clamp(pos.x, -scene.scale / 2, scene.scale / 2); if (pos.x != preX) { vel.x = 0; }
|
||||||
// float preY = pos.y; pos.y = Math.Clamp(pos.y, 0f, scene.scale / 2); if (pos.y != preY) { vel.y = 0; }
|
// float preY = pos.y; pos.y = Math.Clamp(pos.y, 0f, scene.scale / 2); if (pos.y != preY) { vel.y = 0; }
|
||||||
// float preZ = pos.z; pos.z = Math.Clamp(pos.z, -scene.scale / 2, scene.scale / 2); if (pos.z != preZ) { vel.z = 0; }
|
// float preZ = pos.z; pos.z = Math.Clamp(pos.z, -scene.scale / 2, scene.scale / 2); if (pos.z != preZ) { vel.z = 0; }
|
||||||
|
|
||||||
// vel *= 1 - Time.Elapsedf * 0.2f;
|
// vel *= 1 - Time.Stepf * 0.2f;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -14,33 +14,33 @@ public class Mono {
|
||||||
Vec3 angle = new Vec3(0, 0, 0);
|
Vec3 angle = new Vec3(0, 0, 0);
|
||||||
|
|
||||||
Thing[] thing;
|
Thing[] thing;
|
||||||
Model model = Model.FromFile("/backrooms/backrooms.glb");
|
Model model = Model.FromFile("backrooms/backrooms.glb");
|
||||||
|
|
||||||
public void Init() {
|
public void Init() {
|
||||||
thing = new Thing[] {
|
thing = new Thing[] {
|
||||||
new Thing(
|
new Thing(
|
||||||
model.GetMesh("Carpet"),
|
model.GetMesh("Carpet"),
|
||||||
new Material(Shader.FromFile("/shaders/oriel.hlsl")),
|
new Material(Shader.FromFile("shaders/oriel.hlsl")),
|
||||||
"backrooms/Carpet.png"
|
"backrooms/Carpet.png"
|
||||||
),
|
),
|
||||||
new Thing(
|
new Thing(
|
||||||
model.GetMesh("Walls"),
|
model.GetMesh("Walls"),
|
||||||
new Material(Shader.FromFile("/shaders/oriel.hlsl")),
|
new Material(Shader.FromFile("shaders/oriel.hlsl")),
|
||||||
"backrooms/Walls.png"
|
"backrooms/Walls.png"
|
||||||
),
|
),
|
||||||
new Thing(
|
new Thing(
|
||||||
model.GetMesh("Ceiling"),
|
model.GetMesh("Ceiling"),
|
||||||
new Material(Shader.FromFile("/shaders/oriel.hlsl")),
|
new Material(Shader.FromFile("shaders/oriel.hlsl")),
|
||||||
"backrooms/Ceiling.png"
|
"backrooms/Ceiling.png"
|
||||||
),
|
),
|
||||||
new Thing(
|
new Thing(
|
||||||
model.GetMesh("Vents"),
|
model.GetMesh("Vents"),
|
||||||
new Material(Shader.FromFile("/shaders/oriel.hlsl")),
|
new Material(Shader.FromFile("shaders/oriel.hlsl")),
|
||||||
"backrooms/Vents.png"
|
"backrooms/Vents.png"
|
||||||
),
|
),
|
||||||
new Thing(
|
new Thing(
|
||||||
model.GetMesh("Lights"),
|
model.GetMesh("Lights"),
|
||||||
new Material(Shader.FromFile("/shaders/oriel.hlsl")),
|
new Material(Shader.FromFile("shaders/oriel.hlsl")),
|
||||||
"backrooms/Lights.png"
|
"backrooms/Lights.png"
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
@ -49,9 +49,9 @@ public class Mono {
|
||||||
public void Frame() {
|
public void Frame() {
|
||||||
Oriels.Rig rig = Oriels.Mono.inst.rig;
|
Oriels.Rig rig = Oriels.Mono.inst.rig;
|
||||||
|
|
||||||
// angle.x -= rig.rCon.device.stick.y * 90f * Time.Elapsedf;
|
// angle.x -= rig.rCon.device.stick.y * 90f * Time.Stepf;
|
||||||
// angle.x = PullRequest.Clamp(angle.x, -89, 89);
|
// angle.x = PullRequest.Clamp(angle.x, -89, 89);
|
||||||
angle.y -= rig.rCon.device.stick.x * 90f * Time.Elapsedf;
|
angle.y -= rig.rCon.device.stick.x * 90f * Time.Stepf;
|
||||||
|
|
||||||
Vec3 input = new Vec3(
|
Vec3 input = new Vec3(
|
||||||
rig.lCon.device.stick.x,
|
rig.lCon.device.stick.x,
|
||||||
|
@ -67,7 +67,7 @@ public class Mono {
|
||||||
).Normalized * input;
|
).Normalized * input;
|
||||||
|
|
||||||
input.y = 0;
|
input.y = 0;
|
||||||
offset += input * Time.Elapsedf;
|
offset += input * Time.Stepf;
|
||||||
}
|
}
|
||||||
offset.y = -height;
|
offset.y = -height;
|
||||||
|
|
||||||
|
|
|
@ -126,7 +126,7 @@ public class BlockCon {
|
||||||
spinDelta = Quat.Slerp(
|
spinDelta = Quat.Slerp(
|
||||||
spinDelta.Normalized,
|
spinDelta.Normalized,
|
||||||
(newRot.Inverse * conRotDelta * newRot).Normalized,
|
(newRot.Inverse * conRotDelta * newRot).Normalized,
|
||||||
Time.Elapsedf / 0.1f
|
Time.Stepf / 0.1f
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
spinRot *= spinDelta * spinDelta;
|
spinRot *= spinDelta * spinDelta;
|
||||||
|
@ -139,16 +139,16 @@ public class BlockCon {
|
||||||
blocks[index].solid.Move(toPos, toRot);
|
blocks[index].solid.Move(toPos, toRot);
|
||||||
|
|
||||||
Quat newHeldRot = blocks[index].solid.GetPose().orientation;
|
Quat newHeldRot = blocks[index].solid.GetPose().orientation;
|
||||||
angularMomentum = Vec3.Lerp(angularMomentum, PullRequest.AngularDisplacement((newHeldRot * oldHeldRot.Inverse).Normalized), Time.Elapsedf / 0.1f);
|
angularMomentum = Vec3.Lerp(angularMomentum, PullRequest.AngularDisplacement((newHeldRot * oldHeldRot.Inverse).Normalized), Time.Stepf / 0.1f);
|
||||||
oldHeldRot = newHeldRot;
|
oldHeldRot = newHeldRot;
|
||||||
|
|
||||||
delta = (cursor + (con.ori * heldRot * spinRot).Normalized * offset) - blocks[index].solid.GetPose().position;
|
delta = (cursor + (con.ori * heldRot * spinRot).Normalized * offset) - blocks[index].solid.GetPose().position;
|
||||||
momentum = Vec3.Lerp(momentum, delta, Time.Elapsedf / 0.1f);
|
momentum = Vec3.Lerp(momentum, delta, Time.Stepf / 0.1f);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
blocks[index].solid.SetAngularVelocity(angularMomentum / Time.Elapsedf);
|
blocks[index].solid.SetAngularVelocity(angularMomentum / Time.Stepf);
|
||||||
blocks[index].solid.SetVelocity(momentum / Time.Elapsedf);
|
blocks[index].solid.SetVelocity(momentum / Time.Stepf);
|
||||||
}
|
}
|
||||||
index = -1;
|
index = -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,13 +35,13 @@ public class Board {
|
||||||
|
|
||||||
|
|
||||||
// velocity
|
// velocity
|
||||||
vel *= 1f - (drag * Time.Elapsedf);
|
vel *= 1f - (drag * Time.Stepf);
|
||||||
vel += accel * speed * Time.Elapsedf;
|
vel += accel * speed * Time.Stepf;
|
||||||
vel = MathF.Max(vel - deccel * brake * Time.Elapsedf, 0);
|
vel = MathF.Max(vel - deccel * brake * Time.Stepf, 0);
|
||||||
|
|
||||||
// steering
|
// steering
|
||||||
vector = Quat.LookDir(dir) * Quat.FromAngles(0, lean * tight, 0) * Vec3.Forward;
|
vector = Quat.LookDir(dir) * Quat.FromAngles(0, lean * tight, 0) * Vec3.Forward;
|
||||||
back += vector * vel * Time.Elapsedf;
|
back += vector * vel * Time.Stepf;
|
||||||
dir = (front - back).Normalized;
|
dir = (front - back).Normalized;
|
||||||
|
|
||||||
front = back + dir * length;
|
front = back + dir * length;
|
||||||
|
|
|
@ -31,9 +31,9 @@ public class Mono {
|
||||||
public void Frame() {
|
public void Frame() {
|
||||||
Oriels.Rig rig = Oriels.Mono.inst.rig;
|
Oriels.Rig rig = Oriels.Mono.inst.rig;
|
||||||
|
|
||||||
// angle.x -= rig.rCon.device.stick.y * 90f * Time.Elapsedf;
|
// angle.x -= rig.rCon.device.stick.y * 90f * Time.Stepf;
|
||||||
// angle.x = PullRequest.Clamp(angle.x, -89, 89);
|
// angle.x = PullRequest.Clamp(angle.x, -89, 89);
|
||||||
angle.y -= rig.rCon.device.stick.x * 90f * Time.Elapsedf;
|
angle.y -= rig.rCon.device.stick.x * 90f * Time.Stepf;
|
||||||
|
|
||||||
Vec3 input = new Vec3(
|
Vec3 input = new Vec3(
|
||||||
rig.lCon.device.stick.x,
|
rig.lCon.device.stick.x,
|
||||||
|
@ -49,7 +49,7 @@ public class Mono {
|
||||||
).Normalized * input;
|
).Normalized * input;
|
||||||
|
|
||||||
input.y = 0;
|
input.y = 0;
|
||||||
offset += input * Time.Elapsedf;
|
offset += input * Time.Stepf;
|
||||||
}
|
}
|
||||||
offset.y = -height;
|
offset.y = -height;
|
||||||
|
|
||||||
|
|
|
@ -346,11 +346,11 @@ public class Cursor {
|
||||||
set {
|
set {
|
||||||
_raw = value;
|
_raw = value;
|
||||||
pos = new Vec3(
|
pos = new Vec3(
|
||||||
(float)xF.Filter(raw.x, (double)Time.Elapsedf),
|
(float)xF.Filter(raw.x, (double)Time.Stepf),
|
||||||
(float)yF.Filter(raw.y, (double)Time.Elapsedf),
|
(float)yF.Filter(raw.y, (double)Time.Stepf),
|
||||||
(float)zF.Filter(raw.z, (double)Time.Elapsedf)
|
(float)zF.Filter(raw.z, (double)Time.Stepf)
|
||||||
);
|
);
|
||||||
smooth = Vec3.Lerp(smooth, pos, Time.Elapsedf * 6f);
|
smooth = Vec3.Lerp(smooth, pos, Time.Stepf * 6f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public Vec3 pos { get; private set; }
|
public Vec3 pos { get; private set; }
|
||||||
|
|
|
@ -31,7 +31,7 @@ public static class PullRequest {
|
||||||
ToAxisAngle(q, out axis, out angle);
|
ToAxisAngle(q, out axis, out angle);
|
||||||
return axis * angle;
|
return axis * angle;
|
||||||
// * (float)(Math.PI / 180); // radians -> degrees
|
// * (float)(Math.PI / 180); // radians -> degrees
|
||||||
// / Time.Elapsedf; // delta -> velocity
|
// / Time.Stepf; // delta -> velocity
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ToAxisAngle(this Quat q, out Vec3 axis, out float angle) {
|
public static void ToAxisAngle(this Quat q, out Vec3 axis, out float angle) {
|
||||||
|
@ -321,7 +321,7 @@ public static class PullRequest {
|
||||||
float error = value - target;
|
float error = value - target;
|
||||||
integral += error;
|
integral += error;
|
||||||
float delta = ((p * error) + (i * integral));
|
float delta = ((p * error) + (i * integral));
|
||||||
return value -= delta * Time.Elapsedf;
|
return value -= delta * Time.Stepf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -333,7 +333,7 @@ public static class PullRequest {
|
||||||
Vec3 error = value - target;
|
Vec3 error = value - target;
|
||||||
integral += error;
|
integral += error;
|
||||||
Vec3 delta = ((p * error) + (i * integral));
|
Vec3 delta = ((p * error) + (i * integral));
|
||||||
return value -= delta * Time.Elapsedf;
|
return value -= delta * Time.Stepf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -345,15 +345,15 @@ public static class PullRequest {
|
||||||
|
|
||||||
public void Step(float to = 1, bool bounce = false) {
|
public void Step(float to = 1, bool bounce = false) {
|
||||||
float dir = to - t;
|
float dir = to - t;
|
||||||
vel += dir * spring * Time.Elapsedf;
|
vel += dir * spring * Time.Stepf;
|
||||||
|
|
||||||
if (Math.Sign(vel) != Math.Sign(dir)) {
|
if (Math.Sign(vel) != Math.Sign(dir)) {
|
||||||
vel *= 1 - (dampen * Time.Elapsedf);
|
vel *= 1 - (dampen * Time.Stepf);
|
||||||
} else {
|
} else {
|
||||||
vel *= 1 - (dampen * 0.33f * Time.Elapsedf);
|
vel *= 1 - (dampen * 0.33f * Time.Stepf);
|
||||||
}
|
}
|
||||||
|
|
||||||
float newt = t + vel * Time.Elapsedf;
|
float newt = t + vel * Time.Stepf;
|
||||||
if (bounce && (newt < 0 || newt > 1)) {
|
if (bounce && (newt < 0 || newt > 1)) {
|
||||||
vel *= -0.5f;
|
vel *= -0.5f;
|
||||||
newt = Math.Clamp(newt, 0, 1);
|
newt = Math.Clamp(newt, 0, 1);
|
||||||
|
|
|
@ -51,7 +51,7 @@ public class Rig {
|
||||||
Vec2 stickL = Input.Controller(Handed.Left).stick;
|
Vec2 stickL = Input.Controller(Handed.Left).stick;
|
||||||
Vec2 stickR = Input.Controller(Handed.Right).stick;
|
Vec2 stickR = Input.Controller(Handed.Right).stick;
|
||||||
Quat delta = Quat.FromAngles(
|
Quat delta = Quat.FromAngles(
|
||||||
Vec3.Up * stickR.x * 120f * Time.Elapsedf
|
Vec3.Up * stickR.x * 120f * Time.Stepf
|
||||||
) * ori;
|
) * ori;
|
||||||
Vec3 headPos = Input.Head.position + Input.Head.Forward * -0.15f; // Input.Head -> Head() ?
|
Vec3 headPos = Input.Head.position + Input.Head.Forward * -0.15f; // Input.Head -> Head() ?
|
||||||
pos -= headPos;
|
pos -= headPos;
|
||||||
|
@ -59,7 +59,7 @@ public class Rig {
|
||||||
pos += headPos;
|
pos += headPos;
|
||||||
ori = delta * ori;
|
ori = delta * ori;
|
||||||
|
|
||||||
Vec3 move = -stickL.X0Y * Time.Elapsedf * 0.5f;
|
Vec3 move = -stickL.X0Y * Time.Stepf * 0.5f;
|
||||||
pos += (Input.Head.orientation * move).X0Z;
|
pos += (Input.Head.orientation * move).X0Z;
|
||||||
|
|
||||||
Renderer.CameraRoot = Matrix.TR(pos, ori) * bounds.Inverse;
|
Renderer.CameraRoot = Matrix.TR(pos, ori) * bounds.Inverse;
|
||||||
|
|
|
@ -86,7 +86,7 @@ public class Mono {
|
||||||
);
|
);
|
||||||
|
|
||||||
// fly player towards cursor:
|
// fly player towards cursor:
|
||||||
// playerPos += (localCursor - playerPos).Normalized * 1f * Time.Elapsedf;
|
// playerPos += (localCursor - playerPos).Normalized * 1f * Time.Stepf;
|
||||||
pidX.p = moveP; pidY.p = moveP; pidZ.p = moveP;
|
pidX.p = moveP; pidY.p = moveP; pidZ.p = moveP;
|
||||||
pidX.i = moveI; pidY.i = moveI; pidZ.i = moveI;
|
pidX.i = moveI; pidY.i = moveI; pidZ.i = moveI;
|
||||||
playerPos = new Vec3(
|
playerPos = new Vec3(
|
||||||
|
@ -172,7 +172,7 @@ public class Mono {
|
||||||
Vec3 toPlayer = (playerPos - enemies[i]).Normalized;
|
Vec3 toPlayer = (playerPos - enemies[i]).Normalized;
|
||||||
float variation = Oriels.Mono.inst.noise.D1(i);
|
float variation = Oriels.Mono.inst.noise.D1(i);
|
||||||
toPlayer *= Quat.FromAngles(0, MathF.Sin(Time.Totalf * variation) * 90 * variation, 0);
|
toPlayer *= Quat.FromAngles(0, MathF.Sin(Time.Totalf * variation) * 90 * variation, 0);
|
||||||
Vec3 newPos = enemies[i] + toPlayer * Time.Elapsedf * 0.5f;
|
Vec3 newPos = enemies[i] + toPlayer * Time.Stepf * 0.5f;
|
||||||
|
|
||||||
// if far enough away from other enemies than set new pos
|
// if far enough away from other enemies than set new pos
|
||||||
bool setNewPos = true;
|
bool setNewPos = true;
|
||||||
|
|
|
@ -7,7 +7,7 @@ SKSettings settings = new SKSettings {
|
||||||
assetsFolder = "add",
|
assetsFolder = "add",
|
||||||
depthMode = DepthMode.D32,
|
depthMode = DepthMode.D32,
|
||||||
disableUnfocusedSleep = true,
|
disableUnfocusedSleep = true,
|
||||||
// displayPreference = DisplayMode.Flatscreen,
|
displayPreference = DisplayMode.Flatscreen,
|
||||||
// disableFlatscreenMRSim = true,
|
// disableFlatscreenMRSim = true,
|
||||||
};
|
};
|
||||||
if (!SK.Initialize(settings))
|
if (!SK.Initialize(settings))
|
||||||
|
|
|
@ -120,7 +120,7 @@ public class Oriel {
|
||||||
// (Input.Key(Key.R).IsActive() ? 1 : 0) - (Input.Key(Key.W).IsActive() ? 1 : 0)
|
// (Input.Key(Key.R).IsActive() ? 1 : 0) - (Input.Key(Key.W).IsActive() ? 1 : 0)
|
||||||
// );
|
// );
|
||||||
// if (input.Length > 0) {
|
// if (input.Length > 0) {
|
||||||
// cursor += input.Normalized * Time.Elapsedf * 0.4f;
|
// cursor += input.Normalized * Time.Stepf * 0.4f;
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// cursorOri = Quat.FromAngles(MathF.Sin(Time.Totalf) * 15, 0, 0);
|
// cursorOri = Quat.FromAngles(MathF.Sin(Time.Totalf) * 15, 0, 0);
|
||||||
|
@ -163,7 +163,7 @@ public class Oriel {
|
||||||
if (interacting) {
|
if (interacting) {
|
||||||
if (detectCount == 1) { // Grab (face -> crown *face)
|
if (detectCount == 1) { // Grab (face -> crown *face)
|
||||||
Quat newOri = (cursorOri * qOffset.Inverse).Normalized;
|
Quat newOri = (cursorOri * qOffset.Inverse).Normalized;
|
||||||
ori = Quat.Slerp(ori, newOri, Time.Elapsedf * 9f);
|
ori = Quat.Slerp(ori, newOri, Time.Stepf * 9f);
|
||||||
// gravity snapping (within 6 degrees) *horizontal
|
// gravity snapping (within 6 degrees) *horizontal
|
||||||
// always? *here **tilt = nosnap
|
// always? *here **tilt = nosnap
|
||||||
if (Vec3.Dot(-Vec3.Up, ori * -Vec3.Up) > 0.9998f) {
|
if (Vec3.Dot(-Vec3.Up, ori * -Vec3.Up) > 0.9998f) {
|
||||||
|
|
|
@ -63,7 +63,7 @@ class Trackballer : dof {
|
||||||
onTheBall ? 0.5f : 5f // 10x less integral when on the ball?
|
onTheBall ? 0.5f : 5f // 10x less integral when on the ball?
|
||||||
);
|
);
|
||||||
// compliance;
|
// compliance;
|
||||||
// compliance = Vec3.Lerp(compliance, Vec3.Zero, Time.Elapsedf * 10f);
|
// compliance = Vec3.Lerp(compliance, Vec3.Zero, Time.Stepf * 10f);
|
||||||
Matrix anchor = Matrix.TR(anchorPos, hand.palm.orientation);
|
Matrix anchor = Matrix.TR(anchorPos, hand.palm.orientation);
|
||||||
Matrix anchorInv = anchor.Inverse;
|
Matrix anchorInv = anchor.Inverse;
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ class Trackballer : dof {
|
||||||
point.Normalized
|
point.Normalized
|
||||||
).Relative(hand.palm.orientation);
|
).Relative(hand.palm.orientation);
|
||||||
|
|
||||||
momentum = Quat.Slerp(momentum, delta, Time.Elapsedf * 10f);
|
momentum = Quat.Slerp(momentum, delta, Time.Stepf * 10f);
|
||||||
|
|
||||||
Vec3 contact = point.Normalized * radius.value;
|
Vec3 contact = point.Normalized * radius.value;
|
||||||
Vec3 offset = point - contact;
|
Vec3 offset = point - contact;
|
||||||
|
@ -142,7 +142,7 @@ class Trackballer : dof {
|
||||||
} else {
|
} else {
|
||||||
PullRequest.ToAxisAngle(momentum, out Vec3 axis, out float angle);
|
PullRequest.ToAxisAngle(momentum, out Vec3 axis, out float angle);
|
||||||
if (angle < stop.value) {
|
if (angle < stop.value) {
|
||||||
momentum = Quat.Slerp(momentum, Quat.Identity, Time.Elapsedf * 10f);
|
momentum = Quat.Slerp(momentum, Quat.Identity, Time.Stepf * 10f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="StereoKit" Version="0.3.7-preview.5" />
|
<PackageReference Include="StereoKit" Version="0.3.7-preview.7" />
|
||||||
<!-- <PackageReference Include="System.Speech" Version="5.0.0" /> -->
|
<!-- <PackageReference Include="System.Speech" Version="5.0.0" /> -->
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue