mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-12 22:13:13 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi into eye-correction-application
This commit is contained in:
commit
57e4ff182d
7 changed files with 388 additions and 37 deletions
300
interface/interface_da.ts
Normal file
300
interface/interface_da.ts
Normal file
|
@ -0,0 +1,300 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="da">
|
||||
<context>
|
||||
<name>Application</name>
|
||||
<message>
|
||||
<location filename="src/Application.cpp" line="1482"/>
|
||||
<source>Sparse Voxel Octree Files (*.svo)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="src/Application.cpp" line="3465"/>
|
||||
<source>Open Script</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="src/Application.cpp" line="3466"/>
|
||||
<source>JavaScript Files (*.js)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ChatWindow</name>
|
||||
<message>
|
||||
<location filename="ui/chatWindow.ui" line="20"/>
|
||||
<location filename="../build/interface/ui_chatWindow.h" line="143"/>
|
||||
<source>Chat</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/chatWindow.ui" line="50"/>
|
||||
<location filename="../build/interface/ui_chatWindow.h" line="144"/>
|
||||
<source>Connecting to XMPP...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/chatWindow.ui" line="71"/>
|
||||
<location filename="../build/interface/ui_chatWindow.h" line="145"/>
|
||||
<source> online now:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="src/ui/ChatWindow.cpp" line="128"/>
|
||||
<source>day</source>
|
||||
<translation>
|
||||
<numerusform>%n dag</numerusform>
|
||||
<numerusform>%n dage</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="src/ui/ChatWindow.cpp" line="128"/>
|
||||
<source>hour</source>
|
||||
<translation>
|
||||
<numerusform>%n time</numerusform>
|
||||
<numerusform>%n timer</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="src/ui/ChatWindow.cpp" line="128"/>
|
||||
<source>minute</source>
|
||||
<translation>
|
||||
<numerusform>%n minut</numerusform>
|
||||
<numerusform>%n minutter</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<source>second</source>
|
||||
<translation type="vanished">
|
||||
<numerusform>%n second</numerusform>
|
||||
<numerusform>%n seconds</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="src/ui/ChatWindow.cpp" line="183"/>
|
||||
<source>%1 online now:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Dialog</name>
|
||||
<message>
|
||||
<location filename="ui/updateDialog.ui" line="20"/>
|
||||
<location filename="ui/updateDialog.ui" line="73"/>
|
||||
<location filename="../build/interface/ui_updateDialog.h" line="137"/>
|
||||
<location filename="../build/interface/ui_updateDialog.h" line="138"/>
|
||||
<source>Update Required</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/updateDialog.ui" line="129"/>
|
||||
<location filename="../build/interface/ui_updateDialog.h" line="140"/>
|
||||
<source>Download</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/updateDialog.ui" line="151"/>
|
||||
<location filename="../build/interface/ui_updateDialog.h" line="141"/>
|
||||
<source>Skip Version</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/updateDialog.ui" line="173"/>
|
||||
<location filename="../build/interface/ui_updateDialog.h" line="142"/>
|
||||
<source>Close</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Menu</name>
|
||||
<message>
|
||||
<location filename="src/Menu.cpp" line="554"/>
|
||||
<source>Open .ini config file</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="src/Menu.cpp" line="556"/>
|
||||
<location filename="src/Menu.cpp" line="568"/>
|
||||
<source>Text files (*.ini)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="src/Menu.cpp" line="566"/>
|
||||
<source>Save .ini config file</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PreferencesDialog</name>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="90"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="618"/>
|
||||
<source>Cancel</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="125"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="619"/>
|
||||
<source>Save all changes</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="196"/>
|
||||
<location filename="ui/preferencesDialog.ui" line="573"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="620"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="629"/>
|
||||
<source>Avatar</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="230"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="621"/>
|
||||
<source><html><head/><body><p>Avatar display name <span style=" color:#909090;">(optional)</span></p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="266"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="622"/>
|
||||
<source>Not showing a name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="294"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="623"/>
|
||||
<source>Head</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="395"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="625"/>
|
||||
<source>Body</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="506"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="627"/>
|
||||
<source>Advanced Tuning</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="537"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="628"/>
|
||||
<source>It's not recomended that you play with these settings unless you've looked into exactly what they do.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="605"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="630"/>
|
||||
<source>Vertical field of view</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="708"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="631"/>
|
||||
<source>Lean scale (applies to Faceshift users)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="793"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="632"/>
|
||||
<source>Avatar scale <span style=" color:#909090;">(default is 1.0)</span></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="875"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="633"/>
|
||||
<source>Pupil dillation</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="954"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="634"/>
|
||||
<source>Audio Jitter Buffer Samples (0 for automatic)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="1045"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="635"/>
|
||||
<source>Faceshift eye detection</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="1125"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="636"/>
|
||||
<source>Octree</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="1236"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="638"/>
|
||||
<source>Max packets sent each second</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="src/ui/VoxelImportDialog.cpp" line="24"/>
|
||||
<source>Loading ...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="src/ui/VoxelImportDialog.cpp" line="27"/>
|
||||
<source>Cancel</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RunningScriptsWidget</name>
|
||||
<message>
|
||||
<location filename="ui/runningScriptsWidget.ui" line="14"/>
|
||||
<location filename="../build/interface/ui_runningScriptsWidget.h" line="140"/>
|
||||
<source>Form</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/runningScriptsWidget.ui" line="39"/>
|
||||
<location filename="../build/interface/ui_runningScriptsWidget.h" line="141"/>
|
||||
<source><html><head/><body><p><span style=" font-size:18pt;">Running Scripts</span></p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/runningScriptsWidget.ui" line="63"/>
|
||||
<location filename="../build/interface/ui_runningScriptsWidget.h" line="142"/>
|
||||
<source><html><head/><body><p><span style=" font-weight:600;">Currently running</span></p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/runningScriptsWidget.ui" line="89"/>
|
||||
<location filename="../build/interface/ui_runningScriptsWidget.h" line="143"/>
|
||||
<source>Reload all</source>
|
||||
<oldsource>Reload All</oldsource>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/runningScriptsWidget.ui" line="116"/>
|
||||
<location filename="../build/interface/ui_runningScriptsWidget.h" line="144"/>
|
||||
<source>Stop all</source>
|
||||
<oldsource>Stop All</oldsource>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/runningScriptsWidget.ui" line="137"/>
|
||||
<location filename="../build/interface/ui_runningScriptsWidget.h" line="145"/>
|
||||
<source><html><head/><body><p><span style=" font-weight:600;">Recently loaded</span></p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/runningScriptsWidget.ui" line="154"/>
|
||||
<location filename="../build/interface/ui_runningScriptsWidget.h" line="146"/>
|
||||
<source>(click a script or use the 1-9 keys to load and run it)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/runningScriptsWidget.ui" line="202"/>
|
||||
<location filename="../build/interface/ui_runningScriptsWidget.h" line="148"/>
|
||||
<source>There are no scripts currently running.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
|
@ -3334,7 +3334,7 @@ namespace render {
|
|||
template <> const ItemKey payloadGetKey(const WorldBoxRenderData::Pointer& stuff) { return ItemKey::Builder::opaqueShape(); }
|
||||
template <> const Item::Bound payloadGetBound(const WorldBoxRenderData::Pointer& stuff) { return Item::Bound(); }
|
||||
template <> void payloadRender(const WorldBoxRenderData::Pointer& stuff, RenderArgs* args) {
|
||||
if (args->_renderMode != RenderArgs::MIRROR_RENDER_MODE && Menu::getInstance()->isOptionChecked(MenuOption::Stats)) {
|
||||
if (args->_renderMode != RenderArgs::MIRROR_RENDER_MODE && Menu::getInstance()->isOptionChecked(MenuOption::WorldAxes)) {
|
||||
PerformanceTimer perfTimer("worldBox");
|
||||
|
||||
auto& batch = *args->_batch;
|
||||
|
|
|
@ -296,6 +296,8 @@ Menu::Menu() {
|
|||
addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::StandingHMDSensorMode, 0, false,
|
||||
avatar, SLOT(updateStandingHMDModeFromMenu()));
|
||||
|
||||
addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::WorldAxes);
|
||||
|
||||
addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::Stats);
|
||||
addActionToQMenuAndActionHash(viewMenu, MenuOption::Log,
|
||||
Qt::CTRL | Qt::SHIFT | Qt::Key_L,
|
||||
|
|
|
@ -294,6 +294,7 @@ namespace MenuOption {
|
|||
const QString VisibleToEveryone = "Everyone";
|
||||
const QString VisibleToFriends = "Friends";
|
||||
const QString VisibleToNoOne = "No one";
|
||||
const QString WorldAxes = "World Axes";
|
||||
}
|
||||
|
||||
#endif // hifi_Menu_h
|
||||
|
|
|
@ -35,43 +35,87 @@ using namespace std;
|
|||
void renderWorldBox(gpu::Batch& batch) {
|
||||
auto geometryCache = DependencyManager::get<GeometryCache>();
|
||||
|
||||
// Show edge of world
|
||||
static const glm::vec3 red(1.0f, 0.0f, 0.0f);
|
||||
static const glm::vec3 green(0.0f, 1.0f, 0.0f);
|
||||
static const glm::vec3 blue(0.0f, 0.0f, 1.0f);
|
||||
static const glm::vec3 grey(0.5f, 0.5f, 0.5f);
|
||||
// Show center of world
|
||||
static const glm::vec3 RED(1.0f, 0.0f, 0.0f);
|
||||
static const glm::vec3 GREEN(0.0f, 1.0f, 0.0f);
|
||||
static const glm::vec3 BLUE(0.0f, 0.0f, 1.0f);
|
||||
static const glm::vec3 GREY(0.5f, 0.5f, 0.5f);
|
||||
static const glm::vec4 GREY4(0.5f, 0.5f, 0.5f, 1.0f);
|
||||
|
||||
static const glm::vec4 DASHED_RED(1.0f, 0.0f, 0.0f, 1.0f);
|
||||
static const glm::vec4 DASHED_GREEN(0.0f, 1.0f, 0.0f, 1.0f);
|
||||
static const glm::vec4 DASHED_BLUE(0.0f, 0.0f, 1.0f, 1.0f);
|
||||
static const float DASH_LENGTH = 1.0f;
|
||||
static const float GAP_LENGTH = 1.0f;
|
||||
auto transform = Transform{};
|
||||
|
||||
batch.setModelTransform(transform);
|
||||
|
||||
// TODO - consider alternate rendering for negative build-able space in the domain
|
||||
geometryCache->renderLine(batch, glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(HALF_TREE_SCALE, 0.0f, 0.0f), red);
|
||||
geometryCache->renderLine(batch, glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, HALF_TREE_SCALE, 0.0f), green);
|
||||
geometryCache->renderLine(batch, glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 0.0f, HALF_TREE_SCALE), blue);
|
||||
geometryCache->renderLine(batch, glm::vec3(0.0f, 0.0f, HALF_TREE_SCALE), glm::vec3(HALF_TREE_SCALE, 0.0f, HALF_TREE_SCALE), grey);
|
||||
geometryCache->renderLine(batch, glm::vec3(HALF_TREE_SCALE, 0.0f, HALF_TREE_SCALE), glm::vec3(HALF_TREE_SCALE, 0.0f, 0.0f), grey);
|
||||
|
||||
geometryCache->renderLine(batch, glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(HALF_TREE_SCALE, 0.0f, 0.0f), RED);
|
||||
geometryCache->renderDashedLine(batch, glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(-HALF_TREE_SCALE, 0.0f, 0.0f), DASHED_RED,
|
||||
DASH_LENGTH, GAP_LENGTH);
|
||||
|
||||
geometryCache->renderLine(batch, glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, HALF_TREE_SCALE, 0.0f), GREEN);
|
||||
geometryCache->renderDashedLine(batch, glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, -HALF_TREE_SCALE, 0.0f), DASHED_GREEN,
|
||||
DASH_LENGTH, GAP_LENGTH);
|
||||
|
||||
geometryCache->renderLine(batch, glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 0.0f, HALF_TREE_SCALE), BLUE);
|
||||
geometryCache->renderDashedLine(batch, glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 0.0f, -HALF_TREE_SCALE), DASHED_BLUE,
|
||||
DASH_LENGTH, GAP_LENGTH);
|
||||
|
||||
// X center boundaries
|
||||
geometryCache->renderLine(batch, glm::vec3(-HALF_TREE_SCALE, -HALF_TREE_SCALE, 0.0f),
|
||||
glm::vec3(HALF_TREE_SCALE, -HALF_TREE_SCALE, 0.0f), GREY);
|
||||
geometryCache->renderLine(batch, glm::vec3(-HALF_TREE_SCALE, -HALF_TREE_SCALE, 0.0f),
|
||||
glm::vec3(-HALF_TREE_SCALE, HALF_TREE_SCALE, 0.0f), GREY);
|
||||
geometryCache->renderLine(batch, glm::vec3(-HALF_TREE_SCALE, HALF_TREE_SCALE, 0.0f),
|
||||
glm::vec3(HALF_TREE_SCALE, HALF_TREE_SCALE, 0.0f), GREY);
|
||||
geometryCache->renderLine(batch, glm::vec3(HALF_TREE_SCALE, -HALF_TREE_SCALE, 0.0f),
|
||||
glm::vec3(HALF_TREE_SCALE, HALF_TREE_SCALE, 0.0f), GREY);
|
||||
|
||||
// Z center boundaries
|
||||
geometryCache->renderLine(batch, glm::vec3(0.0f, -HALF_TREE_SCALE, -HALF_TREE_SCALE),
|
||||
glm::vec3(0.0f, -HALF_TREE_SCALE, HALF_TREE_SCALE), GREY);
|
||||
geometryCache->renderLine(batch, glm::vec3(0.0f, -HALF_TREE_SCALE, -HALF_TREE_SCALE),
|
||||
glm::vec3(0.0f, HALF_TREE_SCALE, -HALF_TREE_SCALE), GREY);
|
||||
geometryCache->renderLine(batch, glm::vec3(0.0f, HALF_TREE_SCALE, -HALF_TREE_SCALE),
|
||||
glm::vec3(0.0f, HALF_TREE_SCALE, HALF_TREE_SCALE), GREY);
|
||||
geometryCache->renderLine(batch, glm::vec3(0.0f, -HALF_TREE_SCALE, HALF_TREE_SCALE),
|
||||
glm::vec3(0.0f, HALF_TREE_SCALE, HALF_TREE_SCALE), GREY);
|
||||
|
||||
// Center boundaries
|
||||
geometryCache->renderLine(batch, glm::vec3(-HALF_TREE_SCALE, 0.0f, -HALF_TREE_SCALE),
|
||||
glm::vec3(-HALF_TREE_SCALE, 0.0f, HALF_TREE_SCALE), GREY);
|
||||
geometryCache->renderLine(batch, glm::vec3(-HALF_TREE_SCALE, 0.0f, -HALF_TREE_SCALE),
|
||||
glm::vec3(HALF_TREE_SCALE, 0.0f, -HALF_TREE_SCALE), GREY);
|
||||
geometryCache->renderLine(batch, glm::vec3(HALF_TREE_SCALE, 0.0f, -HALF_TREE_SCALE),
|
||||
glm::vec3(HALF_TREE_SCALE, 0.0f, HALF_TREE_SCALE), GREY);
|
||||
geometryCache->renderLine(batch, glm::vec3(-HALF_TREE_SCALE, 0.0f, HALF_TREE_SCALE),
|
||||
glm::vec3(HALF_TREE_SCALE, 0.0f, HALF_TREE_SCALE), GREY);
|
||||
|
||||
geometryCache->renderWireCube(batch, TREE_SCALE, GREY4);
|
||||
|
||||
// Draw meter markers along the 3 axis to help with measuring things
|
||||
const float MARKER_DISTANCE = 1.0f;
|
||||
const float MARKER_RADIUS = 0.05f;
|
||||
|
||||
geometryCache->renderSphere(batch, MARKER_RADIUS, 10, 10, red);
|
||||
geometryCache->renderSphere(batch, MARKER_RADIUS, 10, 10, RED);
|
||||
|
||||
transform.setTranslation(glm::vec3(MARKER_DISTANCE, 0.0f, 0.0f));
|
||||
batch.setModelTransform(transform);
|
||||
geometryCache->renderSphere(batch, MARKER_RADIUS, 10, 10, red);
|
||||
geometryCache->renderSphere(batch, MARKER_RADIUS, 10, 10, RED);
|
||||
|
||||
transform.setTranslation(glm::vec3(0.0f, MARKER_DISTANCE, 0.0f));
|
||||
batch.setModelTransform(transform);
|
||||
geometryCache->renderSphere(batch, MARKER_RADIUS, 10, 10, green);
|
||||
geometryCache->renderSphere(batch, MARKER_RADIUS, 10, 10, GREEN);
|
||||
|
||||
transform.setTranslation(glm::vec3(0.0f, 0.0f, MARKER_DISTANCE));
|
||||
batch.setModelTransform(transform);
|
||||
geometryCache->renderSphere(batch, MARKER_RADIUS, 10, 10, blue);
|
||||
geometryCache->renderSphere(batch, MARKER_RADIUS, 10, 10, BLUE);
|
||||
|
||||
transform.setTranslation(glm::vec3(MARKER_DISTANCE, 0.0f, MARKER_DISTANCE));
|
||||
batch.setModelTransform(transform);
|
||||
geometryCache->renderSphere(batch, MARKER_RADIUS, 10, 10, grey);
|
||||
geometryCache->renderSphere(batch, MARKER_RADIUS, 10, 10, GREY);
|
||||
}
|
||||
|
||||
// Return a random vector of average length 1
|
||||
|
|
|
@ -70,7 +70,7 @@ void GeometryCache::renderSphere(gpu::Batch& batch, float radius, int slices, in
|
|||
|
||||
int vertices = slices * (stacks - 1) + 2;
|
||||
int indices = slices * (stacks - 1) * NUM_VERTICES_PER_TRIANGULATED_QUAD;
|
||||
|
||||
|
||||
if ((registered && (!_registeredSphereVertices.contains(id) || _lastRegisteredSphereVertices[id] != radiusKey))
|
||||
|| (!registered && !_sphereVertices.contains(radiusKey))) {
|
||||
|
||||
|
@ -80,7 +80,7 @@ void GeometryCache::renderSphere(gpu::Batch& batch, float radius, int slices, in
|
|||
qCDebug(renderutils) << "renderSphere()... RELEASING REGISTERED VERTICES BUFFER";
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
auto verticesBuffer = std::make_shared<gpu::Buffer>();
|
||||
if (registered) {
|
||||
_registeredSphereVertices[id] = verticesBuffer;
|
||||
|
@ -134,7 +134,7 @@ void GeometryCache::renderSphere(gpu::Batch& batch, float radius, int slices, in
|
|||
qCDebug(renderutils) << "renderSphere()... REUSING PREVIOUSLY REGISTERED VERTICES BUFFER";
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
if ((registered && (!_registeredSphereIndices.contains(id) || _lastRegisteredSphereIndices[id] != slicesStacksKey))
|
||||
|| (!registered && !_sphereIndices.contains(slicesStacksKey))) {
|
||||
|
||||
|
@ -1327,7 +1327,9 @@ void GeometryCache::renderQuad(gpu::Batch& batch, const glm::vec3& topLeft, cons
|
|||
batch.draw(gpu::TRIANGLE_STRIP, 4, 0);
|
||||
}
|
||||
|
||||
void GeometryCache::renderDashedLine(gpu::Batch& batch, const glm::vec3& start, const glm::vec3& end, const glm::vec4& color, int id) {
|
||||
void GeometryCache::renderDashedLine(gpu::Batch& batch, const glm::vec3& start, const glm::vec3& end, const glm::vec4& color,
|
||||
const float dash_length, const float gap_length, int id) {
|
||||
|
||||
bool registered = (id != UNKNOWN_ID);
|
||||
Vec3PairVec2Pair key(Vec3Pair(start, end), Vec2Pair(glm::vec2(color.x, color.y), glm::vec2(color.z, color.w)));
|
||||
BatchItemDetails& details = registered ? _registeredDashedLines[id] : _dashedLines[key];
|
||||
|
@ -1351,16 +1353,14 @@ void GeometryCache::renderDashedLine(gpu::Batch& batch, const glm::vec3& start,
|
|||
((int(color.w * 255.0f) & 0xFF) << 24);
|
||||
|
||||
// draw each line segment with appropriate gaps
|
||||
const float DASH_LENGTH = 0.05f;
|
||||
const float GAP_LENGTH = 0.025f;
|
||||
const float SEGMENT_LENGTH = DASH_LENGTH + GAP_LENGTH;
|
||||
const float SEGMENT_LENGTH = dash_length + gap_length;
|
||||
float length = glm::distance(start, end);
|
||||
float segmentCount = length / SEGMENT_LENGTH;
|
||||
int segmentCountFloor = (int)glm::floor(segmentCount);
|
||||
|
||||
glm::vec3 segmentVector = (end - start) / segmentCount;
|
||||
glm::vec3 dashVector = segmentVector / SEGMENT_LENGTH * DASH_LENGTH;
|
||||
glm::vec3 gapVector = segmentVector / SEGMENT_LENGTH * GAP_LENGTH;
|
||||
glm::vec3 dashVector = segmentVector / SEGMENT_LENGTH * dash_length;
|
||||
glm::vec3 gapVector = segmentVector / SEGMENT_LENGTH * gap_length;
|
||||
|
||||
const int FLOATS_PER_VERTEX = 3;
|
||||
details.vertices = (segmentCountFloor + 1) * 2;
|
||||
|
@ -1394,7 +1394,7 @@ void GeometryCache::renderDashedLine(gpu::Batch& batch, const glm::vec3& start,
|
|||
*(vertex++) = point.y;
|
||||
*(vertex++) = point.z;
|
||||
*(colorDataAt++) = compactColor;
|
||||
|
||||
|
||||
for (int i = 0; i < segmentCountFloor; i++) {
|
||||
point += dashVector;
|
||||
*(vertex++) = point.x;
|
||||
|
|
|
@ -180,8 +180,13 @@ public:
|
|||
|
||||
void renderLine(gpu::Batch& batch, const glm::vec3& p1, const glm::vec3& p2,
|
||||
const glm::vec4& color1, const glm::vec4& color2, int id = UNKNOWN_ID);
|
||||
|
||||
void renderDashedLine(gpu::Batch& batch, const glm::vec3& start, const glm::vec3& end, const glm::vec4& color, int id = UNKNOWN_ID);
|
||||
|
||||
void renderDashedLine(gpu::Batch& batch, const glm::vec3& start, const glm::vec3& end, const glm::vec4& color,
|
||||
int id = UNKNOWN_ID)
|
||||
{ renderDashedLine(batch, start, end, color, 0.05f, 0.025f, id); }
|
||||
|
||||
void renderDashedLine(gpu::Batch& batch, const glm::vec3& start, const glm::vec3& end, const glm::vec4& color,
|
||||
const float dash_length, const float gap_length, int id = UNKNOWN_ID);
|
||||
|
||||
void renderLine(gpu::Batch& batch, const glm::vec2& p1, const glm::vec2& p2, const glm::vec3& color, int id = UNKNOWN_ID)
|
||||
{ renderLine(batch, p1, p2, glm::vec4(color, 1.0f), id); }
|
||||
|
@ -189,12 +194,11 @@ public:
|
|||
void renderLine(gpu::Batch& batch, const glm::vec2& p1, const glm::vec2& p2, const glm::vec4& color, int id = UNKNOWN_ID)
|
||||
{ renderLine(batch, p1, p2, color, color, id); }
|
||||
|
||||
|
||||
void renderLine(gpu::Batch& batch, const glm::vec2& p1, const glm::vec2& p2,
|
||||
const glm::vec3& color1, const glm::vec3& color2, int id = UNKNOWN_ID)
|
||||
void renderLine(gpu::Batch& batch, const glm::vec2& p1, const glm::vec2& p2,
|
||||
const glm::vec3& color1, const glm::vec3& color2, int id = UNKNOWN_ID)
|
||||
{ renderLine(batch, p1, p2, glm::vec4(color1, 1.0f), glm::vec4(color2, 1.0f), id); }
|
||||
|
||||
void renderLine(gpu::Batch& batch, const glm::vec2& p1, const glm::vec2& p2,
|
||||
|
||||
void renderLine(gpu::Batch& batch, const glm::vec2& p1, const glm::vec2& p2,
|
||||
const glm::vec4& color1, const glm::vec4& color2, int id = UNKNOWN_ID);
|
||||
|
||||
void updateVertices(int id, const QVector<glm::vec2>& points, const glm::vec4& color);
|
||||
|
@ -213,7 +217,7 @@ public:
|
|||
private:
|
||||
GeometryCache();
|
||||
virtual ~GeometryCache();
|
||||
|
||||
|
||||
typedef QPair<int, int> IntPair;
|
||||
typedef QPair<unsigned int, unsigned int> VerticesIndices;
|
||||
|
||||
|
@ -244,7 +248,7 @@ private:
|
|||
~BatchItemDetails();
|
||||
void clear();
|
||||
};
|
||||
|
||||
|
||||
QHash<IntPair, VerticesIndices> _coneVBOs;
|
||||
|
||||
int _nextID;
|
||||
|
|
Loading…
Reference in a new issue