Cogs.Core
PackMeshCommand.h
1#pragma once
2#include "EditorCommand.h"
3
4namespace Cogs::Core
5{
6
8 {
9 enum struct Target {
10 WebGL1_Low,
11 WebGL2_Low,
12 WebGL2_Med
13 };
14
15 struct Options {
16 Target target = Target::WebGL2_Med;
17 bool allowIdOffset = true;
18 bool allowSeparateIdStream = true; // Put ids into its own vertex data stream where it make sense.
19 bool optimizeTriangleOrder = true; // Minimize GPU VS invocations
20 bool optimizeVertexOrder = true; // Optimize for vertex fetch cache.
21 bool discardTexCoords = false; // Ignore any texture coords in input mesh.
22 bool discardNormals = false; // Ignore normal vectors in input mesh.
23 };
24
26
27 void apply() override;
28 void undo() override;
29
30 static bool pack(Context* context, std::string& status, glm::mat4& transform, MeshHandle& src, const Options& options);
31
32 struct UndoItem {
33 WeakEntityPtr entity;
34 MeshHandle meshHandle;
35 };
36 std::vector<UndoItem> undoItems;
37 Options packOptions;
38 };
39
40
41}
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition: Context.h:83
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....
std::weak_ptr< ComponentModel::Entity > WeakEntityPtr
Weak Smart pointer for Entity access.
Definition: EntityPtr.h:18
Base class for Cogs Editor commands.
Definition: EditorCommand.h:19
std::vector< ParsedValue > options
Options passed to the command when running in batch mode.
Definition: EditorCommand.h:61
void apply() override
Run the command.