mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-17 16:40:17 +02:00
Maybe
This commit is contained in:
parent
0cf87748cd
commit
aa18aaa7b1
4 changed files with 21 additions and 3 deletions
|
@ -1127,8 +1127,8 @@ void MyAvatar::setEnableDebugDrawIKChains(bool isEnabled) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyAvatar::setEnableMeshVisible(bool isEnabled) {
|
void MyAvatar::setEnableMeshVisible(bool isEnabled) {
|
||||||
// TODO: This should tell the main MetaRenderItem of the Avatar to be hidden to control vsisiblity since the model is culled by the MetaRI.
|
|
||||||
_skeletonModel->setVisibleInScene(isEnabled, qApp->getMain3DScene(), render::ItemKey::TAG_BITS_0 | render::ItemKey::TAG_BITS_1, true);
|
_skeletonModel->setVisibleInScene(isEnabled, qApp->getMain3DScene(), render::ItemKey::TAG_BITS_0 | render::ItemKey::TAG_BITS_1, true);
|
||||||
|
Avatar::setEnableMeshVisible(isEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyAvatar::setEnableInverseKinematics(bool isEnabled) {
|
void MyAvatar::setEnableInverseKinematics(bool isEnabled) {
|
||||||
|
|
|
@ -1159,7 +1159,7 @@ public slots:
|
||||||
* @function MyAvatar.getEnableMeshVisible
|
* @function MyAvatar.getEnableMeshVisible
|
||||||
* @returns {boolean} <code>true</code> if your avatar's mesh is visible, otherwise <code>false</code>.
|
* @returns {boolean} <code>true</code> if your avatar's mesh is visible, otherwise <code>false</code>.
|
||||||
*/
|
*/
|
||||||
bool getEnableMeshVisible() const { return _skeletonModel->isVisible(); }
|
bool getEnableMeshVisible() const override { return _skeletonModel->isVisible(); }
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Set whether or not your avatar mesh is visible.
|
* Set whether or not your avatar mesh is visible.
|
||||||
|
@ -1171,7 +1171,7 @@ public slots:
|
||||||
* MyAvatar.setEnableMeshVisible(true);
|
* MyAvatar.setEnableMeshVisible(true);
|
||||||
* }, 10000);
|
* }, 10000);
|
||||||
*/
|
*/
|
||||||
void setEnableMeshVisible(bool isEnabled);
|
void setEnableMeshVisible(bool isEnabled) override;
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* @function MyAvatar.setEnableInverseKinematics
|
* @function MyAvatar.setEnableInverseKinematics
|
||||||
|
|
|
@ -765,6 +765,20 @@ 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) {
|
||||||
|
});
|
||||||
|
}
|
||||||
|
qApp->getMain3DScene()->enqueueTransaction(transaction);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Avatar::getEnableMeshVisible() const {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void Avatar::fixupModelsInScene(const render::ScenePointer& scene) {
|
void Avatar::fixupModelsInScene(const render::ScenePointer& scene) {
|
||||||
bool canTryFade{ false };
|
bool canTryFade{ false };
|
||||||
|
|
||||||
|
|
|
@ -356,6 +356,10 @@ public:
|
||||||
|
|
||||||
virtual void setAvatarEntityDataChanged(bool value) override;
|
virtual void setAvatarEntityDataChanged(bool value) override;
|
||||||
|
|
||||||
|
// Show hide the model representation of the avatar
|
||||||
|
virtual void setEnableMeshVisible(bool isEnabled);
|
||||||
|
virtual bool getEnableMeshVisible() const;
|
||||||
|
|
||||||
void addMaterial(graphics::MaterialLayer material, const std::string& parentMaterialName) override;
|
void addMaterial(graphics::MaterialLayer material, const std::string& parentMaterialName) override;
|
||||||
void removeMaterial(graphics::MaterialPointer material, const std::string& parentMaterialName) override;
|
void removeMaterial(graphics::MaterialPointer material, const std::string& parentMaterialName) override;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue