mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 09:33:36 +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);
|
||||
|
||||
//the following is still being prototyped (making the eyes look at a specific location), it should be finished by 5/20/13
|
||||
if (_interactingOther) {
|
||||
_head.setLooking(true);
|
||||
_head.setLookatPosition(_interactingOther->getSpringyHeadPosition());
|
||||
|
||||
if (_isMine) {
|
||||
setLookatPosition(_interactingOther->getSpringyHeadPosition());
|
||||
}
|
||||
} else {
|
||||
_head.setLooking(false);
|
||||
}
|
||||
|
||||
|
||||
_head.setLookatPosition(_lookatPosition);
|
||||
_head.setAudioLoudness(_audioLoudness);
|
||||
_head.setSkinColor(glm::vec3(skinColor[0], skinColor[1], skinColor[2]));
|
||||
_head.simulate(deltaTime, _isMine);
|
||||
|
|
|
@ -63,6 +63,10 @@ int AvatarData::getBroadcastData(unsigned char* destinationBuffer) {
|
|||
// Hand Position
|
||||
memcpy(destinationBuffer, &_handPosition, 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)
|
||||
memcpy(destinationBuffer, &_handState, sizeof(char));
|
||||
|
@ -146,6 +150,10 @@ int AvatarData::parseData(unsigned char* sourceBuffer, int numBytes) {
|
|||
memcpy(&_handPosition, sourceBuffer, sizeof(float) * 3);
|
||||
sourceBuffer += sizeof(float) * 3;
|
||||
|
||||
// Lookat Position
|
||||
memcpy(&_lookatPosition, sourceBuffer, sizeof(float) * 3);
|
||||
sourceBuffer += sizeof(float) * 3;
|
||||
|
||||
// Hand State
|
||||
memcpy(&_handState, sourceBuffer, sizeof(char));
|
||||
sourceBuffer += sizeof(char);
|
||||
|
|
|
@ -30,6 +30,7 @@ class AvatarData : public AgentData {
|
|||
public:
|
||||
AvatarData() :
|
||||
_handPosition(0,0,0),
|
||||
_lookatPosition(0,0,0),
|
||||
_bodyYaw(-90.0),
|
||||
_bodyPitch(0.0),
|
||||
_bodyRoll(0.0),
|
||||
|
@ -53,9 +54,10 @@ public:
|
|||
_wantColor(true) { };
|
||||
|
||||
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 parseData(unsigned char* sourceBuffer, int numBytes);
|
||||
|
@ -138,6 +140,7 @@ protected:
|
|||
|
||||
glm::vec3 _position;
|
||||
glm::vec3 _handPosition;
|
||||
glm::vec3 _lookatPosition;
|
||||
|
||||
// Body rotation
|
||||
float _bodyYaw;
|
||||
|
|
Loading…
Reference in a new issue