fun with dots

This commit is contained in:
Asuro
2025-02-10 17:57:21 +01:00
parent 16fcfa8af9
commit cbe21bfd78
6 changed files with 68 additions and 22 deletions

View File

@@ -13,14 +13,6 @@ namespace Game
Cubes.Setup(data.EntityStorage);
if (Cubes.Count == 0)
{
uint64_t state = 0
| BGFX_STATE_WRITE_RGB
| BGFX_STATE_WRITE_A
| BGFX_STATE_WRITE_Z
| BGFX_STATE_DEPTH_TEST_LESS
| BGFX_STATE_CULL_CW
| BGFX_STATE_MSAA;
for (uint32_t yy = 0; yy < 11; ++yy)
{
for (uint32_t xx = 0; xx < 11; ++xx)
@@ -48,10 +40,23 @@ namespace Game
void Cube::Update()
{
double time = GetInstance().Now;
bx::mtxRotateXY(Transform.M, time + TestX * 0.1f, time * 2 + TestY * .37f);
Transform.M[12] = -15.0f + float(TestX) * 3.0f;
Transform.M[13] = -15.0f + float(TestY) * 3.0f;
Transform.M[14] = 0.0f;
double globalTime = GetInstance().Now;
double time = TestY <= 5 ? globalTime * 0.1f : 0.0f;
if (TestX == 4 && TestY == 4)
{
bx::mtxTranslate(Transform.M, 0, 0, bx::lerp(2.0f, -30.0f, bx::sin(globalTime* 0.5f) * 0.5 + 0.5));
}
else
{
float rot[16]{0};
bx::mtxRotateXY(rot, time + TestX * 0.1f, time * 2 + TestY * .37f);
float scale[16]{0};
bx::mtxScale(scale, 1.0f + TestX * 0.4f);
float pos[16]{0};
bx::mtxTranslate(pos, TestX * 10.0f - 40.0f, TestY * 10.0f - 40.0f, TestX);
float buf[16]{0};
bx::mtxMul(buf, scale, rot);
bx::mtxMul(Transform.M, buf, pos);
}
}
}