mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 04:23:33 +02:00
First pass
This commit is contained in:
parent
7702bfceaa
commit
9020607ccf
5 changed files with 133 additions and 103 deletions
|
@ -5393,6 +5393,12 @@ void Application::displaySide(RenderArgs* renderArgs, Camera& theCamera, bool se
|
|||
}
|
||||
renderArgs->_debugFlags = renderDebugFlags;
|
||||
//ViveControllerManager::getInstance().updateRendering(renderArgs, _main3DScene, transaction);
|
||||
|
||||
RenderArgs::OutlineFlags renderOutlineFlags = RenderArgs::RENDER_OUTLINE_NONE;
|
||||
if (DependencyManager::get<ContextOverlayInterface>()->getIsInMarketplaceInspectionMode()) {
|
||||
renderOutlineFlags = static_cast<RenderArgs::OutlineFlags>(renderOutlineFlags |
|
||||
static_cast<int>(RenderArgs::RENDER_OUTLINE_WIREFRAMES));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,8 @@ class ContextOverlayInterface : public QObject, public Dependency {
|
|||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(QUuid entityWithContextOverlay READ getCurrentEntityWithContextOverlay WRITE setCurrentEntityWithContextOverlay)
|
||||
Q_PROPERTY(bool enabled READ getEnabled WRITE setEnabled);
|
||||
Q_PROPERTY(bool enabled READ getEnabled WRITE setEnabled)
|
||||
Q_PROPERTY(bool isInMarketplaceInspectionMode READ getIsInMarketplaceInspectionMode WRITE setIsInMarketplaceInspectionMode)
|
||||
QSharedPointer<EntityScriptingInterface> _entityScriptingInterface;
|
||||
EntityPropertyFlags _entityPropertyFlags;
|
||||
QSharedPointer<HMDScriptingInterface> _hmdScriptingInterface;
|
||||
|
@ -53,6 +54,8 @@ public:
|
|||
void setCurrentEntityWithContextOverlay(const QUuid& entityID) { _currentEntityWithContextOverlay = entityID; }
|
||||
void setEnabled(bool enabled) { _enabled = enabled; }
|
||||
bool getEnabled() { return _enabled; }
|
||||
bool getIsInMarketplaceInspectionMode() { return _isInMarketplaceInspectionMode; }
|
||||
void setIsInMarketplaceInspectionMode(bool mode) { _isInMarketplaceInspectionMode = mode; }
|
||||
|
||||
public slots:
|
||||
bool createOrDestroyContextOverlay(const EntityItemID& entityItemID, const PointerEvent& event);
|
||||
|
@ -70,6 +73,7 @@ private:
|
|||
bool _contextOverlayJustClicked { false };
|
||||
|
||||
void openMarketplace();
|
||||
bool _isInMarketplaceInspectionMode { false };
|
||||
|
||||
bool contextOverlayFilterPassed(const EntityItemID& entityItemID);
|
||||
glm::vec3 drawOutlineOverlay(const EntityItemID& entityItemID);
|
||||
|
|
|
@ -372,6 +372,18 @@ void RenderableModelEntityItem::render(RenderArgs* args) {
|
|||
_model->updateRenderItems();
|
||||
}
|
||||
|
||||
bool showingEntityHighlight = (bool)(args->_outlineFlags & (int)RenderArgs::RENDER_OUTLINE_WIREFRAMES);
|
||||
if (getMarketplaceID().length() != 0 && showingEntityHighlight) {
|
||||
static glm::vec4 yellowColor(1.0f, 1.0f, 0.0f, 1.0f);
|
||||
gpu::Batch& batch = *args->_batch;
|
||||
bool success;
|
||||
auto shapeTransform = getTransformToCenter(success);
|
||||
if (success) {
|
||||
batch.setModelTransform(shapeTransform); // we want to include the scale as well
|
||||
DependencyManager::get<GeometryCache>()->renderWireCubeInstance(args, batch, yellowColor);
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasModel() || (_model && _model->didVisualGeometryRequestFail())) {
|
||||
static glm::vec4 greenColor(0.0f, 1.0f, 0.0f, 1.0f);
|
||||
gpu::Batch& batch = *args->_batch;
|
||||
|
|
|
@ -63,6 +63,11 @@ namespace render {
|
|||
public:
|
||||
enum RenderMode { DEFAULT_RENDER_MODE, SHADOW_RENDER_MODE, DIFFUSE_RENDER_MODE, NORMAL_RENDER_MODE, MIRROR_RENDER_MODE, SECONDARY_CAMERA_RENDER_MODE };
|
||||
enum DisplayMode { MONO, STEREO_MONITOR, STEREO_HMD };
|
||||
enum OutlineFlags {
|
||||
RENDER_OUTLINE_NONE = 0,
|
||||
RENDER_OUTLINE_WIREFRAMES = 1,
|
||||
RENDER_OUTLINE_SHADER = 2
|
||||
};
|
||||
enum DebugFlags {
|
||||
RENDER_DEBUG_NONE = 0,
|
||||
RENDER_DEBUG_HULLS = 1
|
||||
|
@ -112,6 +117,7 @@ namespace render {
|
|||
int _boundaryLevelAdjust { 0 };
|
||||
RenderMode _renderMode { DEFAULT_RENDER_MODE };
|
||||
DisplayMode _displayMode { MONO };
|
||||
OutlineFlags _outlineFlags{ RENDER_OUTLINE_NONE };
|
||||
DebugFlags _debugFlags { RENDER_DEBUG_NONE };
|
||||
gpu::Batch* _batch = nullptr;
|
||||
|
||||
|
|
|
@ -116,10 +116,12 @@ function onClick() {
|
|||
if (onMarketplaceScreen) {
|
||||
// for toolbar-mode: go back to home screen, this will close the window.
|
||||
tablet.gotoHomeScreen();
|
||||
ContextOverlay.isInMarketplaceInspectionMode = false;
|
||||
} else {
|
||||
var entity = HMD.tabletID;
|
||||
Entities.editEntity(entity, { textures: JSON.stringify({ "tex.close": HOME_BUTTON_TEXTURE }) });
|
||||
showMarketplace();
|
||||
ContextOverlay.isInMarketplaceInspectionMode = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue