Nebula
Toggle main menu visibility
Loading...
Searching...
No Matches
assetpreview.h
Go to the documentation of this file.
1
#pragma once
2
//------------------------------------------------------------------------------
27
//------------------------------------------------------------------------------
28
#if WITH_NEBULA_EDITOR
29
#include "
core/refcounted.h
"
30
#include "
coregraphics/mesh.h
"
31
#include "
coregraphics/texture.h
"
32
#include "
graphics/graphicsentity.h
"
33
#include "
graphics/view.h
"
34
#include "
math/bbox.h
"
35
#include "neweditor/viewtools/editorcamera.h"
36
#include "
resources/resourceid.h
"
37
#include "imgui.h"
38
#include <functional>
39
40
namespace
GraphicsFeature
41
{
42
43
class
AssetPreview
:
public
Core::RefCounted
44
{
45
__DeclareClass
(
AssetPreview
)
46
public
:
48
static
const
Graphics::StageMask
Stage = 1 << 3;
49
50
AssetPreview
();
51
virtual
~AssetPreview
();
52
54
static
AssetPreview
* Get();
56
static
AssetPreview
* Peek();
58
static
void
Destroy();
59
62
using
Overlay = std::function<void(ImDrawList* drawList,
const
Math::mat4
& viewProjection,
const
ImVec2& min,
const
ImVec2& max)>;
63
65
void
Draw(
const
ImVec2& size,
const
Overlay& overlay =
nullptr
);
67
void
Hide();
69
void
Frame
(
const
Math::bbox
& box);
71
CoreGraphics::MeshId
GetMaterialKnob();
73
Graphics::ViewId
GetView()
const
;
75
int
GetShading()
const
;
76
77
private
:
79
bool
Setup();
81
void
Discard();
84
void
DrawViewMenu(
const
ImVec2& min);
85
86
static
Ptr<AssetPreview>
instance;
87
88
Graphics::ViewId
view;
89
Graphics::GraphicsEntityId
camera;
90
Graphics::GraphicsEntityId
light;
91
CoreGraphics::TextureId
target;
92
Ids::Id32
textureId;
93
bool
hasTextureId;
94
Resources::ResourceId knob;
95
Editor::EditorCamera orbit;
96
bool
enabled;
97
float
fieldOfView;
98
bool
orthographic;
99
int
shading;
100
};
101
102
}
// namespace GraphicsFeature
103
#endif
// WITH_NEBULA_EDITOR
104
//------------------------------------------------------------------------------
bbox.h
Core::RefCounted
The common base class of Nebula.
Definition
refcounted.h:45
AssetPreview
The 3D preview the asset documents draw what they edit in: a material on a knob, a model,...
Math::bbox
Nebula's bounding box class.
Definition
bbox.h:24
Ptr
Nebula's smart pointer class which manages the life time of RefCounted objects.
Definition
ptr.h:38
graphicsentity.h
mesh.h
Frame
ImGUI debug interface for inspecting frame scripts.
Definition
shaderserverbase.h:53
GraphicsFeature
Definition
graphicsfeatureunit.cc:66
Graphics::StageMask
uint16_t StageMask
Definition
view.h:23
Ids::Id32
uint32_t Id32
Definition
id.h:138
refcounted.h
resourceid.h
__DeclareClass
#define __DeclareClass(type)
CoreGraphics::MeshId
Definition
mesh.h:29
CoreGraphics::TextureId
texture type
Definition
texture.h:25
Graphics::GraphicsEntityId
The graphics entity is only an Id, to which we can attach GraphicsContexts.
Definition
graphicsentity.h:16
Graphics::ViewId
Definition
view.h:34
Math::mat4
A 4x4 single point precision float matrix.
Definition
mat4.h:55
texture.h
view.h
code
addons
graphicsfeature
editor
assets
assetpreview.h
Generated on
for Nebula. Dark theme by
Tilen Majerle
. All rights reserved.