Merge branch 'master' of https://github.com/highfidelity/hifi into Case20410

This commit is contained in:
Roxanne Skelly 2019-04-02 16:48:32 -07:00
commit 959b8bfbed
4 changed files with 39 additions and 29 deletions

View file

@ -26,11 +26,10 @@ QUrl getBakeableModelURL(const QUrl& url) {
GLTF_EXTENSION
};
QUrl cleanURL = url.adjusted(QUrl::RemoveQuery | QUrl::RemoveFragment);
QString cleanURLString = cleanURL.fileName();
QString filename = url.fileName();
for (auto& extension : extensionsToBake) {
if (cleanURLString.endsWith(extension, Qt::CaseInsensitive)) {
return cleanURL;
if (filename.endsWith(extension, Qt::CaseInsensitive)) {
return url;
}
}

View file

@ -38,10 +38,10 @@ PacketVersion versionForPacketType(PacketType packetType) {
return static_cast<PacketVersion>(EntityQueryPacketVersion::ConicalFrustums);
case PacketType::AvatarIdentity:
case PacketType::AvatarData:
return static_cast<PacketVersion>(AvatarMixerPacketVersion::SendMaxTranslationDimension);
return static_cast<PacketVersion>(AvatarMixerPacketVersion::FBXJointOrderChange);
case PacketType::BulkAvatarData:
case PacketType::KillAvatar:
return static_cast<PacketVersion>(AvatarMixerPacketVersion::SendMaxTranslationDimension);
return static_cast<PacketVersion>(AvatarMixerPacketVersion::FBXJointOrderChange);
case PacketType::MessagesData:
return static_cast<PacketVersion>(MessageDataVersion::TextOrBinaryData);
// ICE packets

View file

@ -328,7 +328,8 @@ enum class AvatarMixerPacketVersion : PacketVersion {
CollisionFlag,
AvatarTraitsAck,
FasterAvatarEntities,
SendMaxTranslationDimension
SendMaxTranslationDimension,
FBXJointOrderChange
};
enum class DomainConnectRequestVersion : PacketVersion {

View file

@ -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 = {
All: {
description: "",
@ -299,26 +321,14 @@ const DEFAULT_ENTITY_PROPERTIES = {
y: 0,
z: 0
},
damping: 0,
angularVelocity: {
x: 0,
y: 0,
z: 0
},
angularDamping: 0,
restitution: 0.5,
friction: 0.5,
density: 1000,
gravity: {
x: 0,
y: 0,
z: 0
},
acceleration: {
x: 0,
y: 0,
z: 0
},
dynamic: false,
},
Shape: {
@ -484,11 +494,6 @@ var toolBar = (function () {
dialogWindow = null,
tablet = null;
function applyProperties(originalProperties, newProperties) {
for (var key in newProperties) {
originalProperties[key] = newProperties[key];
}
}
function createNewEntity(requestedProperties) {
var dimensions = requestedProperties.dimensions ? requestedProperties.dimensions : DEFAULT_DIMENSIONS;
var position = getPositionToCreateEntity();
@ -496,17 +501,23 @@ var toolBar = (function () {
var properties = {};
applyProperties(properties, DEFAULT_ENTITY_PROPERTIES.All);
copyProperties(properties, DEFAULT_ENTITY_PROPERTIES.All);
var type = requestedProperties.type;
if (type === "Box" || type === "Sphere") {
applyProperties(properties, DEFAULT_ENTITY_PROPERTIES.Shape);
copyProperties(properties, DEFAULT_ENTITY_PROPERTIES.Shape);
} 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.
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) {
@ -675,7 +686,6 @@ var toolBar = (function () {
grabbable: result.grabbable
},
dynamic: dynamic,
gravity: dynamic ? { x: 0, y: -10, z: 0 } : { x: 0, y: 0, z: 0 }
});
}
}