mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 07:13:57 +02:00
Merge pull request #364 from birarda/master
lazily allocation of HeadData in getBroadcastData
This commit is contained in:
commit
57af90ec13
1 changed files with 5 additions and 0 deletions
|
@ -68,6 +68,11 @@ int AvatarData::getBroadcastData(unsigned char* destinationBuffer) {
|
|||
// that can pack any type given the number of bytes
|
||||
// and return the number of bytes to push the pointer
|
||||
|
||||
// lazily allocate memory for HeadData in case we're not an Avatar instance
|
||||
if (!_headData) {
|
||||
_headData = new HeadData();
|
||||
}
|
||||
|
||||
// Body world position
|
||||
memcpy(destinationBuffer, &_position, sizeof(float) * 3);
|
||||
destinationBuffer += sizeof(float) * 3;
|
||||
|
|
Loading…
Reference in a new issue