Cogs.Core
Extensions
Editor
Source
Commands
PackMeshCommand.h
1
#pragma once
2
#include "EditorCommand.h"
3
4
namespace
Cogs::Core
5
{
6
7
struct
PackMeshCommand
:
public
EditorCommand
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
25
PackMeshCommand
(
EditorState
* state);
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
}
Cogs::Core::Context
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition:
Context.h:83
Cogs::Core
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....
Definition:
ComponentFunctions.h:10
Cogs::Core::WeakEntityPtr
std::weak_ptr< ComponentModel::Entity > WeakEntityPtr
Weak Smart pointer for Entity access.
Definition:
EntityPtr.h:18
Cogs::Core::EditorCommand
Base class for Cogs Editor commands.
Definition:
EditorCommand.h:19
Cogs::Core::EditorCommand::options
std::vector< ParsedValue > options
Options passed to the command when running in batch mode.
Definition:
EditorCommand.h:61
Cogs::Core::EditorState
Definition:
EditorState.h:76
Cogs::Core::PackMeshCommand::Options
Definition:
PackMeshCommand.h:15
Cogs::Core::PackMeshCommand::UndoItem
Definition:
PackMeshCommand.h:32
Cogs::Core::PackMeshCommand
Definition:
PackMeshCommand.h:8
Cogs::Core::PackMeshCommand::apply
void apply() override
Run the command.
Definition:
PackMeshCommand.cpp:66
Cogs::Core::ResourceHandle_t< Mesh >
Generated by
1.9.6