mirror of
https://github.com/JulianGro/overte.git
synced 2025-05-08 23:19:35 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi into Case20410
This commit is contained in:
commit
959b8bfbed
4 changed files with 39 additions and 29 deletions
|
@ -26,11 +26,10 @@ QUrl getBakeableModelURL(const QUrl& url) {
|
||||||
GLTF_EXTENSION
|
GLTF_EXTENSION
|
||||||
};
|
};
|
||||||
|
|
||||||
QUrl cleanURL = url.adjusted(QUrl::RemoveQuery | QUrl::RemoveFragment);
|
QString filename = url.fileName();
|
||||||
QString cleanURLString = cleanURL.fileName();
|
|
||||||
for (auto& extension : extensionsToBake) {
|
for (auto& extension : extensionsToBake) {
|
||||||
if (cleanURLString.endsWith(extension, Qt::CaseInsensitive)) {
|
if (filename.endsWith(extension, Qt::CaseInsensitive)) {
|
||||||
return cleanURL;
|
return url;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,10 +38,10 @@ PacketVersion versionForPacketType(PacketType packetType) {
|
||||||
return static_cast<PacketVersion>(EntityQueryPacketVersion::ConicalFrustums);
|
return static_cast<PacketVersion>(EntityQueryPacketVersion::ConicalFrustums);
|
||||||
case PacketType::AvatarIdentity:
|
case PacketType::AvatarIdentity:
|
||||||
case PacketType::AvatarData:
|
case PacketType::AvatarData:
|
||||||
return static_cast<PacketVersion>(AvatarMixerPacketVersion::SendMaxTranslationDimension);
|
return static_cast<PacketVersion>(AvatarMixerPacketVersion::FBXJointOrderChange);
|
||||||
case PacketType::BulkAvatarData:
|
case PacketType::BulkAvatarData:
|
||||||
case PacketType::KillAvatar:
|
case PacketType::KillAvatar:
|
||||||
return static_cast<PacketVersion>(AvatarMixerPacketVersion::SendMaxTranslationDimension);
|
return static_cast<PacketVersion>(AvatarMixerPacketVersion::FBXJointOrderChange);
|
||||||
case PacketType::MessagesData:
|
case PacketType::MessagesData:
|
||||||
return static_cast<PacketVersion>(MessageDataVersion::TextOrBinaryData);
|
return static_cast<PacketVersion>(MessageDataVersion::TextOrBinaryData);
|
||||||
// ICE packets
|
// ICE packets
|
||||||
|
|
|
@ -328,7 +328,8 @@ enum class AvatarMixerPacketVersion : PacketVersion {
|
||||||
CollisionFlag,
|
CollisionFlag,
|
||||||
AvatarTraitsAck,
|
AvatarTraitsAck,
|
||||||
FasterAvatarEntities,
|
FasterAvatarEntities,
|
||||||
SendMaxTranslationDimension
|
SendMaxTranslationDimension,
|
||||||
|
FBXJointOrderChange
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class DomainConnectRequestVersion : PacketVersion {
|
enum class DomainConnectRequestVersion : PacketVersion {
|
||||||
|
|
|
@ -282,6 +282,28 @@ function checkEditPermissionsAndUpdate() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Copies the properties in `b` into `a`. `a` will be modified.
|
||||||
|
function copyProperties(a, b) {
|
||||||
|
for (var key in b) {
|
||||||
|
a[key] = b[key];
|
||||||
|
}
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
|
||||||
|
const DEFAULT_DYNAMIC_PROPERTIES = {
|
||||||
|
dynamic: true,
|
||||||
|
damping: 0.39347,
|
||||||
|
angularDamping: 0.39347,
|
||||||
|
gravity: { x: 0, y: -9.8, z: 0 },
|
||||||
|
};
|
||||||
|
|
||||||
|
const DEFAULT_NON_DYNAMIC_PROPERTIES = {
|
||||||
|
dynamic: false,
|
||||||
|
damping: 0,
|
||||||
|
angularDamping: 0,
|
||||||
|
gravity: { x: 0, y: 0, z: 0 },
|
||||||
|
};
|
||||||
|
|
||||||
const DEFAULT_ENTITY_PROPERTIES = {
|
const DEFAULT_ENTITY_PROPERTIES = {
|
||||||
All: {
|
All: {
|
||||||
description: "",
|
description: "",
|
||||||
|
@ -299,26 +321,14 @@ const DEFAULT_ENTITY_PROPERTIES = {
|
||||||
y: 0,
|
y: 0,
|
||||||
z: 0
|
z: 0
|
||||||
},
|
},
|
||||||
damping: 0,
|
|
||||||
angularVelocity: {
|
angularVelocity: {
|
||||||
x: 0,
|
x: 0,
|
||||||
y: 0,
|
y: 0,
|
||||||
z: 0
|
z: 0
|
||||||
},
|
},
|
||||||
angularDamping: 0,
|
|
||||||
restitution: 0.5,
|
restitution: 0.5,
|
||||||
friction: 0.5,
|
friction: 0.5,
|
||||||
density: 1000,
|
density: 1000,
|
||||||
gravity: {
|
|
||||||
x: 0,
|
|
||||||
y: 0,
|
|
||||||
z: 0
|
|
||||||
},
|
|
||||||
acceleration: {
|
|
||||||
x: 0,
|
|
||||||
y: 0,
|
|
||||||
z: 0
|
|
||||||
},
|
|
||||||
dynamic: false,
|
dynamic: false,
|
||||||
},
|
},
|
||||||
Shape: {
|
Shape: {
|
||||||
|
@ -484,11 +494,6 @@ var toolBar = (function () {
|
||||||
dialogWindow = null,
|
dialogWindow = null,
|
||||||
tablet = null;
|
tablet = null;
|
||||||
|
|
||||||
function applyProperties(originalProperties, newProperties) {
|
|
||||||
for (var key in newProperties) {
|
|
||||||
originalProperties[key] = newProperties[key];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function createNewEntity(requestedProperties) {
|
function createNewEntity(requestedProperties) {
|
||||||
var dimensions = requestedProperties.dimensions ? requestedProperties.dimensions : DEFAULT_DIMENSIONS;
|
var dimensions = requestedProperties.dimensions ? requestedProperties.dimensions : DEFAULT_DIMENSIONS;
|
||||||
var position = getPositionToCreateEntity();
|
var position = getPositionToCreateEntity();
|
||||||
|
@ -496,17 +501,23 @@ var toolBar = (function () {
|
||||||
|
|
||||||
var properties = {};
|
var properties = {};
|
||||||
|
|
||||||
applyProperties(properties, DEFAULT_ENTITY_PROPERTIES.All);
|
copyProperties(properties, DEFAULT_ENTITY_PROPERTIES.All);
|
||||||
|
|
||||||
var type = requestedProperties.type;
|
var type = requestedProperties.type;
|
||||||
if (type === "Box" || type === "Sphere") {
|
if (type === "Box" || type === "Sphere") {
|
||||||
applyProperties(properties, DEFAULT_ENTITY_PROPERTIES.Shape);
|
copyProperties(properties, DEFAULT_ENTITY_PROPERTIES.Shape);
|
||||||
} else {
|
} else {
|
||||||
applyProperties(properties, DEFAULT_ENTITY_PROPERTIES[type]);
|
copyProperties(properties, DEFAULT_ENTITY_PROPERTIES[type]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// We apply the requested properties first so that they take priority over any default properties.
|
// We apply the requested properties first so that they take priority over any default properties.
|
||||||
applyProperties(properties, requestedProperties);
|
copyProperties(properties, requestedProperties);
|
||||||
|
|
||||||
|
if (properties.dynamic) {
|
||||||
|
copyProperties(properties, DEFAULT_DYNAMIC_PROPERTIES);
|
||||||
|
} else {
|
||||||
|
copyProperties(properties, DEFAULT_NON_DYNAMIC_PROPERTIES);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (position !== null && position !== undefined) {
|
if (position !== null && position !== undefined) {
|
||||||
|
@ -675,7 +686,6 @@ var toolBar = (function () {
|
||||||
grabbable: result.grabbable
|
grabbable: result.grabbable
|
||||||
},
|
},
|
||||||
dynamic: dynamic,
|
dynamic: dynamic,
|
||||||
gravity: dynamic ? { x: 0, y: -10, z: 0 } : { x: 0, y: 0, z: 0 }
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue