Removed untested avatar bubble fade code. Made changes as requested by Andrew

This commit is contained in:
Olivier Prat 2017-07-13 23:04:55 +02:00
parent b68ec4f933
commit b125fba2e1
6 changed files with 360 additions and 375 deletions

View file

@ -273,17 +273,11 @@ void AvatarManager::simulateAvatarFades(float deltaTime) {
return;
}
//const float SHRINK_RATE = 0.15f;
//const float MIN_FADE_SCALE = MIN_AVATAR_SCALE;
QReadLocker locker(&_hashLock);
QVector<AvatarSharedPointer>::iterator avatarItr = _avatarsToFade.begin();
const render::ScenePointer& scene = qApp->getMain3DScene();
while (avatarItr != _avatarsToFade.end()) {
auto avatar = std::static_pointer_cast<Avatar>(*avatarItr);
// avatar->setTargetScale(avatar->getUniformScale() * SHRINK_RATE);
// avatar->animateScaleChanges(deltaTime);
// if (avatar->getTargetScale() <= MIN_FADE_SCALE) {
avatar->updateFadingStatus(scene);
if (!avatar->isFading()) {
// fading to zero is such a rare event we push a unique transaction for each

View file

@ -356,8 +356,8 @@ private:
bool _initialized { false };
bool _isLookAtTarget { false };
bool _isAnimatingScale { false };
bool _mustFadeIn{ false };
bool _isFading{ false };
bool _mustFadeIn { false };
bool _isFading { false };
static int _jointConesID;

View file

@ -173,14 +173,7 @@ void AvatarHashMap::processKillAvatar(QSharedPointer<ReceivedMessage> message, S
void AvatarHashMap::removeAvatar(const QUuid& sessionUUID, KillAvatarReason removalReason) {
QWriteLocker locker(&_hashLock);
AvatarSharedPointer removedAvatar;
if (removalReason != KillAvatarReason::TheirAvatarEnteredYourBubble && removalReason != KillAvatarReason::YourAvatarEnteredTheirBubble) {
removedAvatar = _avatarHash.take(sessionUUID);
}
else {
removedAvatar = _avatarHash[sessionUUID];
}
AvatarSharedPointer removedAvatar = _avatarHash.take(sessionUUID);
if (removedAvatar) {
handleRemovedAvatar(removedAvatar, removalReason);

View file

@ -219,7 +219,7 @@ namespace render {
template <> uint32_t metaFetchMetaSubItems(const RenderableModelEntityItemMeta::Pointer& payload, ItemIDs& subItems) {
auto modelEntity = std::static_pointer_cast<RenderableModelEntityItem>(payload->entity);
auto model = modelEntity->getModelNotSafe();
if (modelEntity->hasModel() && model) {
if (model && modelEntity->hasModel()) {
auto& metaSubItems = model->fetchRenderItemIDs();
subItems.insert(subItems.end(), metaSubItems.begin(), metaSubItems.end());
return (uint32_t) metaSubItems.size();

View file

@ -273,8 +273,7 @@ void Scene::queryTransitionItems(const Transaction::TransitionQueries& transacti
if (!TransitionStage::isIndexInvalid(transitionId)) {
auto& transition = transitionStage->getTransition(transitionId);
func(itemId, &transition);
}
else {
} else {
func(itemId, nullptr);
}
}
@ -314,8 +313,7 @@ void Scene::setItemTransition(ItemID itemId, Index transitionId) {
auto& subItem = _items[subItemId];
subItem.setTransitionId(transitionId);
}
}
else {
} else {
qWarning() << "Collecting sub items on item without payload";
}
}

View file

@ -14,384 +14,384 @@ import "configSlider"
import "../lib/plotperf"
Column {
id: root
property var config: Render.getConfig("RenderMainView.Fade");
property var configEdit: Render.getConfig("RenderMainView.FadeEdit");
spacing: 8
id: root
property var config: Render.getConfig("RenderMainView.Fade");
property var configEdit: Render.getConfig("RenderMainView.FadeEdit");
spacing: 8
Row {
spacing: 8
Row {
spacing: 8
CheckBox {
text: "Edit Fade"
checked: root.configEdit["editFade"]
onCheckedChanged: {
root.configEdit["editFade"] = checked;
Render.getConfig("RenderMainView.DrawFadedOpaqueBounds").enabled = checked;
}
}
ComboBox {
id: categoryBox
width: 400
model: ["Elements enter/leave domain", "Bubble isect. - Owner POV", "Bubble isect. - Trespasser POV", "Another user leaves/arrives", "Changing an avatar"]
Timer {
id: postpone
interval: 100; running: false; repeat: false
onTriggered: { paramWidgetLoader.sourceComponent = paramWidgets }
}
onCurrentIndexChanged: {
root.config["editedCategory"] = currentIndex;
// This is a hack to be sure the widgets below properly reflect the change of category: delete the Component
// by setting the loader source to Null and then recreate it 100ms later
paramWidgetLoader.sourceComponent = undefined;
postpone.interval = 100
postpone.start()
}
}
}
Row {
spacing: 8
CheckBox {
text: "Edit Fade"
checked: root.configEdit["editFade"]
onCheckedChanged: {
root.configEdit["editFade"] = checked;
Render.getConfig("RenderMainView.DrawFadedOpaqueBounds").enabled = checked;
}
}
ComboBox {
id: categoryBox
width: 400
model: ["Elements enter/leave domain", "Bubble isect. - Owner POV", "Bubble isect. - Trespasser POV", "Another user leaves/arrives", "Changing an avatar"]
Timer {
id: postpone
interval: 100; running: false; repeat: false
onTriggered: { paramWidgetLoader.sourceComponent = paramWidgets }
}
onCurrentIndexChanged: {
root.config["editedCategory"] = currentIndex;
// This is a hack to be sure the widgets below properly reflect the change of category: delete the Component
// by setting the loader source to Null and then recreate it 100ms later
paramWidgetLoader.sourceComponent = undefined;
postpone.interval = 100
postpone.start()
}
}
}
Row {
spacing: 8
CheckBox {
text: "Manual"
checked: root.config["manualFade"]
onCheckedChanged: {
root.config["manualFade"] = checked;
}
}
ConfigSlider {
label: "Threshold"
integral: false
config: root.config
property: "manualThreshold"
max: 1.0
min: 0.0
width: 400
}
}
CheckBox {
text: "Manual"
checked: root.config["manualFade"]
onCheckedChanged: {
root.config["manualFade"] = checked;
}
}
ConfigSlider {
label: "Threshold"
integral: false
config: root.config
property: "manualThreshold"
max: 1.0
min: 0.0
width: 400
}
}
Action {
Action {
id: saveAction
text: "Save"
onTriggered: {
root.config.save()
}
root.config.save()
}
}
Action {
Action {
id: loadAction
text: "Load"
onTriggered: {
root.config.load()
// This is a hack to be sure the widgets below properly reflect the change of category: delete the Component
// by setting the loader source to Null and then recreate it 500ms later
paramWidgetLoader.sourceComponent = undefined;
postpone.interval = 500
postpone.start()
}
root.config.load()
// This is a hack to be sure the widgets below properly reflect the change of category: delete the Component
// by setting the loader source to Null and then recreate it 500ms later
paramWidgetLoader.sourceComponent = undefined;
postpone.interval = 500
postpone.start()
}
}
Component {
id: paramWidgets
Component {
id: paramWidgets
Column {
spacing: 8
Column {
spacing: 8
CheckBox {
text: "Invert"
checked: root.config["isInverted"]
onCheckedChanged: { root.config["isInverted"] = checked }
}
Row {
spacing: 8
GroupBox {
title: "Base Gradient"
width: 450
Column {
spacing: 8
CheckBox {
text: "Invert"
checked: root.config["isInverted"]
onCheckedChanged: { root.config["isInverted"] = checked }
}
Row {
spacing: 8
ConfigSlider {
label: "Size X"
integral: false
config: root.config
property: "baseSizeX"
max: 1.0
min: 0.0
width: 400
}
ConfigSlider {
label: "Size Y"
integral: false
config: root.config
property: "baseSizeY"
max: 1.0
min: 0.0
width: 400
}
ConfigSlider {
label: "Size Z"
integral: false
config: root.config
property: "baseSizeZ"
max: 1.0
min: 0.0
width: 400
}
ConfigSlider {
label: "Level"
integral: false
config: root.config
property: "baseLevel"
max: 1.0
min: 0.0
width: 400
}
}
}
GroupBox {
title: "Noise Gradient"
width: 450
Column {
spacing: 8
GroupBox {
title: "Base Gradient"
width: 450
Column {
spacing: 8
ConfigSlider {
label: "Size X"
integral: false
config: root.config
property: "noiseSizeX"
max: 1.0
min: 0.0
width: 400
}
ConfigSlider {
label: "Size Y"
integral: false
config: root.config
property: "noiseSizeY"
max: 1.0
min: 0.0
width: 400
}
ConfigSlider {
label: "Size Z"
integral: false
config: root.config
property: "noiseSizeZ"
max: 1.0
min: 0.0
width: 400
}
ConfigSlider {
label: "Level"
integral: false
config: root.config
property: "noiseLevel"
max: 1.0
min: 0.0
width: 400
}
}
}
}
Row {
spacing: 8
ConfigSlider {
label: "Size X"
integral: false
config: root.config
property: "baseSizeX"
max: 1.0
min: 0.0
width: 400
}
ConfigSlider {
label: "Size Y"
integral: false
config: root.config
property: "baseSizeY"
max: 1.0
min: 0.0
width: 400
}
ConfigSlider {
label: "Size Z"
integral: false
config: root.config
property: "baseSizeZ"
max: 1.0
min: 0.0
width: 400
}
ConfigSlider {
label: "Level"
integral: false
config: root.config
property: "baseLevel"
max: 1.0
min: 0.0
width: 400
}
}
}
GroupBox {
title: "Noise Gradient"
width: 450
Column {
spacing: 8
GroupBox {
title: "Edge"
width: 450
Column {
spacing: 8
ConfigSlider {
label: "Size X"
integral: false
config: root.config
property: "noiseSizeX"
max: 1.0
min: 0.0
width: 400
}
ConfigSlider {
label: "Size Y"
integral: false
config: root.config
property: "noiseSizeY"
max: 1.0
min: 0.0
width: 400
}
ConfigSlider {
label: "Size Z"
integral: false
config: root.config
property: "noiseSizeZ"
max: 1.0
min: 0.0
width: 400
}
ConfigSlider {
label: "Level"
integral: false
config: root.config
property: "noiseLevel"
max: 1.0
min: 0.0
width: 400
}
}
}
}
Row {
spacing: 8
ConfigSlider {
label: "Width"
integral: false
config: root.config
property: "edgeWidth"
max: 1.0
min: 0.0
width: 400
}
GroupBox {
title: "Inner color"
Column {
spacing: 8
ConfigSlider {
label: "Color R"
integral: false
config: root.config
property: "edgeInnerColorR"
max: 1.0
min: 0.0
width: 400
}
ConfigSlider {
label: "Color G"
integral: false
config: root.config
property: "edgeInnerColorG"
max: 1.0
min: 0.0
width: 400
}
ConfigSlider {
label: "Color B"
integral: false
config: root.config
property: "edgeInnerColorB"
max: 1.0
min: 0.0
width: 400
}
ConfigSlider {
label: "Color intensity"
integral: false
config: root.config
property: "edgeInnerIntensity"
max: 5.0
min: 0.0
width: 400
}
}
}
GroupBox {
title: "Outer color"
Column {
spacing: 8
ConfigSlider {
label: "Color R"
integral: false
config: root.config
property: "edgeOuterColorR"
max: 1.0
min: 0.0
width: 400
}
ConfigSlider {
label: "Color G"
integral: false
config: root.config
property: "edgeOuterColorG"
max: 1.0
min: 0.0
width: 400
}
ConfigSlider {
label: "Color B"
integral: false
config: root.config
property: "edgeOuterColorB"
max: 1.0
min: 0.0
width: 400
}
ConfigSlider {
label: "Color intensity"
integral: false
config: root.config
property: "edgeOuterIntensity"
max: 5.0
min: 0.0
width: 400
}
}
}
}
}
GroupBox {
title: "Edge"
width: 450
Column {
spacing: 8
Column {
GroupBox {
title: "Timing"
width: 450
Column {
spacing: 8
ConfigSlider {
label: "Width"
integral: false
config: root.config
property: "edgeWidth"
max: 1.0
min: 0.0
width: 400
}
GroupBox {
title: "Inner color"
Column {
spacing: 8
ConfigSlider {
label: "Color R"
integral: false
config: root.config
property: "edgeInnerColorR"
max: 1.0
min: 0.0
width: 400
}
ConfigSlider {
label: "Color G"
integral: false
config: root.config
property: "edgeInnerColorG"
max: 1.0
min: 0.0
width: 400
}
ConfigSlider {
label: "Color B"
integral: false
config: root.config
property: "edgeInnerColorB"
max: 1.0
min: 0.0
width: 400
}
ConfigSlider {
label: "Color intensity"
integral: false
config: root.config
property: "edgeInnerIntensity"
max: 5.0
min: 0.0
width: 400
}
}
}
GroupBox {
title: "Outer color"
Column {
spacing: 8
ConfigSlider {
label: "Color R"
integral: false
config: root.config
property: "edgeOuterColorR"
max: 1.0
min: 0.0
width: 400
}
ConfigSlider {
label: "Color G"
integral: false
config: root.config
property: "edgeOuterColorG"
max: 1.0
min: 0.0
width: 400
}
ConfigSlider {
label: "Color B"
integral: false
config: root.config
property: "edgeOuterColorB"
max: 1.0
min: 0.0
width: 400
}
ConfigSlider {
label: "Color intensity"
integral: false
config: root.config
property: "edgeOuterIntensity"
max: 5.0
min: 0.0
width: 400
}
}
}
}
}
ConfigSlider {
label: "Duration"
integral: false
config: root.config
property: "duration"
max: 10.0
min: 0.1
width: 400
}
ComboBox {
width: 400
model: ["Linear", "Ease In", "Ease Out", "Ease In / Out"]
currentIndex: root.config["timing"]
onCurrentIndexChanged: {
root.config["timing"] = currentIndex;
}
}
GroupBox {
title: "Noise Animation"
Column {
spacing: 8
ConfigSlider {
label: "Speed X"
integral: false
config: root.config
property: "noiseSpeedX"
max: 1.0
min: -1.0
width: 400
}
ConfigSlider {
label: "Speed Y"
integral: false
config: root.config
property: "noiseSpeedY"
max: 1.0
min: -1.0
width: 400
}
ConfigSlider {
label: "Speed Z"
integral: false
config: root.config
property: "noiseSpeedZ"
max: 1.0
min: -1.0
width: 400
}
}
}
Column {
GroupBox {
title: "Timing"
width: 450
Column {
spacing: 8
PlotPerf {
title: "Threshold"
height: parent.evalEvenHeight()
object: config
valueUnit: "%"
valueScale: 0.01
valueNumDigits: "1"
plots: [
{
prop: "threshold",
label: "Threshold",
color: "#FFBB77"
}
]
}
ConfigSlider {
label: "Duration"
integral: false
config: root.config
property: "duration"
max: 10.0
min: 0.1
width: 400
}
ComboBox {
width: 400
model: ["Linear", "Ease In", "Ease Out", "Ease In / Out"]
currentIndex: root.config["timing"]
onCurrentIndexChanged: {
root.config["timing"] = currentIndex;
}
}
GroupBox {
title: "Noise Animation"
Column {
spacing: 8
ConfigSlider {
label: "Speed X"
integral: false
config: root.config
property: "noiseSpeedX"
max: 1.0
min: -1.0
width: 400
}
ConfigSlider {
label: "Speed Y"
integral: false
config: root.config
property: "noiseSpeedY"
max: 1.0
min: -1.0
width: 400
}
ConfigSlider {
label: "Speed Z"
integral: false
config: root.config
property: "noiseSpeedZ"
max: 1.0
min: -1.0
width: 400
}
}
}
}
}
PlotPerf {
title: "Threshold"
height: parent.evalEvenHeight()
object: config
valueUnit: "%"
valueScale: 0.01
valueNumDigits: "1"
plots: [
{
prop: "threshold",
label: "Threshold",
color: "#FFBB77"
}
]
}
Row {
spacing: 8
Button {
action: saveAction
}
Button {
action: loadAction
}
}
}
}
}
}
}
}
Row {
spacing: 8
Button {
action: saveAction
}
Button {
action: loadAction
}
}
Loader {
id: paramWidgetLoader
sourceComponent: paramWidgets
}
}
}
}
}
Loader {
id: paramWidgetLoader
sourceComponent: paramWidgets
}
}