mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-08-08 17:57:02 +08:00
Move direction into the transform component and include it in server-to-client entity updates. Client now sets transform direction from the network message and uses it to compute yaw for model rotation, so entities visually face their movement direction. Refactor net_utils to support arbitrary Vec3 fields.
26 lines
726 B
C++
26 lines
726 B
C++
#pragma once
|
|
|
|
#include "Cubed/gameplay/model.hpp"
|
|
#include "Cubed/render/model_node.hpp"
|
|
#include "Cubed/shader.hpp"
|
|
|
|
#include <glm/glm.hpp>
|
|
namespace Cubed {
|
|
class Renderer;
|
|
class Camera;
|
|
class ModelRender {
|
|
public:
|
|
ModelRender(Renderer& renderer);
|
|
void render_model(ModelID id, const glm::vec3& pos, float yaw,
|
|
Camera& camera);
|
|
|
|
void shadow_pass(ModelID id, const glm::vec3& pos, float yaw,
|
|
Camera& camera);
|
|
|
|
private:
|
|
Renderer& m_renderer;
|
|
void render_node(const ModelNode& node, const glm::mat4& parent,
|
|
const glm::mat4& view, const Shader& shader, bool shadow);
|
|
void render_mesh(const Mesh& mesh, bool shadow);
|
|
};
|
|
} // namespace Cubed
|