mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Merge branch 'master' into 21089
This commit is contained in:
commit
427c8008c6
35 changed files with 123 additions and 90 deletions
|
@ -14,7 +14,7 @@ endif ()
|
|||
|
||||
if (HIFI_MEMORY_DEBUGGING)
|
||||
if (UNIX)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -U_FORTIFY_SOURCE -fno-stack-protector -fno-omit-frame-pointer")
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libasan -static-libstdc++ -fsanitize=address")
|
||||
endif (UNIX)
|
||||
endif ()
|
||||
|
|
|
@ -571,7 +571,9 @@ Function HandlePostInstallOptions
|
|||
; both launches use the explorer trick in case the user has elevated permissions for the installer
|
||||
; it won't be possible to use this approach if either application should be launched with a command line param
|
||||
${If} ${SectionIsSelected} ${@SERVER_COMPONENT_NAME@}
|
||||
Exec '"$WINDIR\explorer.exe" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@"'
|
||||
; create shortcut with ARGUMENTS
|
||||
CreateShortCut "$TEMP\SandboxShortcut.lnk" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" "-- --launchInterface"
|
||||
Exec '"$WINDIR\explorer.exe" "$TEMP\SandboxShortcut.lnk"'
|
||||
${Else}
|
||||
Exec '"$WINDIR\explorer.exe" "$INSTDIR\@INTERFACE_WIN_EXEC_NAME@"'
|
||||
${EndIf}
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
{ "from": "OculusTouch.LT", "to": "Standard.LT" },
|
||||
{ "from": "OculusTouch.LS", "to": "Standard.LS" },
|
||||
{ "from": "OculusTouch.LeftGrip", "filters": { "type": "deadZone", "min": 0.5 }, "to": "Standard.LeftGrip" },
|
||||
{ "from": "OculusTouch.LeftHand", "to": "Standard.LeftHand" },
|
||||
{ "from": "OculusTouch.LeftHand", "to": "Standard.LeftHand", "when": [ "Application.InHMD" ] },
|
||||
|
||||
{ "from": "OculusTouch.RY", "to": "Standard.RY",
|
||||
"filters": [
|
||||
|
@ -39,7 +39,7 @@
|
|||
{ "from": "OculusTouch.RT", "to": "Standard.RT" },
|
||||
{ "from": "OculusTouch.RS", "to": "Standard.RS" },
|
||||
{ "from": "OculusTouch.RightGrip", "filters": { "type": "deadZone", "min": 0.5 }, "to": "Standard.RightGrip" },
|
||||
{ "from": "OculusTouch.RightHand", "to": "Standard.RightHand" },
|
||||
{ "from": "OculusTouch.RightHand", "to": "Standard.RightHand", "when": [ "Application.InHMD" ] },
|
||||
|
||||
{ "from": "OculusTouch.LeftApplicationMenu", "to": "Standard.Back" },
|
||||
{ "from": "OculusTouch.RightApplicationMenu", "to": "Standard.Start" },
|
||||
|
@ -58,4 +58,3 @@
|
|||
{ "from": "OculusTouch.RightIndexPoint", "to": "Standard.RightIndexPoint" }
|
||||
]
|
||||
}
|
||||
|
||||
|
|
|
@ -95,46 +95,10 @@ Hifi.AvatarInputs {
|
|||
anchors.fill: parent
|
||||
color: root.mirrorVisible ? (root.audioClipping ? "red" : "#696969") : "#00000000"
|
||||
|
||||
Image {
|
||||
id: faceMute
|
||||
width: root.iconSize
|
||||
height: root.iconSize
|
||||
visible: root.cameraEnabled
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: root.iconPadding
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
source: root.cameraMuted ? "../images/face-mute.svg" : "../images/face.svg"
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
root.toggleCameraMute()
|
||||
}
|
||||
onDoubleClicked: {
|
||||
root.resetSensors();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Image {
|
||||
id: micMute
|
||||
width: root.iconSize
|
||||
height: root.iconSize
|
||||
anchors.left: root.cameraEnabled ? faceMute.right : parent.left
|
||||
anchors.leftMargin: root.iconPadding
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
source: root.audioMuted ? "../images/mic-mute.svg" : "../images/mic.svg"
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
root.toggleAudioMute()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
id: audioMeter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: micMute.right
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: root.iconPadding
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: root.iconPadding
|
||||
|
|
|
@ -20,10 +20,10 @@ ScrollingWindow {
|
|||
anchors.centerIn: parent
|
||||
UpdateDialog {
|
||||
id: updateDialog
|
||||
|
||||
|
||||
implicitWidth: backgroundRectangle.width
|
||||
implicitHeight: backgroundRectangle.height
|
||||
|
||||
|
||||
readonly property int contentWidth: 500
|
||||
readonly property int logoSize: 60
|
||||
readonly property int borderWidth: 30
|
||||
|
@ -36,7 +36,7 @@ ScrollingWindow {
|
|||
|
||||
signal triggerBuildDownload
|
||||
signal closeUpdateDialog
|
||||
|
||||
|
||||
Rectangle {
|
||||
id: backgroundRectangle
|
||||
color: "#ffffff"
|
||||
|
@ -47,7 +47,7 @@ ScrollingWindow {
|
|||
|
||||
Image {
|
||||
id: logo
|
||||
source: "../images/interface-logo.svg"
|
||||
source: "../images/hifi-logo.svg"
|
||||
width: updateDialog.logoSize
|
||||
height: updateDialog.logoSize
|
||||
anchors {
|
||||
|
@ -65,7 +65,7 @@ ScrollingWindow {
|
|||
topMargin: updateDialog.borderWidth
|
||||
top: parent.top
|
||||
}
|
||||
|
||||
|
||||
Rectangle {
|
||||
id: header
|
||||
width: parent.width - updateDialog.logoSize - updateDialog.inputSpacing
|
||||
|
|
|
@ -113,9 +113,8 @@ Rectangle {
|
|||
}
|
||||
FiraSansRegular {
|
||||
id: users;
|
||||
visible: action === 'concurrency';
|
||||
text: onlineUsers;
|
||||
size: textSize;
|
||||
text: (action === 'concurrency') ? onlineUsers : 'snapshot';
|
||||
size: (action === 'concurrency') ? textSize : textSizeSmall;
|
||||
color: hifi.colors.white;
|
||||
anchors {
|
||||
verticalCenter: usersImage.verticalCenter;
|
||||
|
|
|
@ -1147,7 +1147,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
|||
});
|
||||
|
||||
// If the user clicks somewhere where there is NO entity at all, we will release focus
|
||||
connect(getEntities(), &EntityTreeRenderer::mousePressOffEntity, [=]() {
|
||||
connect(getEntities().data(), &EntityTreeRenderer::mousePressOffEntity, [=]() {
|
||||
setKeyboardFocusEntity(UNKNOWN_ENTITY_ID);
|
||||
});
|
||||
|
||||
|
@ -3474,7 +3474,7 @@ void Application::init() {
|
|||
|
||||
// connect the _entityCollisionSystem to our EntityTreeRenderer since that's what handles running entity scripts
|
||||
connect(_entitySimulation.get(), &EntitySimulation::entityCollisionWithEntity,
|
||||
getEntities(), &EntityTreeRenderer::entityCollisionWithEntity);
|
||||
getEntities().data(), &EntityTreeRenderer::entityCollisionWithEntity);
|
||||
|
||||
// connect the _entities (EntityTreeRenderer) to our script engine's EntityScriptingInterface for firing
|
||||
// of events related clicking, hovering over, and entering entities
|
||||
|
|
|
@ -180,7 +180,7 @@ public:
|
|||
void copyDisplayViewFrustum(ViewFrustum& viewOut) const;
|
||||
void copyShadowViewFrustum(ViewFrustum& viewOut) const override;
|
||||
const OctreePacketProcessor& getOctreePacketProcessor() const { return _octreeProcessor; }
|
||||
EntityTreeRenderer* getEntities() const { return DependencyManager::get<EntityTreeRenderer>().data(); }
|
||||
QSharedPointer<EntityTreeRenderer> getEntities() const { return DependencyManager::get<EntityTreeRenderer>(); }
|
||||
QUndoStack* getUndoStack() { return &_undoStack; }
|
||||
MainWindow* getWindow() const { return _window; }
|
||||
EntityTreePointer getEntityClipboard() const { return _entityClipboard; }
|
||||
|
|
|
@ -29,7 +29,7 @@ SpatiallyNestableWeakPointer InterfaceParentFinder::find(QUuid parentID, bool& s
|
|||
if (entityTree) {
|
||||
parent = entityTree->findByID(parentID);
|
||||
} else {
|
||||
EntityTreeRenderer* treeRenderer = qApp->getEntities();
|
||||
auto treeRenderer = qApp->getEntities();
|
||||
EntityTreePointer tree = treeRenderer ? treeRenderer->getTree() : nullptr;
|
||||
parent = tree ? tree->findEntityByEntityItemID(parentID) : nullptr;
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ Avatar::Avatar(RigPointer rig) :
|
|||
Avatar::~Avatar() {
|
||||
assert(isDead()); // mark dead before calling the dtor
|
||||
|
||||
EntityTreeRenderer* treeRenderer = qApp->getEntities();
|
||||
auto treeRenderer = qApp->getEntities();
|
||||
EntityTreePointer entityTree = treeRenderer ? treeRenderer->getTree() : nullptr;
|
||||
if (entityTree) {
|
||||
entityTree->withWriteLock([&] {
|
||||
|
@ -199,7 +199,7 @@ void Avatar::updateAvatarEntities() {
|
|||
return; // wait until MyAvatar gets an ID before doing this.
|
||||
}
|
||||
|
||||
EntityTreeRenderer* treeRenderer = qApp->getEntities();
|
||||
auto treeRenderer = qApp->getEntities();
|
||||
EntityTreePointer entityTree = treeRenderer ? treeRenderer->getTree() : nullptr;
|
||||
if (!entityTree) {
|
||||
return;
|
||||
|
|
|
@ -472,7 +472,7 @@ void MyAvatar::simulate(float deltaTime) {
|
|||
|
||||
locationChanged();
|
||||
// if a entity-child of this avatar has moved outside of its queryAACube, update the cube and tell the entity server.
|
||||
EntityTreeRenderer* entityTreeRenderer = qApp->getEntities();
|
||||
auto entityTreeRenderer = qApp->getEntities();
|
||||
EntityTreePointer entityTree = entityTreeRenderer ? entityTreeRenderer->getTree() : nullptr;
|
||||
if (entityTree) {
|
||||
bool flyingAllowed = true;
|
||||
|
@ -1938,7 +1938,7 @@ void MyAvatar::setCharacterControllerEnabled(bool enabled) {
|
|||
}
|
||||
|
||||
bool ghostingAllowed = true;
|
||||
EntityTreeRenderer* entityTreeRenderer = qApp->getEntities();
|
||||
auto entityTreeRenderer = qApp->getEntities();
|
||||
if (entityTreeRenderer) {
|
||||
std::shared_ptr<ZoneEntityItem> zone = entityTreeRenderer->myAvatarZone();
|
||||
if (zone) {
|
||||
|
@ -2289,7 +2289,7 @@ void MyAvatar::removeHoldAction(AvatarActionHold* holdAction) {
|
|||
}
|
||||
|
||||
void MyAvatar::updateHoldActions(const AnimPose& prePhysicsPose, const AnimPose& postUpdatePose) {
|
||||
EntityTreeRenderer* entityTreeRenderer = qApp->getEntities();
|
||||
auto entityTreeRenderer = qApp->getEntities();
|
||||
EntityTreePointer entityTree = entityTreeRenderer ? entityTreeRenderer->getTree() : nullptr;
|
||||
if (entityTree) {
|
||||
// lateAvatarUpdate will modify entity position & orientation, so we need an entity write lock
|
||||
|
|
|
@ -92,13 +92,19 @@ void OctreePacketProcessor::processPacket(QSharedPointer<ReceivedMessage> messag
|
|||
switch(packetType) {
|
||||
case PacketType::EntityErase: {
|
||||
if (DependencyManager::get<SceneScriptingInterface>()->shouldRenderEntities()) {
|
||||
qApp->getEntities()->processEraseMessage(*message, sendingNode);
|
||||
auto renderer = qApp->getEntities();
|
||||
if (renderer) {
|
||||
renderer->processEraseMessage(*message, sendingNode);
|
||||
}
|
||||
}
|
||||
} break;
|
||||
|
||||
case PacketType::EntityData: {
|
||||
if (DependencyManager::get<SceneScriptingInterface>()->shouldRenderEntities()) {
|
||||
qApp->getEntities()->processDatagram(*message, sendingNode);
|
||||
auto renderer = qApp->getEntities();
|
||||
if (renderer) {
|
||||
renderer->processDatagram(*message, sendingNode);
|
||||
}
|
||||
}
|
||||
} break;
|
||||
|
||||
|
|
|
@ -118,11 +118,26 @@ void AnimSkeleton::convertAbsoluteRotationsToRelative(std::vector<glm::quat>& ro
|
|||
}
|
||||
}
|
||||
|
||||
void AnimSkeleton::saveNonMirroredPoses(const AnimPoseVec& poses) const {
|
||||
_nonMirroredPoses.clear();
|
||||
for (int i = 0; i < (int)_nonMirroredIndices.size(); ++i) {
|
||||
_nonMirroredPoses.push_back(poses[_nonMirroredIndices[i]]);
|
||||
}
|
||||
}
|
||||
|
||||
void AnimSkeleton::restoreNonMirroredPoses(AnimPoseVec& poses) const {
|
||||
for (int i = 0; i < (int)_nonMirroredIndices.size(); ++i) {
|
||||
int index = _nonMirroredIndices[i];
|
||||
poses[index] = _nonMirroredPoses[i];
|
||||
}
|
||||
}
|
||||
|
||||
void AnimSkeleton::mirrorRelativePoses(AnimPoseVec& poses) const {
|
||||
saveNonMirroredPoses(poses);
|
||||
convertRelativePosesToAbsolute(poses);
|
||||
mirrorAbsolutePoses(poses);
|
||||
convertAbsolutePosesToRelative(poses);
|
||||
restoreNonMirroredPoses(poses);
|
||||
}
|
||||
|
||||
void AnimSkeleton::mirrorAbsolutePoses(AnimPoseVec& poses) const {
|
||||
|
@ -189,8 +204,14 @@ void AnimSkeleton::buildSkeletonFromJoints(const std::vector<FBXJoint>& joints)
|
|||
}
|
||||
|
||||
// build mirror map.
|
||||
_nonMirroredIndices.clear();
|
||||
_mirrorMap.reserve(_joints.size());
|
||||
for (int i = 0; i < (int)joints.size(); i++) {
|
||||
if (_joints[i].name.endsWith("tEye")) {
|
||||
// HACK: we don't want to mirror some joints so we remember their indices
|
||||
// so we can restore them after a future mirror operation
|
||||
_nonMirroredIndices.push_back(i);
|
||||
}
|
||||
int mirrorJointIndex = -1;
|
||||
if (_joints[i].name.startsWith("Left")) {
|
||||
QString mirrorJointName = QString(_joints[i].name).replace(0, 4, "Right");
|
||||
|
|
|
@ -57,6 +57,9 @@ public:
|
|||
|
||||
void convertAbsoluteRotationsToRelative(std::vector<glm::quat>& rotations) const;
|
||||
|
||||
void saveNonMirroredPoses(const AnimPoseVec& poses) const;
|
||||
void restoreNonMirroredPoses(AnimPoseVec& poses) const;
|
||||
|
||||
void mirrorRelativePoses(AnimPoseVec& poses) const;
|
||||
void mirrorAbsolutePoses(AnimPoseVec& poses) const;
|
||||
|
||||
|
@ -75,6 +78,8 @@ protected:
|
|||
AnimPoseVec _absoluteDefaultPoses;
|
||||
AnimPoseVec _relativePreRotationPoses;
|
||||
AnimPoseVec _relativePostRotationPoses;
|
||||
mutable AnimPoseVec _nonMirroredPoses;
|
||||
std::vector<int> _nonMirroredIndices;
|
||||
std::vector<int> _mirrorMap;
|
||||
|
||||
// no copies
|
||||
|
|
|
@ -85,18 +85,26 @@ public:
|
|||
}
|
||||
|
||||
void beforeAboutToQuit() {
|
||||
Lock lock(_checkDevicesMutex);
|
||||
_quit = true;
|
||||
}
|
||||
|
||||
void run() override {
|
||||
while (!_quit) {
|
||||
while (true) {
|
||||
{
|
||||
Lock lock(_checkDevicesMutex);
|
||||
if (_quit) {
|
||||
break;
|
||||
}
|
||||
_audioClient->checkDevices();
|
||||
}
|
||||
QThread::msleep(DEVICE_CHECK_INTERVAL_MSECS);
|
||||
_audioClient->checkDevices();
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
AudioClient* _audioClient { nullptr };
|
||||
Mutex _checkDevicesMutex;
|
||||
bool _quit { false };
|
||||
};
|
||||
|
||||
|
|
|
@ -520,7 +520,7 @@ const FBXGeometry* EntityTreeRenderer::getGeometryForEntity(EntityItemPointer en
|
|||
std::shared_ptr<RenderableModelEntityItem> modelEntityItem =
|
||||
std::dynamic_pointer_cast<RenderableModelEntityItem>(entityItem);
|
||||
assert(modelEntityItem); // we need this!!!
|
||||
ModelPointer model = modelEntityItem->getModel(this);
|
||||
ModelPointer model = modelEntityItem->getModel(getSharedFromThis());
|
||||
if (model && model->isLoaded()) {
|
||||
result = &model->getFBXGeometry();
|
||||
}
|
||||
|
@ -533,7 +533,7 @@ ModelPointer EntityTreeRenderer::getModelForEntityItem(EntityItemPointer entityI
|
|||
if (entityItem->getType() == EntityTypes::Model) {
|
||||
std::shared_ptr<RenderableModelEntityItem> modelEntityItem =
|
||||
std::dynamic_pointer_cast<RenderableModelEntityItem>(entityItem);
|
||||
result = modelEntityItem->getModel(this);
|
||||
result = modelEntityItem->getModel(getSharedFromThis());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -45,6 +45,10 @@ public:
|
|||
AbstractScriptingServicesInterface* scriptingServices);
|
||||
virtual ~EntityTreeRenderer();
|
||||
|
||||
QSharedPointer<EntityTreeRenderer> getSharedFromThis() {
|
||||
return qSharedPointerCast<EntityTreeRenderer>(sharedFromThis());
|
||||
}
|
||||
|
||||
virtual char getMyNodeType() const override { return NodeType::EntityServer; }
|
||||
virtual PacketType getMyQueryMessageType() const override { return PacketType::EntityQuery; }
|
||||
virtual PacketType getExpectedPacketType() const override { return PacketType::EntityData; }
|
||||
|
|
|
@ -65,7 +65,7 @@ void RenderableModelEntityItem::setModelURL(const QString& url) {
|
|||
|
||||
void RenderableModelEntityItem::loader() {
|
||||
_needsModelReload = true;
|
||||
EntityTreeRenderer* renderer = DependencyManager::get<EntityTreeRenderer>().data();
|
||||
auto renderer = DependencyManager::get<EntityTreeRenderer>();
|
||||
assert(renderer);
|
||||
{
|
||||
PerformanceTimer perfTimer("getModel");
|
||||
|
@ -368,7 +368,7 @@ void RenderableModelEntityItem::render(RenderArgs* args) {
|
|||
if (!_model || _needsModelReload) {
|
||||
// TODO: this getModel() appears to be about 3% of model render time. We should optimize
|
||||
PerformanceTimer perfTimer("getModel");
|
||||
EntityTreeRenderer* renderer = static_cast<EntityTreeRenderer*>(args->_renderer);
|
||||
auto renderer = qSharedPointerCast<EntityTreeRenderer>(args->_renderer);
|
||||
getModel(renderer);
|
||||
|
||||
// Remap textures immediately after loading to avoid flicker
|
||||
|
@ -470,7 +470,7 @@ void RenderableModelEntityItem::render(RenderArgs* args) {
|
|||
}
|
||||
}
|
||||
|
||||
ModelPointer RenderableModelEntityItem::getModel(EntityTreeRenderer* renderer) {
|
||||
ModelPointer RenderableModelEntityItem::getModel(QSharedPointer<EntityTreeRenderer> renderer) {
|
||||
if (!renderer) {
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -495,7 +495,7 @@ ModelPointer RenderableModelEntityItem::getModel(EntityTreeRenderer* renderer) {
|
|||
_needsInitialSimulation = true;
|
||||
// If we need to change URLs, update it *after rendering* (to avoid access violations)
|
||||
} else if (QUrl(getModelURL()) != _model->getURL()) {
|
||||
QMetaObject::invokeMethod(_myRenderer, "updateModel", Qt::QueuedConnection,
|
||||
QMetaObject::invokeMethod(_myRenderer.data(), "updateModel", Qt::QueuedConnection,
|
||||
Q_ARG(ModelPointer, _model),
|
||||
Q_ARG(const QString&, getModelURL()));
|
||||
_needsInitialSimulation = true;
|
||||
|
|
|
@ -51,7 +51,7 @@ public:
|
|||
bool& keepSearching, OctreeElementPointer& element, float& distance,
|
||||
BoxFace& face, glm::vec3& surfaceNormal,
|
||||
void** intersectedObject, bool precisionPicking) const override;
|
||||
ModelPointer getModel(EntityTreeRenderer* renderer);
|
||||
ModelPointer getModel(QSharedPointer<EntityTreeRenderer> renderer);
|
||||
|
||||
virtual bool needsToCallUpdate() const override;
|
||||
virtual void update(const quint64& now) override;
|
||||
|
@ -105,7 +105,7 @@ private:
|
|||
ModelPointer _model = nullptr;
|
||||
bool _needsInitialSimulation = true;
|
||||
bool _needsModelReload = true;
|
||||
EntityTreeRenderer* _myRenderer = nullptr;
|
||||
QSharedPointer<EntityTreeRenderer> _myRenderer;
|
||||
QString _lastTextures;
|
||||
QVariantMap _currentTextures;
|
||||
QVariantMap _originalTextures;
|
||||
|
|
|
@ -64,7 +64,7 @@ RenderableWebEntityItem::~RenderableWebEntityItem() {
|
|||
}
|
||||
}
|
||||
|
||||
bool RenderableWebEntityItem::buildWebSurface(EntityTreeRenderer* renderer) {
|
||||
bool RenderableWebEntityItem::buildWebSurface(QSharedPointer<EntityTreeRenderer> renderer) {
|
||||
if (_currentWebCount >= MAX_CONCURRENT_WEB_VIEWS) {
|
||||
qWarning() << "Too many concurrent web views to create new view";
|
||||
return false;
|
||||
|
@ -139,10 +139,11 @@ bool RenderableWebEntityItem::buildWebSurface(EntityTreeRenderer* renderer) {
|
|||
handlePointerEvent(event);
|
||||
}
|
||||
};
|
||||
_mousePressConnection = QObject::connect(renderer, &EntityTreeRenderer::mousePressOnEntity, forwardPointerEvent);
|
||||
_mouseReleaseConnection = QObject::connect(renderer, &EntityTreeRenderer::mouseReleaseOnEntity, forwardPointerEvent);
|
||||
_mouseMoveConnection = QObject::connect(renderer, &EntityTreeRenderer::mouseMoveOnEntity, forwardPointerEvent);
|
||||
_hoverLeaveConnection = QObject::connect(renderer, &EntityTreeRenderer::hoverLeaveEntity, [=](const EntityItemID& entityItemID, const PointerEvent& event) {
|
||||
_mousePressConnection = QObject::connect(renderer.data(), &EntityTreeRenderer::mousePressOnEntity, forwardPointerEvent);
|
||||
_mouseReleaseConnection = QObject::connect(renderer.data(), &EntityTreeRenderer::mouseReleaseOnEntity, forwardPointerEvent);
|
||||
_mouseMoveConnection = QObject::connect(renderer.data(), &EntityTreeRenderer::mouseMoveOnEntity, forwardPointerEvent);
|
||||
_hoverLeaveConnection = QObject::connect(renderer.data(), &EntityTreeRenderer::hoverLeaveEntity,
|
||||
[=](const EntityItemID& entityItemID, const PointerEvent& event) {
|
||||
if (this->_pressed && this->getID() == entityItemID) {
|
||||
// If the user mouses off the entity while the button is down, simulate a touch end.
|
||||
QTouchEvent::TouchPoint point;
|
||||
|
@ -190,7 +191,8 @@ void RenderableWebEntityItem::render(RenderArgs* args) {
|
|||
#endif
|
||||
|
||||
if (!_webSurface) {
|
||||
if (!buildWebSurface(static_cast<EntityTreeRenderer*>(args->_renderer))) {
|
||||
auto renderer = qSharedPointerCast<EntityTreeRenderer>(args->_renderer);
|
||||
if (!buildWebSurface(renderer)) {
|
||||
return;
|
||||
}
|
||||
_fadeStartTime = usecTimestampNow();
|
||||
|
|
|
@ -52,7 +52,7 @@ public:
|
|||
virtual bool isTransparent() override;
|
||||
|
||||
private:
|
||||
bool buildWebSurface(EntityTreeRenderer* renderer);
|
||||
bool buildWebSurface(QSharedPointer<EntityTreeRenderer> renderer);
|
||||
void destroyWebSurface();
|
||||
glm::vec2 getWindowSize() const;
|
||||
|
||||
|
|
|
@ -123,7 +123,9 @@ glm::vec3 OBJTokenizer::getVec3() {
|
|||
return v;
|
||||
}
|
||||
glm::vec2 OBJTokenizer::getVec2() {
|
||||
auto v = glm::vec2(getFloat(), 1.0f - getFloat()); // OBJ has an odd sense of u, v. Also N.B.: getFloat() has side-effect
|
||||
float uCoord = getFloat();
|
||||
float vCoord = 1.0f - getFloat();
|
||||
auto v = glm::vec2(uCoord, vCoord);
|
||||
while (isNextTokenFloat()) {
|
||||
// there can be a w, but we don't handle that
|
||||
nextToken();
|
||||
|
|
|
@ -322,7 +322,9 @@ void GL45Texture::withPreservedTexture(std::function<void()> f) const {
|
|||
}
|
||||
|
||||
void GL45Texture::generateMips() const {
|
||||
qCDebug(gpugl45logging) << "Generating mipmaps for " << _source.c_str();
|
||||
if (_transferrable) {
|
||||
qCDebug(gpugl45logging) << "Generating mipmaps for " << _source.c_str();
|
||||
}
|
||||
glGenerateTextureMipmap(_id);
|
||||
(void)CHECK_GL_ERROR();
|
||||
}
|
||||
|
|
|
@ -508,12 +508,16 @@ std::vector<HifiSockAddr> Socket::getConnectionSockAddrs() {
|
|||
}
|
||||
|
||||
void Socket::handleSocketError(QAbstractSocket::SocketError socketError) {
|
||||
qCWarning(networking) << "udt::Socket error -" << socketError;
|
||||
static const QString SOCKET_REGEX = "udt::Socket error - ";
|
||||
static QString repeatedMessage
|
||||
= LogHandler::getInstance().addRepeatedMessageRegex(SOCKET_REGEX);
|
||||
|
||||
qCDebug(networking) << "udt::Socket error - " << socketError;
|
||||
}
|
||||
|
||||
void Socket::handleStateChanged(QAbstractSocket::SocketState socketState) {
|
||||
if (socketState != QAbstractSocket::BoundState) {
|
||||
qCWarning(networking) << "udt::Socket state changed - state is now" << socketState;
|
||||
qCDebug(networking) << "udt::Socket state changed - state is now" << socketState;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -216,7 +216,7 @@ bool OctreeRenderer::renderOperation(OctreeElementPointer element, void* extraDa
|
|||
|
||||
void OctreeRenderer::render(RenderArgs* renderArgs) {
|
||||
if (_tree) {
|
||||
renderArgs->_renderer = this;
|
||||
renderArgs->_renderer = sharedFromThis();
|
||||
_tree->withReadLock([&] {
|
||||
_tree->recurseTreeWithOperation(renderOperation, renderArgs);
|
||||
});
|
||||
|
|
|
@ -29,7 +29,7 @@ class OctreeRenderer;
|
|||
|
||||
|
||||
// Generic client side Octree renderer class.
|
||||
class OctreeRenderer : public QObject {
|
||||
class OctreeRenderer : public QObject, public QEnableSharedFromThis<OctreeRenderer> {
|
||||
Q_OBJECT
|
||||
public:
|
||||
OctreeRenderer();
|
||||
|
|
|
@ -86,6 +86,7 @@ const LoaderList& getLoadedPlugins() {
|
|||
QString pluginPath = QCoreApplication::applicationDirPath() + "/plugins/";
|
||||
#endif
|
||||
QDir pluginDir(pluginPath);
|
||||
pluginDir.setSorting(QDir::Name);
|
||||
pluginDir.setFilter(QDir::Files);
|
||||
if (pluginDir.exists()) {
|
||||
qInfo() << "Loading runtime plugins from " << pluginPath;
|
||||
|
|
|
@ -79,7 +79,7 @@ public:
|
|||
};
|
||||
|
||||
RenderArgs(std::shared_ptr<gpu::Context> context = nullptr,
|
||||
OctreeRenderer* renderer = nullptr,
|
||||
QSharedPointer<OctreeRenderer> renderer = QSharedPointer<OctreeRenderer>(nullptr),
|
||||
float sizeScale = 1.0f,
|
||||
int boundaryLevelAdjust = 0,
|
||||
RenderMode renderMode = DEFAULT_RENDER_MODE,
|
||||
|
@ -110,7 +110,7 @@ public:
|
|||
std::shared_ptr<gpu::Context> _context = nullptr;
|
||||
std::shared_ptr<gpu::Framebuffer> _blitFramebuffer = nullptr;
|
||||
std::shared_ptr<render::ShapePipeline> _pipeline = nullptr;
|
||||
OctreeRenderer* _renderer = nullptr;
|
||||
QSharedPointer<OctreeRenderer> _renderer;
|
||||
std::stack<ViewFrustum> _viewFrustums;
|
||||
glm::ivec4 _viewport{ 0.0f, 0.0f, 1.0f, 1.0f };
|
||||
glm::vec3 _boomOffset{ 0.0f, 0.0f, 1.0f };
|
||||
|
|
|
@ -868,6 +868,12 @@ function onContentLoaded() {
|
|||
homeServer.start();
|
||||
}
|
||||
|
||||
// If we were launched with the launchInterface option, then we need to launch interface now
|
||||
if (argv.launchInterface) {
|
||||
log.debug("Interface launch requested... argv.launchInterface:", argv.launchInterface);
|
||||
startInterface();
|
||||
}
|
||||
|
||||
// If we were launched with the shutdownWatcher option, then we need to watch for the interface app
|
||||
// shutting down. The interface app will regularly update a running state file which we will check.
|
||||
// If the file doesn't exist or stops updating for a significant amount of time, we will shut down.
|
||||
|
|
|
@ -3,7 +3,7 @@ AUTOSCRIBE_SHADER_LIB(gpu model render-utils)
|
|||
# This is not a testcase -- just set it up as a regular hifi project
|
||||
setup_hifi_project(Quick Gui OpenGL Script Widgets)
|
||||
set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "Tests/manual-tests/")
|
||||
link_hifi_libraries(networking gl gpu gpu-gl procedural shared fbx model model-networking animation script-engine render render-utils )
|
||||
link_hifi_libraries(networking gl gpu gpu-gl procedural shared fbx model model-networking animation script-engine render render-utils octree )
|
||||
package_libraries_for_deployment()
|
||||
|
||||
target_nsight()
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include <QtCore/QFile>
|
||||
|
||||
#include <FBXReader.h>
|
||||
#include <OctreeRenderer.h>
|
||||
|
||||
struct MyVertex {
|
||||
vec3 position;
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include <DeferredLightingEffect.h>
|
||||
#include <FramebufferCache.h>
|
||||
#include <TextureCache.h>
|
||||
#include <OctreeRenderer.h>
|
||||
|
||||
#ifdef DEFERRED_LIGHTING
|
||||
extern void initDeferredPipelines(render::ShapePlumber& plumber);
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
#include <TextureCache.h>
|
||||
#include <PerfStat.h>
|
||||
#include <PathUtils.h>
|
||||
#include <OctreeRenderer.h>
|
||||
#include <RenderArgs.h>
|
||||
#include <ViewFrustum.h>
|
||||
|
||||
|
|
|
@ -642,7 +642,7 @@ private:
|
|||
_renderCount = _renderThread._presentCount.load();
|
||||
update();
|
||||
|
||||
RenderArgs renderArgs(_renderThread._gpuContext, _octree.data(), DEFAULT_OCTREE_SIZE_SCALE,
|
||||
RenderArgs renderArgs(_renderThread._gpuContext, _octree, DEFAULT_OCTREE_SIZE_SCALE,
|
||||
0, RenderArgs::DEFAULT_RENDER_MODE,
|
||||
RenderArgs::MONO, RenderArgs::RENDER_DEBUG_NONE);
|
||||
|
||||
|
|
|
@ -971,6 +971,7 @@ TutorialManager = function() {
|
|||
var currentStep = null;
|
||||
var startedTutorialAt = 0;
|
||||
var startedLastStepAt = 0;
|
||||
var didFinishTutorial = false;
|
||||
|
||||
var wentToEntryStepNum;
|
||||
var VERSION = 1;
|
||||
|
@ -1032,6 +1033,7 @@ TutorialManager = function() {
|
|||
info("DONE WITH TUTORIAL");
|
||||
currentStepNum = -1;
|
||||
currentStep = null;
|
||||
didFinishTutorial = true;
|
||||
return false;
|
||||
} else {
|
||||
info("Starting step", currentStepNum);
|
||||
|
@ -1069,8 +1071,11 @@ TutorialManager = function() {
|
|||
// This is a message sent from the "entry" portal in the courtyard,
|
||||
// after the tutorial has finished.
|
||||
this.enteredEntryPortal = function() {
|
||||
info("Got enteredEntryPortal, tracking");
|
||||
this.trackStep("wentToEntry", wentToEntryStepNum);
|
||||
info("Got enteredEntryPortal");
|
||||
if (didFinishTutorial) {
|
||||
info("Tracking wentToEntry");
|
||||
this.trackStep("wentToEntry", wentToEntryStepNum);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue