inline getters and setters in AvatarData

This commit is contained in:
Stephen Birarda 2013-05-17 12:19:19 -07:00
parent 1ba1b56b2c
commit fb2f36519d
2 changed files with 13 additions and 50 deletions

View file

@ -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);
}
}

View file

@ -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);