mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 16:41:02 +02:00
There and back again...
This commit is contained in:
parent
f66e13b2ec
commit
13d02011f3
3 changed files with 9 additions and 15 deletions
|
@ -104,6 +104,9 @@ void AvatarManager::updateMyAvatar(float deltaTime) {
|
||||||
PerformanceWarning warn(showWarnings, "AvatarManager::updateMyAvatar()");
|
PerformanceWarning warn(showWarnings, "AvatarManager::updateMyAvatar()");
|
||||||
|
|
||||||
_myAvatar->update(deltaTime);
|
_myAvatar->update(deltaTime);
|
||||||
|
render::Transaction transaction;
|
||||||
|
_myAvatar->updateRenderItem(transaction);
|
||||||
|
qApp->getMain3DScene()->enqueueTransaction(transaction);
|
||||||
|
|
||||||
quint64 now = usecTimestampNow();
|
quint64 now = usecTimestampNow();
|
||||||
quint64 dt = now - _lastSendAvatarDataTime;
|
quint64 dt = now - _lastSendAvatarDataTime;
|
||||||
|
|
|
@ -52,12 +52,10 @@ const glm::vec3 HAND_TO_PALM_OFFSET(0.0f, 0.12f, 0.08f);
|
||||||
|
|
||||||
namespace render {
|
namespace render {
|
||||||
template <> const ItemKey payloadGetKey(const AvatarSharedPointer& avatar) {
|
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 avatarPtr = static_pointer_cast<Avatar>(avatar);
|
||||||
auto model = avatarPtr->getSkeletonModel();
|
auto model = avatarPtr->getSkeletonModel();
|
||||||
//if (model && !model->isVisible()) {
|
if (!avatarPtr->getEnableMeshVisible()) {
|
||||||
|
|
||||||
if (!avatarPtr->getEnableMeshVisible() && model) {
|
|
||||||
keyBuilder.withInvisible();
|
keyBuilder.withInvisible();
|
||||||
}
|
}
|
||||||
return keyBuilder.build();
|
return keyBuilder.build();
|
||||||
|
@ -816,7 +814,7 @@ void Avatar::fixupModelsInScene(const render::ScenePointer& scene) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_needMeshVisibleSwitch) {
|
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);
|
updateRenderItem(transaction);
|
||||||
_needMeshVisibleSwitch = false;
|
_needMeshVisibleSwitch = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -395,13 +395,9 @@ void CullShapeBounds::run(const RenderContextPointer& renderContext, const Input
|
||||||
if (antiFrustum == nullptr) {
|
if (antiFrustum == nullptr) {
|
||||||
for (auto& item : inItems.second) {
|
for (auto& item : inItems.second) {
|
||||||
if (test.solidAngleTest(item.bound) && test.frustumTest(item.bound)) {
|
if (test.solidAngleTest(item.bound) && test.frustumTest(item.bound)) {
|
||||||
const auto& theItem = scene->getItem(item.id);
|
const auto shapeKey = scene->getItem(item.id).getKey();
|
||||||
const auto shapeKey = theItem.getKey();
|
|
||||||
if (cullFilter.test(shapeKey)) {
|
if (cullFilter.test(shapeKey)) {
|
||||||
outItems->second.emplace_back(item);
|
outItems->second.emplace_back(item);
|
||||||
if (theItem.getKey().isMetaCullGroup()) {
|
|
||||||
theItem.fetchMetaSubItemBounds(outItems->second, (*scene));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (boundsFilter.test(shapeKey)) {
|
if (boundsFilter.test(shapeKey)) {
|
||||||
outBounds += item.bound;
|
outBounds += item.bound;
|
||||||
|
@ -411,13 +407,9 @@ void CullShapeBounds::run(const RenderContextPointer& renderContext, const Input
|
||||||
} else {
|
} else {
|
||||||
for (auto& item : inItems.second) {
|
for (auto& item : inItems.second) {
|
||||||
if (test.solidAngleTest(item.bound) && test.frustumTest(item.bound) && test.antiFrustumTest(item.bound)) {
|
if (test.solidAngleTest(item.bound) && test.frustumTest(item.bound) && test.antiFrustumTest(item.bound)) {
|
||||||
const auto& theItem = scene->getItem(item.id);
|
const auto shapeKey = scene->getItem(item.id).getKey();
|
||||||
const auto shapeKey = theItem.getKey();
|
|
||||||
if (cullFilter.test(shapeKey)) {
|
if (cullFilter.test(shapeKey)) {
|
||||||
outItems->second.emplace_back(item);
|
outItems->second.emplace_back(item);
|
||||||
if (theItem.getKey().isMetaCullGroup()) {
|
|
||||||
theItem.fetchMetaSubItemBounds(outItems->second, (*scene));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (boundsFilter.test(shapeKey)) {
|
if (boundsFilter.test(shapeKey)) {
|
||||||
outBounds += item.bound;
|
outBounds += item.bound;
|
||||||
|
@ -495,6 +487,7 @@ void FetchSpatialSelection::run(const RenderContextPointer& renderContext,
|
||||||
if (filter.test(item.getKey())) {
|
if (filter.test(item.getKey())) {
|
||||||
ItemBound itemBound(id, item.getBound());
|
ItemBound itemBound(id, item.getBound());
|
||||||
outItems.emplace_back(itemBound);
|
outItems.emplace_back(itemBound);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue