chunky slash arc with mid tip pos

This commit is contained in:
ethan merchant 2024-12-21 14:58:40 -05:00
parent 6e8b9ce8b3
commit 7c5c09c3b3

View file

@ -21,11 +21,6 @@ static class Arts
static TextStyle text_style; static TextStyle text_style;
// slash tip pos frame circle buffer
static int tip_index = 0;
static int tip_count = 12;
static Vec3[] tip_buffer = new Vec3[tip_count];
public static void Init() public static void Init()
{ {
foreach (ModelNode node in assets_model.Nodes) foreach (ModelNode node in assets_model.Nodes)
@ -76,6 +71,11 @@ static class Arts
mat_slash.FaceCull = Cull.None; mat_slash.FaceCull = Cull.None;
} }
// slash tip pos frame circle buffer [!] move out of render class
static int tip_index = 0;
static int tip_count = 24; // [!] this needs to be scaled with headset framerate
static Vec3[] tip_buffer = new Vec3[tip_count];
// [!] hacky offset stepper for noise // [!] hacky offset stepper for noise
public static int offset = 0; public static int offset = 0;
static int offstep() => offset += 100; static int offstep() => offset += 100;
@ -248,14 +248,17 @@ static class Arts
tip_index = (tip_index + 1) % tip_count; tip_index = (tip_index + 1) % tip_count;
tip_buffer[tip_index] = tip_pos; tip_buffer[tip_index] = tip_pos;
Vec3 oldest_tip = tip_buffer[(tip_index + 1) % tip_count]; Vec3 oldest_tip = tip_buffer[(tip_index + 1) % tip_count];
Vec3 mid_tip = tip_buffer[(tip_index + (tip_count / 3) * 2) % tip_count];
mesh.SetData( mesh.SetData(
new Vertex[] { new Vertex[] {
new( blade_pos, V.XYZ(0,0,1)), new( blade_pos, V.XYZ(0,0,1)),
new( tip_pos, V.XYZ(0,0,1)), new( tip_pos, V.XYZ(0,0,1)),
new(oldest_tip, V.XYZ(0,0,1)) new( mid_tip, V.XYZ(0,0,1)),
new(oldest_tip, V.XYZ(0,0,1)),
}, },
new uint[] { new uint[] {
0, 1, 2 0, 1, 2,
0, 2, 3,
} }
); );
mesh.Draw( mesh.Draw(