mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
Friday night end of the day, last compilation.... almost
This commit is contained in:
parent
aa18aaa7b1
commit
36a08fdd84
5 changed files with 40 additions and 28 deletions
|
@ -1126,8 +1126,11 @@ void MyAvatar::setEnableDebugDrawIKChains(bool isEnabled) {
|
|||
_enableDebugDrawIKChains = isEnabled;
|
||||
}
|
||||
|
||||
bool MyAvatar::getEnableMeshVisible() const {
|
||||
return Avatar::getEnableMeshVisible();
|
||||
}
|
||||
|
||||
void MyAvatar::setEnableMeshVisible(bool isEnabled) {
|
||||
_skeletonModel->setVisibleInScene(isEnabled, qApp->getMain3DScene(), render::ItemKey::TAG_BITS_0 | render::ItemKey::TAG_BITS_1, true);
|
||||
Avatar::setEnableMeshVisible(isEnabled);
|
||||
}
|
||||
|
||||
|
|
|
@ -1159,7 +1159,7 @@ public slots:
|
|||
* @function MyAvatar.getEnableMeshVisible
|
||||
* @returns {boolean} <code>true</code> if your avatar's mesh is visible, otherwise <code>false</code>.
|
||||
*/
|
||||
bool getEnableMeshVisible() const override { return _skeletonModel->isVisible(); }
|
||||
bool getEnableMeshVisible() const override;
|
||||
|
||||
/**jsdoc
|
||||
* Set whether or not your avatar mesh is visible.
|
||||
|
|
|
@ -55,7 +55,9 @@ namespace render {
|
|||
ItemKey::Builder keyBuilder = ItemKey::Builder::opaqueShape().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 (model && !model->isVisible()) {
|
||||
|
||||
if (!avatarPtr->getEnableMeshVisible() && model) {
|
||||
keyBuilder.withInvisible();
|
||||
}
|
||||
return keyBuilder.build();
|
||||
|
@ -767,16 +769,14 @@ void Avatar::render(RenderArgs* renderArgs) {
|
|||
|
||||
|
||||
void Avatar::setEnableMeshVisible(bool isEnabled) {
|
||||
render::Transaction transaction;
|
||||
if (render::Item::isValidID(_renderItemID)) {
|
||||
transaction.updateItem<render::Payload<AvatarData>>(_renderItemID, [](render::Payload<AvatarData>& p) {
|
||||
});
|
||||
if (_isMeshEnableVisible != isEnabled) {
|
||||
_isMeshEnableVisible = isEnabled;
|
||||
_needMeshVisibleSwitch = true;
|
||||
}
|
||||
qApp->getMain3DScene()->enqueueTransaction(transaction);
|
||||
}
|
||||
|
||||
bool Avatar::getEnableMeshVisible() const {
|
||||
return true;
|
||||
return _isMeshEnableVisible;
|
||||
}
|
||||
|
||||
void Avatar::fixupModelsInScene(const render::ScenePointer& scene) {
|
||||
|
@ -801,6 +801,12 @@ void Avatar::fixupModelsInScene(const render::ScenePointer& scene) {
|
|||
}
|
||||
}
|
||||
|
||||
if (_needMeshVisibleSwitch) {
|
||||
// _skeletonModel->setVisibleInScene(_isMeshEnableVisible, scene, render::ItemKey::TAG_BITS_0 | render::ItemKey::TAG_BITS_1, true);
|
||||
updateRenderItem(transaction);
|
||||
_needMeshVisibleSwitch = false;
|
||||
}
|
||||
|
||||
if (_mustFadeIn && canTryFade) {
|
||||
// Do it now to be sure all the sub items are ready and the fade is sent to them too
|
||||
fade(transaction, render::Transition::USER_ENTER_DOMAIN);
|
||||
|
|
|
@ -536,6 +536,9 @@ protected:
|
|||
std::mutex _materialsLock;
|
||||
|
||||
void processMaterials();
|
||||
|
||||
bool _isMeshEnableVisible{ true };
|
||||
bool _needMeshVisibleSwitch{ true };
|
||||
};
|
||||
|
||||
#endif // hifi_Avatar_h
|
||||
|
|
|
@ -368,9 +368,9 @@ void CullShapeBounds::run(const RenderContextPointer& renderContext, const Input
|
|||
RenderArgs* args = renderContext->args;
|
||||
|
||||
const auto& inShapes = inputs.get0();
|
||||
const auto& cullFilter = inputs.get1();
|
||||
const auto& boundsFilter = inputs.get2();
|
||||
const auto& antiFrustum = inputs.get3();
|
||||
const auto& cullFilter = inputs.get1();
|
||||
const auto& boundsFilter = inputs.get2();
|
||||
const auto& antiFrustum = inputs.get3();
|
||||
auto& outShapes = outputs.edit0();
|
||||
auto& outBounds = outputs.edit1();
|
||||
|
||||
|
@ -380,7 +380,7 @@ void CullShapeBounds::run(const RenderContextPointer& renderContext, const Input
|
|||
if (!cullFilter.selectsNothing() || !boundsFilter.selectsNothing()) {
|
||||
auto& details = args->_details.edit(_detailType);
|
||||
Test test(_cullFunctor, args, details, antiFrustum);
|
||||
auto scene = args->_scene;
|
||||
auto scene = args->_scene;
|
||||
|
||||
for (auto& inItems : inShapes) {
|
||||
auto key = inItems.first;
|
||||
|
@ -395,26 +395,26 @@ 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 shapeKey = scene->getItem(item.id).getKey();
|
||||
if (cullFilter.test(shapeKey)) {
|
||||
outItems->second.emplace_back(item);
|
||||
}
|
||||
if (boundsFilter.test(shapeKey)) {
|
||||
outBounds += item.bound;
|
||||
}
|
||||
const auto shapeKey = scene->getItem(item.id).getKey();
|
||||
if (cullFilter.test(shapeKey)) {
|
||||
outItems->second.emplace_back(item);
|
||||
}
|
||||
if (boundsFilter.test(shapeKey)) {
|
||||
outBounds += item.bound;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (auto& item : inItems.second) {
|
||||
if (test.solidAngleTest(item.bound) && test.frustumTest(item.bound) && test.antiFrustumTest(item.bound)) {
|
||||
const auto shapeKey = scene->getItem(item.id).getKey();
|
||||
if (cullFilter.test(shapeKey)) {
|
||||
outItems->second.emplace_back(item);
|
||||
}
|
||||
if (boundsFilter.test(shapeKey)) {
|
||||
outBounds += item.bound;
|
||||
}
|
||||
}
|
||||
const auto shapeKey = scene->getItem(item.id).getKey();
|
||||
if (cullFilter.test(shapeKey)) {
|
||||
outItems->second.emplace_back(item);
|
||||
}
|
||||
if (boundsFilter.test(shapeKey)) {
|
||||
outBounds += item.bound;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
details._rendered += (int)outItems->second.size();
|
||||
|
|
Loading…
Reference in a new issue