There and back again...

This commit is contained in:
Sam Gateau 2018-05-24 00:53:29 -07:00
parent f66e13b2ec
commit 13d02011f3
3 changed files with 9 additions and 15 deletions

View file

@ -104,6 +104,9 @@ void AvatarManager::updateMyAvatar(float deltaTime) {
PerformanceWarning warn(showWarnings, "AvatarManager::updateMyAvatar()");
_myAvatar->update(deltaTime);
render::Transaction transaction;
_myAvatar->updateRenderItem(transaction);
qApp->getMain3DScene()->enqueueTransaction(transaction);
quint64 now = usecTimestampNow();
quint64 dt = now - _lastSendAvatarDataTime;

View file

@ -52,12 +52,10 @@ const glm::vec3 HAND_TO_PALM_OFFSET(0.0f, 0.12f, 0.08f);
namespace render {
template <> const ItemKey payloadGetKey(const AvatarSharedPointer& avatar) {
ItemKey::Builder keyBuilder = ItemKey::Builder::opaqueShape().withTypeMeta().withTagBits(ItemKey::TAG_BITS_0 | ItemKey::TAG_BITS_1).withMetaCullGroup();
ItemKey::Builder keyBuilder = ItemKey::Builder::opaqueShape().withShadowCaster().withTypeMeta().withTagBits(ItemKey::TAG_BITS_0 | ItemKey::TAG_BITS_1).withMetaCullGroup();
auto avatarPtr = static_pointer_cast<Avatar>(avatar);
auto model = avatarPtr->getSkeletonModel();
//if (model && !model->isVisible()) {
if (!avatarPtr->getEnableMeshVisible() && model) {
if (!avatarPtr->getEnableMeshVisible()) {
keyBuilder.withInvisible();
}
return keyBuilder.build();
@ -816,7 +814,7 @@ void Avatar::fixupModelsInScene(const render::ScenePointer& scene) {
}
if (_needMeshVisibleSwitch) {
// _skeletonModel->setVisibleInScene(_isMeshEnableVisible, scene, render::ItemKey::TAG_BITS_0 | render::ItemKey::TAG_BITS_1, true);
_skeletonModel->setVisibleInScene(_isMeshEnableVisible, scene, render::ItemKey::TAG_BITS_0 | render::ItemKey::TAG_BITS_1, true);
updateRenderItem(transaction);
_needMeshVisibleSwitch = false;
}

View file

@ -395,13 +395,9 @@ void CullShapeBounds::run(const RenderContextPointer& renderContext, const Input
if (antiFrustum == nullptr) {
for (auto& item : inItems.second) {
if (test.solidAngleTest(item.bound) && test.frustumTest(item.bound)) {
const auto& theItem = scene->getItem(item.id);
const auto shapeKey = theItem.getKey();
const auto shapeKey = scene->getItem(item.id).getKey();
if (cullFilter.test(shapeKey)) {
outItems->second.emplace_back(item);
if (theItem.getKey().isMetaCullGroup()) {
theItem.fetchMetaSubItemBounds(outItems->second, (*scene));
}
}
if (boundsFilter.test(shapeKey)) {
outBounds += item.bound;
@ -411,13 +407,9 @@ void CullShapeBounds::run(const RenderContextPointer& renderContext, const Input
} else {
for (auto& item : inItems.second) {
if (test.solidAngleTest(item.bound) && test.frustumTest(item.bound) && test.antiFrustumTest(item.bound)) {
const auto& theItem = scene->getItem(item.id);
const auto shapeKey = theItem.getKey();
const auto shapeKey = scene->getItem(item.id).getKey();
if (cullFilter.test(shapeKey)) {
outItems->second.emplace_back(item);
if (theItem.getKey().isMetaCullGroup()) {
theItem.fetchMetaSubItemBounds(outItems->second, (*scene));
}
}
if (boundsFilter.test(shapeKey)) {
outBounds += item.bound;
@ -495,6 +487,7 @@ void FetchSpatialSelection::run(const RenderContextPointer& renderContext,
if (filter.test(item.getKey())) {
ItemBound itemBound(id, item.getBound());
outItems.emplace_back(itemBound);
}
}
}