Remove trail spaces

This commit is contained in:
Ray 2021-04-22 18:55:24 +02:00
parent f92ee46d86
commit dcf52c132f
61 changed files with 565 additions and 565 deletions

View file

@ -56,7 +56,7 @@ int main(void)
camera.fovy = 45.0f;
camera.projection = CAMERA_PERSPECTIVE;
const int instances = 10000; // Number of instances to display
const int instances = 10000; // Number of instances to display
Mesh cube = GenMeshCube(1.0f, 1.0f, 1.0f);
Matrix *rotations = RL_MALLOC(instances*sizeof(Matrix)); // Rotation state of instances
@ -69,7 +69,7 @@ int main(void)
x = GetRandomValue(-50, 50);
y = GetRandomValue(-50, 50);
z = GetRandomValue(-50, 50);
translations[i] = MatrixTranslate(x, y, z);
translations[i] = MatrixTranslate(x, y, z);
x = GetRandomValue(0, 360);
y = GetRandomValue(0, 360);
@ -83,7 +83,7 @@ int main(void)
Matrix *transforms = RL_MALLOC(instances*sizeof(Matrix)); // Pre-multiplied transformations passed to rlgl
Shader shader = LoadShader(TextFormat("resources/shaders/glsl%i/base_lighting_instanced.vs", GLSL_VERSION),
Shader shader = LoadShader(TextFormat("resources/shaders/glsl%i/base_lighting_instanced.vs", GLSL_VERSION),
TextFormat("resources/shaders/glsl%i/lighting.fs", GLSL_VERSION));
// Get some shader loactions
@ -102,7 +102,7 @@ int main(void)
Material material = LoadMaterialDefault();
material.shader = shader;
material.maps[MATERIAL_MAP_DIFFUSE].color = RED;
SetCameraMode(camera, CAMERA_ORBITAL); // Set an orbital camera mode
int textPositionY = 300;
@ -134,10 +134,10 @@ int main(void)
if (IsKeyDown(KEY_EIGHT)) groups = 8;
if (IsKeyDown(KEY_NINE)) groups = 9;
if (IsKeyDown(KEY_W)) { groups = 7; amp = 25; speed = 18; variance = 0.70f; }
if (IsKeyDown(KEY_EQUAL)) speed = (speed <= (fps*0.25f))? (fps*0.25f) : (speed*0.95f);
if (IsKeyDown(KEY_KP_ADD)) speed = (speed <= (fps*0.25f))? (fps*0.25f) : (speed*0.95f);
if (IsKeyDown(KEY_MINUS)) speed = fmaxf(speed*1.02f, speed + 1);
if (IsKeyDown(KEY_KP_SUBTRACT)) speed = fmaxf(speed*1.02f, speed + 1);
@ -150,19 +150,19 @@ int main(void)
{
rotations[i] = MatrixMultiply(rotations[i], rotationsInc[i]);
transforms[i] = MatrixMultiply(rotations[i], translations[i]);
// Get the animation cycle's framesCounter for this instance
loop = (float)((framesCounter + (int)(((float)(i%groups)/groups)*speed))%speed)/speed;
// Calculate the y according to loop cycle
y = (sinf(loop*PI*2))*amp*((1 - variance) + (variance*(float)(i%(groups*10))/(groups*10)));
// Clamp to floor
y = (y < 0)? 0.0f : y;
transforms[i] = MatrixMultiply(transforms[i], MatrixTranslate(0.0f, y, 0.0f));
}
UpdateCamera(&camera);
//----------------------------------------------------------------------------------
@ -179,35 +179,35 @@ int main(void)
DrawText("A CUBE OF DANCING CUBES!", 490, 10, 20, MAROON);
DrawText("PRESS KEYS:", 10, textPositionY, 20, BLACK);
DrawText("1 - 9", 10, textPositionY += 25, 10, BLACK);
DrawText("1 - 9", 10, textPositionY += 25, 10, BLACK);
DrawText(": Number of groups", 50, textPositionY , 10, BLACK);
DrawText(TextFormat(": %d", groups), 160, textPositionY , 10, BLACK);
DrawText("UP", 10, textPositionY += 15, 10, BLACK);
DrawText("UP", 10, textPositionY += 15, 10, BLACK);
DrawText(": increase amplitude", 50, textPositionY, 10, BLACK);
DrawText(TextFormat(": %.2f", amp), 160, textPositionY , 10, BLACK);
DrawText("DOWN", 10, textPositionY += 15, 10, BLACK);
DrawText("DOWN", 10, textPositionY += 15, 10, BLACK);
DrawText(": decrease amplitude", 50, textPositionY, 10, BLACK);
DrawText("LEFT", 10, textPositionY += 15, 10, BLACK);
DrawText("LEFT", 10, textPositionY += 15, 10, BLACK);
DrawText(": decrease variance", 50, textPositionY, 10, BLACK);
DrawText(TextFormat(": %.2f", variance), 160, textPositionY , 10, BLACK);
DrawText("RIGHT", 10, textPositionY += 15, 10, BLACK);
DrawText("RIGHT", 10, textPositionY += 15, 10, BLACK);
DrawText(": increase variance", 50, textPositionY, 10, BLACK);
DrawText("+/=", 10, textPositionY += 15, 10, BLACK);
DrawText("+/=", 10, textPositionY += 15, 10, BLACK);
DrawText(": increase speed", 50, textPositionY, 10, BLACK);
DrawText(TextFormat(": %d = %f loops/sec", speed, ((float)fps / speed)), 160, textPositionY , 10, BLACK);
DrawText("-", 10, textPositionY += 15, 10, BLACK);
DrawText("-", 10, textPositionY += 15, 10, BLACK);
DrawText(": decrease speed", 50, textPositionY, 10, BLACK);
DrawText("W", 10, textPositionY += 15, 10, BLACK);
DrawText("W", 10, textPositionY += 15, 10, BLACK);
DrawText(": Wild setup!", 50, textPositionY, 10, BLACK);
DrawFPS(10, 10);
EndDrawing();