mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 05:17:02 +02:00
Merge branch 'master' of github.com:highfidelity/hifi into improveFontLoading
This commit is contained in:
commit
877fa52034
10 changed files with 63 additions and 17 deletions
Binary file not shown.
|
@ -257,7 +257,11 @@ Item {
|
||||||
id: octreeCol
|
id: octreeCol
|
||||||
spacing: 4; x: 4; y: 4;
|
spacing: 4; x: 4; y: 4;
|
||||||
StatText {
|
StatText {
|
||||||
text: "Engine: " + root.engineFrameTime.toFixed(1) + " ms"
|
text: "Render Engine: " + root.engineFrameTime.toFixed(1) + " ms"
|
||||||
|
}
|
||||||
|
StatText {
|
||||||
|
visible: root.expanded
|
||||||
|
text: root.renderEngineStats
|
||||||
}
|
}
|
||||||
StatText {
|
StatText {
|
||||||
text: "Batch: " + root.batchFrameTime.toFixed(1) + " ms"
|
text: "Batch: " + root.batchFrameTime.toFixed(1) + " ms"
|
||||||
|
|
|
@ -187,9 +187,10 @@ Windows.ScrollingWindow {
|
||||||
var textures = JSON.stringify({ "tex.picture": defaultURL});
|
var textures = JSON.stringify({ "tex.picture": defaultURL});
|
||||||
var shapeType = "box";
|
var shapeType = "box";
|
||||||
var dynamic = false;
|
var dynamic = false;
|
||||||
|
var collisionless = true;
|
||||||
var position = Vec3.sum(MyAvatar.position, Vec3.multiply(2, Quat.getForward(MyAvatar.orientation)));
|
var position = Vec3.sum(MyAvatar.position, Vec3.multiply(2, Quat.getForward(MyAvatar.orientation)));
|
||||||
var gravity = Vec3.multiply(Vec3.fromPolar(Math.PI / 2, 0), 0);
|
var gravity = Vec3.multiply(Vec3.fromPolar(Math.PI / 2, 0), 0);
|
||||||
Entities.addModelEntity(name, modelURL, textures, shapeType, dynamic, position, gravity);
|
Entities.addModelEntity(name, modelURL, textures, shapeType, dynamic, collisionless, position, gravity);
|
||||||
} else {
|
} else {
|
||||||
var SHAPE_TYPE_NONE = 0;
|
var SHAPE_TYPE_NONE = 0;
|
||||||
var SHAPE_TYPE_SIMPLE_HULL = 1;
|
var SHAPE_TYPE_SIMPLE_HULL = 1;
|
||||||
|
@ -234,6 +235,7 @@ Windows.ScrollingWindow {
|
||||||
var result = JSON.parse(jsonResult);
|
var result = JSON.parse(jsonResult);
|
||||||
var url = result.textInput.trim();
|
var url = result.textInput.trim();
|
||||||
var shapeType;
|
var shapeType;
|
||||||
|
var collisionless = false;
|
||||||
switch (result.comboBox) {
|
switch (result.comboBox) {
|
||||||
case SHAPE_TYPE_SIMPLE_HULL:
|
case SHAPE_TYPE_SIMPLE_HULL:
|
||||||
shapeType = "simple-hull";
|
shapeType = "simple-hull";
|
||||||
|
@ -252,6 +254,7 @@ Windows.ScrollingWindow {
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
shapeType = "none";
|
shapeType = "none";
|
||||||
|
collisionless = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
var dynamic = result.checkBox !== null ? result.checkBox : DYNAMIC_DEFAULT;
|
var dynamic = result.checkBox !== null ? result.checkBox : DYNAMIC_DEFAULT;
|
||||||
|
@ -273,7 +276,7 @@ Windows.ScrollingWindow {
|
||||||
print("Asset browser - adding asset " + url + " (" + name + ") to world.");
|
print("Asset browser - adding asset " + url + " (" + name + ") to world.");
|
||||||
|
|
||||||
// Entities.addEntity doesn't work from QML, so we use this.
|
// Entities.addEntity doesn't work from QML, so we use this.
|
||||||
Entities.addModelEntity(name, url, "", shapeType, dynamic, addPosition, gravity);
|
Entities.addModelEntity(name, url, "", shapeType, dynamic, collisionless, addPosition, gravity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -144,7 +144,7 @@ Rectangle {
|
||||||
}
|
}
|
||||||
|
|
||||||
function canAddToWorld(path) {
|
function canAddToWorld(path) {
|
||||||
var supportedExtensions = [/\.fbx\b/i, /\.obj\b/i];
|
var supportedExtensions = [/\.fbx\b/i, /\.obj\b/i, /\.jpg\b/i, /\.png\b/i];
|
||||||
|
|
||||||
if (selectedItemCount > 1) {
|
if (selectedItemCount > 1) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -188,9 +188,10 @@ Rectangle {
|
||||||
var textures = JSON.stringify({ "tex.picture": defaultURL});
|
var textures = JSON.stringify({ "tex.picture": defaultURL});
|
||||||
var shapeType = "box";
|
var shapeType = "box";
|
||||||
var dynamic = false;
|
var dynamic = false;
|
||||||
|
var collisionless = true;
|
||||||
var position = Vec3.sum(MyAvatar.position, Vec3.multiply(2, Quat.getForward(MyAvatar.orientation)));
|
var position = Vec3.sum(MyAvatar.position, Vec3.multiply(2, Quat.getForward(MyAvatar.orientation)));
|
||||||
var gravity = Vec3.multiply(Vec3.fromPolar(Math.PI / 2, 0), 0);
|
var gravity = Vec3.multiply(Vec3.fromPolar(Math.PI / 2, 0), 0);
|
||||||
Entities.addModelEntity(name, modelURL, textures, shapeType, dynamic, position, gravity);
|
Entities.addModelEntity(name, modelURL, textures, shapeType, dynamic, collisionless, position, gravity);
|
||||||
} else {
|
} else {
|
||||||
var SHAPE_TYPE_NONE = 0;
|
var SHAPE_TYPE_NONE = 0;
|
||||||
var SHAPE_TYPE_SIMPLE_HULL = 1;
|
var SHAPE_TYPE_SIMPLE_HULL = 1;
|
||||||
|
@ -235,6 +236,7 @@ Rectangle {
|
||||||
var result = JSON.parse(jsonResult);
|
var result = JSON.parse(jsonResult);
|
||||||
var url = result.textInput.trim();
|
var url = result.textInput.trim();
|
||||||
var shapeType;
|
var shapeType;
|
||||||
|
var collisionless = false;
|
||||||
switch (result.comboBox) {
|
switch (result.comboBox) {
|
||||||
case SHAPE_TYPE_SIMPLE_HULL:
|
case SHAPE_TYPE_SIMPLE_HULL:
|
||||||
shapeType = "simple-hull";
|
shapeType = "simple-hull";
|
||||||
|
@ -253,6 +255,7 @@ Rectangle {
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
shapeType = "none";
|
shapeType = "none";
|
||||||
|
collisionless = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
var dynamic = result.checkBox !== null ? result.checkBox : DYNAMIC_DEFAULT;
|
var dynamic = result.checkBox !== null ? result.checkBox : DYNAMIC_DEFAULT;
|
||||||
|
@ -274,7 +277,7 @@ Rectangle {
|
||||||
print("Asset browser - adding asset " + url + " (" + name + ") to world.");
|
print("Asset browser - adding asset " + url + " (" + name + ") to world.");
|
||||||
|
|
||||||
// Entities.addEntity doesn't work from QML, so we use this.
|
// Entities.addEntity doesn't work from QML, so we use this.
|
||||||
Entities.addModelEntity(name, url, "", shapeType, dynamic, addPosition, gravity);
|
Entities.addModelEntity(name, url, "", shapeType, dynamic, collisionless, addPosition, gravity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -6677,8 +6677,8 @@ void Application::addAssetToWorldSetMapping(QString filePath, QString mapping, Q
|
||||||
addAssetToWorldError(filenameFromPath(filePath), errorInfo);
|
addAssetToWorldError(filenameFromPath(filePath), errorInfo);
|
||||||
} else {
|
} else {
|
||||||
// to prevent files that aren't models from being loaded into world automatically
|
// to prevent files that aren't models from being loaded into world automatically
|
||||||
if (filePath.endsWith(OBJ_EXTENSION) || filePath.endsWith(FBX_EXTENSION) ||
|
if (filePath.toLower().endsWith(OBJ_EXTENSION) || filePath.toLower().endsWith(FBX_EXTENSION) ||
|
||||||
filePath.endsWith(JPG_EXTENSION) || filePath.endsWith(PNG_EXTENSION)) {
|
filePath.toLower().endsWith(JPG_EXTENSION) || filePath.toLower().endsWith(PNG_EXTENSION)) {
|
||||||
addAssetToWorldAddEntity(filePath, mapping);
|
addAssetToWorldAddEntity(filePath, mapping);
|
||||||
} else {
|
} else {
|
||||||
qCDebug(interfaceapp) << "Zipped contents are not supported entity files";
|
qCDebug(interfaceapp) << "Zipped contents are not supported entity files";
|
||||||
|
@ -6695,7 +6695,7 @@ void Application::addAssetToWorldAddEntity(QString filePath, QString mapping) {
|
||||||
EntityItemProperties properties;
|
EntityItemProperties properties;
|
||||||
properties.setType(EntityTypes::Model);
|
properties.setType(EntityTypes::Model);
|
||||||
properties.setName(mapping.right(mapping.length() - 1));
|
properties.setName(mapping.right(mapping.length() - 1));
|
||||||
if (filePath.endsWith(PNG_EXTENSION) || filePath.endsWith(JPG_EXTENSION)) {
|
if (filePath.toLower().endsWith(PNG_EXTENSION) || filePath.toLower().endsWith(JPG_EXTENSION)) {
|
||||||
QJsonObject textures {
|
QJsonObject textures {
|
||||||
{"tex.picture", QString("atp:" + mapping) }
|
{"tex.picture", QString("atp:" + mapping) }
|
||||||
};
|
};
|
||||||
|
@ -6791,7 +6791,9 @@ void Application::addAssetToWorldCheckModelSize() {
|
||||||
EntityItemProperties properties;
|
EntityItemProperties properties;
|
||||||
properties.setDimensions(dimensions);
|
properties.setDimensions(dimensions);
|
||||||
properties.setVisible(true);
|
properties.setVisible(true);
|
||||||
properties.setCollisionless(false);
|
if (!name.toLower().endsWith(PNG_EXTENSION) && !name.toLower().endsWith(JPG_EXTENSION)) {
|
||||||
|
properties.setCollisionless(false);
|
||||||
|
}
|
||||||
properties.setUserData(GRABBABLE_USER_DATA);
|
properties.setUserData(GRABBABLE_USER_DATA);
|
||||||
properties.setLastEdited(usecTimestampNow());
|
properties.setLastEdited(usecTimestampNow());
|
||||||
entityScriptingInterface->editEntity(entityID, properties);
|
entityScriptingInterface->editEntity(entityID, properties);
|
||||||
|
|
|
@ -482,7 +482,7 @@ void Stats::updateStats(bool force) {
|
||||||
float dt = (float)itr.value().getMovingAverage() / (float)USECS_PER_MSEC;
|
float dt = (float)itr.value().getMovingAverage() / (float)USECS_PER_MSEC;
|
||||||
_gameUpdateStats = QString("/idle/update = %1 ms").arg(dt);
|
_gameUpdateStats = QString("/idle/update = %1 ms").arg(dt);
|
||||||
|
|
||||||
QVector<QString> categories = { "devices", "physics", "otherAvatars", "MyAvatar", "misc" };
|
QVector<QString> categories = { "devices", "physics", "otherAvatars", "MyAvatar", "pickManager", "postUpdateLambdas", "misc" };
|
||||||
for (int32_t j = 0; j < categories.size(); ++j) {
|
for (int32_t j = 0; j < categories.size(); ++j) {
|
||||||
QString recordKey = "/idle/update/" + categories[j];
|
QString recordKey = "/idle/update/" + categories[j];
|
||||||
itr = allRecords.find(recordKey);
|
itr = allRecords.find(recordKey);
|
||||||
|
@ -502,10 +502,39 @@ void Stats::updateStats(bool force) {
|
||||||
_gameUpdateStats = "";
|
_gameUpdateStats = "";
|
||||||
emit gameUpdateStatsChanged();
|
emit gameUpdateStatsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
itr = allRecords.find("/paintGL/display/EngineRun/Engine");
|
||||||
|
std::priority_queue<SortableStat> renderEngineStats;
|
||||||
|
if (itr != allRecords.end()) {
|
||||||
|
float dt = (float)itr.value().getMovingAverage() / (float)USECS_PER_MSEC;
|
||||||
|
_renderEngineStats = QString("/render = %1 ms").arg(dt);
|
||||||
|
|
||||||
|
QVector<QString> categories = { "RenderMainView", "SecondaryCameraJob", "UpdateScene"};
|
||||||
|
for (int32_t j = 0; j < categories.size(); ++j) {
|
||||||
|
QString recordKey = "/paintGL/display/EngineRun/Engine/" + categories[j];
|
||||||
|
itr = allRecords.find(recordKey);
|
||||||
|
if (itr != allRecords.end()) {
|
||||||
|
float dt = (float)itr.value().getMovingAverage() / (float)USECS_PER_MSEC;
|
||||||
|
QString message = QString("\n %1 = %2").arg(categories[j]).arg(dt);
|
||||||
|
renderEngineStats.push(SortableStat(message, dt));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (!renderEngineStats.empty()) {
|
||||||
|
SortableStat stat = renderEngineStats.top();
|
||||||
|
_renderEngineStats += stat.message;
|
||||||
|
renderEngineStats.pop();
|
||||||
|
}
|
||||||
|
emit renderEngineStatsChanged();
|
||||||
|
} else if (_renderEngineStats != "") {
|
||||||
|
_renderEngineStats = "";
|
||||||
|
emit renderEngineStatsChanged();
|
||||||
|
}
|
||||||
} else if (_showGameUpdateStats) {
|
} else if (_showGameUpdateStats) {
|
||||||
_showGameUpdateStats = false;
|
_showGameUpdateStats = false;
|
||||||
_gameUpdateStats = "";
|
_gameUpdateStats = "";
|
||||||
|
_renderEngineStats = "";
|
||||||
emit gameUpdateStatsChanged();
|
emit gameUpdateStatsChanged();
|
||||||
|
emit renderEngineStatsChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -106,6 +106,7 @@ class Stats : public QQuickItem {
|
||||||
STATS_PROPERTY(QString, lodStatus, QString())
|
STATS_PROPERTY(QString, lodStatus, QString())
|
||||||
STATS_PROPERTY(QString, timingStats, QString())
|
STATS_PROPERTY(QString, timingStats, QString())
|
||||||
STATS_PROPERTY(QString, gameUpdateStats, QString())
|
STATS_PROPERTY(QString, gameUpdateStats, QString())
|
||||||
|
STATS_PROPERTY(QString, renderEngineStats, QString())
|
||||||
STATS_PROPERTY(int, serverElements, 0)
|
STATS_PROPERTY(int, serverElements, 0)
|
||||||
STATS_PROPERTY(int, serverInternal, 0)
|
STATS_PROPERTY(int, serverInternal, 0)
|
||||||
STATS_PROPERTY(int, serverLeaves, 0)
|
STATS_PROPERTY(int, serverLeaves, 0)
|
||||||
|
@ -239,6 +240,7 @@ signals:
|
||||||
void localLeavesChanged();
|
void localLeavesChanged();
|
||||||
void timingStatsChanged();
|
void timingStatsChanged();
|
||||||
void gameUpdateStatsChanged();
|
void gameUpdateStatsChanged();
|
||||||
|
void renderEngineStatsChanged();
|
||||||
void glContextSwapchainMemoryChanged();
|
void glContextSwapchainMemoryChanged();
|
||||||
void qmlTextureMemoryChanged();
|
void qmlTextureMemoryChanged();
|
||||||
void texturePendingTransfersChanged();
|
void texturePendingTransfersChanged();
|
||||||
|
|
|
@ -304,8 +304,9 @@ QUuid EntityScriptingInterface::addEntity(const EntityItemProperties& properties
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QUuid EntityScriptingInterface::addModelEntity(const QString& name, const QString& modelUrl, const QString& textures, const QString& shapeType,
|
QUuid EntityScriptingInterface::addModelEntity(const QString& name, const QString& modelUrl, const QString& textures,
|
||||||
bool dynamic, const glm::vec3& position, const glm::vec3& gravity) {
|
const QString& shapeType, bool dynamic, bool collisionless,
|
||||||
|
const glm::vec3& position, const glm::vec3& gravity) {
|
||||||
_activityTracking.addedEntityCount++;
|
_activityTracking.addedEntityCount++;
|
||||||
|
|
||||||
EntityItemProperties properties;
|
EntityItemProperties properties;
|
||||||
|
@ -314,6 +315,7 @@ QUuid EntityScriptingInterface::addModelEntity(const QString& name, const QStrin
|
||||||
properties.setModelURL(modelUrl);
|
properties.setModelURL(modelUrl);
|
||||||
properties.setShapeTypeFromString(shapeType);
|
properties.setShapeTypeFromString(shapeType);
|
||||||
properties.setDynamic(dynamic);
|
properties.setDynamic(dynamic);
|
||||||
|
properties.setCollisionless(collisionless);
|
||||||
properties.setPosition(position);
|
properties.setPosition(position);
|
||||||
properties.setGravity(gravity);
|
properties.setGravity(gravity);
|
||||||
if (!textures.isEmpty()) {
|
if (!textures.isEmpty()) {
|
||||||
|
|
|
@ -165,7 +165,7 @@ public slots:
|
||||||
/// temporary method until addEntity can be used from QJSEngine
|
/// temporary method until addEntity can be used from QJSEngine
|
||||||
/// Deliberately not adding jsdoc, only used internally.
|
/// Deliberately not adding jsdoc, only used internally.
|
||||||
Q_INVOKABLE QUuid addModelEntity(const QString& name, const QString& modelUrl, const QString& textures, const QString& shapeType, bool dynamic,
|
Q_INVOKABLE QUuid addModelEntity(const QString& name, const QString& modelUrl, const QString& textures, const QString& shapeType, bool dynamic,
|
||||||
const glm::vec3& position, const glm::vec3& gravity);
|
bool collisionless, const glm::vec3& position, const glm::vec3& gravity);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Return the properties for the specified {EntityID}.
|
* Return the properties for the specified {EntityID}.
|
||||||
|
|
|
@ -565,11 +565,12 @@ var toolBar = (function () {
|
||||||
createNewEntity({
|
createNewEntity({
|
||||||
type: "Model",
|
type: "Model",
|
||||||
dimensions: {
|
dimensions: {
|
||||||
x: 4.16,
|
x: 0.5385,
|
||||||
y: 0.02,
|
y: 0.2819,
|
||||||
z: 2.58
|
z: 0.0092
|
||||||
},
|
},
|
||||||
shapeType: "box",
|
shapeType: "box",
|
||||||
|
collisionless: true,
|
||||||
modelURL: IMAGE_MODEL,
|
modelURL: IMAGE_MODEL,
|
||||||
textures: JSON.stringify({ "tex.picture": DEFAULT_IMAGE })
|
textures: JSON.stringify({ "tex.picture": DEFAULT_IMAGE })
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue