mirror of
https://github.com/overte-org/overte.git
synced 2025-04-15 14:56:57 +02:00
remove orb in the otherAvatar destructor, and check
_otherAvatarOrbMeshPlaceholder pointer before updating the position
This commit is contained in:
parent
eba4a27329
commit
1804422df0
2 changed files with 9 additions and 1 deletions
|
@ -22,6 +22,10 @@ OtherAvatar::OtherAvatar(QThread* thread) : Avatar(thread) {
|
|||
createOrb();
|
||||
}
|
||||
|
||||
OtherAvatar::~OtherAvatar() {
|
||||
removeOrb();
|
||||
}
|
||||
|
||||
void OtherAvatar::removeOrb() {
|
||||
if (qApp->getOverlays().isAddedOverlay(_otherAvatarOrbMeshPlaceholderID)) {
|
||||
qApp->getOverlays().deleteOverlay(_otherAvatarOrbMeshPlaceholderID);
|
||||
|
@ -29,7 +33,9 @@ void OtherAvatar::removeOrb() {
|
|||
}
|
||||
|
||||
void OtherAvatar::updateOrbPosition() {
|
||||
_otherAvatarOrbMeshPlaceholder->setWorldPosition(getHead()->getPosition());
|
||||
if (_otherAvatarOrbMeshPlaceholder != nullptr) {
|
||||
_otherAvatarOrbMeshPlaceholder->setWorldPosition(getHead()->getPosition());
|
||||
}
|
||||
}
|
||||
|
||||
void OtherAvatar::createOrb() {
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
class OtherAvatar : public Avatar {
|
||||
public:
|
||||
explicit OtherAvatar(QThread* thread);
|
||||
~OtherAvatar();
|
||||
|
||||
virtual void instantiableAvatar() override { };
|
||||
void createOrb() override;
|
||||
void updateOrbPosition();
|
||||
|
|
Loading…
Reference in a new issue