Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#include <stdint.h>
#include <string>
#include <vector>
#include <array>
#include <memory>
// Can be hundreds of megabytes in these vectors
class Mesh
{
std::string name;
std::vector<Vector3> vertices;
std::vector<std::array<uint32_t, 3>> indices;
BoundingBox bbox;
};
// Just 72 or 80 bytes, very cheap to copy. Can e.g. pass copies to another threads for background processing.
class Model
{
std::shared_ptr<Mesh> mesh;
Matrix transform;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.