From fb2f36519d66ca32a9afc6fa15a70c85228ec827 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Fri, 17 May 2013 12:19:19 -0700 Subject: [PATCH] inline getters and setters in AvatarData --- libraries/avatars/src/AvatarData.cpp | 42 +--------------------------- libraries/avatars/src/AvatarData.h | 21 ++++++++------ 2 files changed, 13 insertions(+), 50 deletions(-) diff --git a/libraries/avatars/src/AvatarData.cpp b/libraries/avatars/src/AvatarData.cpp index 9333c3ce50..f63947a580 100644 --- a/libraries/avatars/src/AvatarData.cpp +++ b/libraries/avatars/src/AvatarData.cpp @@ -192,49 +192,9 @@ int AvatarData::parseData(unsigned char* sourceBuffer, int numBytes) { return sourceBuffer - startPosition; } -const glm::vec3& AvatarData::getPosition() const { - return _position; -} - -void AvatarData::setPosition(glm::vec3 position) { - _position = position; -} - -void AvatarData::setHandPosition(glm::vec3 handPosition) { - _handPosition = handPosition; -} - -float AvatarData::getBodyYaw() { - return _bodyYaw; -} - -void AvatarData::setBodyYaw(float bodyYaw) { - _bodyYaw = bodyYaw; -} - -float AvatarData::getBodyPitch() { - return _bodyPitch; -} - -void AvatarData::setBodyPitch(float bodyPitch) { - _bodyPitch = bodyPitch; -} - -float AvatarData::getBodyRoll() { - return _bodyRoll; -} - -void AvatarData::setBodyRoll(float bodyRoll) { - _bodyRoll = bodyRoll; -} - void AvatarData::setHeadPitch(float p) { // Set head pitch and apply limits const float MAX_PITCH = 60; const float MIN_PITCH = -60; _headPitch = glm::clamp(p, MIN_PITCH, MAX_PITCH); -} - - - - +} \ No newline at end of file diff --git a/libraries/avatars/src/AvatarData.h b/libraries/avatars/src/AvatarData.h index 413f5afcf1..f37c4f3396 100644 --- a/libraries/avatars/src/AvatarData.h +++ b/libraries/avatars/src/AvatarData.h @@ -52,20 +52,23 @@ public: _wantResIn(false), _wantColor(true) { }; - const glm::vec3& getPosition() const; - void setPosition(glm::vec3 position); - void setHandPosition(glm::vec3 handPosition); + const glm::vec3& getPosition() const { return _position; } + void setPosition(const glm::vec3 position) { _position = position; } + + void setHandPosition(const glm::vec3 handPosition) { _handPosition = handPosition; } int getBroadcastData(unsigned char* destinationBuffer); int parseData(unsigned char* sourceBuffer, int numBytes); // Body Rotation - float getBodyYaw(); - float getBodyPitch(); - float getBodyRoll(); - void setBodyYaw(float bodyYaw); - void setBodyPitch(float bodyPitch); - void setBodyRoll(float bodyRoll); + float getBodyYaw() const { return _bodyYaw; } + void setBodyYaw(float bodyYaw) { _bodyYaw = bodyYaw; } + + float getBodyPitch() const { return _bodyPitch; } + void setBodyPitch(float bodyPitch) { _bodyPitch = bodyPitch; } + + float getBodyRoll() const {return _bodyRoll; } + void setBodyRoll(float bodyRoll) { _bodyRoll = bodyRoll; } // Head Rotation void setHeadPitch(float p);