mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 01:50:12 +02:00
preparing to add transmitted lookat position data
This commit is contained in:
parent
7f0d2e572e
commit
ffbc70814a
3 changed files with 19 additions and 5 deletions
|
@ -396,14 +396,17 @@ void Avatar::simulate(float deltaTime) {
|
||||||
|
|
||||||
_head.setBodyYaw(_bodyYaw);
|
_head.setBodyYaw(_bodyYaw);
|
||||||
|
|
||||||
//the following is still being prototyped (making the eyes look at a specific location), it should be finished by 5/20/13
|
|
||||||
if (_interactingOther) {
|
if (_interactingOther) {
|
||||||
_head.setLooking(true);
|
_head.setLooking(true);
|
||||||
_head.setLookatPosition(_interactingOther->getSpringyHeadPosition());
|
|
||||||
|
if (_isMine) {
|
||||||
|
setLookatPosition(_interactingOther->getSpringyHeadPosition());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
_head.setLooking(false);
|
_head.setLooking(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_head.setLookatPosition(_lookatPosition);
|
||||||
_head.setAudioLoudness(_audioLoudness);
|
_head.setAudioLoudness(_audioLoudness);
|
||||||
_head.setSkinColor(glm::vec3(skinColor[0], skinColor[1], skinColor[2]));
|
_head.setSkinColor(glm::vec3(skinColor[0], skinColor[1], skinColor[2]));
|
||||||
_head.simulate(deltaTime, _isMine);
|
_head.simulate(deltaTime, _isMine);
|
||||||
|
|
|
@ -63,6 +63,10 @@ int AvatarData::getBroadcastData(unsigned char* destinationBuffer) {
|
||||||
// Hand Position
|
// Hand Position
|
||||||
memcpy(destinationBuffer, &_handPosition, sizeof(float) * 3);
|
memcpy(destinationBuffer, &_handPosition, sizeof(float) * 3);
|
||||||
destinationBuffer += sizeof(float) * 3;
|
destinationBuffer += sizeof(float) * 3;
|
||||||
|
|
||||||
|
// Lookat Position
|
||||||
|
memcpy(destinationBuffer, &_lookatPosition, sizeof(float) * 3);
|
||||||
|
destinationBuffer += sizeof(float) * 3;
|
||||||
|
|
||||||
// Hand State (0 = not grabbing, 1 = grabbing)
|
// Hand State (0 = not grabbing, 1 = grabbing)
|
||||||
memcpy(destinationBuffer, &_handState, sizeof(char));
|
memcpy(destinationBuffer, &_handState, sizeof(char));
|
||||||
|
@ -146,6 +150,10 @@ int AvatarData::parseData(unsigned char* sourceBuffer, int numBytes) {
|
||||||
memcpy(&_handPosition, sourceBuffer, sizeof(float) * 3);
|
memcpy(&_handPosition, sourceBuffer, sizeof(float) * 3);
|
||||||
sourceBuffer += sizeof(float) * 3;
|
sourceBuffer += sizeof(float) * 3;
|
||||||
|
|
||||||
|
// Lookat Position
|
||||||
|
memcpy(&_lookatPosition, sourceBuffer, sizeof(float) * 3);
|
||||||
|
sourceBuffer += sizeof(float) * 3;
|
||||||
|
|
||||||
// Hand State
|
// Hand State
|
||||||
memcpy(&_handState, sourceBuffer, sizeof(char));
|
memcpy(&_handState, sourceBuffer, sizeof(char));
|
||||||
sourceBuffer += sizeof(char);
|
sourceBuffer += sizeof(char);
|
||||||
|
|
|
@ -30,6 +30,7 @@ class AvatarData : public AgentData {
|
||||||
public:
|
public:
|
||||||
AvatarData() :
|
AvatarData() :
|
||||||
_handPosition(0,0,0),
|
_handPosition(0,0,0),
|
||||||
|
_lookatPosition(0,0,0),
|
||||||
_bodyYaw(-90.0),
|
_bodyYaw(-90.0),
|
||||||
_bodyPitch(0.0),
|
_bodyPitch(0.0),
|
||||||
_bodyRoll(0.0),
|
_bodyRoll(0.0),
|
||||||
|
@ -53,9 +54,10 @@ public:
|
||||||
_wantColor(true) { };
|
_wantColor(true) { };
|
||||||
|
|
||||||
const glm::vec3& getPosition() const { return _position; }
|
const glm::vec3& getPosition() const { return _position; }
|
||||||
void setPosition(const glm::vec3 position) { _position = position; }
|
|
||||||
|
|
||||||
void setHandPosition(const glm::vec3 handPosition) { _handPosition = handPosition; }
|
void setPosition (const glm::vec3 position ) { _position = position; }
|
||||||
|
void setHandPosition (const glm::vec3 handPosition ) { _handPosition = handPosition; }
|
||||||
|
void setLookatPosition(const glm::vec3 lookatPosition) { _lookatPosition = lookatPosition; }
|
||||||
|
|
||||||
int getBroadcastData(unsigned char* destinationBuffer);
|
int getBroadcastData(unsigned char* destinationBuffer);
|
||||||
int parseData(unsigned char* sourceBuffer, int numBytes);
|
int parseData(unsigned char* sourceBuffer, int numBytes);
|
||||||
|
@ -138,6 +140,7 @@ protected:
|
||||||
|
|
||||||
glm::vec3 _position;
|
glm::vec3 _position;
|
||||||
glm::vec3 _handPosition;
|
glm::vec3 _handPosition;
|
||||||
|
glm::vec3 _lookatPosition;
|
||||||
|
|
||||||
// Body rotation
|
// Body rotation
|
||||||
float _bodyYaw;
|
float _bodyYaw;
|
||||||
|
|
Loading…
Reference in a new issue