mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 13:43:49 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi into oldPropsFilters
This commit is contained in:
commit
8a9153a461
71 changed files with 801 additions and 348 deletions
|
@ -571,6 +571,7 @@ Rectangle {
|
|||
MouseArea {
|
||||
anchors.fill: parent;
|
||||
propagateComposedEvents: false;
|
||||
hoverEnabled: true;
|
||||
}
|
||||
|
||||
RalewayBold {
|
||||
|
|
|
@ -45,6 +45,7 @@ Rectangle {
|
|||
MouseArea {
|
||||
anchors.fill: parent;
|
||||
propagateComposedEvents: false;
|
||||
hoverEnabled: true;
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
|
|
|
@ -44,6 +44,7 @@ Rectangle {
|
|||
MouseArea {
|
||||
anchors.fill: parent;
|
||||
propagateComposedEvents: false;
|
||||
hoverEnabled: true;
|
||||
}
|
||||
|
||||
Item {
|
||||
|
|
BIN
interface/resources/qml/hifi/commerce/common/images/loader.gif
Normal file
BIN
interface/resources/qml/hifi/commerce/common/images/loader.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 58 KiB |
|
@ -119,6 +119,7 @@ Rectangle {
|
|||
MouseArea {
|
||||
anchors.fill: parent;
|
||||
propagateComposedEvents: false;
|
||||
hoverEnabled: true;
|
||||
}
|
||||
|
||||
Image {
|
||||
|
|
|
@ -316,6 +316,7 @@ Item {
|
|||
MouseArea {
|
||||
anchors.fill: parent;
|
||||
propagateComposedEvents: false;
|
||||
hoverEnabled: true;
|
||||
}
|
||||
|
||||
RalewayBold {
|
||||
|
|
|
@ -66,6 +66,7 @@ Item {
|
|||
MouseArea {
|
||||
anchors.fill: parent;
|
||||
propagateComposedEvents: false;
|
||||
hoverEnabled: true;
|
||||
}
|
||||
|
||||
// This will cause a bug -- if you bring up passphrase selection in HUD mode while
|
||||
|
|
|
@ -34,6 +34,7 @@ Item {
|
|||
MouseArea {
|
||||
anchors.fill: parent;
|
||||
propagateComposedEvents: false;
|
||||
hoverEnabled: true;
|
||||
}
|
||||
|
||||
Connections {
|
||||
|
|
|
@ -306,6 +306,7 @@ Item {
|
|||
MouseArea {
|
||||
anchors.fill: parent;
|
||||
propagateComposedEvents: false;
|
||||
hoverEnabled: true;
|
||||
}
|
||||
|
||||
RalewayBold {
|
||||
|
|
|
@ -394,6 +394,7 @@ Item {
|
|||
MouseArea {
|
||||
anchors.fill: parent;
|
||||
propagateComposedEvents: false;
|
||||
hoverEnabled: true;
|
||||
}
|
||||
|
||||
Image {
|
||||
|
|
|
@ -43,6 +43,7 @@ Item {
|
|||
width: parent.width;
|
||||
height: (root.shouldShowTopAndBottomOfWallet || root.shouldShowTopOfWallet) ? parent.height : parent.height - root.parentAppTitleBarHeight - root.parentAppNavBarHeight;
|
||||
propagateComposedEvents: false;
|
||||
hoverEnabled: true;
|
||||
}
|
||||
|
||||
Connections {
|
||||
|
@ -57,6 +58,9 @@ Item {
|
|||
|
||||
if (result.status === 'success') {
|
||||
root.nextActiveView = 'paymentSuccess';
|
||||
if (sendPubliclyCheckbox.checked && sendMoneyStep.referrer === "nearby") {
|
||||
sendSignalToWallet({method: 'sendMoney_sendPublicly', recipient: sendMoneyStep.selectedRecipientNodeID, amount: parseInt(amountTextField.text)});
|
||||
}
|
||||
} else {
|
||||
root.nextActiveView = 'paymentFailure';
|
||||
}
|
||||
|
@ -103,6 +107,12 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
HifiCommerceCommon.CommerceLightbox {
|
||||
id: lightboxPopup;
|
||||
visible: false;
|
||||
anchors.fill: parent;
|
||||
}
|
||||
|
||||
// Send Money Home BEGIN
|
||||
Item {
|
||||
id: sendMoneyHome;
|
||||
|
@ -326,6 +336,7 @@ Item {
|
|||
MouseArea {
|
||||
anchors.fill: parent;
|
||||
propagateComposedEvents: false;
|
||||
hoverEnabled: true;
|
||||
}
|
||||
|
||||
ListModel {
|
||||
|
@ -477,6 +488,7 @@ Item {
|
|||
enabled: connectionsList.currentIndex !== index;
|
||||
anchors.fill: parent;
|
||||
propagateComposedEvents: false;
|
||||
hoverEnabled: true;
|
||||
onClicked: {
|
||||
connectionsList.currentIndex = index;
|
||||
}
|
||||
|
@ -505,6 +517,7 @@ Item {
|
|||
MouseArea {
|
||||
anchors.fill: parent;
|
||||
propagateComposedEvents: false;
|
||||
hoverEnabled: true;
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
|
@ -917,7 +930,7 @@ Item {
|
|||
id: optionalMessage;
|
||||
property int maximumLength: 72;
|
||||
property string previousText: text;
|
||||
placeholderText: "<i>Optional Message (" + maximumLength + " character limit)</i>";
|
||||
placeholderText: "<i>Optional Public Message (" + maximumLength + " character limit)</i>";
|
||||
font.family: firaSansSemiBold.name;
|
||||
font.pixelSize: 20;
|
||||
// Anchors
|
||||
|
@ -967,16 +980,54 @@ Item {
|
|||
|
||||
HifiControlsUit.CheckBox {
|
||||
id: sendPubliclyCheckbox;
|
||||
visible: false; // FIXME ONCE PARTICLE EFFECTS ARE IN
|
||||
text: "Send Publicly"
|
||||
visible: sendMoneyStep.referrer === "nearby";
|
||||
checked: Settings.getValue("sendMoneyNearbyPublicly", true);
|
||||
text: "Show Effect"
|
||||
// Anchors
|
||||
anchors.top: messageContainer.bottom;
|
||||
anchors.topMargin: 16;
|
||||
anchors.left: parent.left;
|
||||
anchors.leftMargin: 20;
|
||||
anchors.right: parent.right;
|
||||
anchors.rightMargin: 16;
|
||||
boxSize: 24;
|
||||
width: 110;
|
||||
boxSize: 28;
|
||||
onCheckedChanged: {
|
||||
Settings.setValue("sendMoneyNearbyPublicly", checked);
|
||||
}
|
||||
}
|
||||
RalewaySemiBold {
|
||||
id: sendPubliclyCheckboxHelp;
|
||||
visible: sendPubliclyCheckbox.visible;
|
||||
text: "[?]";
|
||||
// Anchors
|
||||
anchors.left: sendPubliclyCheckbox.right;
|
||||
anchors.leftMargin: 8;
|
||||
anchors.verticalCenter: sendPubliclyCheckbox.verticalCenter;
|
||||
height: 30;
|
||||
width: paintedWidth;
|
||||
// Text size
|
||||
size: 18;
|
||||
// Style
|
||||
color: hifi.colors.blueAccent;
|
||||
MouseArea {
|
||||
enabled: sendPubliclyCheckboxHelp.visible;
|
||||
anchors.fill: parent;
|
||||
hoverEnabled: true;
|
||||
onEntered: {
|
||||
parent.color = hifi.colors.blueHighlight;
|
||||
}
|
||||
onExited: {
|
||||
parent.color = hifi.colors.blueAccent;
|
||||
}
|
||||
onClicked: {
|
||||
lightboxPopup.titleText = "Send Money Effect";
|
||||
lightboxPopup.bodyImageSource = "../wallet/sendMoney/images/send-money-effect-sm.jpg"; // Path relative to CommerceLightbox.qml
|
||||
lightboxPopup.bodyText = "Enabling this option will create a particle effect between you and " +
|
||||
"your recipient that is visible to everyone nearby.";
|
||||
lightboxPopup.button1text = "CLOSE";
|
||||
lightboxPopup.button1method = "root.visible = false;"
|
||||
lightboxPopup.visible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
|
@ -1059,6 +1110,7 @@ Item {
|
|||
MouseArea {
|
||||
anchors.fill: parent;
|
||||
propagateComposedEvents: false;
|
||||
hoverEnabled: true;
|
||||
}
|
||||
|
||||
AnimatedImage {
|
||||
|
@ -1533,6 +1585,8 @@ Item {
|
|||
sendMoneyStep.selectedRecipientProfilePic = "";
|
||||
amountTextField.text = "";
|
||||
optionalMessage.text = "";
|
||||
sendPubliclyCheckbox.checked = Settings.getValue("sendMoneyNearbyPublicly", true);
|
||||
sendMoneyStep.referrer = "";
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
|
@ -2294,7 +2294,7 @@ void Application::initializeGL() {
|
|||
#ifndef Q_OS_ANDROID
|
||||
_renderEngine->addJob<SecondaryCameraRenderTask>("SecondaryCameraJob", cullFunctor, !DISABLE_DEFERRED);
|
||||
#endif
|
||||
_renderEngine->addJob<RenderViewTask>("RenderMainView", cullFunctor, !DISABLE_DEFERRED);
|
||||
_renderEngine->addJob<RenderViewTask>("RenderMainView", cullFunctor, !DISABLE_DEFERRED, render::ItemKey::TAG_BITS_0, render::ItemKey::TAG_BITS_0);
|
||||
|
||||
#ifdef Q_OS_OSX
|
||||
DeadlockWatchdogThread::resume();
|
||||
|
|
|
@ -178,7 +178,7 @@ public:
|
|||
render::ItemID WorldBoxRenderData::_item{ render::Item::INVALID_ITEM_ID };
|
||||
|
||||
namespace render {
|
||||
template <> const ItemKey payloadGetKey(const WorldBoxRenderData::Pointer& stuff) { return ItemKey::Builder::opaqueShape(); }
|
||||
template <> const ItemKey payloadGetKey(const WorldBoxRenderData::Pointer& stuff) { return ItemKey::Builder::opaqueShape().withTagBits(ItemKey::TAG_BITS_0 | ItemKey::TAG_BITS_1); }
|
||||
template <> const Item::Bound payloadGetBound(const WorldBoxRenderData::Pointer& stuff) { return Item::Bound(); }
|
||||
template <> void payloadRender(const WorldBoxRenderData::Pointer& stuff, RenderArgs* args) {
|
||||
if (Menu::getInstance()->isOptionChecked(MenuOption::WorldAxes)) {
|
||||
|
|
|
@ -19,8 +19,9 @@
|
|||
using RenderArgsPointer = std::shared_ptr<RenderArgs>;
|
||||
|
||||
void MainRenderTask::build(JobModel& task, const render::Varying& inputs, render::Varying& outputs, render::CullFunctor cullFunctor, bool isDeferred) {
|
||||
task.addJob<RenderShadowTask>("RenderShadowTask", cullFunctor);
|
||||
const auto items = task.addJob<RenderFetchCullSortTask>("FetchCullSort", cullFunctor);
|
||||
|
||||
task.addJob<RenderShadowTask>("RenderShadowTask", cullFunctor, render::ItemKey::TAG_BITS_1, render::ItemKey::TAG_BITS_1);
|
||||
const auto items = task.addJob<RenderFetchCullSortTask>("FetchCullSort", cullFunctor, render::ItemKey::TAG_BITS_1, render::ItemKey::TAG_BITS_1);
|
||||
assert(items.canCast<RenderFetchCullSortTask::Output>());
|
||||
if (!isDeferred) {
|
||||
task.addJob<RenderForwardTask>("Forward", items);
|
||||
|
@ -205,7 +206,7 @@ public:
|
|||
|
||||
void SecondaryCameraRenderTask::build(JobModel& task, const render::Varying& inputs, render::Varying& outputs, render::CullFunctor cullFunctor, bool isDeferred) {
|
||||
const auto cachedArg = task.addJob<SecondaryCameraJob>("SecondaryCamera");
|
||||
const auto items = task.addJob<RenderFetchCullSortTask>("FetchCullSort", cullFunctor);
|
||||
const auto items = task.addJob<RenderFetchCullSortTask>("FetchCullSort", cullFunctor, render::ItemKey::TAG_BITS_1, render::ItemKey::TAG_BITS_1);
|
||||
assert(items.canCast<RenderFetchCullSortTask::Output>());
|
||||
if (!isDeferred) {
|
||||
task.addJob<RenderForwardTask>("Forward", items);
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
#include <recording/Frame.h>
|
||||
#include <RecordingScriptingInterface.h>
|
||||
#include <trackers/FaceTracker.h>
|
||||
#include <RenderableModelEntityItem.h>
|
||||
|
||||
#include "MyHead.h"
|
||||
#include "MySkeletonModel.h"
|
||||
|
@ -503,11 +504,42 @@ void MyAvatar::updateEyeContactTarget(float deltaTime) {
|
|||
extern QByteArray avatarStateToFrame(const AvatarData* _avatar);
|
||||
extern void avatarStateFromFrame(const QByteArray& frameData, AvatarData* _avatar);
|
||||
|
||||
void MyAvatar::beParentOfChild(SpatiallyNestablePointer newChild) const {
|
||||
_cauterizationNeedsUpdate = true;
|
||||
SpatiallyNestable::beParentOfChild(newChild);
|
||||
}
|
||||
|
||||
void MyAvatar::forgetChild(SpatiallyNestablePointer newChild) const {
|
||||
_cauterizationNeedsUpdate = true;
|
||||
SpatiallyNestable::forgetChild(newChild);
|
||||
}
|
||||
|
||||
void MyAvatar::updateChildCauterization(SpatiallyNestablePointer object) {
|
||||
if (object->getNestableType() == NestableType::Entity) {
|
||||
EntityItemPointer entity = std::static_pointer_cast<EntityItem>(object);
|
||||
entity->setCauterized(!_prevShouldDrawHead);
|
||||
}
|
||||
}
|
||||
|
||||
void MyAvatar::simulate(float deltaTime) {
|
||||
PerformanceTimer perfTimer("simulate");
|
||||
|
||||
animateScaleChanges(deltaTime);
|
||||
|
||||
if (_cauterizationNeedsUpdate) {
|
||||
const std::unordered_set<int>& headBoneSet = _skeletonModel->getCauterizeBoneSet();
|
||||
forEachChild([&](SpatiallyNestablePointer object) {
|
||||
bool isChildOfHead = headBoneSet.find(object->getParentJointIndex()) != headBoneSet.end();
|
||||
if (isChildOfHead) {
|
||||
updateChildCauterization(object);
|
||||
object->forEachDescendant([&](SpatiallyNestablePointer descendant) {
|
||||
updateChildCauterization(descendant);
|
||||
});
|
||||
}
|
||||
});
|
||||
_cauterizationNeedsUpdate = false;
|
||||
}
|
||||
|
||||
{
|
||||
PerformanceTimer perfTimer("transform");
|
||||
bool stepAction = false;
|
||||
|
@ -1067,7 +1099,7 @@ void MyAvatar::setEnableDebugDrawIKChains(bool isEnabled) {
|
|||
}
|
||||
|
||||
void MyAvatar::setEnableMeshVisible(bool isEnabled) {
|
||||
_skeletonModel->setVisibleInScene(isEnabled, qApp->getMain3DScene());
|
||||
_skeletonModel->setVisibleInScene(isEnabled, qApp->getMain3DScene(), render::ItemKey::TAG_BITS_NONE);
|
||||
}
|
||||
|
||||
void MyAvatar::setEnableInverseKinematics(bool isEnabled) {
|
||||
|
@ -1417,8 +1449,9 @@ void MyAvatar::clearJointsData() {
|
|||
|
||||
void MyAvatar::setSkeletonModelURL(const QUrl& skeletonModelURL) {
|
||||
Avatar::setSkeletonModelURL(skeletonModelURL);
|
||||
_skeletonModel->setVisibleInScene(true, qApp->getMain3DScene());
|
||||
_skeletonModel->setVisibleInScene(true, qApp->getMain3DScene(), render::ItemKey::TAG_BITS_NONE);
|
||||
_headBoneSet.clear();
|
||||
_cauterizationNeedsUpdate = true;
|
||||
emit skeletonChanged();
|
||||
|
||||
}
|
||||
|
@ -1762,7 +1795,7 @@ void MyAvatar::attach(const QString& modelURL, const QString& jointName,
|
|||
|
||||
void MyAvatar::setVisibleInSceneIfReady(Model* model, const render::ScenePointer& scene, bool visible) {
|
||||
if (model->isActive() && model->isRenderable()) {
|
||||
model->setVisibleInScene(visible, scene);
|
||||
model->setVisibleInScene(visible, scene, render::ItemKey::TAG_BITS_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1790,6 +1823,8 @@ void MyAvatar::initHeadBones() {
|
|||
}
|
||||
q.pop();
|
||||
}
|
||||
|
||||
_cauterizationNeedsUpdate = true;
|
||||
}
|
||||
|
||||
QUrl MyAvatar::getAnimGraphOverrideUrl() const {
|
||||
|
@ -1860,6 +1895,7 @@ void MyAvatar::postUpdate(float deltaTime, const render::ScenePointer& scene) {
|
|||
_fstAnimGraphOverrideUrl = _skeletonModel->getGeometry()->getAnimGraphOverrideUrl();
|
||||
initAnimGraph();
|
||||
_isAnimatingScale = true;
|
||||
_cauterizationNeedsUpdate = true;
|
||||
}
|
||||
|
||||
if (_enableDebugDrawDefaultPose || _enableDebugDrawAnimPose) {
|
||||
|
@ -1948,6 +1984,7 @@ void MyAvatar::preDisplaySide(RenderArgs* renderArgs) {
|
|||
// toggle using the cauterizedBones depending on where the camera is and the rendering pass type.
|
||||
const bool shouldDrawHead = shouldRenderHead(renderArgs);
|
||||
if (shouldDrawHead != _prevShouldDrawHead) {
|
||||
_cauterizationNeedsUpdate = true;
|
||||
_skeletonModel->setEnableCauterization(!shouldDrawHead);
|
||||
|
||||
for (int i = 0; i < _attachmentData.size(); i++) {
|
||||
|
@ -1957,7 +1994,8 @@ void MyAvatar::preDisplaySide(RenderArgs* renderArgs) {
|
|||
_attachmentData[i].jointName.compare("RightEye", Qt::CaseInsensitive) == 0 ||
|
||||
_attachmentData[i].jointName.compare("HeadTop_End", Qt::CaseInsensitive) == 0 ||
|
||||
_attachmentData[i].jointName.compare("Face", Qt::CaseInsensitive) == 0) {
|
||||
_attachmentModels[i]->setVisibleInScene(shouldDrawHead, qApp->getMain3DScene());
|
||||
_attachmentModels[i]->setVisibleInScene(shouldDrawHead, qApp->getMain3DScene(),
|
||||
render::ItemKey::TAG_BITS_NONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3238,8 +3276,6 @@ bool MyAvatar::pinJoint(int index, const glm::vec3& position, const glm::quat& o
|
|||
slamPosition(position);
|
||||
setWorldOrientation(orientation);
|
||||
|
||||
_skeletonModel->getRig().setMaxHipsOffsetLength(0.05f);
|
||||
|
||||
auto it = std::find(_pinnedJoints.begin(), _pinnedJoints.end(), index);
|
||||
if (it == _pinnedJoints.end()) {
|
||||
_pinnedJoints.push_back(index);
|
||||
|
@ -3259,12 +3295,6 @@ bool MyAvatar::clearPinOnJoint(int index) {
|
|||
auto it = std::find(_pinnedJoints.begin(), _pinnedJoints.end(), index);
|
||||
if (it != _pinnedJoints.end()) {
|
||||
_pinnedJoints.erase(it);
|
||||
|
||||
auto hipsIndex = getJointIndex("Hips");
|
||||
if (index == hipsIndex) {
|
||||
_skeletonModel->getRig().setMaxHipsOffsetLength(FLT_MAX);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -633,6 +633,11 @@ signals:
|
|||
private slots:
|
||||
void leaveDomain();
|
||||
|
||||
|
||||
protected:
|
||||
virtual void beParentOfChild(SpatiallyNestablePointer newChild) const override;
|
||||
virtual void forgetChild(SpatiallyNestablePointer newChild) const override;
|
||||
|
||||
private:
|
||||
|
||||
bool requiresSafeLanding(const glm::vec3& positionIn, glm::vec3& positionOut);
|
||||
|
@ -812,6 +817,8 @@ private:
|
|||
bool _enableDebugDrawIKChains { false };
|
||||
bool _enableDebugDrawDetailedCollision { false };
|
||||
|
||||
mutable bool _cauterizationNeedsUpdate; // do we need to scan children and update their "cauterized" state?
|
||||
|
||||
AudioListenerMode _audioListenerMode;
|
||||
glm::vec3 _customListenPosition;
|
||||
glm::quat _customListenOrientation;
|
||||
|
@ -849,6 +856,8 @@ private:
|
|||
// height of user in sensor space, when standing erect.
|
||||
ThreadSafeValueCache<float> _userHeight { DEFAULT_AVATAR_HEIGHT };
|
||||
|
||||
void updateChildCauterization(SpatiallyNestablePointer object);
|
||||
|
||||
// max unscaled forward movement speed
|
||||
ThreadSafeValueCache<float> _walkSpeed { DEFAULT_AVATAR_MAX_WALKING_SPEED };
|
||||
};
|
||||
|
|
|
@ -43,8 +43,6 @@ static AnimPose computeHipsInSensorFrame(MyAvatar* myAvatar, bool isFlying) {
|
|||
AnimPose result = AnimPose(worldToSensorMat * avatarTransform.getMatrix() * Matrices::Y_180);
|
||||
result.scale() = glm::vec3(1.0f, 1.0f, 1.0f);
|
||||
return result;
|
||||
} else {
|
||||
DebugDraw::getInstance().removeMarker("pinnedHips");
|
||||
}
|
||||
|
||||
glm::mat4 hipsMat = myAvatar->deriveBodyFromHMDSensor();
|
||||
|
|
|
@ -86,7 +86,8 @@ void ModelOverlay::update(float deltatime) {
|
|||
}
|
||||
if (_visibleDirty) {
|
||||
_visibleDirty = false;
|
||||
_model->setVisibleInScene(getVisible(), scene);
|
||||
// don't show overlays in mirrors
|
||||
_model->setVisibleInScene(getVisible(), scene, render::ItemKey::TAG_BITS_0);
|
||||
}
|
||||
if (_drawInFrontDirty) {
|
||||
_drawInFrontDirty = false;
|
||||
|
@ -120,8 +121,10 @@ void ModelOverlay::removeFromScene(Overlay::Pointer overlay, const render::Scene
|
|||
}
|
||||
|
||||
void ModelOverlay::setVisible(bool visible) {
|
||||
Overlay::setVisible(visible);
|
||||
_visibleDirty = true;
|
||||
if (visible != getVisible()) {
|
||||
Overlay::setVisible(visible);
|
||||
_visibleDirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
void ModelOverlay::setDrawInFront(bool drawInFront) {
|
||||
|
|
|
@ -106,7 +106,7 @@ private:
|
|||
bool _jointMappingCompleted { false };
|
||||
QVector<int> _jointMapping; // domain is index into model-joints, range is index into animation-joints
|
||||
|
||||
bool _visibleDirty { false };
|
||||
bool _visibleDirty { true };
|
||||
bool _drawInFrontDirty { false };
|
||||
bool _drawInHUDDirty { false };
|
||||
|
||||
|
|
|
@ -44,6 +44,13 @@ namespace render {
|
|||
} else {
|
||||
builder.withViewSpace();
|
||||
}
|
||||
|
||||
if (!overlay->getVisible()) {
|
||||
builder.withInvisible();
|
||||
}
|
||||
|
||||
builder.withTagBits(render::ItemKey::TAG_BITS_0); // Only draw overlays in main view
|
||||
|
||||
return builder.build();
|
||||
}
|
||||
template <> const Item::Bound payloadGetBound(const Overlay::Pointer& overlay) {
|
||||
|
|
|
@ -880,25 +880,6 @@ const AnimPoseVec& AnimInverseKinematics::evaluate(const AnimVariantMap& animVar
|
|||
return _relativePoses;
|
||||
}
|
||||
|
||||
AnimPose AnimInverseKinematics::applyHipsOffset() const {
|
||||
glm::vec3 hipsOffset = _hipsOffset;
|
||||
AnimPose relHipsPose = _relativePoses[_hipsIndex];
|
||||
float offsetLength = glm::length(hipsOffset);
|
||||
const float MIN_HIPS_OFFSET_LENGTH = 0.03f;
|
||||
if (offsetLength > MIN_HIPS_OFFSET_LENGTH) {
|
||||
float scaleFactor = ((offsetLength - MIN_HIPS_OFFSET_LENGTH) / offsetLength);
|
||||
glm::vec3 scaledHipsOffset = scaleFactor * hipsOffset;
|
||||
if (_hipsParentIndex == -1) {
|
||||
relHipsPose.trans() = _relativePoses[_hipsIndex].trans() + scaledHipsOffset;
|
||||
} else {
|
||||
AnimPose absHipsPose = _skeleton->getAbsolutePose(_hipsIndex, _relativePoses);
|
||||
absHipsPose.trans() += scaledHipsOffset;
|
||||
relHipsPose = _skeleton->getAbsolutePose(_hipsParentIndex, _relativePoses).inverse() * absHipsPose;
|
||||
}
|
||||
}
|
||||
return relHipsPose;
|
||||
}
|
||||
|
||||
//virtual
|
||||
const AnimPoseVec& AnimInverseKinematics::overlay(const AnimVariantMap& animVars, const AnimContext& context, float dt, Triggers& triggersOut, const AnimPoseVec& underPoses) {
|
||||
// allows solutionSource to be overridden by an animVar
|
||||
|
@ -996,27 +977,6 @@ const AnimPoseVec& AnimInverseKinematics::overlay(const AnimVariantMap& animVars
|
|||
|
||||
_relativePoses[_hipsIndex] = parentAbsPose.inverse() * absPose;
|
||||
_relativePoses[_hipsIndex].scale() = glm::vec3(1.0f);
|
||||
_hipsOffset = Vectors::ZERO;
|
||||
|
||||
} else if (_hipsIndex >= 0) {
|
||||
|
||||
// if there is no hips target, shift hips according to the _hipsOffset from the previous frame
|
||||
AnimPose relHipsPose = applyHipsOffset();
|
||||
|
||||
// determine if we should begin interpolating the hips.
|
||||
for (size_t i = 0; i < targets.size(); i++) {
|
||||
if (_prevJointChainInfoVec[i].target.getIndex() == _hipsIndex) {
|
||||
if (_prevJointChainInfoVec[i].timer > 0.0f) {
|
||||
// smoothly lerp in hipsOffset
|
||||
float alpha = (JOINT_CHAIN_INTERP_TIME - _prevJointChainInfoVec[i].timer) / JOINT_CHAIN_INTERP_TIME;
|
||||
AnimPose prevRelHipsPose(_prevJointChainInfoVec[i].jointInfoVec[0].rot, _prevJointChainInfoVec[i].jointInfoVec[0].trans);
|
||||
::blend(1, &prevRelHipsPose, &relHipsPose, alpha, &relHipsPose);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
_relativePoses[_hipsIndex] = relHipsPose;
|
||||
}
|
||||
|
||||
// if there is an active jointChainInfo for the hips store the post shifted hips into it.
|
||||
|
@ -1084,11 +1044,6 @@ const AnimPoseVec& AnimInverseKinematics::overlay(const AnimVariantMap& animVars
|
|||
|
||||
solve(context, targets, dt, jointChainInfoVec);
|
||||
}
|
||||
|
||||
if (_hipsTargetIndex < 0) {
|
||||
PROFILE_RANGE_EX(simulation_animation, "ik/measureHipsOffset", 0xffff00ff, 0);
|
||||
_hipsOffset = computeHipsOffset(targets, underPoses, dt, _hipsOffset);
|
||||
}
|
||||
}
|
||||
|
||||
if (context.getEnableDebugDrawIKConstraints()) {
|
||||
|
@ -1099,69 +1054,6 @@ const AnimPoseVec& AnimInverseKinematics::overlay(const AnimVariantMap& animVars
|
|||
return _relativePoses;
|
||||
}
|
||||
|
||||
glm::vec3 AnimInverseKinematics::computeHipsOffset(const std::vector<IKTarget>& targets, const AnimPoseVec& underPoses, float dt, glm::vec3 prevHipsOffset) const {
|
||||
|
||||
// measure new _hipsOffset for next frame
|
||||
// by looking for discrepancies between where a targeted endEffector is
|
||||
// and where it wants to be (after IK solutions are done)
|
||||
glm::vec3 hipsOffset = prevHipsOffset;
|
||||
glm::vec3 newHipsOffset = Vectors::ZERO;
|
||||
for (auto& target: targets) {
|
||||
int targetIndex = target.getIndex();
|
||||
if (targetIndex == _headIndex && _headIndex != -1) {
|
||||
// special handling for headTarget
|
||||
if (target.getType() == IKTarget::Type::RotationOnly) {
|
||||
// we want to shift the hips to bring the underPose closer
|
||||
// to where the head happens to be (overpose)
|
||||
glm::vec3 under = _skeleton->getAbsolutePose(_headIndex, underPoses).trans();
|
||||
glm::vec3 actual = _skeleton->getAbsolutePose(_headIndex, _relativePoses).trans();
|
||||
const float HEAD_OFFSET_SLAVE_FACTOR = 0.65f;
|
||||
newHipsOffset += HEAD_OFFSET_SLAVE_FACTOR * (actual - under);
|
||||
} else if (target.getType() == IKTarget::Type::HmdHead) {
|
||||
// we want to shift the hips to bring the head to its designated position
|
||||
glm::vec3 actual = _skeleton->getAbsolutePose(_headIndex, _relativePoses).trans();
|
||||
hipsOffset += target.getTranslation() - actual;
|
||||
// and ignore all other targets
|
||||
newHipsOffset = hipsOffset;
|
||||
break;
|
||||
} else if (target.getType() == IKTarget::Type::RotationAndPosition) {
|
||||
glm::vec3 actualPosition = _skeleton->getAbsolutePose(targetIndex, _relativePoses).trans();
|
||||
glm::vec3 targetPosition = target.getTranslation();
|
||||
newHipsOffset += targetPosition - actualPosition;
|
||||
|
||||
// Add downward pressure on the hips
|
||||
const float PRESSURE_SCALE_FACTOR = 0.95f;
|
||||
const float PRESSURE_TRANSLATION_OFFSET = 1.0f;
|
||||
newHipsOffset *= PRESSURE_SCALE_FACTOR;
|
||||
newHipsOffset -= PRESSURE_TRANSLATION_OFFSET;
|
||||
}
|
||||
} else if (target.getType() == IKTarget::Type::RotationAndPosition) {
|
||||
glm::vec3 actualPosition = _skeleton->getAbsolutePose(targetIndex, _relativePoses).trans();
|
||||
glm::vec3 targetPosition = target.getTranslation();
|
||||
newHipsOffset += targetPosition - actualPosition;
|
||||
}
|
||||
}
|
||||
|
||||
// smooth transitions by relaxing hipsOffset toward the new value
|
||||
const float HIPS_OFFSET_SLAVE_TIMESCALE = 0.10f;
|
||||
float tau = dt < HIPS_OFFSET_SLAVE_TIMESCALE ? dt / HIPS_OFFSET_SLAVE_TIMESCALE : 1.0f;
|
||||
hipsOffset += (newHipsOffset - hipsOffset) * tau;
|
||||
|
||||
// clamp the hips offset
|
||||
float hipsOffsetLength = glm::length(hipsOffset);
|
||||
if (hipsOffsetLength > _maxHipsOffsetLength) {
|
||||
hipsOffset *= _maxHipsOffsetLength / hipsOffsetLength;
|
||||
}
|
||||
|
||||
return hipsOffset;
|
||||
}
|
||||
|
||||
void AnimInverseKinematics::setMaxHipsOffsetLength(float maxLength) {
|
||||
// manually adjust scale here
|
||||
const float METERS_TO_CENTIMETERS = 100.0f;
|
||||
_maxHipsOffsetLength = METERS_TO_CENTIMETERS * maxLength;
|
||||
}
|
||||
|
||||
void AnimInverseKinematics::clearIKJointLimitHistory() {
|
||||
for (auto& pair : _constraints) {
|
||||
pair.second->clearHistory();
|
||||
|
|
|
@ -57,8 +57,6 @@ public:
|
|||
|
||||
void clearIKJointLimitHistory();
|
||||
|
||||
void setMaxHipsOffsetLength(float maxLength);
|
||||
|
||||
float getMaxErrorOnLastSolve() { return _maxErrorOnLastSolve; }
|
||||
|
||||
enum class SolutionSource {
|
||||
|
@ -92,7 +90,6 @@ protected:
|
|||
void blendToPoses(const AnimPoseVec& targetPoses, const AnimPoseVec& underPose, float blendFactor);
|
||||
void preconditionRelativePosesToAvoidLimbLock(const AnimContext& context, const std::vector<IKTarget>& targets);
|
||||
void setSecondaryTargets(const AnimContext& context);
|
||||
AnimPose applyHipsOffset() const;
|
||||
|
||||
// used to pre-compute information about each joint influeced by a spline IK target.
|
||||
struct SplineJointInfo {
|
||||
|
@ -111,7 +108,6 @@ protected:
|
|||
void clearConstraints();
|
||||
void initConstraints();
|
||||
void initLimitCenterPoses();
|
||||
glm::vec3 computeHipsOffset(const std::vector<IKTarget>& targets, const AnimPoseVec& underPoses, float dt, glm::vec3 prevHipsOffset) const;
|
||||
|
||||
// no copies
|
||||
AnimInverseKinematics(const AnimInverseKinematics&) = delete;
|
||||
|
@ -150,9 +146,6 @@ protected:
|
|||
|
||||
mutable std::map<int, std::vector<SplineJointInfo>> _splineJointInfoMap;
|
||||
|
||||
// experimental data for moving hips during IK
|
||||
glm::vec3 _hipsOffset { Vectors::ZERO };
|
||||
float _maxHipsOffsetLength{ FLT_MAX };
|
||||
int _headIndex { -1 };
|
||||
int _hipsIndex { -1 };
|
||||
int _hipsParentIndex { -1 };
|
||||
|
|
|
@ -372,18 +372,6 @@ void Rig::clearIKJointLimitHistory() {
|
|||
}
|
||||
}
|
||||
|
||||
void Rig::setMaxHipsOffsetLength(float maxLength) {
|
||||
_maxHipsOffsetLength = maxLength;
|
||||
auto ikNode = getAnimInverseKinematicsNode();
|
||||
if (ikNode) {
|
||||
ikNode->setMaxHipsOffsetLength(_maxHipsOffsetLength);
|
||||
}
|
||||
}
|
||||
|
||||
float Rig::getMaxHipsOffsetLength() const {
|
||||
return _maxHipsOffsetLength;
|
||||
}
|
||||
|
||||
float Rig::getIKErrorOnLastSolve() const {
|
||||
float result = 0.0f;
|
||||
|
||||
|
|
|
@ -346,7 +346,6 @@ protected:
|
|||
bool _enabledAnimations { true };
|
||||
|
||||
mutable uint32_t _jointNameWarningCount { 0 };
|
||||
float _maxHipsOffsetLength { 1.0f };
|
||||
|
||||
bool _enableDebugDrawIKTargets { false };
|
||||
bool _enableDebugDrawIKConstraints { false };
|
||||
|
|
|
@ -50,7 +50,7 @@ const glm::vec3 HAND_TO_PALM_OFFSET(0.0f, 0.12f, 0.08f);
|
|||
|
||||
namespace render {
|
||||
template <> const ItemKey payloadGetKey(const AvatarSharedPointer& avatar) {
|
||||
return ItemKey::Builder::opaqueShape().withTypeMeta();
|
||||
return ItemKey::Builder::opaqueShape().withTypeMeta().withTagBits(ItemKey::TAG_BITS_0 | ItemKey::TAG_BITS_1);
|
||||
}
|
||||
template <> const Item::Bound payloadGetBound(const AvatarSharedPointer& avatar) {
|
||||
return static_pointer_cast<Avatar>(avatar)->getBounds();
|
||||
|
|
|
@ -159,10 +159,10 @@ Item::Bound EntityRenderer::getBound() {
|
|||
|
||||
ItemKey EntityRenderer::getKey() {
|
||||
if (isTransparent()) {
|
||||
return ItemKey::Builder::transparentShape().withTypeMeta();
|
||||
return ItemKey::Builder::transparentShape().withTypeMeta().withTagBits(render::ItemKey::TAG_BITS_0 | render::ItemKey::TAG_BITS_1);
|
||||
}
|
||||
|
||||
return ItemKey::Builder::opaqueShape().withTypeMeta();
|
||||
return ItemKey::Builder::opaqueShape().withTypeMeta().withTagBits(render::ItemKey::TAG_BITS_0 | render::ItemKey::TAG_BITS_1);
|
||||
}
|
||||
|
||||
uint32_t EntityRenderer::metaFetchMetaSubItems(ItemIDs& subItems) {
|
||||
|
@ -185,7 +185,12 @@ void EntityRenderer::render(RenderArgs* args) {
|
|||
emit requestRenderUpdate();
|
||||
}
|
||||
|
||||
if (_visible) {
|
||||
auto& renderMode = args->_renderMode;
|
||||
bool cauterized = (renderMode != RenderArgs::RenderMode::SHADOW_RENDER_MODE &&
|
||||
renderMode != RenderArgs::RenderMode::SECONDARY_CAMERA_RENDER_MODE &&
|
||||
_cauterized);
|
||||
|
||||
if (_visible && !cauterized) {
|
||||
doRender(args);
|
||||
}
|
||||
}
|
||||
|
@ -366,6 +371,7 @@ void EntityRenderer::doRenderUpdateSynchronous(const ScenePointer& scene, Transa
|
|||
|
||||
_moving = entity->isMovingRelativeToParent();
|
||||
_visible = entity->getVisible();
|
||||
_cauterized = entity->getCauterized();
|
||||
_needsRenderUpdate = false;
|
||||
});
|
||||
}
|
||||
|
|
|
@ -124,6 +124,7 @@ protected:
|
|||
bool _isFading{ _entitiesShouldFadeFunction() };
|
||||
bool _prevIsTransparent { false };
|
||||
bool _visible { false };
|
||||
bool _cauterized { false };
|
||||
bool _moving { false };
|
||||
bool _needsRenderUpdate { false };
|
||||
// Only touched on the rendering thread
|
||||
|
|
|
@ -1013,9 +1013,9 @@ ModelEntityRenderer::ModelEntityRenderer(const EntityItemPointer& entity) : Pare
|
|||
|
||||
void ModelEntityRenderer::setKey(bool didVisualGeometryRequestSucceed) {
|
||||
if (didVisualGeometryRequestSucceed) {
|
||||
_itemKey = ItemKey::Builder().withTypeMeta();
|
||||
_itemKey = ItemKey::Builder().withTypeMeta().withTagBits(render::ItemKey::TAG_BITS_0 | render::ItemKey::TAG_BITS_1);
|
||||
} else {
|
||||
_itemKey = ItemKey::Builder().withTypeMeta().withTypeShape();
|
||||
_itemKey = ItemKey::Builder().withTypeMeta().withTypeShape().withTagBits(render::ItemKey::TAG_BITS_0 | render::ItemKey::TAG_BITS_1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1334,11 +1334,16 @@ void ModelEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& sce
|
|||
entity->updateModelBounds();
|
||||
entity->stopModelOverrideIfNoParent();
|
||||
|
||||
if (model->isVisible() != _visible) {
|
||||
// Default behavior for model is to not be visible in main view if cauterized (aka parented to the avatar's neck joint)
|
||||
uint32_t viewTaskBits = _cauterized ?
|
||||
render::ItemKey::TAG_BITS_1 : // draw in every view except the main one (view zero)
|
||||
render::ItemKey::TAG_BITS_ALL; // draw in all views
|
||||
|
||||
if (model->isVisible() != _visible || model->getViewTagBits() != viewTaskBits) {
|
||||
// FIXME: this seems like it could be optimized if we tracked our last known visible state in
|
||||
// the renderable item. As it stands now the model checks it's visible/invisible state
|
||||
// so most of the time we don't do anything in this function.
|
||||
model->setVisibleInScene(_visible, scene);
|
||||
model->setVisibleInScene(_visible, scene, viewTaskBits);
|
||||
}
|
||||
// TODO? early exit here when not visible?
|
||||
|
||||
|
|
|
@ -147,9 +147,9 @@ void ParticleEffectEntityRenderer::doRenderUpdateAsynchronousTyped(const TypedEn
|
|||
|
||||
ItemKey ParticleEffectEntityRenderer::getKey() {
|
||||
if (_visible) {
|
||||
return ItemKey::Builder::transparentShape();
|
||||
return ItemKey::Builder::transparentShape().withTagBits(render::ItemKey::TAG_BITS_0 | render::ItemKey::TAG_BITS_1);
|
||||
} else {
|
||||
return ItemKey::Builder().withInvisible().build();
|
||||
return ItemKey::Builder().withInvisible().withTagBits(render::ItemKey::TAG_BITS_0 | render::ItemKey::TAG_BITS_1).build();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -112,7 +112,7 @@ PolyLineEntityRenderer::PolyLineEntityRenderer(const EntityItemPointer& entity)
|
|||
}
|
||||
|
||||
ItemKey PolyLineEntityRenderer::getKey() {
|
||||
return ItemKey::Builder::transparentShape().withTypeMeta();
|
||||
return ItemKey::Builder::transparentShape().withTypeMeta().withTagBits(render::ItemKey::TAG_BITS_0 | render::ItemKey::TAG_BITS_1);
|
||||
}
|
||||
|
||||
ShapeKey PolyLineEntityRenderer::getShapeKey() {
|
||||
|
|
|
@ -99,7 +99,7 @@ const float MARCHING_CUBE_COLLISION_HULL_OFFSET = 0.5;
|
|||
|
||||
In RenderablePolyVoxEntityItem::render, these flags are checked and changes are propagated along the chain.
|
||||
decompressVolumeData() is called to decompress _voxelData into _volData. recomputeMesh() is called to invoke the
|
||||
polyVox surface extractor to create _mesh (as well as set Simulation _dirtyFlags). Because Simulation::DIRTY_SHAPE
|
||||
polyVox surface extractor to create _mesh (as well as set Simulation _flags). Because Simulation::DIRTY_SHAPE
|
||||
is set, isReadyToComputeShape() gets called and _shape is created either from _volData or _shape, depending on
|
||||
the surface style.
|
||||
|
||||
|
@ -1138,7 +1138,7 @@ void RenderablePolyVoxEntityItem::setMesh(graphics::MeshPointer mesh) {
|
|||
bool neighborsNeedUpdate;
|
||||
withWriteLock([&] {
|
||||
if (!_collisionless) {
|
||||
_dirtyFlags |= Simulation::DIRTY_SHAPE | Simulation::DIRTY_MASS;
|
||||
_flags |= Simulation::DIRTY_SHAPE | Simulation::DIRTY_MASS;
|
||||
}
|
||||
_mesh = mesh;
|
||||
_meshDirty = true;
|
||||
|
|
|
@ -269,7 +269,7 @@ void ZoneEntityRenderer::doRenderUpdateAsynchronousTyped(const TypedEntityPointe
|
|||
|
||||
|
||||
ItemKey ZoneEntityRenderer::getKey() {
|
||||
return ItemKey::Builder().withTypeMeta().build();
|
||||
return ItemKey::Builder().withTypeMeta().withTagBits(render::ItemKey::TAG_BITS_0 | render::ItemKey::TAG_BITS_1).build();
|
||||
}
|
||||
|
||||
bool ZoneEntityRenderer::needsRenderUpdateFromTypedEntity(const TypedEntityPointer& entity) const {
|
||||
|
|
|
@ -933,7 +933,7 @@ void EntityItem::setDensity(float density) {
|
|||
withWriteLock([&] {
|
||||
if (_density != clampedDensity) {
|
||||
_density = clampedDensity;
|
||||
_dirtyFlags |= Simulation::DIRTY_MASS;
|
||||
_flags |= Simulation::DIRTY_MASS;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -958,7 +958,7 @@ void EntityItem::setMass(float mass) {
|
|||
withWriteLock([&] {
|
||||
if (_density != newDensity) {
|
||||
_density = newDensity;
|
||||
_dirtyFlags |= Simulation::DIRTY_MASS;
|
||||
_flags |= Simulation::DIRTY_MASS;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -1623,41 +1623,42 @@ void EntityItem::setParentID(const QUuid& value) {
|
|||
if (!value.isNull() && tree) {
|
||||
EntityItemPointer entity = tree->findEntityByEntityItemID(value);
|
||||
if (entity) {
|
||||
newParentNoBootstrapping = entity->getDirtyFlags() & Simulation::NO_BOOTSTRAPPING;
|
||||
newParentNoBootstrapping = entity->getSpecialFlags() & Simulation::SPECIAL_FLAGS_NO_BOOTSTRAPPING;
|
||||
}
|
||||
}
|
||||
|
||||
if (!oldParentID.isNull() && tree) {
|
||||
EntityItemPointer entity = tree->findEntityByEntityItemID(oldParentID);
|
||||
if (entity) {
|
||||
oldParentNoBootstrapping = entity->getDirtyFlags() & Simulation::NO_BOOTSTRAPPING;
|
||||
oldParentNoBootstrapping = entity->getDirtyFlags() & Simulation::SPECIAL_FLAGS_NO_BOOTSTRAPPING;
|
||||
}
|
||||
}
|
||||
|
||||
if (!value.isNull() && (value == Physics::getSessionUUID() || value == AVATAR_SELF_ID)) {
|
||||
newParentNoBootstrapping |= Simulation::NO_BOOTSTRAPPING;
|
||||
newParentNoBootstrapping |= Simulation::SPECIAL_FLAGS_NO_BOOTSTRAPPING;
|
||||
}
|
||||
|
||||
if (!oldParentID.isNull() && (oldParentID == Physics::getSessionUUID() || oldParentID == AVATAR_SELF_ID)) {
|
||||
oldParentNoBootstrapping |= Simulation::NO_BOOTSTRAPPING;
|
||||
oldParentNoBootstrapping |= Simulation::SPECIAL_FLAGS_NO_BOOTSTRAPPING;
|
||||
}
|
||||
|
||||
if ((bool)(oldParentNoBootstrapping ^ newParentNoBootstrapping)) {
|
||||
if ((bool)(newParentNoBootstrapping & Simulation::NO_BOOTSTRAPPING)) {
|
||||
markDirtyFlags(Simulation::NO_BOOTSTRAPPING);
|
||||
forEachDescendant([&](SpatiallyNestablePointer object) {
|
||||
if (object->getNestableType() == NestableType::Entity) {
|
||||
EntityItemPointer entity = std::static_pointer_cast<EntityItem>(object);
|
||||
entity->markDirtyFlags(Simulation::DIRTY_COLLISION_GROUP | Simulation::NO_BOOTSTRAPPING);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
clearDirtyFlags(Simulation::NO_BOOTSTRAPPING);
|
||||
if ((bool)(newParentNoBootstrapping & Simulation::SPECIAL_FLAGS_NO_BOOTSTRAPPING)) {
|
||||
markSpecialFlags(Simulation::SPECIAL_FLAGS_NO_BOOTSTRAPPING);
|
||||
forEachDescendant([&](SpatiallyNestablePointer object) {
|
||||
if (object->getNestableType() == NestableType::Entity) {
|
||||
EntityItemPointer entity = std::static_pointer_cast<EntityItem>(object);
|
||||
entity->markDirtyFlags(Simulation::DIRTY_COLLISION_GROUP);
|
||||
entity->clearDirtyFlags(Simulation::NO_BOOTSTRAPPING);
|
||||
entity->markSpecialFlags(Simulation::SPECIAL_FLAGS_NO_BOOTSTRAPPING);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
clearSpecialFlags(Simulation::SPECIAL_FLAGS_NO_BOOTSTRAPPING);
|
||||
forEachDescendant([&](SpatiallyNestablePointer object) {
|
||||
if (object->getNestableType() == NestableType::Entity) {
|
||||
EntityItemPointer entity = std::static_pointer_cast<EntityItem>(object);
|
||||
entity->markDirtyFlags(Simulation::DIRTY_COLLISION_GROUP);
|
||||
entity->clearSpecialFlags(Simulation::SPECIAL_FLAGS_NO_BOOTSTRAPPING);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -1694,7 +1695,7 @@ void EntityItem::setUnscaledDimensions(const glm::vec3& value) {
|
|||
locationChanged();
|
||||
dimensionsChanged();
|
||||
withWriteLock([&] {
|
||||
_dirtyFlags |= (Simulation::DIRTY_SHAPE | Simulation::DIRTY_MASS);
|
||||
_flags |= (Simulation::DIRTY_SHAPE | Simulation::DIRTY_MASS);
|
||||
_queryAACubeSet = false;
|
||||
});
|
||||
}
|
||||
|
@ -1703,7 +1704,7 @@ void EntityItem::setUnscaledDimensions(const glm::vec3& value) {
|
|||
void EntityItem::setRotation(glm::quat rotation) {
|
||||
if (getLocalOrientation() != rotation) {
|
||||
setLocalOrientation(rotation);
|
||||
_dirtyFlags |= Simulation::DIRTY_ROTATION;
|
||||
_flags |= Simulation::DIRTY_ROTATION;
|
||||
forEachDescendant([&](SpatiallyNestablePointer object) {
|
||||
if (object->getNestableType() == NestableType::Entity) {
|
||||
EntityItemPointer entity = std::static_pointer_cast<EntityItem>(object);
|
||||
|
@ -1733,7 +1734,7 @@ void EntityItem::setVelocity(const glm::vec3& value) {
|
|||
velocity = value;
|
||||
}
|
||||
setLocalVelocity(velocity);
|
||||
_dirtyFlags |= Simulation::DIRTY_LINEAR_VELOCITY;
|
||||
_flags |= Simulation::DIRTY_LINEAR_VELOCITY;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1744,7 +1745,7 @@ void EntityItem::setDamping(float value) {
|
|||
withWriteLock([&] {
|
||||
if (_damping != clampedDamping) {
|
||||
_damping = clampedDamping;
|
||||
_dirtyFlags |= Simulation::DIRTY_MATERIAL;
|
||||
_flags |= Simulation::DIRTY_MATERIAL;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -1763,7 +1764,7 @@ void EntityItem::setGravity(const glm::vec3& value) {
|
|||
} else {
|
||||
_gravity = value;
|
||||
}
|
||||
_dirtyFlags |= Simulation::DIRTY_LINEAR_VELOCITY;
|
||||
_flags |= Simulation::DIRTY_LINEAR_VELOCITY;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1788,7 +1789,7 @@ void EntityItem::setAngularVelocity(const glm::vec3& value) {
|
|||
angularVelocity = value;
|
||||
}
|
||||
setLocalAngularVelocity(angularVelocity);
|
||||
_dirtyFlags |= Simulation::DIRTY_ANGULAR_VELOCITY;
|
||||
_flags |= Simulation::DIRTY_ANGULAR_VELOCITY;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1799,7 +1800,7 @@ void EntityItem::setAngularDamping(float value) {
|
|||
withWriteLock([&] {
|
||||
if (_angularDamping != clampedDamping) {
|
||||
_angularDamping = clampedDamping;
|
||||
_dirtyFlags |= Simulation::DIRTY_MATERIAL;
|
||||
_flags |= Simulation::DIRTY_MATERIAL;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -1808,7 +1809,7 @@ void EntityItem::setCollisionless(bool value) {
|
|||
withWriteLock([&] {
|
||||
if (_collisionless != value) {
|
||||
_collisionless = value;
|
||||
_dirtyFlags |= Simulation::DIRTY_COLLISION_GROUP;
|
||||
_flags |= Simulation::DIRTY_COLLISION_GROUP;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -1817,7 +1818,7 @@ void EntityItem::setCollisionMask(uint8_t value) {
|
|||
withWriteLock([&] {
|
||||
if ((_collisionMask & ENTITY_COLLISION_MASK_DEFAULT) != (value & ENTITY_COLLISION_MASK_DEFAULT)) {
|
||||
_collisionMask = (value & ENTITY_COLLISION_MASK_DEFAULT);
|
||||
_dirtyFlags |= Simulation::DIRTY_COLLISION_GROUP;
|
||||
_flags |= Simulation::DIRTY_COLLISION_GROUP;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -1829,11 +1830,11 @@ void EntityItem::setDynamic(bool value) {
|
|||
if (value && getShapeType() == SHAPE_TYPE_STATIC_MESH) {
|
||||
if (_dynamic) {
|
||||
_dynamic = false;
|
||||
_dirtyFlags |= Simulation::DIRTY_MOTION_TYPE;
|
||||
_flags |= Simulation::DIRTY_MOTION_TYPE;
|
||||
}
|
||||
} else {
|
||||
_dynamic = value;
|
||||
_dirtyFlags |= Simulation::DIRTY_MOTION_TYPE;
|
||||
_flags |= Simulation::DIRTY_MOTION_TYPE;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -1844,7 +1845,7 @@ void EntityItem::setRestitution(float value) {
|
|||
withWriteLock([&] {
|
||||
if (_restitution != clampedValue) {
|
||||
_restitution = clampedValue;
|
||||
_dirtyFlags |= Simulation::DIRTY_MATERIAL;
|
||||
_flags |= Simulation::DIRTY_MATERIAL;
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -1855,7 +1856,7 @@ void EntityItem::setFriction(float value) {
|
|||
withWriteLock([&] {
|
||||
if (_friction != clampedValue) {
|
||||
_friction = clampedValue;
|
||||
_dirtyFlags |= Simulation::DIRTY_MATERIAL;
|
||||
_flags |= Simulation::DIRTY_MATERIAL;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -1864,7 +1865,7 @@ void EntityItem::setLifetime(float value) {
|
|||
withWriteLock([&] {
|
||||
if (_lifetime != value) {
|
||||
_lifetime = value;
|
||||
_dirtyFlags |= Simulation::DIRTY_LIFETIME;
|
||||
_flags |= Simulation::DIRTY_LIFETIME;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -1873,7 +1874,7 @@ void EntityItem::setCreated(quint64 value) {
|
|||
withWriteLock([&] {
|
||||
if (_created != value) {
|
||||
_created = value;
|
||||
_dirtyFlags |= Simulation::DIRTY_LIFETIME;
|
||||
_flags |= Simulation::DIRTY_LIFETIME;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -1902,7 +1903,7 @@ void EntityItem::computeCollisionGroupAndFinalMask(int16_t& group, int16_t& mask
|
|||
}
|
||||
}
|
||||
|
||||
if ((bool)(_dirtyFlags & Simulation::NO_BOOTSTRAPPING)) {
|
||||
if ((bool)(_flags & Simulation::SPECIAL_FLAGS_NO_BOOTSTRAPPING)) {
|
||||
userMask &= ~USER_COLLISION_GROUP_MY_AVATAR;
|
||||
}
|
||||
mask = Physics::getDefaultCollisionMask(group) & (int16_t)(userMask);
|
||||
|
@ -1997,17 +1998,18 @@ bool EntityItem::addActionInternal(EntitySimulationPointer simulation, EntityDyn
|
|||
serializeActions(success, newDataCache);
|
||||
if (success) {
|
||||
_allActionsDataCache = newDataCache;
|
||||
_dirtyFlags |= Simulation::DIRTY_PHYSICS_ACTIVATION;
|
||||
_flags |= Simulation::DIRTY_PHYSICS_ACTIVATION;
|
||||
|
||||
auto actionType = action->getType();
|
||||
if (actionType == DYNAMIC_TYPE_HOLD || actionType == DYNAMIC_TYPE_FAR_GRAB) {
|
||||
if (!(bool)(_dirtyFlags & Simulation::NO_BOOTSTRAPPING)) {
|
||||
_dirtyFlags |= Simulation::NO_BOOTSTRAPPING;
|
||||
_dirtyFlags |= Simulation::DIRTY_COLLISION_GROUP; // may need to not collide with own avatar
|
||||
if (!(bool)(_flags & Simulation::SPECIAL_FLAGS_NO_BOOTSTRAPPING)) {
|
||||
_flags |= Simulation::SPECIAL_FLAGS_NO_BOOTSTRAPPING;
|
||||
_flags |= Simulation::DIRTY_COLLISION_GROUP; // may need to not collide with own avatar
|
||||
forEachDescendant([&](SpatiallyNestablePointer child) {
|
||||
if (child->getNestableType() == NestableType::Entity) {
|
||||
EntityItemPointer entity = std::static_pointer_cast<EntityItem>(child);
|
||||
entity->markDirtyFlags(Simulation::NO_BOOTSTRAPPING | Simulation::DIRTY_COLLISION_GROUP);
|
||||
entity->markDirtyFlags(Simulation::DIRTY_COLLISION_GROUP);
|
||||
entity->markSpecialFlags(Simulation::SPECIAL_FLAGS_NO_BOOTSTRAPPING);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -2033,7 +2035,7 @@ bool EntityItem::updateAction(EntitySimulationPointer simulation, const QUuid& a
|
|||
if (success) {
|
||||
action->setIsMine(true);
|
||||
serializeActions(success, _allActionsDataCache);
|
||||
_dirtyFlags |= Simulation::DIRTY_PHYSICS_ACTIVATION;
|
||||
_flags |= Simulation::DIRTY_PHYSICS_ACTIVATION;
|
||||
} else {
|
||||
qCDebug(entities) << "EntityItem::updateAction failed";
|
||||
}
|
||||
|
@ -2091,17 +2093,17 @@ bool EntityItem::removeActionInternal(const QUuid& actionID, EntitySimulationPoi
|
|||
_objectActions.remove(actionID);
|
||||
|
||||
if ((removedActionType == DYNAMIC_TYPE_HOLD || removedActionType == DYNAMIC_TYPE_FAR_GRAB) && !stillHasGrabActions()) {
|
||||
_dirtyFlags &= ~Simulation::NO_BOOTSTRAPPING;
|
||||
_dirtyFlags |= Simulation::DIRTY_COLLISION_GROUP; // may need to not collide with own avatar
|
||||
_flags &= ~Simulation::SPECIAL_FLAGS_NO_BOOTSTRAPPING;
|
||||
_flags |= Simulation::DIRTY_COLLISION_GROUP; // may need to not collide with own avatar
|
||||
forEachDescendant([&](SpatiallyNestablePointer child) {
|
||||
if (child->getNestableType() == NestableType::Entity) {
|
||||
EntityItemPointer entity = std::static_pointer_cast<EntityItem>(child);
|
||||
entity->markDirtyFlags(Simulation::DIRTY_COLLISION_GROUP);
|
||||
entity->clearDirtyFlags(Simulation::NO_BOOTSTRAPPING);
|
||||
entity->clearSpecialFlags(Simulation::SPECIAL_FLAGS_NO_BOOTSTRAPPING);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// NO-OP: we assume NO_BOOTSTRAPPING bits and collision group are correct
|
||||
// NO-OP: we assume SPECIAL_FLAGS_NO_BOOTSTRAPPING bits and collision group are correct
|
||||
// because they should have been set correctly when the action was added
|
||||
// and/or when children were linked
|
||||
}
|
||||
|
@ -2112,7 +2114,7 @@ bool EntityItem::removeActionInternal(const QUuid& actionID, EntitySimulationPoi
|
|||
|
||||
bool success = true;
|
||||
serializeActions(success, _allActionsDataCache);
|
||||
_dirtyFlags |= Simulation::DIRTY_PHYSICS_ACTIVATION;
|
||||
_flags |= Simulation::DIRTY_PHYSICS_ACTIVATION;
|
||||
setDynamicDataNeedsTransmit(true);
|
||||
return success;
|
||||
}
|
||||
|
@ -2132,8 +2134,8 @@ bool EntityItem::clearActions(EntitySimulationPointer simulation) {
|
|||
// empty _serializedActions means no actions for the EntityItem
|
||||
_actionsToRemove.clear();
|
||||
_allActionsDataCache.clear();
|
||||
_dirtyFlags |= Simulation::DIRTY_PHYSICS_ACTIVATION;
|
||||
_dirtyFlags |= Simulation::DIRTY_COLLISION_GROUP; // may need to not collide with own avatar
|
||||
_flags |= Simulation::DIRTY_PHYSICS_ACTIVATION;
|
||||
_flags |= Simulation::DIRTY_COLLISION_GROUP; // may need to not collide with own avatar
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
@ -2364,7 +2366,7 @@ QList<EntityDynamicPointer> EntityItem::getActionsOfType(EntityDynamicType typeT
|
|||
void EntityItem::locationChanged(bool tellPhysics) {
|
||||
requiresRecalcBoxes();
|
||||
if (tellPhysics) {
|
||||
_dirtyFlags |= Simulation::DIRTY_TRANSFORM;
|
||||
_flags |= Simulation::DIRTY_TRANSFORM;
|
||||
EntityTreePointer tree = getTree();
|
||||
if (tree) {
|
||||
tree->entityChanged(getThisPointer());
|
||||
|
@ -2832,7 +2834,7 @@ DEFINE_PROPERTY_ACCESSOR(quint32, StaticCertificateVersion, staticCertificateVer
|
|||
uint32_t EntityItem::getDirtyFlags() const {
|
||||
uint32_t result;
|
||||
withReadLock([&] {
|
||||
result = _dirtyFlags;
|
||||
result = _flags & Simulation::DIRTY_FLAGS;
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
@ -2840,13 +2842,37 @@ uint32_t EntityItem::getDirtyFlags() const {
|
|||
|
||||
void EntityItem::markDirtyFlags(uint32_t mask) {
|
||||
withWriteLock([&] {
|
||||
_dirtyFlags |= mask;
|
||||
mask &= Simulation::DIRTY_FLAGS;
|
||||
_flags |= mask;
|
||||
});
|
||||
}
|
||||
|
||||
void EntityItem::clearDirtyFlags(uint32_t mask) {
|
||||
withWriteLock([&] {
|
||||
_dirtyFlags &= ~mask;
|
||||
mask &= Simulation::DIRTY_FLAGS;
|
||||
_flags &= ~mask;
|
||||
});
|
||||
}
|
||||
|
||||
uint32_t EntityItem::getSpecialFlags() const {
|
||||
uint32_t result;
|
||||
withReadLock([&] {
|
||||
result = _flags & Simulation::SPECIAL_FLAGS;
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
void EntityItem::markSpecialFlags(uint32_t mask) {
|
||||
withWriteLock([&] {
|
||||
mask &= Simulation::SPECIAL_FLAGS;
|
||||
_flags |= mask;
|
||||
});
|
||||
}
|
||||
|
||||
void EntityItem::clearSpecialFlags(uint32_t mask) {
|
||||
withWriteLock([&] {
|
||||
mask &= Simulation::SPECIAL_FLAGS;
|
||||
_flags &= ~mask;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -358,7 +358,11 @@ public:
|
|||
|
||||
uint32_t getDirtyFlags() const;
|
||||
void markDirtyFlags(uint32_t mask);
|
||||
void clearDirtyFlags(uint32_t mask = 0xffffffff);
|
||||
void clearDirtyFlags(uint32_t mask = 0x0000ffff);
|
||||
|
||||
uint32_t getSpecialFlags() const;
|
||||
void markSpecialFlags(uint32_t mask);
|
||||
void clearSpecialFlags(uint32_t mask = 0xffff0000);
|
||||
|
||||
bool isMoving() const;
|
||||
bool isMovingRelativeToParent() const;
|
||||
|
@ -385,7 +389,7 @@ public:
|
|||
void getAllTerseUpdateProperties(EntityItemProperties& properties) const;
|
||||
|
||||
void flagForOwnershipBid(uint8_t priority);
|
||||
void flagForMotionStateChange() { _dirtyFlags |= Simulation::DIRTY_MOTION_TYPE; }
|
||||
void flagForMotionStateChange() { _flags |= Simulation::DIRTY_MOTION_TYPE; }
|
||||
|
||||
QString actionsToDebugString();
|
||||
bool addAction(EntitySimulationPointer simulation, EntityDynamicPointer action);
|
||||
|
@ -470,6 +474,9 @@ public:
|
|||
static QString _marketplacePublicKey;
|
||||
static void retrieveMarketplacePublicKey();
|
||||
|
||||
void setCauterized(bool value) { _cauterized = value; }
|
||||
bool getCauterized() const { return _cauterized; }
|
||||
|
||||
signals:
|
||||
void requestRenderUpdate();
|
||||
|
||||
|
@ -572,7 +579,7 @@ protected:
|
|||
//
|
||||
|
||||
// DirtyFlags are set whenever a property changes that the EntitySimulation needs to know about.
|
||||
uint32_t _dirtyFlags { 0 }; // things that have changed from EXTERNAL changes (via script or packet) but NOT from simulation
|
||||
uint32_t _flags { 0 }; // things that have changed from EXTERNAL changes (via script or packet) but NOT from simulation
|
||||
|
||||
// these backpointers are only ever set/cleared by friends:
|
||||
EntityTreeElementPointer _element; // set by EntityTreeElement
|
||||
|
@ -623,6 +630,7 @@ protected:
|
|||
quint64 _lastUpdatedAccelerationTimestamp { 0 };
|
||||
quint64 _lastUpdatedQueryAACubeTimestamp { 0 };
|
||||
|
||||
bool _cauterized { false }; // if true, don't draw because it would obscure 1st-person camera
|
||||
};
|
||||
|
||||
#endif // hifi_EntityItem_h
|
||||
|
|
|
@ -85,7 +85,7 @@ bool ModelEntityItem::setProperties(const EntityItemProperties& properties) {
|
|||
bool somethingChangedInAnimations = _animationProperties.setProperties(properties);
|
||||
|
||||
if (somethingChangedInAnimations) {
|
||||
_dirtyFlags |= Simulation::DIRTY_UPDATEABLE;
|
||||
_flags |= Simulation::DIRTY_UPDATEABLE;
|
||||
}
|
||||
somethingChanged = somethingChanged || somethingChangedInAnimations;
|
||||
|
||||
|
@ -132,7 +132,7 @@ int ModelEntityItem::readEntitySubclassDataFromBuffer(const unsigned char* data,
|
|||
READ_ENTITY_PROPERTY(PROP_SHAPE_TYPE, ShapeType, setShapeType);
|
||||
|
||||
if (animationPropertiesChanged) {
|
||||
_dirtyFlags |= Simulation::DIRTY_UPDATEABLE;
|
||||
_flags |= Simulation::DIRTY_UPDATEABLE;
|
||||
somethingChanged = true;
|
||||
}
|
||||
|
||||
|
@ -305,10 +305,10 @@ void ModelEntityItem::setShapeType(ShapeType type) {
|
|||
// dynamic and STATIC_MESH are incompatible
|
||||
// since the shape is being set here we clear the dynamic bit
|
||||
_dynamic = false;
|
||||
_dirtyFlags |= Simulation::DIRTY_MOTION_TYPE;
|
||||
_flags |= Simulation::DIRTY_MOTION_TYPE;
|
||||
}
|
||||
_shapeType = type;
|
||||
_dirtyFlags |= Simulation::DIRTY_SHAPE | Simulation::DIRTY_MASS;
|
||||
_flags |= Simulation::DIRTY_SHAPE | Simulation::DIRTY_MASS;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -336,7 +336,7 @@ void ModelEntityItem::setModelURL(const QString& url) {
|
|||
if (_modelURL != url) {
|
||||
_modelURL = url;
|
||||
if (_shapeType == SHAPE_TYPE_STATIC_MESH) {
|
||||
_dirtyFlags |= Simulation::DIRTY_SHAPE | Simulation::DIRTY_MASS;
|
||||
_flags |= Simulation::DIRTY_SHAPE | Simulation::DIRTY_MASS;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -348,14 +348,14 @@ void ModelEntityItem::setCompoundShapeURL(const QString& url) {
|
|||
ShapeType oldType = computeTrueShapeType();
|
||||
_compoundShapeURL.set(url);
|
||||
if (oldType != computeTrueShapeType()) {
|
||||
_dirtyFlags |= Simulation::DIRTY_SHAPE | Simulation::DIRTY_MASS;
|
||||
_flags |= Simulation::DIRTY_SHAPE | Simulation::DIRTY_MASS;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void ModelEntityItem::setAnimationURL(const QString& url) {
|
||||
_dirtyFlags |= Simulation::DIRTY_UPDATEABLE;
|
||||
_flags |= Simulation::DIRTY_UPDATEABLE;
|
||||
withWriteLock([&] {
|
||||
_animationProperties.setURL(url);
|
||||
});
|
||||
|
@ -422,16 +422,16 @@ void ModelEntityItem::setAnimationSettings(const QString& value) {
|
|||
bool allowTranslation = settingsMap["allowTranslation"].toBool();
|
||||
setAnimationAllowTranslation(allowTranslation);
|
||||
}
|
||||
_dirtyFlags |= Simulation::DIRTY_UPDATEABLE;
|
||||
_flags |= Simulation::DIRTY_UPDATEABLE;
|
||||
}
|
||||
|
||||
void ModelEntityItem::setAnimationIsPlaying(bool value) {
|
||||
_dirtyFlags |= Simulation::DIRTY_UPDATEABLE;
|
||||
_flags |= Simulation::DIRTY_UPDATEABLE;
|
||||
_animationProperties.setRunning(value);
|
||||
}
|
||||
|
||||
void ModelEntityItem::setAnimationFPS(float value) {
|
||||
_dirtyFlags |= Simulation::DIRTY_UPDATEABLE;
|
||||
_flags |= Simulation::DIRTY_UPDATEABLE;
|
||||
_animationProperties.setFPS(value);
|
||||
}
|
||||
|
||||
|
|
|
@ -601,7 +601,7 @@ void ParticleEffectEntityItem::setShapeType(ShapeType type) {
|
|||
withWriteLock([&] {
|
||||
if (type != _shapeType) {
|
||||
_shapeType = type;
|
||||
_dirtyFlags |= Simulation::DIRTY_SHAPE | Simulation::DIRTY_MASS;
|
||||
_flags |= Simulation::DIRTY_SHAPE | Simulation::DIRTY_MASS;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -27,10 +27,28 @@ namespace Simulation {
|
|||
const uint32_t DIRTY_PHYSICS_ACTIVATION = 0x0800; // should activate object in physics engine
|
||||
const uint32_t DIRTY_SIMULATOR_ID = 0x1000; // the simulatorID has changed
|
||||
const uint32_t DIRTY_SIMULATION_OWNERSHIP_PRIORITY = 0x2000; // our own bid priority has changed
|
||||
const uint32_t NO_BOOTSTRAPPING = 0x4000;
|
||||
|
||||
// bits 17-32 are reservied for special flags
|
||||
const uint32_t SPECIAL_FLAGS_NO_BOOTSTRAPPING = 0x10000;
|
||||
|
||||
const uint32_t DIRTY_TRANSFORM = DIRTY_POSITION | DIRTY_ROTATION;
|
||||
const uint32_t DIRTY_VELOCITIES = DIRTY_LINEAR_VELOCITY | DIRTY_ANGULAR_VELOCITY;
|
||||
const uint32_t SPECIAL_FLAGS = SPECIAL_FLAGS_NO_BOOTSTRAPPING;
|
||||
|
||||
const uint32_t DIRTY_FLAGS = DIRTY_POSITION |
|
||||
DIRTY_ROTATION |
|
||||
DIRTY_LINEAR_VELOCITY |
|
||||
DIRTY_ANGULAR_VELOCITY |
|
||||
DIRTY_MASS |
|
||||
DIRTY_COLLISION_GROUP |
|
||||
DIRTY_MOTION_TYPE |
|
||||
DIRTY_SHAPE |
|
||||
DIRTY_LIFETIME |
|
||||
DIRTY_UPDATEABLE |
|
||||
DIRTY_MATERIAL |
|
||||
DIRTY_PHYSICS_ACTIVATION |
|
||||
DIRTY_SIMULATOR_ID |
|
||||
DIRTY_SIMULATION_OWNERSHIP_PRIORITY;
|
||||
};
|
||||
|
||||
#endif // hifi_SimulationFlags_h
|
||||
|
|
|
@ -67,7 +67,7 @@ public:
|
|||
typedef render::Payload<AnimDebugDrawData> AnimDebugDrawPayload;
|
||||
|
||||
namespace render {
|
||||
template <> const ItemKey payloadGetKey(const AnimDebugDrawData::Pointer& data) { return (data->_isVisible ? ItemKey::Builder::opaqueShape() : ItemKey::Builder::opaqueShape().withInvisible()); }
|
||||
template <> const ItemKey payloadGetKey(const AnimDebugDrawData::Pointer& data) { return (data->_isVisible ? ItemKey::Builder::opaqueShape() : ItemKey::Builder::opaqueShape().withInvisible()).withTagBits(ItemKey::TAG_BITS_ALL); }
|
||||
template <> const Item::Bound payloadGetBound(const AnimDebugDrawData::Pointer& data) { return data->_bound; }
|
||||
template <> void payloadRender(const AnimDebugDrawData::Pointer& data, RenderArgs* args) {
|
||||
data->render(args);
|
||||
|
|
|
@ -249,7 +249,7 @@ void CauterizedModel::updateRenderItems() {
|
|||
data.updateTransformForCauterizedMesh(renderTransform);
|
||||
|
||||
data.setEnableCauterization(enableCauterization);
|
||||
data.setKey(isVisible, isLayeredInFront || isLayeredInHUD);
|
||||
data.updateKey(isVisible, isLayeredInFront || isLayeredInHUD, render::ItemKey::TAG_BITS_ALL);
|
||||
data.setLayer(isLayeredInFront, isLayeredInHUD);
|
||||
data.setShapeKey(invalidatePayloadShapeKey, isWireframe);
|
||||
});
|
||||
|
|
|
@ -203,6 +203,12 @@ vec3 evalGlobalLightingAlphaBlended(mat4 invViewMat, float shadowAttenuation, fl
|
|||
|
||||
return color;
|
||||
}
|
||||
<@endfunc@>
|
||||
|
||||
<@func declareEvalGlobalLightingAlphaBlendedWithHaze()@>
|
||||
|
||||
<$declareLightingAmbient(1, 1, 1)$>
|
||||
<$declareLightingDirectional()$>
|
||||
|
||||
vec3 evalGlobalLightingAlphaBlendedWithHaze(
|
||||
mat4 invViewMat, float shadowAttenuation, float obscurance, vec3 position, vec3 normal,
|
||||
|
|
|
@ -18,9 +18,13 @@ namespace render {
|
|||
template <> const ItemKey payloadGetKey(const LightPayload::Pointer& payload) {
|
||||
ItemKey::Builder builder;
|
||||
builder.withTypeLight();
|
||||
if (!payload || !payload->isVisible()) {
|
||||
builder.withInvisible();
|
||||
builder.withTagBits(ItemKey::TAG_BITS_ALL);
|
||||
if (payload) {
|
||||
if (!payload->isVisible()) {
|
||||
builder.withInvisible();
|
||||
}
|
||||
}
|
||||
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
|
@ -87,6 +91,7 @@ namespace render {
|
|||
template <> const ItemKey payloadGetKey(const KeyLightPayload::Pointer& payload) {
|
||||
ItemKey::Builder builder;
|
||||
builder.withTypeLight();
|
||||
builder.withTagBits(ItemKey::TAG_BITS_ALL);
|
||||
if (!payload || !payload->isVisible()) {
|
||||
builder.withInvisible();
|
||||
}
|
||||
|
|
|
@ -71,10 +71,20 @@ void MeshPartPayload::updateMaterial(graphics::MaterialPointer drawMaterial) {
|
|||
_drawMaterial = drawMaterial;
|
||||
}
|
||||
|
||||
ItemKey MeshPartPayload::getKey() const {
|
||||
void MeshPartPayload::updateKey(bool isVisible, bool isLayered, uint8_t tagBits) {
|
||||
ItemKey::Builder builder;
|
||||
builder.withTypeShape();
|
||||
|
||||
if (!isVisible) {
|
||||
builder.withInvisible();
|
||||
}
|
||||
|
||||
builder.withTagBits(tagBits);
|
||||
|
||||
if (isLayered) {
|
||||
builder.withLayered();
|
||||
}
|
||||
|
||||
if (_drawMaterial) {
|
||||
auto matKey = _drawMaterial->getKey();
|
||||
if (matKey.isTranslucent()) {
|
||||
|
@ -82,7 +92,11 @@ ItemKey MeshPartPayload::getKey() const {
|
|||
}
|
||||
}
|
||||
|
||||
return builder.build();
|
||||
_itemKey = builder.build();
|
||||
}
|
||||
|
||||
ItemKey MeshPartPayload::getKey() const {
|
||||
return _itemKey;
|
||||
}
|
||||
|
||||
Item::Bound MeshPartPayload::getBound() const {
|
||||
|
@ -389,7 +403,7 @@ void ModelMeshPartPayload::updateTransformForSkinnedMesh(const Transform& render
|
|||
_worldBound.transform(boundTransform);
|
||||
}
|
||||
|
||||
void ModelMeshPartPayload::setKey(bool isVisible, bool isLayered) {
|
||||
void ModelMeshPartPayload::updateKey(bool isVisible, bool isLayered, uint8_t tagBits) {
|
||||
ItemKey::Builder builder;
|
||||
builder.withTypeShape();
|
||||
|
||||
|
@ -397,6 +411,8 @@ void ModelMeshPartPayload::setKey(bool isVisible, bool isLayered) {
|
|||
builder.withInvisible();
|
||||
}
|
||||
|
||||
builder.withTagBits(tagBits);
|
||||
|
||||
if (isLayered) {
|
||||
builder.withLayered();
|
||||
}
|
||||
|
@ -415,10 +431,6 @@ void ModelMeshPartPayload::setKey(bool isVisible, bool isLayered) {
|
|||
_itemKey = builder.build();
|
||||
}
|
||||
|
||||
ItemKey ModelMeshPartPayload::getKey() const {
|
||||
return _itemKey;
|
||||
}
|
||||
|
||||
void ModelMeshPartPayload::setLayer(bool isLayeredInFront, bool isLayeredInHUD) {
|
||||
if (isLayeredInFront) {
|
||||
_layer = Item::LAYER_3D_FRONT;
|
||||
|
|
|
@ -33,6 +33,8 @@ public:
|
|||
typedef render::Payload<MeshPartPayload> Payload;
|
||||
typedef Payload::DataPointer Pointer;
|
||||
|
||||
virtual void updateKey(bool isVisible, bool isLayered, uint8_t tagBits);
|
||||
|
||||
virtual void updateMeshPart(const std::shared_ptr<const graphics::Mesh>& drawMesh, int partIndex);
|
||||
|
||||
virtual void notifyLocationChanged() {}
|
||||
|
@ -70,6 +72,9 @@ public:
|
|||
size_t getMaterialTextureSize() { return _drawMaterial ? _drawMaterial->getTextureSize() : 0; }
|
||||
int getMaterialTextureCount() { return _drawMaterial ? _drawMaterial->getTextureCount() : 0; }
|
||||
bool hasTextureInfo() const { return _drawMaterial ? _drawMaterial->hasTextureInfo() : false; }
|
||||
|
||||
protected:
|
||||
render::ItemKey _itemKey{ render::ItemKey::Builder::opaqueShape().build() };
|
||||
};
|
||||
|
||||
namespace render {
|
||||
|
@ -94,16 +99,15 @@ public:
|
|||
using TransformType = glm::mat4;
|
||||
#endif
|
||||
|
||||
void updateKey(bool isVisible, bool isLayered, uint8_t tagBits) override;
|
||||
void updateClusterBuffer(const std::vector<TransformType>& clusterTransforms);
|
||||
void updateTransformForSkinnedMesh(const Transform& renderTransform, const Transform& boundTransform);
|
||||
|
||||
// Render Item interface
|
||||
render::ItemKey getKey() const override;
|
||||
int getLayer() const;
|
||||
render::ShapeKey getShapeKey() const override; // shape interface
|
||||
void render(RenderArgs* args) override;
|
||||
|
||||
void setKey(bool isVisible, bool isLayered);
|
||||
void setLayer(bool isLayeredInFront, bool isLayeredInHUD);
|
||||
void setShapeKey(bool invalidateShapeKey, bool isWireframe);
|
||||
|
||||
|
@ -126,7 +130,6 @@ private:
|
|||
void initCache(const ModelPointer& model);
|
||||
|
||||
gpu::BufferPointer _blendedVertexBuffer;
|
||||
render::ItemKey _itemKey { render::ItemKey::Builder::opaqueShape().build() };
|
||||
render::ShapeKey _shapeKey { render::ShapeKey::Builder::invalid() };
|
||||
int _layer { render::Item::LAYER_3D };
|
||||
};
|
||||
|
|
|
@ -268,6 +268,7 @@ void Model::updateRenderItems() {
|
|||
|
||||
bool isWireframe = self->isWireframe();
|
||||
bool isVisible = self->isVisible();
|
||||
uint8_t viewTagBits = self->getViewTagBits();
|
||||
bool isLayeredInFront = self->isLayeredInFront();
|
||||
bool isLayeredInHUD = self->isLayeredInHUD();
|
||||
|
||||
|
@ -280,8 +281,10 @@ void Model::updateRenderItems() {
|
|||
|
||||
bool invalidatePayloadShapeKey = self->shouldInvalidatePayloadShapeKey(meshIndex);
|
||||
|
||||
transaction.updateItem<ModelMeshPartPayload>(itemID, [modelTransform, clusterTransforms, invalidatePayloadShapeKey,
|
||||
isWireframe, isVisible, isLayeredInFront, isLayeredInHUD](ModelMeshPartPayload& data) {
|
||||
transaction.updateItem<ModelMeshPartPayload>(itemID, [modelTransform, clusterTransforms,
|
||||
invalidatePayloadShapeKey, isWireframe, isVisible,
|
||||
viewTagBits, isLayeredInFront,
|
||||
isLayeredInHUD](ModelMeshPartPayload& data) {
|
||||
data.updateClusterBuffer(clusterTransforms);
|
||||
|
||||
Transform renderTransform = modelTransform;
|
||||
|
@ -297,7 +300,7 @@ void Model::updateRenderItems() {
|
|||
}
|
||||
data.updateTransformForSkinnedMesh(renderTransform, modelTransform);
|
||||
|
||||
data.setKey(isVisible, isLayeredInFront || isLayeredInHUD);
|
||||
data.updateKey(isVisible, isLayeredInFront || isLayeredInHUD, viewTagBits);
|
||||
data.setLayer(isLayeredInFront, isLayeredInHUD);
|
||||
data.setShapeKey(invalidatePayloadShapeKey, isWireframe);
|
||||
});
|
||||
|
@ -681,22 +684,25 @@ void Model::calculateTriangleSets() {
|
|||
}
|
||||
}
|
||||
|
||||
void Model::setVisibleInScene(bool isVisible, const render::ScenePointer& scene) {
|
||||
if (_isVisible != isVisible) {
|
||||
void Model::setVisibleInScene(bool isVisible, const render::ScenePointer& scene, uint8_t viewTagBits) {
|
||||
if (_isVisible != isVisible || _viewTagBits != viewTagBits) {
|
||||
_isVisible = isVisible;
|
||||
_viewTagBits = viewTagBits;
|
||||
|
||||
bool isLayeredInFront = _isLayeredInFront;
|
||||
bool isLayeredInHUD = _isLayeredInHUD;
|
||||
|
||||
render::Transaction transaction;
|
||||
foreach (auto item, _modelMeshRenderItemsMap.keys()) {
|
||||
transaction.updateItem<ModelMeshPartPayload>(item, [isVisible, isLayeredInFront, isLayeredInHUD](ModelMeshPartPayload& data) {
|
||||
data.setKey(isVisible, isLayeredInFront || isLayeredInHUD);
|
||||
transaction.updateItem<ModelMeshPartPayload>(item, [isVisible, viewTagBits, isLayeredInFront,
|
||||
isLayeredInHUD](ModelMeshPartPayload& data) {
|
||||
data.updateKey(isVisible, isLayeredInFront || isLayeredInHUD, viewTagBits);
|
||||
});
|
||||
}
|
||||
foreach(auto item, _collisionRenderItemsMap.keys()) {
|
||||
transaction.updateItem<ModelMeshPartPayload>(item, [isVisible, isLayeredInFront, isLayeredInHUD](ModelMeshPartPayload& data) {
|
||||
data.setKey(isVisible, isLayeredInFront || isLayeredInHUD);
|
||||
transaction.updateItem<ModelMeshPartPayload>(item, [isVisible, viewTagBits, isLayeredInFront,
|
||||
isLayeredInHUD](ModelMeshPartPayload& data) {
|
||||
data.updateKey(isVisible, isLayeredInFront || isLayeredInHUD, viewTagBits);
|
||||
});
|
||||
}
|
||||
scene->enqueueTransaction(transaction);
|
||||
|
@ -709,18 +715,21 @@ void Model::setLayeredInFront(bool isLayeredInFront, const render::ScenePointer&
|
|||
_isLayeredInFront = isLayeredInFront;
|
||||
|
||||
bool isVisible = _isVisible;
|
||||
uint8_t viewTagBits = _viewTagBits;
|
||||
bool isLayeredInHUD = _isLayeredInHUD;
|
||||
|
||||
render::Transaction transaction;
|
||||
foreach(auto item, _modelMeshRenderItemsMap.keys()) {
|
||||
transaction.updateItem<ModelMeshPartPayload>(item, [isVisible, isLayeredInFront, isLayeredInHUD](ModelMeshPartPayload& data) {
|
||||
data.setKey(isVisible, isLayeredInFront || isLayeredInHUD);
|
||||
transaction.updateItem<ModelMeshPartPayload>(item, [isVisible, viewTagBits, isLayeredInFront,
|
||||
isLayeredInHUD](ModelMeshPartPayload& data) {
|
||||
data.updateKey(isVisible, isLayeredInFront || isLayeredInHUD, viewTagBits);
|
||||
data.setLayer(isLayeredInFront, isLayeredInHUD);
|
||||
});
|
||||
}
|
||||
foreach(auto item, _collisionRenderItemsMap.keys()) {
|
||||
transaction.updateItem<ModelMeshPartPayload>(item, [isVisible, isLayeredInFront, isLayeredInHUD](ModelMeshPartPayload& data) {
|
||||
data.setKey(isVisible, isLayeredInFront || isLayeredInHUD);
|
||||
transaction.updateItem<ModelMeshPartPayload>(item, [isVisible, viewTagBits, isLayeredInFront,
|
||||
isLayeredInHUD](ModelMeshPartPayload& data) {
|
||||
data.updateKey(isVisible, isLayeredInFront || isLayeredInHUD, viewTagBits);
|
||||
data.setLayer(isLayeredInFront, isLayeredInHUD);
|
||||
});
|
||||
}
|
||||
|
@ -733,18 +742,21 @@ void Model::setLayeredInHUD(bool isLayeredInHUD, const render::ScenePointer& sce
|
|||
_isLayeredInHUD = isLayeredInHUD;
|
||||
|
||||
bool isVisible = _isVisible;
|
||||
uint8_t viewTagBits = _viewTagBits;
|
||||
bool isLayeredInFront = _isLayeredInFront;
|
||||
|
||||
render::Transaction transaction;
|
||||
foreach(auto item, _modelMeshRenderItemsMap.keys()) {
|
||||
transaction.updateItem<ModelMeshPartPayload>(item, [isVisible, isLayeredInFront, isLayeredInHUD](ModelMeshPartPayload& data) {
|
||||
data.setKey(isVisible, isLayeredInFront || isLayeredInHUD);
|
||||
transaction.updateItem<ModelMeshPartPayload>(item, [isVisible, viewTagBits, isLayeredInFront,
|
||||
isLayeredInHUD](ModelMeshPartPayload& data) {
|
||||
data.updateKey(isVisible, isLayeredInFront || isLayeredInHUD, viewTagBits);
|
||||
data.setLayer(isLayeredInFront, isLayeredInHUD);
|
||||
});
|
||||
}
|
||||
foreach(auto item, _collisionRenderItemsMap.keys()) {
|
||||
transaction.updateItem<ModelMeshPartPayload>(item, [isVisible, isLayeredInFront, isLayeredInHUD](ModelMeshPartPayload& data) {
|
||||
data.setKey(isVisible, isLayeredInFront || isLayeredInHUD);
|
||||
transaction.updateItem<ModelMeshPartPayload>(item, [isVisible, viewTagBits, isLayeredInFront,
|
||||
isLayeredInHUD](ModelMeshPartPayload& data) {
|
||||
data.updateKey(isVisible, isLayeredInFront || isLayeredInHUD, viewTagBits);
|
||||
data.setLayer(isLayeredInFront, isLayeredInHUD);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ public:
|
|||
const QUrl& getURL() const { return _url; }
|
||||
|
||||
// new Scene/Engine rendering support
|
||||
void setVisibleInScene(bool isVisible, const render::ScenePointer& scene);
|
||||
void setVisibleInScene(bool isVisible, const render::ScenePointer& scene, uint8_t viewTagBits);
|
||||
void setLayeredInFront(bool isLayeredInFront, const render::ScenePointer& scene);
|
||||
void setLayeredInHUD(bool isLayeredInHUD, const render::ScenePointer& scene);
|
||||
bool needsFixupInScene() const;
|
||||
|
@ -104,6 +104,7 @@ public:
|
|||
bool isRenderable() const;
|
||||
|
||||
bool isVisible() const { return _isVisible; }
|
||||
uint8_t getViewTagBits() const { return _viewTagBits; }
|
||||
|
||||
bool isLayeredInFront() const { return _isLayeredInFront; }
|
||||
bool isLayeredInHUD() const { return _isLayeredInHUD; }
|
||||
|
@ -396,6 +397,7 @@ protected:
|
|||
|
||||
QUrl _url;
|
||||
bool _isVisible;
|
||||
uint8_t _viewTagBits{ render::ItemKey::TAG_BITS_ALL };
|
||||
|
||||
gpu::Buffers _blendedVertexBuffers;
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include "model_lightmap_fade_vert.h"
|
||||
#include "model_lightmap_normal_map_fade_vert.h"
|
||||
#include "model_translucent_vert.h"
|
||||
#include "model_translucent_fade_vert.h"
|
||||
#include "model_translucent_normal_map_vert.h"
|
||||
#include "skin_model_fade_vert.h"
|
||||
#include "skin_model_normal_map_fade_vert.h"
|
||||
|
||||
|
@ -73,12 +73,14 @@
|
|||
#include "model_lightmap_specular_map_frag.h"
|
||||
#include "model_translucent_frag.h"
|
||||
#include "model_translucent_unlit_frag.h"
|
||||
#include "model_translucent_normal_map_frag.h"
|
||||
|
||||
#include "model_lightmap_fade_frag.h"
|
||||
#include "model_lightmap_normal_map_fade_frag.h"
|
||||
#include "model_lightmap_normal_specular_map_fade_frag.h"
|
||||
#include "model_lightmap_specular_map_fade_frag.h"
|
||||
#include "model_translucent_fade_frag.h"
|
||||
#include "model_translucent_normal_map_fade_frag.h"
|
||||
#include "model_translucent_unlit_fade_frag.h"
|
||||
|
||||
#include "overlay3D_vert.h"
|
||||
|
@ -191,7 +193,7 @@ void initDeferredPipelines(render::ShapePlumber& plumber, const render::ShapePip
|
|||
auto modelLightmapVertex = gpu::Shader::createVertex(std::string(model_lightmap_vert));
|
||||
auto modelLightmapNormalMapVertex = gpu::Shader::createVertex(std::string(model_lightmap_normal_map_vert));
|
||||
auto modelTranslucentVertex = gpu::Shader::createVertex(std::string(model_translucent_vert));
|
||||
auto modelTranslucentFadeVertex = gpu::Shader::createVertex(std::string(model_translucent_fade_vert));
|
||||
auto modelTranslucentNormalMapVertex = gpu::Shader::createVertex(std::string(model_translucent_normal_map_vert));
|
||||
auto modelShadowVertex = gpu::Shader::createVertex(std::string(model_shadow_vert));
|
||||
auto skinModelVertex = gpu::Shader::createVertex(std::string(skin_model_vert));
|
||||
auto skinModelNormalMapVertex = gpu::Shader::createVertex(std::string(skin_model_normal_map_vert));
|
||||
|
@ -220,6 +222,7 @@ void initDeferredPipelines(render::ShapePlumber& plumber, const render::ShapePip
|
|||
auto modelSpecularMapPixel = gpu::Shader::createPixel(std::string(model_specular_map_frag));
|
||||
auto modelNormalSpecularMapPixel = gpu::Shader::createPixel(std::string(model_normal_specular_map_frag));
|
||||
auto modelTranslucentPixel = gpu::Shader::createPixel(std::string(model_translucent_frag));
|
||||
auto modelTranslucentNormalMapPixel = gpu::Shader::createPixel(std::string(model_translucent_normal_map_frag));
|
||||
auto modelTranslucentUnlitPixel = gpu::Shader::createPixel(std::string(model_translucent_unlit_frag));
|
||||
auto modelShadowPixel = gpu::Shader::createPixel(std::string(model_shadow_frag));
|
||||
auto modelLightmapPixel = gpu::Shader::createPixel(std::string(model_lightmap_frag));
|
||||
|
@ -238,6 +241,7 @@ void initDeferredPipelines(render::ShapePlumber& plumber, const render::ShapePip
|
|||
auto modelNormalSpecularMapFadePixel = gpu::Shader::createPixel(std::string(model_normal_specular_map_fade_frag));
|
||||
auto modelShadowFadePixel = gpu::Shader::createPixel(std::string(model_shadow_fade_frag));
|
||||
auto modelTranslucentFadePixel = gpu::Shader::createPixel(std::string(model_translucent_fade_frag));
|
||||
auto modelTranslucentNormalMapFadePixel = gpu::Shader::createPixel(std::string(model_translucent_normal_map_fade_frag));
|
||||
auto modelTranslucentUnlitFadePixel = gpu::Shader::createPixel(std::string(model_translucent_unlit_fade_frag));
|
||||
auto simpleFadePixel = gpu::Shader::createPixel(std::string(simple_textured_fade_frag));
|
||||
auto simpleUnlitFadePixel = gpu::Shader::createPixel(std::string(simple_textured_unlit_fade_frag));
|
||||
|
@ -307,13 +311,13 @@ void initDeferredPipelines(render::ShapePlumber& plumber, const render::ShapePip
|
|||
simpleVertex, simpleTranslucentUnlitPixel, nullptr, nullptr);
|
||||
addPipeline(
|
||||
Key::Builder().withMaterial().withTranslucent().withTangents(),
|
||||
modelTranslucentVertex, modelTranslucentPixel, nullptr, nullptr);
|
||||
modelTranslucentNormalMapVertex, modelTranslucentNormalMapPixel, nullptr, nullptr);
|
||||
addPipeline(
|
||||
Key::Builder().withMaterial().withTranslucent().withSpecular(),
|
||||
modelTranslucentVertex, modelTranslucentPixel, nullptr, nullptr);
|
||||
addPipeline(
|
||||
Key::Builder().withMaterial().withTranslucent().withTangents().withSpecular(),
|
||||
modelTranslucentVertex, modelTranslucentPixel, nullptr, nullptr);
|
||||
modelTranslucentNormalMapVertex, modelTranslucentNormalMapPixel, nullptr, nullptr);
|
||||
addPipeline(
|
||||
// FIXME: Ignore lightmap for translucents meshpart
|
||||
Key::Builder().withMaterial().withTranslucent().withLightmap(),
|
||||
|
@ -321,7 +325,7 @@ void initDeferredPipelines(render::ShapePlumber& plumber, const render::ShapePip
|
|||
// Same thing but with Fade on
|
||||
addPipeline(
|
||||
Key::Builder().withMaterial().withTranslucent().withFade(),
|
||||
modelTranslucentFadeVertex, modelTranslucentFadePixel, batchSetter, itemSetter);
|
||||
modelTranslucentVertex, modelTranslucentFadePixel, batchSetter, itemSetter);
|
||||
addPipeline(
|
||||
Key::Builder().withTranslucent().withFade(),
|
||||
simpleFadeVertex, simpleTranslucentFadePixel, batchSetter, itemSetter);
|
||||
|
@ -333,13 +337,13 @@ void initDeferredPipelines(render::ShapePlumber& plumber, const render::ShapePip
|
|||
simpleFadeVertex, simpleTranslucentUnlitFadePixel, batchSetter, itemSetter);
|
||||
addPipeline(
|
||||
Key::Builder().withMaterial().withTranslucent().withTangents().withFade(),
|
||||
modelNormalMapFadeVertex, modelTranslucentFadePixel, batchSetter, itemSetter);
|
||||
modelTranslucentNormalMapVertex, modelTranslucentNormalMapFadePixel, batchSetter, itemSetter);
|
||||
addPipeline(
|
||||
Key::Builder().withMaterial().withTranslucent().withSpecular().withFade(),
|
||||
modelFadeVertex, modelTranslucentFadePixel, batchSetter, itemSetter);
|
||||
addPipeline(
|
||||
Key::Builder().withMaterial().withTranslucent().withTangents().withSpecular().withFade(),
|
||||
modelNormalMapFadeVertex, modelTranslucentFadePixel, batchSetter, itemSetter);
|
||||
modelTranslucentNormalMapVertex, modelTranslucentNormalMapFadePixel, batchSetter, itemSetter);
|
||||
addPipeline(
|
||||
// FIXME: Ignore lightmap for translucents meshpart
|
||||
Key::Builder().withMaterial().withTranslucent().withLightmap().withFade(),
|
||||
|
@ -405,26 +409,26 @@ void initDeferredPipelines(render::ShapePlumber& plumber, const render::ShapePip
|
|||
skinModelTranslucentVertex, modelTranslucentPixel, nullptr, nullptr);
|
||||
addPipeline(
|
||||
Key::Builder().withMaterial().withSkinned().withTranslucent().withTangents(),
|
||||
skinModelNormalMapTranslucentVertex, modelTranslucentPixel, nullptr, nullptr);
|
||||
skinModelNormalMapTranslucentVertex, modelTranslucentNormalMapPixel, nullptr, nullptr);
|
||||
addPipeline(
|
||||
Key::Builder().withMaterial().withSkinned().withTranslucent().withSpecular(),
|
||||
skinModelTranslucentVertex, modelTranslucentPixel, nullptr, nullptr);
|
||||
addPipeline(
|
||||
Key::Builder().withMaterial().withSkinned().withTranslucent().withTangents().withSpecular(),
|
||||
skinModelNormalMapTranslucentVertex, modelTranslucentPixel, nullptr, nullptr);
|
||||
skinModelNormalMapTranslucentVertex, modelTranslucentNormalMapPixel, nullptr, nullptr);
|
||||
// Same thing but with Fade on
|
||||
addPipeline(
|
||||
Key::Builder().withMaterial().withSkinned().withTranslucent().withFade(),
|
||||
skinModelFadeVertex, modelTranslucentFadePixel, batchSetter, itemSetter);
|
||||
addPipeline(
|
||||
Key::Builder().withMaterial().withSkinned().withTranslucent().withTangents().withFade(),
|
||||
skinModelNormalMapFadeVertex, modelTranslucentFadePixel, batchSetter, itemSetter);
|
||||
skinModelNormalMapFadeVertex, modelTranslucentNormalMapFadePixel, batchSetter, itemSetter);
|
||||
addPipeline(
|
||||
Key::Builder().withMaterial().withSkinned().withTranslucent().withSpecular().withFade(),
|
||||
skinModelFadeVertex, modelTranslucentFadePixel, batchSetter, itemSetter);
|
||||
addPipeline(
|
||||
Key::Builder().withMaterial().withSkinned().withTranslucent().withTangents().withSpecular().withFade(),
|
||||
skinModelNormalMapFadeVertex, modelTranslucentFadePixel, batchSetter, itemSetter);
|
||||
skinModelNormalMapFadeVertex, modelTranslucentNormalMapFadePixel, batchSetter, itemSetter);
|
||||
|
||||
// Depth-only
|
||||
addPipeline(
|
||||
|
|
|
@ -200,7 +200,7 @@ void RenderShadowMap::run(const render::RenderContextPointer& renderContext, con
|
|||
});
|
||||
}
|
||||
|
||||
void RenderShadowTask::build(JobModel& task, const render::Varying& input, render::Varying& output, CullFunctor cullFunctor) {
|
||||
void RenderShadowTask::build(JobModel& task, const render::Varying& input, render::Varying& output, CullFunctor cullFunctor, uint8_t tagBits, uint8_t tagMask) {
|
||||
cullFunctor = cullFunctor ? cullFunctor : [](const RenderArgs*, const AABox&) { return true; };
|
||||
|
||||
// Prepare the ShapePipeline
|
||||
|
@ -216,7 +216,7 @@ void RenderShadowTask::build(JobModel& task, const render::Varying& input, rende
|
|||
task.addJob<RenderShadowSetup>("ShadowSetup");
|
||||
|
||||
for (auto i = 0; i < SHADOW_CASCADE_MAX_COUNT; i++) {
|
||||
const auto setupOutput = task.addJob<RenderShadowCascadeSetup>("ShadowCascadeSetup", i);
|
||||
const auto setupOutput = task.addJob<RenderShadowCascadeSetup>("ShadowCascadeSetup", i, tagBits, tagMask);
|
||||
const auto shadowFilter = setupOutput.getN<RenderShadowCascadeSetup::Outputs>(1);
|
||||
|
||||
// CPU jobs:
|
||||
|
@ -264,7 +264,7 @@ void RenderShadowCascadeSetup::run(const render::RenderContextPointer& renderCon
|
|||
|
||||
const auto globalShadow = lightStage->getCurrentKeyShadow();
|
||||
if (globalShadow && _cascadeIndex<globalShadow->getCascadeCount()) {
|
||||
output.edit1() = ItemFilter::Builder::visibleWorldItems().withTypeShape().withOpaque().withoutLayered();
|
||||
output.edit1() = ItemFilter::Builder::visibleWorldItems().withTypeShape().withOpaque().withoutLayered().withTagBits(_tagBits, _tagMask);
|
||||
|
||||
globalShadow->setKeylightCascadeFrustum(_cascadeIndex, args->getViewFrustum(), SHADOW_FRUSTUM_NEAR, SHADOW_FRUSTUM_FAR);
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ public:
|
|||
using JobModel = render::Task::Model<RenderShadowTask, Config>;
|
||||
|
||||
RenderShadowTask() {}
|
||||
void build(JobModel& task, const render::Varying& inputs, render::Varying& outputs, render::CullFunctor shouldRender);
|
||||
void build(JobModel& task, const render::Varying& inputs, render::Varying& outputs, render::CullFunctor shouldRender, uint8_t tagBits = 0x00, uint8_t tagMask = 0x00);
|
||||
|
||||
void configure(const Config& configuration);
|
||||
};
|
||||
|
@ -67,12 +67,14 @@ public:
|
|||
using Outputs = render::VaryingSet3<RenderArgs::RenderMode, render::ItemFilter, float>;
|
||||
using JobModel = render::Job::ModelO<RenderShadowCascadeSetup, Outputs>;
|
||||
|
||||
RenderShadowCascadeSetup(unsigned int cascadeIndex) : _cascadeIndex{ cascadeIndex } {}
|
||||
RenderShadowCascadeSetup(unsigned int cascadeIndex, uint8_t tagBits = 0x00, uint8_t tagMask = 0x00) : _cascadeIndex{ cascadeIndex }, _tagBits(tagBits), _tagMask(tagMask) {}
|
||||
void run(const render::RenderContextPointer& renderContext, Outputs& output);
|
||||
|
||||
private:
|
||||
|
||||
unsigned int _cascadeIndex;
|
||||
uint8_t _tagBits{ 0x00 };
|
||||
uint8_t _tagMask{ 0x00 };
|
||||
};
|
||||
|
||||
class RenderShadowCascadeTeardown {
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include "RenderDeferredTask.h"
|
||||
#include "RenderForwardTask.h"
|
||||
|
||||
void RenderViewTask::build(JobModel& task, const render::Varying& input, render::Varying& output, render::CullFunctor cullFunctor, bool isDeferred) {
|
||||
void RenderViewTask::build(JobModel& task, const render::Varying& input, render::Varying& output, render::CullFunctor cullFunctor, bool isDeferred, uint8_t tagBits, uint8_t tagMask) {
|
||||
// auto items = input.get<Input>();
|
||||
|
||||
// Shadows use an orthographic projection because they are linked to sunlights
|
||||
|
@ -28,9 +28,9 @@ void RenderViewTask::build(JobModel& task, const render::Varying& input, render:
|
|||
const auto threshold = 1e-3f;
|
||||
return relativeBoundRadius > threshold;
|
||||
return true;
|
||||
});
|
||||
}, tagBits, tagMask);
|
||||
|
||||
const auto items = task.addJob<RenderFetchCullSortTask>("FetchCullSort", cullFunctor);
|
||||
const auto items = task.addJob<RenderFetchCullSortTask>("FetchCullSort", cullFunctor, tagBits, tagMask);
|
||||
assert(items.canCast<RenderFetchCullSortTask::Output>());
|
||||
|
||||
if (isDeferred) {
|
||||
|
|
|
@ -23,7 +23,7 @@ public:
|
|||
|
||||
RenderViewTask() {}
|
||||
|
||||
void build(JobModel& task, const render::Varying& inputs, render::Varying& outputs, render::CullFunctor cullFunctor, bool isDeferred);
|
||||
void build(JobModel& task, const render::Varying& inputs, render::Varying& outputs, render::CullFunctor cullFunctor, bool isDeferred, uint8_t tagBits = 0x00, uint8_t tagMask = 0x00);
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ void main(void) {
|
|||
<$evalMaterialEmissive(emissiveTex, emissive, matKey, emissive)$>;
|
||||
|
||||
vec3 viewNormal;
|
||||
<$tangentToViewSpaceLOD(_position, normalTex, _normal, _tangent, viewNormal)$>
|
||||
<$tangentToViewSpaceLOD(_position, normalTex, _normal, _tangent, viewNormal)$>
|
||||
|
||||
float scattering = getMaterialScattering(mat);
|
||||
<$evalMaterialScattering(scatteringTex, scattering, matKey, scattering)$>;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
<@include DeferredGlobalLight.slh@>
|
||||
|
||||
<$declareEvalGlobalLightingAlphaBlended()$>
|
||||
<$declareEvalGlobalLightingAlphaBlendedWithHaze()$>
|
||||
|
||||
<@include LightLocal.slh@>
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
<@include DeferredGlobalLight.slh@>
|
||||
|
||||
<$declareEvalGlobalLightingAlphaBlended()$>
|
||||
<$declareEvalGlobalLightingAlphaBlendedWithHaze()$>
|
||||
|
||||
<@include LightLocal.slh@>
|
||||
|
||||
|
|
91
libraries/render-utils/src/model_translucent_normal_map.slf
Normal file
91
libraries/render-utils/src/model_translucent_normal_map.slf
Normal file
|
@ -0,0 +1,91 @@
|
|||
<@include gpu/Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
//
|
||||
// model_translucent_normal_map.frag
|
||||
// fragment shader
|
||||
//
|
||||
// Created by Olivier Prat on 23/01/2018.
|
||||
// Copyright 2018 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
<@include graphics/Material.slh@>
|
||||
|
||||
<@include DeferredGlobalLight.slh@>
|
||||
|
||||
<$declareEvalGlobalLightingAlphaBlendedWithHaze()$>
|
||||
|
||||
<@include LightLocal.slh@>
|
||||
|
||||
<@include gpu/Transform.slh@>
|
||||
<$declareStandardCameraTransform()$>
|
||||
|
||||
<@include MaterialTextures.slh@>
|
||||
<$declareMaterialTextures(ALBEDO, ROUGHNESS, NORMAL, _SCRIBE_NULL, EMISSIVE, OCCLUSION)$>
|
||||
|
||||
in vec2 _texCoord0;
|
||||
in vec2 _texCoord1;
|
||||
in vec4 _position;
|
||||
in vec4 _worldPosition;
|
||||
in vec3 _normal;
|
||||
in vec3 _tangent;
|
||||
in vec3 _color;
|
||||
in float _alpha;
|
||||
|
||||
out vec4 _fragColor;
|
||||
|
||||
void main(void) {
|
||||
Material mat = getMaterial();
|
||||
int matKey = getMaterialKey(mat);
|
||||
<$fetchMaterialTexturesCoord0(matKey, _texCoord0, albedoTex, roughnessTex, normalTex, _SCRIBE_NULL, emissiveTex)$>
|
||||
<$fetchMaterialTexturesCoord1(matKey, _texCoord1, occlusionTex)$>
|
||||
|
||||
float opacity = getMaterialOpacity(mat) * _alpha;
|
||||
<$evalMaterialOpacity(albedoTex.a, opacity, matKey, opacity)$>;
|
||||
|
||||
vec3 albedo = getMaterialAlbedo(mat);
|
||||
<$evalMaterialAlbedo(albedoTex, albedo, matKey, albedo)$>;
|
||||
albedo *= _color;
|
||||
|
||||
float roughness = getMaterialRoughness(mat);
|
||||
<$evalMaterialRoughness(roughnessTex, roughness, matKey, roughness)$>;
|
||||
|
||||
float metallic = getMaterialMetallic(mat);
|
||||
vec3 fresnel = getFresnelF0(metallic, albedo);
|
||||
|
||||
vec3 emissive = getMaterialEmissive(mat);
|
||||
<$evalMaterialEmissive(emissiveTex, emissive, matKey, emissive)$>;
|
||||
|
||||
vec3 fragPosition = _position.xyz;
|
||||
vec3 fragNormal;
|
||||
<$tangentToViewSpaceLOD(_position, normalTex, _normal, _tangent, fragNormal)$>
|
||||
|
||||
TransformCamera cam = getTransformCamera();
|
||||
vec3 fragEyeVector = vec3(cam._viewInverse * vec4(-fragPosition, 0.0));
|
||||
vec3 fragEyeDir = normalize(fragEyeVector);
|
||||
SurfaceData surface = initSurfaceData(roughness, fragNormal, fragEyeDir);
|
||||
|
||||
vec4 localLighting = vec4(0.0);
|
||||
|
||||
<$fetchClusterInfo(_worldPosition)$>;
|
||||
if (hasLocalLights(numLights, clusterPos, dims)) {
|
||||
localLighting = evalLocalLighting(cluster, numLights, _worldPosition.xyz, surface,
|
||||
metallic, fresnel, albedo, 0.0,
|
||||
vec4(0), vec4(0), opacity);
|
||||
}
|
||||
|
||||
_fragColor = vec4(evalGlobalLightingAlphaBlendedWithHaze(
|
||||
cam._viewInverse,
|
||||
1.0,
|
||||
occlusionTex,
|
||||
fragPosition,
|
||||
albedo,
|
||||
fresnel,
|
||||
metallic,
|
||||
emissive,
|
||||
surface, opacity, localLighting.rgb),
|
||||
opacity);
|
||||
}
|
|
@ -1,10 +1,10 @@
|
|||
<@include gpu/Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
// model_translucent_fade.slv
|
||||
// model_translucent_normal_map.slv
|
||||
// vertex shader
|
||||
//
|
||||
// Created by Olivier Prat on 15/01/18.
|
||||
// Created by Olivier Prat on 23/01/18.
|
||||
// Copyright 2018 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
|
@ -25,6 +25,7 @@ out vec2 _texCoord1;
|
|||
out vec4 _position;
|
||||
out vec4 _worldPosition;
|
||||
out vec3 _normal;
|
||||
out vec3 _tangent;
|
||||
out vec3 _color;
|
||||
|
||||
void main(void) {
|
||||
|
@ -41,4 +42,5 @@ void main(void) {
|
|||
<$transformModelToEyeAndClipPos(cam, obj, inPosition, _position, gl_Position)$>
|
||||
<$transformModelToWorldPos(obj, inPosition, _worldPosition)$>
|
||||
<$transformModelToWorldDir(cam, obj, inNormal.xyz, _normal)$>
|
||||
<$transformModelToWorldDir(cam, obj, inTangent.xyz, _tangent)$>
|
||||
}
|
101
libraries/render-utils/src/model_translucent_normal_map_fade.slf
Normal file
101
libraries/render-utils/src/model_translucent_normal_map_fade.slf
Normal file
|
@ -0,0 +1,101 @@
|
|||
<@include gpu/Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
//
|
||||
// model_translucent_normal_map_fade.frag
|
||||
// fragment shader
|
||||
//
|
||||
// Created by Olivier Prat on 23/01/18.
|
||||
// Copyright 2018 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
<@include graphics/Material.slh@>
|
||||
|
||||
<@include DeferredGlobalLight.slh@>
|
||||
|
||||
<$declareEvalGlobalLightingAlphaBlendedWithHaze()$>
|
||||
|
||||
<@include LightLocal.slh@>
|
||||
|
||||
<@include gpu/Transform.slh@>
|
||||
<$declareStandardCameraTransform()$>
|
||||
|
||||
<@include MaterialTextures.slh@>
|
||||
<$declareMaterialTextures(ALBEDO, ROUGHNESS, NORMAL, _SCRIBE_NULL, EMISSIVE, OCCLUSION)$>
|
||||
|
||||
<@include Fade.slh@>
|
||||
<$declareFadeFragment()$>
|
||||
|
||||
in vec2 _texCoord0;
|
||||
in vec2 _texCoord1;
|
||||
in vec4 _position;
|
||||
in vec3 _normal;
|
||||
in vec3 _tangent;
|
||||
in vec3 _color;
|
||||
in float _alpha;
|
||||
in vec4 _worldPosition;
|
||||
|
||||
out vec4 _fragColor;
|
||||
|
||||
void main(void) {
|
||||
vec3 fadeEmissive;
|
||||
FadeObjectParams fadeParams;
|
||||
|
||||
<$fetchFadeObjectParams(fadeParams)$>
|
||||
applyFade(fadeParams, _worldPosition.xyz, fadeEmissive);
|
||||
|
||||
Material mat = getMaterial();
|
||||
int matKey = getMaterialKey(mat);
|
||||
<$fetchMaterialTexturesCoord0(matKey, _texCoord0, albedoTex, roughnessTex, normalTex, _SCRIBE_NULL, emissiveTex)$>
|
||||
<$fetchMaterialTexturesCoord1(matKey, _texCoord1, occlusionTex)$>
|
||||
|
||||
float opacity = getMaterialOpacity(mat) * _alpha;
|
||||
<$evalMaterialOpacity(albedoTex.a, opacity, matKey, opacity)$>;
|
||||
|
||||
vec3 albedo = getMaterialAlbedo(mat);
|
||||
<$evalMaterialAlbedo(albedoTex, albedo, matKey, albedo)$>;
|
||||
albedo *= _color;
|
||||
|
||||
float roughness = getMaterialRoughness(mat);
|
||||
<$evalMaterialRoughness(roughnessTex, roughness, matKey, roughness)$>;
|
||||
|
||||
float metallic = getMaterialMetallic(mat);
|
||||
vec3 fresnel = getFresnelF0(metallic, albedo);
|
||||
|
||||
vec3 emissive = getMaterialEmissive(mat);
|
||||
<$evalMaterialEmissive(emissiveTex, emissive, matKey, emissive)$>;
|
||||
|
||||
vec3 fragPosition = _position.xyz;
|
||||
// Lighting is done in world space
|
||||
vec3 fragNormal;
|
||||
<$tangentToViewSpaceLOD(_position, normalTex, _normal, _tangent, fragNormal)$>
|
||||
|
||||
TransformCamera cam = getTransformCamera();
|
||||
vec3 fragEyeVector = vec3(cam._viewInverse * vec4(-fragPosition, 0.0));
|
||||
vec3 fragEyeDir = normalize(fragEyeVector);
|
||||
SurfaceData surface = initSurfaceData(roughness, fragNormal, fragEyeDir);
|
||||
|
||||
vec4 localLighting = vec4(0.0);
|
||||
|
||||
<$fetchClusterInfo(_worldPosition)$>;
|
||||
if (hasLocalLights(numLights, clusterPos, dims)) {
|
||||
localLighting = evalLocalLighting(cluster, numLights, _worldPosition.xyz, surface,
|
||||
metallic, fresnel, albedo, 0.0,
|
||||
vec4(0), vec4(0), opacity);
|
||||
}
|
||||
|
||||
_fragColor = vec4(evalGlobalLightingAlphaBlendedWithHaze(
|
||||
cam._viewInverse,
|
||||
1.0,
|
||||
occlusionTex,
|
||||
fragPosition,
|
||||
albedo,
|
||||
fresnel,
|
||||
metallic,
|
||||
emissive+fadeEmissive,
|
||||
surface, opacity, localLighting.rgb),
|
||||
opacity);
|
||||
}
|
|
@ -11,7 +11,7 @@
|
|||
//
|
||||
|
||||
<@include DeferredGlobalLight.slh@>
|
||||
<$declareEvalGlobalLightingAlphaBlended()$>
|
||||
<$declareEvalGlobalLightingAlphaBlendedWithHaze()$>
|
||||
|
||||
<@include graphics/Material.slh@>
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
<@include DeferredBufferWrite.slh@>
|
||||
<@include DeferredGlobalLight.slh@>
|
||||
<$declareEvalGlobalLightingAlphaBlended()$>
|
||||
<$declareEvalGlobalLightingAlphaBlendedWithHaze()$>
|
||||
|
||||
<@include gpu/Transform.slh@>
|
||||
<$declareStandardCameraTransform()$>
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
<@include DeferredBufferWrite.slh@>
|
||||
<@include DeferredGlobalLight.slh@>
|
||||
<$declareEvalGlobalLightingAlphaBlended()$>
|
||||
<$declareEvalGlobalLightingAlphaBlendedWithHaze()$>
|
||||
|
||||
<@include gpu/Transform.slh@>
|
||||
<$declareStandardCameraTransform()$>
|
||||
|
|
|
@ -61,7 +61,7 @@ void render::cullItems(const RenderContextPointer& renderContext, const CullFunc
|
|||
details._rendered += (int)outItems.size();
|
||||
}
|
||||
|
||||
void FetchNonspatialItems::run(const RenderContextPointer& renderContext, ItemBounds& outItems) {
|
||||
void FetchNonspatialItems::run(const RenderContextPointer& renderContext, const ItemFilter& filter, ItemBounds& outItems) {
|
||||
assert(renderContext->args);
|
||||
assert(renderContext->args->hasViewFrustum());
|
||||
auto& scene = renderContext->_scene;
|
||||
|
@ -72,7 +72,9 @@ void FetchNonspatialItems::run(const RenderContextPointer& renderContext, ItemBo
|
|||
outItems.reserve(items.size());
|
||||
for (auto& id : items) {
|
||||
auto& item = scene->getItem(id);
|
||||
outItems.emplace_back(ItemBound(id, item.getBound()));
|
||||
if (filter.test(item.getKey())) {
|
||||
outItems.emplace_back(ItemBound(id, item.getBound()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -24,8 +24,8 @@ namespace render {
|
|||
|
||||
class FetchNonspatialItems {
|
||||
public:
|
||||
using JobModel = Job::ModelO<FetchNonspatialItems, ItemBounds>;
|
||||
void run(const RenderContextPointer& renderContext, ItemBounds& outItems);
|
||||
using JobModel = Job::ModelIO<FetchNonspatialItems, ItemFilter, ItemBounds>;
|
||||
void run(const RenderContextPointer& renderContext, const ItemFilter& filter, ItemBounds& outItems);
|
||||
};
|
||||
|
||||
class FetchSpatialTreeConfig : public Job::Config {
|
||||
|
|
|
@ -34,6 +34,21 @@ const int Item::LAYER_3D = 1;
|
|||
const int Item::LAYER_3D_FRONT = 2;
|
||||
const int Item::LAYER_3D_HUD = 3;
|
||||
|
||||
const uint8_t ItemKey::TAG_BITS_ALL { 0xFF };
|
||||
const uint8_t ItemKey::TAG_BITS_NONE { 0x00 };
|
||||
const uint8_t ItemKey::TAG_BITS_0 { 0x01 };
|
||||
const uint8_t ItemKey::TAG_BITS_1 { 0x02 };
|
||||
const uint8_t ItemKey::TAG_BITS_2 { 0x04 };
|
||||
const uint8_t ItemKey::TAG_BITS_3 { 0x08 };
|
||||
const uint8_t ItemKey::TAG_BITS_4 { 0x10 };
|
||||
const uint8_t ItemKey::TAG_BITS_5 { 0x20 };
|
||||
const uint8_t ItemKey::TAG_BITS_6 { 0x40 };
|
||||
const uint8_t ItemKey::TAG_BITS_7 { 0x80 };
|
||||
|
||||
const uint32_t ItemKey::KEY_TAG_BITS_MASK = ((uint32_t) ItemKey::TAG_BITS_ALL) << FIRST_TAG_BIT;
|
||||
|
||||
|
||||
|
||||
void Item::Status::Value::setScale(float scale) {
|
||||
_scale = (std::numeric_limits<unsigned short>::max() -1) * 0.5f * (1.0f + std::max(std::min(scale, 1.0f), 0.0f));
|
||||
}
|
||||
|
|
|
@ -38,25 +38,62 @@ class Context;
|
|||
// Key is the KEY to filter Items and create specialized lists
|
||||
class ItemKey {
|
||||
public:
|
||||
enum FlagBit {
|
||||
// 8 tags are available to organize the items and filter them against as fields of the ItemKey.
|
||||
// TAG & TAG_BITS are defined from several bits in the Key.
|
||||
// An Item can be tagged and filtering can rely on the tags to keep or exclude items
|
||||
// ItemKey are not taged by default
|
||||
enum Tag : uint8_t {
|
||||
TAG_0 = 0, // 8 Tags
|
||||
TAG_1,
|
||||
TAG_2,
|
||||
TAG_3,
|
||||
TAG_4,
|
||||
TAG_5,
|
||||
TAG_6,
|
||||
TAG_7,
|
||||
|
||||
NUM_TAGS
|
||||
};
|
||||
// Tag bits are derived from the Tag enum
|
||||
const static uint8_t TAG_BITS_ALL;
|
||||
const static uint8_t TAG_BITS_NONE;
|
||||
const static uint8_t TAG_BITS_0;
|
||||
const static uint8_t TAG_BITS_1;
|
||||
const static uint8_t TAG_BITS_2;
|
||||
const static uint8_t TAG_BITS_3;
|
||||
const static uint8_t TAG_BITS_4;
|
||||
const static uint8_t TAG_BITS_5;
|
||||
const static uint8_t TAG_BITS_6;
|
||||
const static uint8_t TAG_BITS_7;
|
||||
|
||||
enum FlagBit : uint32_t {
|
||||
TYPE_SHAPE = 0, // Item is a Shape
|
||||
TYPE_LIGHT, // Item is a Light
|
||||
TYPE_META, // Item is a Meta: meanning it s used to represent a higher level object, potentially represented by other render items
|
||||
|
||||
TRANSLUCENT, // Transparent and not opaque, for some odd reason TRANSPARENCY doesn't work...
|
||||
VIEW_SPACE, // Transformed in view space, and not in world space
|
||||
DYNAMIC, // Dynamic and bound will change unlike static item
|
||||
DEFORMED, // Deformed within bound, not solid
|
||||
INVISIBLE, // Visible or not? could be just here to cast shadow
|
||||
INVISIBLE, // Visible or not in the scene?
|
||||
SHADOW_CASTER, // Item cast shadows
|
||||
PICKABLE, // Item can be picked/selected
|
||||
LAYERED, // Item belongs to one of the layers different from the default layer
|
||||
|
||||
SMALLER,
|
||||
FIRST_TAG_BIT, // 8 Tags available to organize the items and filter them against
|
||||
LAST_TAG_BIT = FIRST_TAG_BIT + NUM_TAGS,
|
||||
|
||||
__SMALLER, // Reserved bit for spatialized item to indicate that it is smaller than expected in the cell in which it belongs (probably because it overlaps over several smaller cells)
|
||||
|
||||
NUM_FLAGS, // Not a valid flag
|
||||
};
|
||||
typedef std::bitset<NUM_FLAGS> Flags;
|
||||
|
||||
// All the bits touching tag bits sets to true
|
||||
const static uint32_t KEY_TAG_BITS_MASK;
|
||||
static uint32_t evalTagBitsWithKeyBits(uint8_t tagBits, const uint32_t keyBits) {
|
||||
return (keyBits & ~KEY_TAG_BITS_MASK) | (((uint32_t)tagBits) << FIRST_TAG_BIT);
|
||||
}
|
||||
|
||||
// The key is the Flags
|
||||
Flags _flags;
|
||||
|
||||
|
@ -84,9 +121,12 @@ public:
|
|||
Builder& withDeformed() { _flags.set(DEFORMED); return (*this); }
|
||||
Builder& withInvisible() { _flags.set(INVISIBLE); return (*this); }
|
||||
Builder& withShadowCaster() { _flags.set(SHADOW_CASTER); return (*this); }
|
||||
Builder& withPickable() { _flags.set(PICKABLE); return (*this); }
|
||||
Builder& withLayered() { _flags.set(LAYERED); return (*this); }
|
||||
|
||||
Builder& withTag(Tag tag) { _flags.set(FIRST_TAG_BIT + tag); return (*this); }
|
||||
// Set ALL the tags in one call using the Tag bits
|
||||
Builder& withTagBits(uint8_t tagBits) { _flags = evalTagBitsWithKeyBits(tagBits, _flags.to_ulong()); return (*this); }
|
||||
|
||||
// Convenient standard keys that we will keep on using all over the place
|
||||
static Builder opaqueShape() { return Builder().withTypeShape(); }
|
||||
static Builder transparentShape() { return Builder().withTypeShape().withTransparent(); }
|
||||
|
@ -116,14 +156,15 @@ public:
|
|||
|
||||
bool isShadowCaster() const { return _flags[SHADOW_CASTER]; }
|
||||
|
||||
bool isPickable() const { return _flags[PICKABLE]; }
|
||||
|
||||
bool isLayered() const { return _flags[LAYERED]; }
|
||||
bool isSpatial() const { return !isLayered(); }
|
||||
|
||||
bool isTag(Tag tag) const { return _flags[FIRST_TAG_BIT + tag]; }
|
||||
uint8_t getTagBits() const { return ((_flags.to_ulong() & KEY_TAG_BITS_MASK) >> FIRST_TAG_BIT); }
|
||||
|
||||
// Probably not public, flags used by the scene
|
||||
bool isSmall() const { return _flags[SMALLER]; }
|
||||
void setSmaller(bool smaller) { (smaller ? _flags.set(SMALLER) : _flags.reset(SMALLER)); }
|
||||
bool isSmall() const { return _flags[__SMALLER]; }
|
||||
void setSmaller(bool smaller) { (smaller ? _flags.set(__SMALLER) : _flags.reset(__SMALLER)); }
|
||||
|
||||
bool operator==(const ItemKey& key) { return (_flags == key._flags); }
|
||||
bool operator!=(const ItemKey& key) { return (_flags != key._flags); }
|
||||
|
@ -177,11 +218,14 @@ public:
|
|||
Builder& withNoShadowCaster() { _value.reset(ItemKey::SHADOW_CASTER); _mask.set(ItemKey::SHADOW_CASTER); return (*this); }
|
||||
Builder& withShadowCaster() { _value.set(ItemKey::SHADOW_CASTER); _mask.set(ItemKey::SHADOW_CASTER); return (*this); }
|
||||
|
||||
Builder& withPickable() { _value.set(ItemKey::PICKABLE); _mask.set(ItemKey::PICKABLE); return (*this); }
|
||||
|
||||
Builder& withoutLayered() { _value.reset(ItemKey::LAYERED); _mask.set(ItemKey::LAYERED); return (*this); }
|
||||
Builder& withLayered() { _value.set(ItemKey::LAYERED); _mask.set(ItemKey::LAYERED); return (*this); }
|
||||
|
||||
Builder& withoutTag(ItemKey::Tag tagIndex) { _value.reset(ItemKey::FIRST_TAG_BIT + tagIndex); _mask.set(ItemKey::FIRST_TAG_BIT + tagIndex); return (*this); }
|
||||
Builder& withTag(ItemKey::Tag tagIndex) { _value.set(ItemKey::FIRST_TAG_BIT + tagIndex); _mask.set(ItemKey::FIRST_TAG_BIT + tagIndex); return (*this); }
|
||||
// Set ALL the tags in one call using the Tag bits and the Tag bits touched
|
||||
Builder& withTagBits(uint8_t tagBits, uint8_t tagMask) { _value = ItemKey::evalTagBitsWithKeyBits(tagBits, _value.to_ulong()); _mask = ItemKey::evalTagBitsWithKeyBits(tagMask, _mask.to_ulong()); return (*this); }
|
||||
|
||||
Builder& withNothing() { _value.reset(); _mask.reset(); return (*this); }
|
||||
|
||||
// Convenient standard keys that we will keep on using all over the place
|
||||
|
|
|
@ -17,19 +17,21 @@
|
|||
|
||||
using namespace render;
|
||||
|
||||
void RenderFetchCullSortTask::build(JobModel& task, const Varying& input, Varying& output, CullFunctor cullFunctor) {
|
||||
void RenderFetchCullSortTask::build(JobModel& task, const Varying& input, Varying& output, CullFunctor cullFunctor, uint8_t tagBits, uint8_t tagMask) {
|
||||
cullFunctor = cullFunctor ? cullFunctor : [](const RenderArgs*, const AABox&){ return true; };
|
||||
|
||||
// CPU jobs:
|
||||
// Fetch and cull the items from the scene
|
||||
const ItemFilter filter = ItemFilter::Builder::visibleWorldItems().withoutLayered();
|
||||
const ItemFilter filter = ItemFilter::Builder::visibleWorldItems().withoutLayered().withTagBits(tagBits, tagMask);
|
||||
const auto spatialFilter = render::Varying(filter);
|
||||
const auto spatialSelection = task.addJob<FetchSpatialTree>("FetchSceneSelection", spatialFilter);
|
||||
const auto cullInputs = CullSpatialSelection::Inputs(spatialSelection, spatialFilter).asVarying();
|
||||
const auto culledSpatialSelection = task.addJob<CullSpatialSelection>("CullSceneSelection", cullInputs, cullFunctor, RenderDetails::ITEM);
|
||||
|
||||
// Overlays are not culled
|
||||
const auto nonspatialSelection = task.addJob<FetchNonspatialItems>("FetchOverlaySelection");
|
||||
const ItemFilter overlayfilter = ItemFilter::Builder().withVisible().withTagBits(tagBits, tagMask);
|
||||
const auto nonspatialFilter = render::Varying(overlayfilter);
|
||||
const auto nonspatialSelection = task.addJob<FetchNonspatialItems>("FetchOverlaySelection", nonspatialFilter);
|
||||
|
||||
// Multi filter visible items into different buckets
|
||||
const int NUM_SPATIAL_FILTERS = 4;
|
||||
|
|
|
@ -36,7 +36,7 @@ public:
|
|||
|
||||
RenderFetchCullSortTask() {}
|
||||
|
||||
void build(JobModel& task, const render::Varying& inputs, render::Varying& outputs, render::CullFunctor cullFunctor);
|
||||
void build(JobModel& task, const render::Varying& inputs, render::Varying& outputs, render::CullFunctor cullFunctor, uint8_t tagBits = 0x00, uint8_t tagMask = 0x00);
|
||||
};
|
||||
|
||||
#endif // hifi_RenderFetchCullSortTask_h
|
||||
|
|
|
@ -527,6 +527,80 @@
|
|||
//
|
||||
//***********************************************
|
||||
|
||||
var sendMoneyRecipient;
|
||||
var sendMoneyParticleEffectUpdateTimer;
|
||||
var particleEffectTimestamp;
|
||||
var sendMoneyParticleEffect;
|
||||
var SEND_MONEY_PARTICLE_TIMER_UPDATE = 250;
|
||||
var SEND_MONEY_PARTICLE_EMITTING_DURATION = 3000;
|
||||
var SEND_MONEY_PARTICLE_LIFETIME_SECONDS = 8;
|
||||
var SEND_MONEY_PARTICLE_PROPERTIES = {
|
||||
accelerationSpread: { x: 0, y: 0, z: 0 },
|
||||
alpha: 1,
|
||||
alphaFinish: 1,
|
||||
alphaSpread: 0,
|
||||
alphaStart: 1,
|
||||
azimuthFinish: 0,
|
||||
azimuthStart: -6,
|
||||
color: { red: 143, green: 5, blue: 255 },
|
||||
colorFinish: { red: 255, green: 0, blue: 204 },
|
||||
colorSpread: { red: 0, green: 0, blue: 0 },
|
||||
colorStart: { red: 0, green: 136, blue: 255 },
|
||||
emitAcceleration: { x: 0, y: 0, z: 0 }, // Immediately gets updated to be accurate
|
||||
emitDimensions: { x: 0, y: 0, z: 0 },
|
||||
emitOrientation: { x: 0, y: 0, z: 0 },
|
||||
emitRate: 4,
|
||||
emitSpeed: 2.1,
|
||||
emitterShouldTrail: true,
|
||||
isEmitting: 1,
|
||||
lifespan: SEND_MONEY_PARTICLE_LIFETIME_SECONDS + 1, // Immediately gets updated to be accurate
|
||||
lifetime: SEND_MONEY_PARTICLE_LIFETIME_SECONDS + 1,
|
||||
maxParticles: 20,
|
||||
name: 'hfc-particles',
|
||||
particleRadius: 0.2,
|
||||
polarFinish: 0,
|
||||
polarStart: 0,
|
||||
radiusFinish: 0.05,
|
||||
radiusSpread: 0,
|
||||
radiusStart: 0.2,
|
||||
speedSpread: 0,
|
||||
textures: "http://hifi-content.s3.amazonaws.com/alan/dev/Particles/Bokeh-Particle-HFC.png",
|
||||
type: 'ParticleEffect'
|
||||
};
|
||||
|
||||
function updateSendMoneyParticleEffect() {
|
||||
var timestampNow = Date.now();
|
||||
if ((timestampNow - particleEffectTimestamp) > (SEND_MONEY_PARTICLE_LIFETIME_SECONDS * 1000)) {
|
||||
deleteSendMoneyParticleEffect();
|
||||
return;
|
||||
} else if ((timestampNow - particleEffectTimestamp) > SEND_MONEY_PARTICLE_EMITTING_DURATION) {
|
||||
Entities.editEntity(sendMoneyParticleEffect, {
|
||||
isEmitting: 0
|
||||
});
|
||||
} else if (sendMoneyParticleEffect) {
|
||||
var recipientPosition = AvatarList.getAvatar(sendMoneyRecipient).position;
|
||||
var distance = Vec3.distance(recipientPosition, MyAvatar.position);
|
||||
var accel = Vec3.subtract(recipientPosition, MyAvatar.position);
|
||||
accel.y -= 3.0;
|
||||
var life = Math.sqrt(2 * distance / Vec3.length(accel));
|
||||
Entities.editEntity(sendMoneyParticleEffect, {
|
||||
emitAcceleration: accel,
|
||||
lifespan: life
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function deleteSendMoneyParticleEffect() {
|
||||
if (sendMoneyParticleEffectUpdateTimer) {
|
||||
Script.clearInterval(sendMoneyParticleEffectUpdateTimer);
|
||||
sendMoneyParticleEffectUpdateTimer = null;
|
||||
}
|
||||
if (sendMoneyParticleEffect) {
|
||||
sendMoneyParticleEffect = Entities.deleteEntity(sendMoneyParticleEffect);
|
||||
}
|
||||
sendMoneyRecipient = null;
|
||||
}
|
||||
|
||||
// Function Name: fromQml()
|
||||
//
|
||||
// Description:
|
||||
|
@ -534,6 +608,7 @@
|
|||
// in the format "{method, params}", like json-rpc. See also sendToQml().
|
||||
var isHmdPreviewDisabled = true;
|
||||
var MARKETPLACES_INJECT_SCRIPT_URL = Script.resolvePath("../html/js/marketplacesInject.js");
|
||||
|
||||
function fromQml(message) {
|
||||
switch (message.method) {
|
||||
case 'passphrasePopup_cancelClicked':
|
||||
|
@ -605,6 +680,19 @@
|
|||
}
|
||||
removeOverlays();
|
||||
break;
|
||||
case 'sendMoney_sendPublicly':
|
||||
deleteSendMoneyParticleEffect();
|
||||
sendMoneyRecipient = message.recipient;
|
||||
var amount = message.amount;
|
||||
var props = SEND_MONEY_PARTICLE_PROPERTIES;
|
||||
props.parentID = MyAvatar.sessionUUID;
|
||||
props.position = MyAvatar.position;
|
||||
props.position.y += 0.2;
|
||||
sendMoneyParticleEffect = Entities.addEntity(props, true);
|
||||
particleEffectTimestamp = Date.now();
|
||||
updateSendMoneyParticleEffect();
|
||||
sendMoneyParticleEffectUpdateTimer = Script.setInterval(updateSendMoneyParticleEffect, SEND_MONEY_PARTICLE_TIMER_UPDATE);
|
||||
break;
|
||||
default:
|
||||
print('Unrecognized message from QML:', JSON.stringify(message));
|
||||
}
|
||||
|
@ -706,6 +794,7 @@
|
|||
function shutdown() {
|
||||
button.clicked.disconnect(onButtonClicked);
|
||||
tablet.removeButton(button);
|
||||
deleteSendMoneyParticleEffect();
|
||||
if (tablet) {
|
||||
tablet.screenChanged.disconnect(onTabletScreenChanged);
|
||||
if (onWalletScreen) {
|
||||
|
|
|
@ -26,6 +26,7 @@ colpick Color Picker / colpick.com
|
|||
/*Color selection box with gradients*/
|
||||
.colpick_color {
|
||||
position: absolute;
|
||||
touch-action: none;
|
||||
left: 7px;
|
||||
top: 7px;
|
||||
width: 156px;
|
||||
|
@ -84,6 +85,7 @@ colpick Color Picker / colpick.com
|
|||
/*Vertical hue bar*/
|
||||
.colpick_hue {
|
||||
position: absolute;
|
||||
touch-action: none;
|
||||
top: 6px;
|
||||
left: 175px;
|
||||
width: 19px;
|
||||
|
@ -94,6 +96,7 @@ colpick Color Picker / colpick.com
|
|||
/*Hue bar sliding indicator*/
|
||||
.colpick_hue_arrs {
|
||||
position: absolute;
|
||||
touch-action: none;
|
||||
left: -8px;
|
||||
width: 35px;
|
||||
height: 7px;
|
||||
|
@ -101,6 +104,7 @@ colpick Color Picker / colpick.com
|
|||
}
|
||||
.colpick_hue_larr {
|
||||
position:absolute;
|
||||
touch-action: none;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-top: 6px solid transparent;
|
||||
|
@ -109,6 +113,7 @@ colpick Color Picker / colpick.com
|
|||
}
|
||||
.colpick_hue_rarr {
|
||||
position:absolute;
|
||||
touch-action: none;
|
||||
right:0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
|
@ -119,6 +124,7 @@ colpick Color Picker / colpick.com
|
|||
/*New color box*/
|
||||
.colpick_new_color {
|
||||
position: absolute;
|
||||
touch-action: none;
|
||||
left: 207px;
|
||||
top: 6px;
|
||||
width: 60px;
|
||||
|
@ -129,6 +135,7 @@ colpick Color Picker / colpick.com
|
|||
/*Current color box*/
|
||||
.colpick_current_color {
|
||||
position: absolute;
|
||||
touch-action: none;
|
||||
left: 277px;
|
||||
top: 6px;
|
||||
width: 60px;
|
||||
|
@ -139,6 +146,7 @@ colpick Color Picker / colpick.com
|
|||
/*Input field containers*/
|
||||
.colpick_field, .colpick_hex_field {
|
||||
position: absolute;
|
||||
touch-action: none;
|
||||
height: 20px;
|
||||
width: 60px;
|
||||
overflow:hidden;
|
||||
|
@ -198,6 +206,7 @@ colpick Color Picker / colpick.com
|
|||
/*Text inputs*/
|
||||
.colpick_field input, .colpick_hex_field input {
|
||||
position: absolute;
|
||||
touch-action: none;
|
||||
right: 11px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
@ -217,6 +226,7 @@ colpick Color Picker / colpick.com
|
|||
/*Field up/down arrows*/
|
||||
.colpick_field_arrs {
|
||||
position: absolute;
|
||||
touch-action: none;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 9px;
|
||||
|
@ -225,6 +235,7 @@ colpick Color Picker / colpick.com
|
|||
}
|
||||
.colpick_field_uarr {
|
||||
position: absolute;
|
||||
touch-action: none;
|
||||
top: 5px;
|
||||
width: 0;
|
||||
height: 0;
|
||||
|
@ -234,6 +245,7 @@ colpick Color Picker / colpick.com
|
|||
}
|
||||
.colpick_field_darr {
|
||||
position: absolute;
|
||||
touch-action: none;
|
||||
bottom:5px;
|
||||
width: 0;
|
||||
height: 0;
|
||||
|
@ -244,6 +256,7 @@ colpick Color Picker / colpick.com
|
|||
/*Submit/Select button*/
|
||||
.colpick_submit {
|
||||
position: absolute;
|
||||
touch-action: none;
|
||||
left: 207px;
|
||||
top: 149px;
|
||||
width: 130px;
|
||||
|
|
|
@ -653,16 +653,16 @@ function loaded() {
|
|||
var elZoneKeyLightDirectionY = document.getElementById("property-zone-key-light-direction-y");
|
||||
|
||||
// Skybox
|
||||
var elZoneSkyboxModeInherit = document.getElementById("property-zone-skybox-mode-inherit");
|
||||
var elZoneSkyboxModeInherit = document.getElementById("property-zone-skybox-mode-inherit");
|
||||
var elZoneSkyboxModeDisabled = document.getElementById("property-zone-skybox-mode-disabled");
|
||||
var elZoneSkyboxModeEnabled = document.getElementById("property-zone-skybox-mode-enabled");
|
||||
var elZoneSkyboxModeEnabled = document.getElementById("property-zone-skybox-mode-enabled");
|
||||
|
||||
// Ambient light
|
||||
var elCopySkyboxURLToAmbientURL = document.getElementById("copy-skybox-url-to-ambient-url");
|
||||
|
||||
var elZoneAmbientLightModeInherit = document.getElementById("property-zone-ambient-light-mode-inherit");
|
||||
var elZoneAmbientLightModeInherit = document.getElementById("property-zone-ambient-light-mode-inherit");
|
||||
var elZoneAmbientLightModeDisabled = document.getElementById("property-zone-ambient-light-mode-disabled");
|
||||
var elZoneAmbientLightModeEnabled = document.getElementById("property-zone-ambient-light-mode-enabled");
|
||||
var elZoneAmbientLightModeEnabled = document.getElementById("property-zone-ambient-light-mode-enabled");
|
||||
|
||||
var elZoneAmbientLightIntensity = document.getElementById("property-zone-key-ambient-intensity");
|
||||
var elZoneAmbientLightURL = document.getElementById("property-zone-key-ambient-url");
|
||||
|
@ -1013,9 +1013,9 @@ function loaded() {
|
|||
|
||||
} else if (properties.type === "Zone") {
|
||||
// Key light
|
||||
elZoneKeyLightModeInherit.checked = (properties.keyLightMode === 'inherit');
|
||||
elZoneKeyLightModeInherit.checked = (properties.keyLightMode === 'inherit');
|
||||
elZoneKeyLightModeDisabled.checked = (properties.keyLightMode === 'disabled');
|
||||
elZoneKeyLightModeEnabled.checked = (properties.keyLightMode === 'enabled');
|
||||
elZoneKeyLightModeEnabled.checked = (properties.keyLightMode === 'enabled');
|
||||
|
||||
elZoneKeyLightColor.style.backgroundColor = "rgb(" + properties.keyLight.color.red + "," +
|
||||
properties.keyLight.color.green + "," + properties.keyLight.color.blue + ")";
|
||||
|
@ -1027,22 +1027,22 @@ function loaded() {
|
|||
elZoneKeyLightDirectionY.value = properties.keyLight.direction.y.toFixed(2);
|
||||
|
||||
// Skybox
|
||||
elZoneSkyboxModeInherit.checked = (properties.skyboxMode === 'inherit');
|
||||
elZoneSkyboxModeInherit.checked = (properties.skyboxMode === 'inherit');
|
||||
elZoneSkyboxModeDisabled.checked = (properties.skyboxMode === 'disabled');
|
||||
elZoneSkyboxModeEnabled.checked = (properties.skyboxMode === 'enabled');
|
||||
elZoneSkyboxModeEnabled.checked = (properties.skyboxMode === 'enabled');
|
||||
|
||||
// Ambient light
|
||||
elZoneAmbientLightModeInherit.checked = (properties.ambientLightMode === 'inherit');
|
||||
elZoneAmbientLightModeInherit.checked = (properties.ambientLightMode === 'inherit');
|
||||
elZoneAmbientLightModeDisabled.checked = (properties.ambientLightMode === 'disabled');
|
||||
elZoneAmbientLightModeEnabled.checked = (properties.ambientLightMode === 'enabled');
|
||||
elZoneAmbientLightModeEnabled.checked = (properties.ambientLightMode === 'enabled');
|
||||
|
||||
elZoneAmbientLightIntensity.value = properties.ambientLight.ambientIntensity.toFixed(2);
|
||||
elZoneAmbientLightURL.value = properties.ambientLight.ambientURL;
|
||||
|
||||
// Haze
|
||||
elZoneHazeModeInherit.checked = (properties.hazeMode === 'inherit');
|
||||
elZoneHazeModeInherit.checked = (properties.hazeMode === 'inherit');
|
||||
elZoneHazeModeDisabled.checked = (properties.hazeMode === 'disabled');
|
||||
elZoneHazeModeEnabled.checked = (properties.hazeMode === 'enabled');
|
||||
elZoneHazeModeEnabled.checked = (properties.hazeMode === 'enabled');
|
||||
|
||||
elZoneHazeRange.value = properties.haze.hazeRange.toFixed(0);
|
||||
elZoneHazeColor.style.backgroundColor = "rgb(" +
|
||||
|
@ -1308,15 +1308,15 @@ function loaded() {
|
|||
colorScheme: 'dark',
|
||||
layout: 'hex',
|
||||
color: '000000',
|
||||
submit: false, // We don't want to have a submission button
|
||||
onShow: function(colpick) {
|
||||
$('#property-color-control2').attr('active', 'true');
|
||||
},
|
||||
onHide: function(colpick) {
|
||||
$('#property-color-control2').attr('active', 'false');
|
||||
},
|
||||
onSubmit: function(hsb, hex, rgb, el) {
|
||||
onChange: function(hsb, hex, rgb, el) {
|
||||
$(el).css('background-color', '#' + hex);
|
||||
$(el).colpickHide();
|
||||
emitColorPropertyUpdate('color', rgb.r, rgb.g, rgb.b);
|
||||
}
|
||||
}));
|
||||
|
@ -1332,15 +1332,15 @@ function loaded() {
|
|||
colorScheme: 'dark',
|
||||
layout: 'hex',
|
||||
color: '000000',
|
||||
submit: false, // We don't want to have a submission button
|
||||
onShow: function(colpick) {
|
||||
$('#property-light-color').attr('active', 'true');
|
||||
},
|
||||
onHide: function(colpick) {
|
||||
$('#property-light-color').attr('active', 'false');
|
||||
},
|
||||
onSubmit: function(hsb, hex, rgb, el) {
|
||||
onChange: function(hsb, hex, rgb, el) {
|
||||
$(el).css('background-color', '#' + hex);
|
||||
$(el).colpickHide();
|
||||
emitColorPropertyUpdate('color', rgb.r, rgb.g, rgb.b);
|
||||
}
|
||||
}));
|
||||
|
@ -1387,15 +1387,15 @@ function loaded() {
|
|||
colorScheme: 'dark',
|
||||
layout: 'hex',
|
||||
color: '000000',
|
||||
submit: false, // We don't want to have a submission button
|
||||
onShow: function(colpick) {
|
||||
$('#property-text-text-color').attr('active', 'true');
|
||||
},
|
||||
onHide: function(colpick) {
|
||||
$('#property-text-text-color').attr('active', 'false');
|
||||
},
|
||||
onSubmit: function(hsb, hex, rgb, el) {
|
||||
onChange: function(hsb, hex, rgb, el) {
|
||||
$(el).css('background-color', '#' + hex);
|
||||
$(el).colpickHide();
|
||||
$(el).attr('active', 'false');
|
||||
emitColorPropertyUpdate('textColor', rgb.r, rgb.g, rgb.b);
|
||||
}
|
||||
|
@ -1411,15 +1411,15 @@ function loaded() {
|
|||
colorScheme: 'dark',
|
||||
layout: 'hex',
|
||||
color: '000000',
|
||||
submit: false, // We don't want to have a submission button
|
||||
onShow: function(colpick) {
|
||||
$('#property-text-background-color').attr('active', 'true');
|
||||
},
|
||||
onHide: function(colpick) {
|
||||
$('#property-text-background-color').attr('active', 'false');
|
||||
},
|
||||
onSubmit: function(hsb, hex, rgb, el) {
|
||||
onChange: function(hsb, hex, rgb, el) {
|
||||
$(el).css('background-color', '#' + hex);
|
||||
$(el).colpickHide();
|
||||
emitColorPropertyUpdate('backgroundColor', rgb.r, rgb.g, rgb.b);
|
||||
}
|
||||
}));
|
||||
|
@ -1436,15 +1436,15 @@ function loaded() {
|
|||
colorScheme: 'dark',
|
||||
layout: 'hex',
|
||||
color: '000000',
|
||||
submit: false, // We don't want to have a submission button
|
||||
onShow: function(colpick) {
|
||||
$('#property-zone-key-light-color').attr('active', 'true');
|
||||
},
|
||||
onHide: function(colpick) {
|
||||
$('#property-zone-key-light-color').attr('active', 'false');
|
||||
},
|
||||
onSubmit: function(hsb, hex, rgb, el) {
|
||||
onChange: function(hsb, hex, rgb, el) {
|
||||
$(el).css('background-color', '#' + hex);
|
||||
$(el).colpickHide();
|
||||
emitColorPropertyUpdate('color', rgb.r, rgb.g, rgb.b, 'keyLight');
|
||||
}
|
||||
}));
|
||||
|
@ -1505,15 +1505,15 @@ function loaded() {
|
|||
colorScheme: 'dark',
|
||||
layout: 'hex',
|
||||
color: '000000',
|
||||
submit: false, // We don't want to have a submission button
|
||||
onShow: function(colpick) {
|
||||
$('#property-zone-haze-color').attr('active', 'true');
|
||||
},
|
||||
onHide: function(colpick) {
|
||||
$('#property-zone-haze-color').attr('active', 'false');
|
||||
},
|
||||
onSubmit: function(hsb, hex, rgb, el) {
|
||||
onChange: function(hsb, hex, rgb, el) {
|
||||
$(el).css('background-color', '#' + hex);
|
||||
$(el).colpickHide();
|
||||
emitColorPropertyUpdate('hazeColor', rgb.r, rgb.g, rgb.b, 'haze');
|
||||
}
|
||||
}));
|
||||
|
@ -1530,15 +1530,15 @@ function loaded() {
|
|||
colorScheme: 'dark',
|
||||
layout: 'hex',
|
||||
color: '000000',
|
||||
submit: false, // We don't want to have a submission button
|
||||
onShow: function(colpick) {
|
||||
$('#property-zone-haze-glare-color').attr('active', 'true');
|
||||
},
|
||||
onHide: function(colpick) {
|
||||
$('#property-zone-haze-glare-color').attr('active', 'false');
|
||||
},
|
||||
onSubmit: function(hsb, hex, rgb, el) {
|
||||
onChange: function(hsb, hex, rgb, el) {
|
||||
$(el).css('background-color', '#' + hex);
|
||||
$(el).colpickHide();
|
||||
emitColorPropertyUpdate('hazeGlareColor', rgb.r, rgb.g, rgb.b, 'haze');
|
||||
}
|
||||
}));
|
||||
|
@ -1572,15 +1572,15 @@ function loaded() {
|
|||
colorScheme: 'dark',
|
||||
layout: 'hex',
|
||||
color: '000000',
|
||||
submit: false, // We don't want to have a submission button
|
||||
onShow: function(colpick) {
|
||||
$('#property-zone-skybox-color').attr('active', 'true');
|
||||
},
|
||||
onHide: function(colpick) {
|
||||
$('#property-zone-skybox-color').attr('active', 'false');
|
||||
},
|
||||
onSubmit: function(hsb, hex, rgb, el) {
|
||||
onChange: function(hsb, hex, rgb, el) {
|
||||
$(el).css('background-color', '#' + hex);
|
||||
$(el).colpickHide();
|
||||
emitColorPropertyUpdate('color', rgb.r, rgb.g, rgb.b, 'skybox');
|
||||
}
|
||||
}));
|
||||
|
|
|
@ -578,6 +578,7 @@ var selectionDisplay = null; // for gridTool.js to ignore
|
|||
case 'refreshConnections':
|
||||
case 'enable_ChooseRecipientNearbyMode':
|
||||
case 'disable_ChooseRecipientNearbyMode':
|
||||
case 'sendMoney_sendPublicly':
|
||||
// NOP
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -300,7 +300,7 @@
|
|||
|
||||
if (visible) {
|
||||
x = ((Date.now() / 1000) % ANIMATION_SECONDS_PER_REPEAT) / ANIMATION_SECONDS_PER_REPEAT;
|
||||
if (isHMD) {
|
||||
if (!isHMD) {
|
||||
x = x * barDesktop.repeat;
|
||||
} else {
|
||||
x = x * BAR_HMD_REPEAT;
|
||||
|
@ -309,9 +309,9 @@
|
|||
// Update progress bar
|
||||
Overlays.editOverlay(barDesktop.overlay, {
|
||||
visible: !isHMD,
|
||||
subImage: {
|
||||
bounds: {
|
||||
x: barDesktop.repeat - x,
|
||||
y: 0,
|
||||
y: windowHeight - barDesktop.height,
|
||||
width: barDesktop.width - barDesktop.repeat,
|
||||
height: barDesktop.height
|
||||
}
|
||||
|
@ -319,9 +319,9 @@
|
|||
|
||||
Overlays.editOverlay(barHMD.overlay, {
|
||||
visible: isHMD,
|
||||
subImage: {
|
||||
bounds: {
|
||||
x: BAR_HMD_REPEAT - x,
|
||||
y: 0,
|
||||
y: windowHeight - BAR_HMD_HEIGHT,
|
||||
width: BAR_HMD_WIDTH - BAR_HMD_REPEAT,
|
||||
height: BAR_HMD_HEIGHT
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue