mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 19:41:20 +02:00
MS15529: Add secondary camera snapshot notification flag
This commit is contained in:
parent
ed8d12593d
commit
96858c9586
6 changed files with 28 additions and 18 deletions
|
@ -7652,18 +7652,18 @@ void Application::takeSnapshot(bool notify, bool includeAnimated, float aspectRa
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::takeSecondaryCameraSnapshot(const QString& filename) {
|
void Application::takeSecondaryCameraSnapshot(const bool& notify, const QString& filename) {
|
||||||
postLambdaEvent([filename, this] {
|
postLambdaEvent([notify, filename, this] {
|
||||||
QString snapshotPath = DependencyManager::get<Snapshot>()->saveSnapshot(getActiveDisplayPlugin()->getSecondaryCameraScreenshot(), filename,
|
QString snapshotPath = DependencyManager::get<Snapshot>()->saveSnapshot(getActiveDisplayPlugin()->getSecondaryCameraScreenshot(), filename,
|
||||||
TestScriptingInterface::getInstance()->getTestResultsLocation());
|
TestScriptingInterface::getInstance()->getTestResultsLocation());
|
||||||
|
|
||||||
emit DependencyManager::get<WindowScriptingInterface>()->stillSnapshotTaken(snapshotPath, true);
|
emit DependencyManager::get<WindowScriptingInterface>()->stillSnapshotTaken(snapshotPath, notify);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::takeSecondaryCamera360Snapshot(const glm::vec3& cameraPosition, const bool& cubemapOutputFormat, const QString& filename) {
|
void Application::takeSecondaryCamera360Snapshot(const glm::vec3& cameraPosition, const bool& cubemapOutputFormat, const bool& notify, const QString& filename) {
|
||||||
postLambdaEvent([filename, cubemapOutputFormat, cameraPosition] {
|
postLambdaEvent([notify, filename, cubemapOutputFormat, cameraPosition] {
|
||||||
DependencyManager::get<Snapshot>()->save360Snapshot(cameraPosition, cubemapOutputFormat, filename);
|
DependencyManager::get<Snapshot>()->save360Snapshot(cameraPosition, cubemapOutputFormat, notify, filename);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -281,8 +281,11 @@ public:
|
||||||
float getGameLoopRate() const { return _gameLoopCounter.rate(); }
|
float getGameLoopRate() const { return _gameLoopCounter.rate(); }
|
||||||
|
|
||||||
void takeSnapshot(bool notify, bool includeAnimated = false, float aspectRatio = 0.0f, const QString& filename = QString());
|
void takeSnapshot(bool notify, bool includeAnimated = false, float aspectRatio = 0.0f, const QString& filename = QString());
|
||||||
void takeSecondaryCameraSnapshot(const QString& filename = QString());
|
void takeSecondaryCameraSnapshot(const bool& notify, const QString& filename = QString());
|
||||||
void takeSecondaryCamera360Snapshot(const glm::vec3& cameraPosition, const bool& cubemapOutputFormat, const QString& filename = QString());
|
void takeSecondaryCamera360Snapshot(const glm::vec3& cameraPosition,
|
||||||
|
const bool& cubemapOutputFormat,
|
||||||
|
const bool& notify,
|
||||||
|
const QString& filename = QString());
|
||||||
|
|
||||||
void shareSnapshot(const QString& filename, const QUrl& href = QUrl(""));
|
void shareSnapshot(const QString& filename, const QUrl& href = QUrl(""));
|
||||||
|
|
||||||
|
|
|
@ -446,12 +446,12 @@ void WindowScriptingInterface::takeSnapshot(bool notify, bool includeAnimated, f
|
||||||
qApp->takeSnapshot(notify, includeAnimated, aspectRatio, filename);
|
qApp->takeSnapshot(notify, includeAnimated, aspectRatio, filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowScriptingInterface::takeSecondaryCameraSnapshot(const QString& filename) {
|
void WindowScriptingInterface::takeSecondaryCameraSnapshot(const bool& notify, const QString& filename) {
|
||||||
qApp->takeSecondaryCameraSnapshot(filename);
|
qApp->takeSecondaryCameraSnapshot(notify, filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowScriptingInterface::takeSecondaryCamera360Snapshot(const glm::vec3& cameraPosition, const bool& cubemapOutputFormat, const QString& filename) {
|
void WindowScriptingInterface::takeSecondaryCamera360Snapshot(const glm::vec3& cameraPosition, const bool& cubemapOutputFormat, const bool& notify, const QString& filename) {
|
||||||
qApp->takeSecondaryCamera360Snapshot(cameraPosition, cubemapOutputFormat, filename);
|
qApp->takeSecondaryCamera360Snapshot(cameraPosition, cubemapOutputFormat, notify, filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowScriptingInterface::shareSnapshot(const QString& path, const QUrl& href) {
|
void WindowScriptingInterface::shareSnapshot(const QString& path, const QUrl& href) {
|
||||||
|
|
|
@ -368,7 +368,7 @@ public slots:
|
||||||
*
|
*
|
||||||
* var filename = QString();
|
* var filename = QString();
|
||||||
*/
|
*/
|
||||||
void takeSecondaryCameraSnapshot(const QString& filename = QString());
|
void takeSecondaryCameraSnapshot(const bool& notify = true, const QString& filename = QString());
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Takes a 360 snapshot given a position of the secondary camera (which does not need to have been previously set up).
|
* Takes a 360 snapshot given a position of the secondary camera (which does not need to have been previously set up).
|
||||||
|
@ -382,7 +382,7 @@ public slots:
|
||||||
*
|
*
|
||||||
* var filename = QString();
|
* var filename = QString();
|
||||||
*/
|
*/
|
||||||
void takeSecondaryCamera360Snapshot(const glm::vec3& cameraPosition, const bool& cubemapOutputFormat = false, const QString& filename = QString());
|
void takeSecondaryCamera360Snapshot(const glm::vec3& cameraPosition, const bool& cubemapOutputFormat = false, const bool& notify = true, const QString& filename = QString());
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Emit a {@link Window.connectionAdded|connectionAdded} or a {@link Window.connectionError|connectionError} signal that
|
* Emit a {@link Window.connectionAdded|connectionAdded} or a {@link Window.connectionError|connectionError} signal that
|
||||||
|
|
|
@ -122,8 +122,9 @@ static const glm::quat CAMERA_ORIENTATION_LEFT(glm::quat(glm::radians(glm::vec3(
|
||||||
static const glm::quat CAMERA_ORIENTATION_BACK(glm::quat(glm::radians(glm::vec3(0.0f, 180.0f, 0.0f))));
|
static const glm::quat CAMERA_ORIENTATION_BACK(glm::quat(glm::radians(glm::vec3(0.0f, 180.0f, 0.0f))));
|
||||||
static const glm::quat CAMERA_ORIENTATION_RIGHT(glm::quat(glm::radians(glm::vec3(0.0f, 270.0f, 0.0f))));
|
static const glm::quat CAMERA_ORIENTATION_RIGHT(glm::quat(glm::radians(glm::vec3(0.0f, 270.0f, 0.0f))));
|
||||||
static const glm::quat CAMERA_ORIENTATION_UP(glm::quat(glm::radians(glm::vec3(90.0f, 0.0f, 0.0f))));
|
static const glm::quat CAMERA_ORIENTATION_UP(glm::quat(glm::radians(glm::vec3(90.0f, 0.0f, 0.0f))));
|
||||||
void Snapshot::save360Snapshot(const glm::vec3& cameraPosition, const bool& cubemapOutputFormat, const QString& filename) {
|
void Snapshot::save360Snapshot(const glm::vec3& cameraPosition, const bool& cubemapOutputFormat, const bool& notify, const QString& filename) {
|
||||||
_snapshotFilename = filename;
|
_snapshotFilename = filename;
|
||||||
|
_notify360 = notify;
|
||||||
_cubemapOutputFormat = cubemapOutputFormat;
|
_cubemapOutputFormat = cubemapOutputFormat;
|
||||||
SecondaryCameraJobConfig* secondaryCameraRenderConfig = static_cast<SecondaryCameraJobConfig*>(qApp->getRenderEngine()->getConfiguration()->getConfig("SecondaryCamera"));
|
SecondaryCameraJobConfig* secondaryCameraRenderConfig = static_cast<SecondaryCameraJobConfig*>(qApp->getRenderEngine()->getConfiguration()->getConfig("SecondaryCamera"));
|
||||||
|
|
||||||
|
@ -247,7 +248,8 @@ void Snapshot::convertToCubemap() {
|
||||||
|
|
||||||
painter.end();
|
painter.end();
|
||||||
|
|
||||||
emit DependencyManager::get<WindowScriptingInterface>()->snapshot360Taken(saveSnapshot(outputImage, _snapshotFilename), true);
|
emit DependencyManager::get<WindowScriptingInterface>()->snapshot360Taken(saveSnapshot(outputImage, _snapshotFilename),
|
||||||
|
_notify360);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Snapshot::convertToEquirectangular() {
|
void Snapshot::convertToEquirectangular() {
|
||||||
|
@ -327,7 +329,8 @@ void Snapshot::convertToEquirectangular() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
emit DependencyManager::get<WindowScriptingInterface>()->snapshot360Taken(saveSnapshot(outputImage, _snapshotFilename), true);
|
emit DependencyManager::get<WindowScriptingInterface>()->snapshot360Taken(saveSnapshot(outputImage, _snapshotFilename),
|
||||||
|
_notify360);
|
||||||
}
|
}
|
||||||
|
|
||||||
QTemporaryFile* Snapshot::saveTempSnapshot(QImage image) {
|
QTemporaryFile* Snapshot::saveTempSnapshot(QImage image) {
|
||||||
|
|
|
@ -50,7 +50,10 @@ class Snapshot : public QObject, public Dependency {
|
||||||
public:
|
public:
|
||||||
Snapshot();
|
Snapshot();
|
||||||
QString saveSnapshot(QImage image, const QString& filename, const QString& pathname = QString());
|
QString saveSnapshot(QImage image, const QString& filename, const QString& pathname = QString());
|
||||||
void save360Snapshot(const glm::vec3& cameraPosition, const bool& cubemapOutputFormat, const QString& filename);
|
void save360Snapshot(const glm::vec3& cameraPosition,
|
||||||
|
const bool& cubemapOutputFormat,
|
||||||
|
const bool& notify,
|
||||||
|
const QString& filename);
|
||||||
QTemporaryFile* saveTempSnapshot(QImage image);
|
QTemporaryFile* saveTempSnapshot(QImage image);
|
||||||
SnapshotMetaData* parseSnapshotData(QString snapshotPath);
|
SnapshotMetaData* parseSnapshotData(QString snapshotPath);
|
||||||
|
|
||||||
|
@ -89,6 +92,7 @@ private:
|
||||||
const QString& userSelectedFilename = QString(),
|
const QString& userSelectedFilename = QString(),
|
||||||
const QString& userSelectedPathname = QString());
|
const QString& userSelectedPathname = QString());
|
||||||
QString _snapshotFilename;
|
QString _snapshotFilename;
|
||||||
|
bool _notify360;
|
||||||
bool _cubemapOutputFormat;
|
bool _cubemapOutputFormat;
|
||||||
QTimer _snapshotTimer;
|
QTimer _snapshotTimer;
|
||||||
qint16 _snapshotIndex;
|
qint16 _snapshotIndex;
|
||||||
|
|
Loading…
Reference in a new issue