renderer cleanup, demo changes
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
# ______ ____ ___
|
||||
# | \/ ____| |___|
|
||||
# | | | \ | |
|
||||
#-----------------------------------------------------------------------
|
||||
# Copyright 2022, tyra - https://github.com/h4570/tyra
|
||||
# Licenced under Apache License 2.0
|
||||
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <renderer/3d/mesh/dynamic/dynamic_mesh.hpp>
|
||||
#include <renderer/3d/pipeline/dynamic/dynpip_options.hpp>
|
||||
#include "states/game/renderer/renderer_dynamic_pair.hpp"
|
||||
#include <renderer/renderer.hpp>
|
||||
|
||||
using Tyra::DynamicMesh;
|
||||
using Tyra::DynPipOptions;
|
||||
using Tyra::Renderer;
|
||||
using Tyra::TextureRepository;
|
||||
using Tyra::Vec4;
|
||||
|
||||
namespace Demo {
|
||||
|
||||
class Enemy {
|
||||
public:
|
||||
Enemy(TextureRepository* repo);
|
||||
~Enemy();
|
||||
|
||||
DynamicMesh* bodyMesh;
|
||||
DynamicMesh* gunMesh;
|
||||
DynPipOptions* options;
|
||||
std::vector<RendererDynamicPair*> pairs;
|
||||
|
||||
void update(const Vec4& playerPosition);
|
||||
|
||||
private:
|
||||
void allocateOptions();
|
||||
};
|
||||
|
||||
} // namespace Demo
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "./terrain/terrain.hpp"
|
||||
#include "./skybox/skybox.hpp"
|
||||
#include "./debug_object.hpp"
|
||||
#include "./enemy/enemy.hpp"
|
||||
|
||||
namespace Demo {
|
||||
|
||||
@@ -44,6 +45,7 @@ class GameState : public State<GlobalStateType> {
|
||||
|
||||
GameRenderer renderer;
|
||||
Player* player;
|
||||
Enemy* enemy;
|
||||
Terrain* terrain;
|
||||
Skybox* skybox;
|
||||
DebugObject* dbgObj;
|
||||
|
||||
@@ -30,8 +30,7 @@ class Player {
|
||||
const Vec4& getPosition() const { return position; }
|
||||
CameraInfo3D getCameraInfo() { return camera.getCameraInfo(); }
|
||||
|
||||
std::vector<RendererStaticPair*> staticPairs;
|
||||
std::vector<RendererDynamicPair*> dynamicPairs;
|
||||
RendererStaticPair* pair;
|
||||
|
||||
void update(const float& terrainHeight);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user