finished tutorial 03

This commit is contained in:
h4570
2022-08-21 16:40:26 +02:00
parent 4303cc2c97
commit 409ee294eb
27 changed files with 349 additions and 25 deletions
@@ -0,0 +1,54 @@
/*
# _____ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# Copyright 2022, tyra - https://github.com/h4570/tyra
# Licensed under Apache License 2.0
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
*/
#pragma once
#include <tyra>
#include <vector>
#include "./tutorial_block.hpp"
namespace Tyra {
class Tutorial03 : public Game {
public:
Tutorial03(Engine* engine);
~Tutorial03();
void init();
void loop();
private:
void loadTexture();
TutorialBlock getBlock(const u8& atlasX, const u8& atlasY,
const float& translationX);
void rotateBlock(TutorialBlock& block);
Engine* engine;
std::vector<TutorialBlock> blocks;
Texture* textureAtlas;
/**
* This is a 3D pipeline (renderer) which we will be using.
*
* Tyra has 3 pipelines:
* - Minecraft (this one)
* - Static (for static 3D objects)
* - Dynamic (for dynamic 3D objects)
*/
MinecraftPipeline mcpip;
/** Our camera */
Vec4 cameraPosition, cameraLookAt;
};
} // namespace Tyra