mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 13:38:02 +02:00
Added referentials to AvatarData
This commit is contained in:
parent
bc77630c5b
commit
1138a3a275
6 changed files with 22 additions and 1 deletions
|
@ -444,6 +444,11 @@ glm::vec3 MyAvatar::getRightPalmPosition() {
|
||||||
return rightHandPosition;
|
return rightHandPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MyAvatar::changeReferential(Referential *ref) {
|
||||||
|
delete _referential;
|
||||||
|
_referential = ref;
|
||||||
|
}
|
||||||
|
|
||||||
void MyAvatar::setLocalGravity(glm::vec3 gravity) {
|
void MyAvatar::setLocalGravity(glm::vec3 gravity) {
|
||||||
_motionBehaviors |= AVATAR_MOTION_OBEY_LOCAL_GRAVITY;
|
_motionBehaviors |= AVATAR_MOTION_OBEY_LOCAL_GRAVITY;
|
||||||
// Environmental and Local gravities are incompatible. Since Local is being set here
|
// Environmental and Local gravities are incompatible. Since Local is being set here
|
||||||
|
|
|
@ -149,6 +149,8 @@ public slots:
|
||||||
glm::vec3 getLeftPalmPosition();
|
glm::vec3 getLeftPalmPosition();
|
||||||
glm::vec3 getRightPalmPosition();
|
glm::vec3 getRightPalmPosition();
|
||||||
|
|
||||||
|
void changeReferential(Referential* ref);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void transformChanged();
|
void transformChanged();
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,7 @@ using namespace std;
|
||||||
AvatarData::AvatarData() :
|
AvatarData::AvatarData() :
|
||||||
_sessionUUID(),
|
_sessionUUID(),
|
||||||
_handPosition(0,0,0),
|
_handPosition(0,0,0),
|
||||||
|
_referential(NULL),
|
||||||
_bodyYaw(-90.f),
|
_bodyYaw(-90.f),
|
||||||
_bodyPitch(0.0f),
|
_bodyPitch(0.0f),
|
||||||
_bodyRoll(0.0f),
|
_bodyRoll(0.0f),
|
||||||
|
@ -62,6 +63,7 @@ AvatarData::AvatarData() :
|
||||||
AvatarData::~AvatarData() {
|
AvatarData::~AvatarData() {
|
||||||
delete _headData;
|
delete _headData;
|
||||||
delete _handData;
|
delete _handData;
|
||||||
|
delete _referential;
|
||||||
}
|
}
|
||||||
|
|
||||||
glm::vec3 AvatarData::getHandPosition() const {
|
glm::vec3 AvatarData::getHandPosition() const {
|
||||||
|
|
|
@ -49,6 +49,7 @@ typedef unsigned long long quint64;
|
||||||
|
|
||||||
#include <Node.h>
|
#include <Node.h>
|
||||||
|
|
||||||
|
#include "Referential.h"
|
||||||
#include "HeadData.h"
|
#include "HeadData.h"
|
||||||
#include "HandData.h"
|
#include "HandData.h"
|
||||||
|
|
||||||
|
@ -283,6 +284,8 @@ protected:
|
||||||
QUuid _sessionUUID;
|
QUuid _sessionUUID;
|
||||||
glm::vec3 _position;
|
glm::vec3 _position;
|
||||||
glm::vec3 _handPosition;
|
glm::vec3 _handPosition;
|
||||||
|
|
||||||
|
Referential* _referential;
|
||||||
|
|
||||||
// Body rotation
|
// Body rotation
|
||||||
float _bodyYaw; // degrees
|
float _bodyYaw; // degrees
|
||||||
|
|
|
@ -15,4 +15,8 @@ Referential::Referential(AvatarData* avatar) :
|
||||||
_isValid(true),
|
_isValid(true),
|
||||||
_avatar(avatar)
|
_avatar(avatar)
|
||||||
{
|
{
|
||||||
|
if (_avatar == NULL) {
|
||||||
|
_isValid = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,10 +12,15 @@
|
||||||
#ifndef hifi_Referential_h
|
#ifndef hifi_Referential_h
|
||||||
#define hifi_Referential_h
|
#define hifi_Referential_h
|
||||||
|
|
||||||
#include "AvatarData.h"
|
#include <glm/gtx/quaternion.hpp>
|
||||||
|
#include <glm/vec3.hpp>
|
||||||
|
|
||||||
|
class AvatarData;
|
||||||
|
|
||||||
class Referential {
|
class Referential {
|
||||||
public:
|
public:
|
||||||
|
virtual ~Referential();
|
||||||
|
|
||||||
virtual bool isValid() { return _isValid; }
|
virtual bool isValid() { return _isValid; }
|
||||||
virtual void update() = 0;
|
virtual void update() = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue