mirror of
https://github.com/overte-org/overte.git
synced 2025-07-30 10:30:23 +02:00
resolve conflicts on merge with upstream master
This commit is contained in:
commit
c5bba41385
2 changed files with 16 additions and 20 deletions
|
@ -19,6 +19,20 @@
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using avatars_lib::printLog;
|
using avatars_lib::printLog;
|
||||||
|
|
||||||
|
int packFloatAngleToTwoByte(unsigned char* buffer, float angle) {
|
||||||
|
const float ANGLE_CONVERSION_RATIO = (std::numeric_limits<uint16_t>::max() / 360.0);
|
||||||
|
|
||||||
|
uint16_t angleHolder = floorf((angle + 180) * ANGLE_CONVERSION_RATIO);
|
||||||
|
memcpy(buffer, &angleHolder, sizeof(uint16_t));
|
||||||
|
|
||||||
|
return sizeof(uint16_t);
|
||||||
|
}
|
||||||
|
|
||||||
|
int unpackFloatAngleFromTwoByte(uint16_t* byteAnglePointer, float* destinationPointer) {
|
||||||
|
*destinationPointer = (*byteAnglePointer / (float) std::numeric_limits<uint16_t>::max()) * 360.0 - 180;
|
||||||
|
return sizeof(uint16_t);
|
||||||
|
}
|
||||||
|
|
||||||
AvatarData::AvatarData() :
|
AvatarData::AvatarData() :
|
||||||
_handPosition(0,0,0),
|
_handPosition(0,0,0),
|
||||||
_bodyYaw(-90.0),
|
_bodyYaw(-90.0),
|
||||||
|
@ -47,21 +61,6 @@ AvatarData::AvatarData() :
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int packFloatAngleToTwoByte(unsigned char* buffer, float angle) {
|
|
||||||
const float ANGLE_CONVERSION_RATIO = (std::numeric_limits<uint16_t>::max() / 360.0);
|
|
||||||
|
|
||||||
uint16_t angleHolder = floorf((angle + 180) * ANGLE_CONVERSION_RATIO);
|
|
||||||
memcpy(buffer, &angleHolder, sizeof(uint16_t));
|
|
||||||
|
|
||||||
return sizeof(uint16_t);
|
|
||||||
}
|
|
||||||
|
|
||||||
int unpackFloatAngleFromTwoByte(uint16_t* byteAnglePointer, float* destinationPointer) {
|
|
||||||
*destinationPointer = (*byteAnglePointer / (float) std::numeric_limits<uint16_t>::max()) * 360.0 - 180;
|
|
||||||
return sizeof(uint16_t);
|
|
||||||
}
|
|
||||||
|
|
||||||
int AvatarData::getBroadcastData(unsigned char* destinationBuffer) {
|
int AvatarData::getBroadcastData(unsigned char* destinationBuffer) {
|
||||||
unsigned char* bufferStart = destinationBuffer;
|
unsigned char* bufferStart = destinationBuffer;
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,6 @@ public:
|
||||||
|
|
||||||
const glm::vec3& getPosition() const { return _position; }
|
const glm::vec3& getPosition() const { return _position; }
|
||||||
void setPosition(const glm::vec3 position) { _position = position; }
|
void setPosition(const glm::vec3 position) { _position = position; }
|
||||||
|
|
||||||
void setHandPosition(const glm::vec3 handPosition) { _handPosition = handPosition; }
|
void setHandPosition(const glm::vec3 handPosition) { _handPosition = handPosition; }
|
||||||
|
|
||||||
int getBroadcastData(unsigned char* destinationBuffer);
|
int getBroadcastData(unsigned char* destinationBuffer);
|
||||||
|
@ -41,10 +40,8 @@ public:
|
||||||
// Body Rotation
|
// Body Rotation
|
||||||
float getBodyYaw() const { return _bodyYaw; }
|
float getBodyYaw() const { return _bodyYaw; }
|
||||||
void setBodyYaw(float bodyYaw) { _bodyYaw = bodyYaw; }
|
void setBodyYaw(float bodyYaw) { _bodyYaw = bodyYaw; }
|
||||||
|
|
||||||
float getBodyPitch() const { return _bodyPitch; }
|
float getBodyPitch() const { return _bodyPitch; }
|
||||||
void setBodyPitch(float bodyPitch) { _bodyPitch = bodyPitch; }
|
void setBodyPitch(float bodyPitch) { _bodyPitch = bodyPitch; }
|
||||||
|
|
||||||
float getBodyRoll() const {return _bodyRoll; }
|
float getBodyRoll() const {return _bodyRoll; }
|
||||||
void setBodyRoll(float bodyRoll) { _bodyRoll = bodyRoll; }
|
void setBodyRoll(float bodyRoll) { _bodyRoll = bodyRoll; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue