Zappy GUI
C++ graphic client: renderer, camera, network
Loading...
Searching...
No Matches
EntityRenderer.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <array>
4
5#include "core/Resources.hpp"
6#include "raylib.h"
7
12 public:
19 static void drawPlayer(Vector3& worldPos, Color teamColor, float rotation, Model& model,
20 const Color* baseMats, float modelSize = 0.4f);
21
28 static void drawEgg(Vector3& worldPos, Color teamColor, Model& model, float rotation = 0.0f,
29 const Color* baseMats = nullptr, float modelSize = 0.3f);
30
39 static void drawResources(const Resources& resources, const std::array<int, 7>& slotIndices,
40 const std::array<float, 7>& rotations, const Vector3& tileCenter,
41 float tileSize, Model& foodModel, float foodModelSize,
42 Model& crystalModel, float crystalModelSize, float baseSize = 0.15f);
43
44 private:
45 static void _restoreModelBaseColors(Model& model, const Color* baseMats, int count = 6);
46};
Helper class for rendering game entities (players, eggs, resources).
static void drawEgg(Vector3 &worldPos, Color teamColor, Model &model, float rotation=0.0f, const Color *baseMats=nullptr, float modelSize=0.3f)
Draws an egg at the given world position.
static void drawResources(const Resources &resources, const std::array< int, 7 > &slotIndices, const std::array< float, 7 > &rotations, const Vector3 &tileCenter, float tileSize, Model &foodModel, float foodModelSize, Model &crystalModel, float crystalModelSize, float baseSize=0.15f)
Draws all resources for a tile using precomputed slot indices.
static void drawPlayer(Vector3 &worldPos, Color teamColor, float rotation, Model &model, const Color *baseMats, float modelSize=0.4f)
Draws a player at the given world position.
static void _restoreModelBaseColors(Model &model, const Color *baseMats, int count=6)