Merge branch 'master' of github.com:highfidelity/hifi into warn-for-head-position-nan

This commit is contained in:
Seth Alves 2018-01-26 10:36:26 -08:00
commit 3be42fe79a
11 changed files with 62 additions and 57 deletions

View file

@ -22,7 +22,7 @@ ListModel {
function swap(a, b) {
if (a < b) {
move(a, b, 1);
move (b - 1, a, 1);
move(b - 1, a, 1);
} else if (a > b) {
move(b, a, 1);
move(a - 1, b, 1);
@ -34,16 +34,17 @@ ListModel {
var piv = get(pivot)[sortColumnName];
swap(pivot, end - 1);
var store = begin;
var i;
for (var i = begin; i < end - 1; ++i) {
for (i = begin; i < end - 1; ++i) {
var currentElement = get(i)[sortColumnName];
if (isSortingDescending) {
if (currentElement < piv) {
if (currentElement > piv) {
swap(store, i);
++store;
}
} else {
if (currentElement > piv) {
if (currentElement < piv) {
swap(store, i);
++store;
}
@ -56,16 +57,17 @@ ListModel {
var piv = get(pivot)[sortColumnName].toLowerCase();
swap(pivot, end - 1);
var store = begin;
var i;
for (var i = begin; i < end - 1; ++i) {
for (i = begin; i < end - 1; ++i) {
var currentElement = get(i)[sortColumnName].toLowerCase();
if (isSortingDescending) {
if (currentElement < piv) {
if (currentElement > piv) {
swap(store, i);
++store;
}
} else {
if (currentElement > piv) {
if (currentElement < piv) {
swap(store, i);
++store;
}

View file

@ -317,6 +317,7 @@ Rectangle {
HifiControlsUit.TextField {
id: filterBar;
property string previousText: "";
colorScheme: hifi.colorSchemes.faintGray;
hasClearButton: true;
hasRoundedBorder: true;
@ -329,6 +330,8 @@ Rectangle {
onTextChanged: {
buildFilteredPurchasesModel();
purchasesContentsList.positionViewAtIndex(0, ListView.Beginning)
filterBar.previousText = filterBar.text;
}
onAccepted: {
@ -647,7 +650,8 @@ Rectangle {
function sortByDate() {
filteredPurchasesModel.sortColumnName = "purchase_date";
filteredPurchasesModel.isSortingDescending = false;
filteredPurchasesModel.isSortingDescending = true;
filteredPurchasesModel.valuesAreNumerical = true;
filteredPurchasesModel.quickSort();
}
@ -677,7 +681,7 @@ Rectangle {
}
}
if (sameItemCount !== tempPurchasesModel.count || filterBar.text !== "") {
if (sameItemCount !== tempPurchasesModel.count || filterBar.text !== filterBar.previousText) {
filteredPurchasesModel.clear();
for (var i = 0; i < tempPurchasesModel.count; i++) {
filteredPurchasesModel.append(tempPurchasesModel.get(i));

View file

@ -41,14 +41,14 @@ QSpinBox, QDoubleSpinBox {
QDoubleSpinBox::up-arrow,
QSpinBox::up-arrow {
background-image: url(styles/up.svg);
background-image: url(:/styles/up.svg);
background-repeat: no-repeat;
background-position: center center;
}
QDoubleSpinBox::down-arrow,
QSpinBox::down-arrow {
background-image: url(styles/down.svg);
background-image: url(:/styles/down.svg);
background-repeat: no-repeat;
background-position: center center;
}
@ -88,7 +88,7 @@ QSlider {
QSlider::groove:horizontal {
border: none;
background-image: url(styles/slider-bg.svg);
background-image: url(:/styles/slider-bg.svg);
background-repeat: no-repeat;
background-position: center center;
}
@ -96,7 +96,7 @@ QSlider::groove:horizontal {
QSlider::handle:horizontal {
width: 18px;
height: 18px;
background-image: url(styles/slider-handle.svg);
background-image: url(:/styles/slider-handle.svg);
background-repeat: no-repeat;
background-position: center center;
}
@ -107,7 +107,7 @@ QPushButton#closeButton {
border-width: 1px;
border-radius: 0;
background-color: #fff;
background-image: url(styles/close.svg);
background-image: url(:/styles/close.svg);
background-repeat: no-repeat;
background-position: center center;
}

View file

@ -63,17 +63,17 @@ QPushButton#cancelButton {
}
#backButton {
background-image: url(icons/backButton.svg);
background-image: url(:/icons/backButton.svg);
border-radius: 0px;
}
#forwardButton {
background-image: url(icons/forwardButton.svg);
background-image: url(:/icons/forwardButton.svg);
border-radius: 0px;
}
#toParentButton {
background-image: url(icons/toParentButton.svg);
background-image: url(:/icons/toParentButton.svg);
border-radius: 0px;
}

View file

@ -22,7 +22,7 @@ QLineEdit {
}
QPushButton#searchButton {
background: url(styles/search.svg);
background: url(:/styles/search.svg);
background-repeat: none;
background-position: left center;
background-origin: content;
@ -55,7 +55,7 @@ QPushButton#searchPrevButton {
QPushButton#revealLogButton {
font-family: Helvetica, Arial, sans-serif;
background: url(styles/txt-file.svg);
background: url(:/styles/txt-file.svg);
background-repeat: none;
background-position: left center;
background-origin: content;
@ -86,11 +86,11 @@ QCheckBox {
}
QCheckBox::indicator:unchecked {
image: url(styles/unchecked.svg);
image: url(:/styles/unchecked.svg);
}
QCheckBox::indicator:checked {
image: url(styles/checked.svg);
image: url(:/styles/checked.svg);
}
QComboBox {
@ -110,6 +110,6 @@ QComboBox::drop-down {
}
QComboBox::down-arrow {
image: url(styles/filter.png);
image: url(:/styles/filter.png);
border-width: 0px;
}

View file

@ -2724,7 +2724,7 @@ void Application::showHelp() {
queryString.addQueryItem("defaultTab", defaultTab);
auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
TabletProxy* tablet = dynamic_cast<TabletProxy*>(tabletScriptingInterface->getTablet(SYSTEM_TABLET));
tablet->gotoWebScreen(PathUtils::resourcesPath() + INFO_HELP_PATH + "?" + queryString.toString());
tablet->gotoWebScreen(PathUtils::resourcesUrl() + INFO_HELP_PATH + "?" + queryString.toString());
DependencyManager::get<HMDScriptingInterface>()->openTablet();
//InfoView::show(INFO_HELP_PATH, false, queryString.toString());
}

View file

@ -39,7 +39,6 @@ BaseLogDialog::BaseLogDialog(QWidget* parent) : QDialog(parent, Qt::Window) {
QFile styleSheet(PathUtils::resourcesPath() + "styles/log_dialog.qss");
if (styleSheet.open(QIODevice::ReadOnly)) {
QDir::setCurrent(PathUtils::resourcesPath());
setStyleSheet(styleSheet.readAll());
}

View file

@ -168,7 +168,7 @@ bool ContextOverlayInterface::createOrDestroyContextOverlay(const EntityItemID&
_contextOverlay->setColorPulse(CONTEXT_OVERLAY_UNHOVERED_COLORPULSE);
_contextOverlay->setIgnoreRayIntersection(false);
_contextOverlay->setDrawInFront(true);
_contextOverlay->setURL(PathUtils::resourcesPath() + "images/inspect-icon.png");
_contextOverlay->setURL(PathUtils::resourcesUrl() + "images/inspect-icon.png");
_contextOverlay->setIsFacingAvatar(true);
_contextOverlayID = qApp->getOverlays().addOverlay(_contextOverlay);
}

View file

@ -1329,7 +1329,9 @@ void ModelEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& sce
_currentTextures = newTextures;
}
}
if (entity->_needsJointSimulation) {
entity->copyAnimationJointDataToModel();
}
entity->updateModelBounds();
entity->stopModelOverrideIfNoParent();

View file

@ -45,8 +45,8 @@ void Engine::load() {
auto config = getConfiguration();
const QString configFile= "config/render.json";
QUrl path(PathUtils::resourcesPath() + configFile);
QFile file(path.toString());
QString path(PathUtils::resourcesPath() + configFile);
QFile file(path);
if (!file.exists()) {
qWarning() << "Engine configuration file" << path << "does not exist";
} else if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {

View file

@ -15,7 +15,7 @@ var TEST_MODEL_URL = 'https://s3.amazonaws.com/hifi-public/ozan/avatars/albert/a
var MIRROR_JOINT_DATA = true;
var MIRRORED_ENTITY_SCRIPT_URL = Script.resolvePath('mirroredEntity.js');
var FREEZE_TOGGLER_SCRIPT_URL = Script.resolvePath('freezeToggler.js?' + Math.random(0, 1000))
var FREEZE_TOGGLER_SCRIPT_URL = Script.resolvePath('freezeToggler.js?' + Math.random(0, 1000));
var THROTTLE = false;
var THROTTLE_RATE = 100;
var doppelgangers = [];
@ -24,8 +24,7 @@ function Doppelganger(avatar) {
this.initialProperties = {
name: 'Hifi-Doppelganger',
type: 'Model',
modelURL: TEST_MODEL_URL,
// dimensions: getAvatarDimensions(avatar),
modelURL: MyAvatar.skeletonModelURL,
position: putDoppelgangerAcrossFromAvatar(this, avatar),
rotation: rotateDoppelgangerTowardAvatar(this, avatar),
collisionsWillMove: false,
@ -48,7 +47,7 @@ function getJointData(avatar) {
var jointNames = MyAvatar.jointNames;
jointNames.forEach(function(joint, index) {
var translation = MyAvatar.getJointTranslation(index);
var rotation = MyAvatar.getJointRotation(index)
var rotation = MyAvatar.getJointRotation(index);
allJointData.push({
joint: joint,
index: index,
@ -66,8 +65,8 @@ function setJointData(doppelganger, relativeXforms) {
for (i = 0; i < l; i++) {
jointRotations.push(relativeXforms[i].rot);
}
Entities.setAbsoluteJointRotationsInObjectFrame(doppelganger.id, jointRotations);
Entities.setLocalJointRotations(doppelganger.id, jointRotations);
return true;
}
@ -127,7 +126,7 @@ var JOINT_MIRROR_NAME_MAP = {
LeftHandPinky2: "RightHandPinky2",
LeftHandPinky3: "RightHandPinky3",
LeftHandPinky4: "RightHandPinky4",
LeftHandPinky: "RightHandPinky",
LeftHandPinky: "RightHandPinky"
};
// maps joint names to parent joint names.
@ -192,7 +191,7 @@ var JOINT_PARENT_NAME_MAP = {
LeftHandPinky1: "LeftHand",
LeftHandPinky2: "LeftHandPinky1",
LeftHandPinky3: "LeftHandPinky2",
LeftHandPinky: "LeftHandPinky3",
LeftHandPinky: "LeftHandPinky3"
};
// maps joint indices to parent joint indices.
@ -206,7 +205,7 @@ function Xform(rot, pos) {
};
Xform.ident = function () {
return new Xform({x: 0, y: 0, z: 0, w: 1}, {x: 0, y: 0, z: 0});
}
};
Xform.mul = function (lhs, rhs) {
var rot = Quat.multiply(lhs.rot, rhs.rot);
var pos = Vec3.sum(lhs.pos, Vec3.multiplyQbyV(lhs.rot, rhs.pos));
@ -354,12 +353,12 @@ function getAvatarFootOffset() {
if (jointName === "RightToe_End") {
toeTop = d.translation.y
}
})
});
var myPosition = MyAvatar.position;
var offset = upperLeg + lowerLeg + foot + toe + toeTop;
offset = offset / 100;
return offset
return offset;
}
@ -395,7 +394,7 @@ function connectDoppelgangerUpdates() {
}
function disconnectDoppelgangerUpdates() {
print('SHOULD DISCONNECT')
print('SHOULD DISCONNECT');
if (isConnected === true) {
Script.update.disconnect(updateDoppelganger);
}
@ -465,13 +464,13 @@ function handleFreezeMessages(channel, message, sender) {
} catch (e) {
print('error parsing wearable message');
}
print('MESSAGE ACTION::' + parsedMessage.action)
print('MESSAGE ACTION::' + parsedMessage.action);
if (parsedMessage.action === 'freeze') {
print('ACTUAL FREEZE')
print('ACTUAL FREEZE');
disconnectDoppelgangerUpdates();
}
if (parsedMessage.action === 'unfreeze') {
print('ACTUAL UNFREEZE')
print('ACTUAL UNFREEZE');
connectDoppelgangerUpdates();
}
@ -496,7 +495,7 @@ function handleWearableMessages(channel, message, sender) {
} catch (e) {
print('error parsing wearable message');
}
print('parsed message!!!')
print('parsed message!!!');
if (channel === 'Hifi-Doppelganger-Wearable') {
mirrorEntitiesForDoppelganger(doppelgangers[0], parsedMessage);
@ -511,13 +510,13 @@ function mirrorEntitiesForDoppelganger(doppelganger, parsedMessage) {
var doppelgangerProps = Entities.getEntityProperties(doppelganger.id);
var action = parsedMessage.action;
print('IN MIRROR ENTITIES CALL' + action)
print('IN MIRROR ENTITIES CALL' + action);
var baseEntity = parsedMessage.baseEntity;
var wearableProps = Entities.getEntityProperties(baseEntity);
print('WEARABLE PROPS::')
print('WEARABLE PROPS::');
delete wearableProps.id;
delete wearableProps.created;
delete wearableProps.age;
@ -545,15 +544,15 @@ function mirrorEntitiesForDoppelganger(doppelganger, parsedMessage) {
baseEntity: baseEntity,
doppelganger: doppelganger.id
}
})
});
var mirrorEntity = Entities.addEntity(wearableProps);
var mirrorEntityProps = Entities.getEntityProperties(mirrorEntity)
print('MIRROR PROPS::' + JSON.stringify(mirrorEntityProps))
var mirrorEntityProps = Entities.getEntityProperties(mirrorEntity);
print('MIRROR PROPS::' + JSON.stringify(mirrorEntityProps));
var wearablePair = {
baseEntity: baseEntity,
mirrorEntity: mirrorEntity
}
};
wearablePairs.push(wearablePair);
}
@ -563,11 +562,11 @@ function mirrorEntitiesForDoppelganger(doppelganger, parsedMessage) {
var mirrorEntity = getMirrorEntityForBaseEntity(baseEntity);
// print('MIRROR ENTITY, newPosition' + mirrorEntity + ":::" + JSON.stringify(newPosition))
Entities.editEntity(mirrorEntity, wearableProps)
Entities.editEntity(mirrorEntity, wearableProps);
}
if (action === 'remove') {
Entities.deleteEntity(getMirrorEntityForBaseEntity(baseEntity))
Entities.deleteEntity(getMirrorEntityForBaseEntity(baseEntity));
wearablePairs = wearablePairs.filter(function(obj) {
return obj.baseEntity !== baseEntity;
});
@ -575,7 +574,7 @@ function mirrorEntitiesForDoppelganger(doppelganger, parsedMessage) {
if (action === 'updateBase') {
//this gets called when the mirrored entity gets grabbed. now we move the
var mirrorEntityProperties = Entities.getEntityProperties(message.mirrorEntity)
var mirrorEntityProperties = Entities.getEntityProperties(message.mirrorEntity);
var doppelgangerToMirrorEntity = Vec3.subtract(doppelgangerProps.position, mirrorEntityProperties.position);
var newPosition = Vec3.sum(MyAvatar.position, doppelgangerToMirrorEntity);
@ -596,7 +595,7 @@ function getMirrorEntityForBaseEntity(baseEntity) {
if (result.length === 0) {
return false;
} else {
return result[0].mirrorEntity
return result[0].mirrorEntity;
}
}
@ -607,13 +606,12 @@ function getBaseEntityForMirrorEntity(mirrorEntity) {
if (result.length === 0) {
return false;
} else {
return result[0].baseEntity
return result[0].baseEntity;
}
}
makeDoppelgangerForMyAvatar();
subscribeToWearableMessages();
subscribeToWearableMessagesForAvatar();
subscribeToFreezeMessages();
function cleanup() {
@ -622,8 +620,8 @@ function cleanup() {
}
doppelgangers.forEach(function(doppelganger) {
print('DOPPELGANGER' + doppelganger.id)
print('DOPPELGANGER' + doppelganger.id);
Entities.deleteEntity(doppelganger.id);
});
}
Script.scriptEnding.connect(cleanup);
Script.scriptEnding.connect(cleanup);