mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-08 14:29:24 +02:00
remove friend class from Avatar
This commit is contained in:
parent
73be57f54a
commit
8ac06c4059
2 changed files with 11 additions and 10 deletions
|
@ -186,9 +186,10 @@ public:
|
||||||
|
|
||||||
virtual void computeShapeInfo(ShapeInfo& shapeInfo);
|
virtual void computeShapeInfo(ShapeInfo& shapeInfo);
|
||||||
|
|
||||||
friend class AvatarManager;
|
void setMotionState(AvatarMotionState* motionState) { _motionState = motionState; }
|
||||||
|
AvatarMotionState* getMotionState() { return _motionState; }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void collisionWithAvatar(const QUuid& myUUID, const QUuid& theirUUID, const CollisionInfo& collision);
|
void collisionWithAvatar(const QUuid& myUUID, const QUuid& theirUUID, const CollisionInfo& collision);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -218,7 +219,7 @@ protected:
|
||||||
glm::vec3 _worldUpDirection;
|
glm::vec3 _worldUpDirection;
|
||||||
float _stringLength;
|
float _stringLength;
|
||||||
bool _moving; ///< set when position is changing
|
bool _moving; ///< set when position is changing
|
||||||
|
|
||||||
// protected methods...
|
// protected methods...
|
||||||
glm::vec3 getBodyRightDirection() const { return getOrientation() * IDENTITY_RIGHT; }
|
glm::vec3 getBodyRightDirection() const { return getOrientation() * IDENTITY_RIGHT; }
|
||||||
glm::vec3 getBodyUpDirection() const { return getOrientation() * IDENTITY_UP; }
|
glm::vec3 getBodyUpDirection() const { return getOrientation() * IDENTITY_UP; }
|
||||||
|
@ -243,7 +244,7 @@ protected:
|
||||||
virtual void updateJointMappings();
|
virtual void updateJointMappings();
|
||||||
|
|
||||||
render::ItemID _renderItemID;
|
render::ItemID _renderItemID;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool _initialized;
|
bool _initialized;
|
||||||
NetworkTexturePointer _billboardTexture;
|
NetworkTexturePointer _billboardTexture;
|
||||||
|
@ -251,9 +252,9 @@ private:
|
||||||
bool _isLookAtTarget;
|
bool _isLookAtTarget;
|
||||||
|
|
||||||
void renderBillboard(RenderArgs* renderArgs);
|
void renderBillboard(RenderArgs* renderArgs);
|
||||||
|
|
||||||
float getBillboardSize() const;
|
float getBillboardSize() const;
|
||||||
|
|
||||||
static int _jointConesID;
|
static int _jointConesID;
|
||||||
|
|
||||||
int _voiceSphereID;
|
int _voiceSphereID;
|
||||||
|
|
|
@ -179,11 +179,11 @@ AvatarSharedPointer AvatarManager::addAvatar(const QUuid& sessionUUID, const QWe
|
||||||
// protected
|
// protected
|
||||||
void AvatarManager::removeAvatarMotionState(AvatarSharedPointer avatar) {
|
void AvatarManager::removeAvatarMotionState(AvatarSharedPointer avatar) {
|
||||||
auto rawPointer = std::static_pointer_cast<Avatar>(avatar);
|
auto rawPointer = std::static_pointer_cast<Avatar>(avatar);
|
||||||
AvatarMotionState* motionState= rawPointer->_motionState;
|
AvatarMotionState* motionState = rawPointer->getMotionState();
|
||||||
if (motionState) {
|
if (motionState) {
|
||||||
// clean up physics stuff
|
// clean up physics stuff
|
||||||
motionState->clearObjectBackPointer();
|
motionState->clearObjectBackPointer();
|
||||||
rawPointer->_motionState = nullptr;
|
rawPointer->setMotionState(nullptr);
|
||||||
_avatarMotionStates.remove(motionState);
|
_avatarMotionStates.remove(motionState);
|
||||||
_motionStatesToAdd.remove(motionState);
|
_motionStatesToAdd.remove(motionState);
|
||||||
_motionStatesToDelete.push_back(motionState);
|
_motionStatesToDelete.push_back(motionState);
|
||||||
|
@ -307,7 +307,7 @@ void AvatarManager::updateAvatarPhysicsShape(const QUuid& id) {
|
||||||
AvatarHash::iterator avatarItr = _avatarHash.find(id);
|
AvatarHash::iterator avatarItr = _avatarHash.find(id);
|
||||||
if (avatarItr != _avatarHash.end()) {
|
if (avatarItr != _avatarHash.end()) {
|
||||||
auto avatar = std::static_pointer_cast<Avatar>(avatarItr.value());
|
auto avatar = std::static_pointer_cast<Avatar>(avatarItr.value());
|
||||||
AvatarMotionState* motionState = avatar->_motionState;
|
AvatarMotionState* motionState = avatar->getMotionState();
|
||||||
if (motionState) {
|
if (motionState) {
|
||||||
motionState->addDirtyFlags(EntityItem::DIRTY_SHAPE);
|
motionState->addDirtyFlags(EntityItem::DIRTY_SHAPE);
|
||||||
} else {
|
} else {
|
||||||
|
@ -316,7 +316,7 @@ void AvatarManager::updateAvatarPhysicsShape(const QUuid& id) {
|
||||||
btCollisionShape* shape = ObjectMotionState::getShapeManager()->getShape(shapeInfo);
|
btCollisionShape* shape = ObjectMotionState::getShapeManager()->getShape(shapeInfo);
|
||||||
if (shape) {
|
if (shape) {
|
||||||
AvatarMotionState* motionState = new AvatarMotionState(avatar.get(), shape);
|
AvatarMotionState* motionState = new AvatarMotionState(avatar.get(), shape);
|
||||||
avatar->_motionState = motionState;
|
avatar->setMotionState(motionState);
|
||||||
_motionStatesToAdd.insert(motionState);
|
_motionStatesToAdd.insert(motionState);
|
||||||
_avatarMotionStates.insert(motionState);
|
_avatarMotionStates.insert(motionState);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue