false tail

This commit is contained in:
ethan merchant 2024-11-08 23:20:49 -05:00
parent 8167ab990b
commit 6181e4ae49

View file

@ -121,18 +121,19 @@ static class Arts
)
);
}
// tail
if (Mono.grow_buffer > 0) { snake_t = 0.0f; }
int i_tail = Mono.snake_len - 1;
Vec3 tail_dir = Vec3.Direction(Mono.snake[i_tail - 1].ToVec3, Mono.snake[i_tail].ToVec3);
meshes["Segment"].Draw(
mat_mono,
Matrix.TRS(
Mono.snake[i_tail].ToVec3 + (tail_dir * (float)(snake_t) * 0.7f),
Quat.LookDir(tail_dir),
V.XYZ(1, 1, (float)(1.0 - snake_t))
)
);
// false tail
if (tailmove.state && snake_t < 1.0f) {
int i_tail = Mono.snake_len - 1;
Vec3 tail_dir = Vec3.Direction(Mono.snake[i_tail - 1].ToVec3, Mono.snake[i_tail].ToVec3);
meshes["Segment"].Draw(
mat_mono,
Matrix.TRS(
Mono.snake[i_tail].ToVec3 + (tail_dir * (float)(snake_t) * 0.7f),
Quat.LookDir(tail_dir),
V.XYZ(1, 1, (float)(1.0 - snake_t))
)
);
}
// holes
foreach (KeyValuePair<XYZi, XYZi> hole in Mono.holes)