Compare commits

...

4 commits

3 changed files with 46 additions and 10 deletions

View file

@ -1,4 +1,3 @@
- [lynx r1 resource](https://github.com/technobaboo/stereokit_lynx_dotnet_template)
- [fb passthrough resource](https://www.aesiio.com/blog/passthrough-dot-net-core)
- [fb passthrough tool source](https://github.com/StereoKit/StereoKit/blob/master/Examples/StereoKitTest/Tools/PassthroughFBExt.cs)
@ -58,6 +57,14 @@ todo
revolver
flick reload
enemy design
dmg
spd def
3 single types *fodder
dmg, spd, def
3 double types *competent
dmg+spd, spd+def, def+dmg
bug(s)
...

View file

@ -13,8 +13,11 @@ static class Arts
static Material mat_backface = new Material("backface.hlsl");
static Material mat_justcolor = new Material("justcolor.hlsl");
static Material mat_slash = new Material("unlit.hlsl");
public static Vec3 shake = new(0, 0, 0);
// static Quat spin_ori = Quat.Identity;
public static Vec3 last_tip_pos = new(0, 0, 0);
static TextStyle text_style;
@ -40,27 +43,47 @@ static class Arts
mat_backface.DepthWrite = false;
mat_both.Chain = mat_backface;
mat_slash.FaceCull = Cull.None;
}
public static void Frame()
{
bool vr = Device.DisplayBlend == DisplayBlend.Opaque;
// render hands if not in mixed reality
Input.HandVisible(Handed.Max, false);
if (vr)
{
// background standin if no passthrough
}
// Input.HandVisible(Handed.Max, false);
// world
Matrix m4_world = Mono.world_pose.ToMatrix();
Hierarchy.Push(m4_world);
meshes["Food"].Draw(
mat_mono,
Matrix.TRS(
Vec3.Zero,
V.XYZ(0, 0, -1),
Quat.Identity,
1.0f
0.1f
)
);
Mesh mesh = new();
Quat hand_rot = Quat.FromAngles(0, 0, SKMath.Sin(Time.Totalf * 6f) * 30f);
Vec3 hand_pos = V.XYZ(SKMath.Sin(Time.Totalf * 1f) * 0.1f, 0, 0);
Vec3 tip_pos = hand_pos + hand_rot * V.XYZ(0, 1, 0);
mesh.SetData(
new Vertex[] {
new( hand_pos, V.XYZ(0,0,1)),
new( tip_pos, V.XYZ(0,0,1)),
new(last_tip_pos, V.XYZ(0,0,1))
},
new uint[] {
0, 1, 2
}
);
mesh.Draw(
mat_slash,
Matrix.T(0, -1.0f, -1)
);
last_tip_pos = Vec3.Lerp(last_tip_pos, tip_pos, Time.Stepf / 0.1f);
// particles
Particle[] particles = VFX.particles;
for (int i = 0; i < particles.Length; i++)
@ -76,6 +99,9 @@ static class Arts
);
}
Hierarchy.Pop();
// menu
Matrix m4_menu = Mono.menu_pose.ToMatrix(Mono.menu_scale);
Hierarchy.Push(m4_menu);

View file

@ -9,6 +9,8 @@ static class Mono
public static int score;
public static Pose world_pose;
public static DeltaBool menu;
public static Pose menu_pose;
public static float menu_scale;
@ -24,6 +26,7 @@ static class Mono
public static void Init()
{
game_time = 0.0;
world_pose = new(0, 0, 0);
menu = new(true);
menu_pose = new(0, 0, 0);
menu_scale = 1 * U.cm;