Euphoria
compiledmesh.h
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4
5#include "eu/core/mesh.h"
7
8namespace eu::core
9{
11struct Mesh;
12}
13
14namespace eu::render
15{
16struct Material;
17struct World;
18struct MeshInstance;
19struct CompiledGeom;
20
22{
23 std::shared_ptr<CompiledGeom> geom;
24 // std::size_t material;
25};
26
28{
29 std::string name;
31 std::vector<CompiledMeshGeom> geoms;
32};
33
35{
36 // todo(Gustav): change the single list to a hierachy?
37 std::vector<CompiledTransformedMesh> meshes;
38 // std::vector<Material> materials;
39};
40
42
43
44// ------------------------------------------------------------------------------------------------
45
46
48{
49 std::vector<std::shared_ptr<MeshInstance>> geoms;
50};
51
53{
55 std::vector<TransformedMeshInWorld> meshes;
56 // std::vector<Material> materials;
57
58 void add_to_world(CompiledMesh* m, World* world, std::shared_ptr<Material> mat);
59 void set_transform(const m4& trans);
60};
61
62}
#define DEBUG_LABEL_ARG_MANY
first debug label argument of many
constexpr m4 m4_identity
The identity matrix.
Definition mat4.h:177
Definition ui.h:4
CompiledMesh compile_mesh(DEBUG_LABEL_ARG_MANY const core::Mesh &mesh, const core::CompiledGeomVertexAttributes &geom_layout)
A list of CompiledVertexLayoutNoNameList (for geom).
4x4 matrix
Definition mat4.h:19
Represents a Geom on the GPU.
Definition world.h:27
std::shared_ptr< CompiledGeom > geom
std::vector< CompiledTransformedMesh > meshes
std::vector< CompiledMeshGeom > geoms
Base class for all materials.
Definition material.h:29
CompiledMesh * compiled_mesh
void set_transform(const m4 &trans)
void add_to_world(CompiledMesh *m, World *world, std::shared_ptr< Material > mat)
std::vector< TransformedMeshInWorld > meshes
Stores Geom + Material (aka a mesh) and its current transform.
Definition world.h:90
std::vector< std::shared_ptr< MeshInstance > > geoms
A list of objects to render.
Definition world.h:201