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; 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) { void AvatarData::setHeadPitch(float p) {
// Set head pitch and apply limits // Set head pitch and apply limits
const float MAX_PITCH = 60; const float MAX_PITCH = 60;
const float MIN_PITCH = -60; const float MIN_PITCH = -60;
_headPitch = glm::clamp(p, MIN_PITCH, MAX_PITCH); _headPitch = glm::clamp(p, MIN_PITCH, MAX_PITCH);
} }

View file

@ -52,20 +52,23 @@ public:
_wantResIn(false), _wantResIn(false),
_wantColor(true) { }; _wantColor(true) { };
const glm::vec3& getPosition() const; const glm::vec3& getPosition() const { return _position; }
void setPosition(glm::vec3 position); void setPosition(const glm::vec3 position) { _position = position; }
void setHandPosition(glm::vec3 handPosition);
void setHandPosition(const glm::vec3 handPosition) { _handPosition = handPosition; }
int getBroadcastData(unsigned char* destinationBuffer); int getBroadcastData(unsigned char* destinationBuffer);
int parseData(unsigned char* sourceBuffer, int numBytes); int parseData(unsigned char* sourceBuffer, int numBytes);
// Body Rotation // Body Rotation
float getBodyYaw(); float getBodyYaw() const { return _bodyYaw; }
float getBodyPitch(); void setBodyYaw(float bodyYaw) { _bodyYaw = bodyYaw; }
float getBodyRoll();
void setBodyYaw(float bodyYaw); float getBodyPitch() const { return _bodyPitch; }
void setBodyPitch(float bodyPitch); void setBodyPitch(float bodyPitch) { _bodyPitch = bodyPitch; }
void setBodyRoll(float bodyRoll);
float getBodyRoll() const {return _bodyRoll; }
void setBodyRoll(float bodyRoll) { _bodyRoll = bodyRoll; }
// Head Rotation // Head Rotation
void setHeadPitch(float p); void setHeadPitch(float p);