utility functions

This commit is contained in:
h4570
2022-08-17 00:19:16 +02:00
parent 4fb0ab3b6c
commit fea2398699
27 changed files with 419 additions and 247 deletions
-40
View File
@@ -1,40 +0,0 @@
/*
# _____ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# 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 "states/game/renderer/renderer_static_pair.hpp"
using Tyra::Renderer;
using Tyra::StaPipOptions;
using Tyra::StaticMesh;
using Tyra::TextureRepository;
using Tyra::Vec4;
namespace Demo {
class DebugObject {
public:
DebugObject(TextureRepository* repo);
~DebugObject();
StaticMesh* mesh;
StaPipOptions* options;
RendererStaticPair* pair;
void setPosition(const Vec4& v);
private:
float rotator;
void allocateOptions();
};
} // namespace Demo
-2
View File
@@ -17,7 +17,6 @@
#include "./terrain/terrain.hpp"
#include "./skybox/skybox.hpp"
#include "./ship/ship.hpp"
#include "./debug_object.hpp"
#include "./enemy/enemy_manager.hpp"
namespace Demo {
@@ -50,7 +49,6 @@ class GameState : public State<GlobalStateType> {
Terrain* terrain;
Skybox* skybox;
Ship* ship;
DebugObject* dbgObj;
};
} // namespace Demo
+2
View File
@@ -20,6 +20,7 @@
using Tyra::Engine;
using Tyra::Pad;
using Tyra::Renderer3DUtility;
using Tyra::Vec4;
namespace Demo {
@@ -41,6 +42,7 @@ class Player {
private:
void handlePlayerPosition(const Heightmap& heightmap,
const float& terrainHeight);
Renderer3DUtility* utility;
float speed;
Pad* pad;
@@ -32,6 +32,7 @@ class GameRenderer {
void clear();
void renderSkybox(const RendererStaticPair& pair);
void render();
private: