nanoMMO 0.97.8
Building an MMO: The Engineering Series
Loading...
Searching...
No Matches
outline.cc
Go to the documentation of this file.
1#include "client/outline.h"
2
3#include <raylib.h>
4#include <raymath.h>
5#include <rlgl.h>
6
7#include <vector>
8
9namespace nanommo {
10
11void DrawOutline(const Model& model, const Matrix& transform, Shader shader) {
12 // A copy of the model, with the outline's shader in its materials, so that
13 // raylib draws it posed, with its bones, as it does the model.
14 std::vector<Material> materials(model.materials,
15 model.materials + model.materialCount);
16 for (Material& material : materials) {
17 material.shader = shader;
18 }
19 Model hull = model;
20 hull.materials = materials.data();
21 hull.transform = MatrixMultiply(model.transform, transform);
22 rlSetCullFace(RL_CULL_FACE_FRONT);
23 DrawModel(hull, {0.0f, 0.0f, 0.0f}, 1.0f, WHITE);
24 rlSetCullFace(RL_CULL_FACE_BACK);
25}
26
27} // namespace nanommo
Definition chat.cc:9
void DrawOutline(const Model &model, const Matrix &transform, Shader shader)
Definition outline.cc:11