diff --git a/voxel-server/CMakeLists.txt b/voxel-server/CMakeLists.txt index 99b72be9cb..e1ce2b6f98 100644 --- a/voxel-server/CMakeLists.txt +++ b/voxel-server/CMakeLists.txt @@ -24,5 +24,8 @@ link_hifi_library(shared ${TARGET_NAME} ${ROOT_DIR}) # link in the hifi voxels library link_hifi_library(voxels ${TARGET_NAME} ${ROOT_DIR}) +# link in the hifi avatars library +link_hifi_library(avatars ${TARGET_NAME} ${ROOT_DIR}) + # find required libraries find_package(GLM REQUIRED) diff --git a/voxel-server/src/VoxelAgentData.cpp b/voxel-server/src/VoxelAgentData.cpp index 8f9b41e4ca..5860106e34 100644 --- a/voxel-server/src/VoxelAgentData.cpp +++ b/voxel-server/src/VoxelAgentData.cpp @@ -28,9 +28,10 @@ VoxelAgentData* VoxelAgentData::clone() const { } void VoxelAgentData::parseData(unsigned char* sourceBuffer, int numBytes) { - // push past the packet header - sourceBuffer++; + // call base class to parse the data + AvatarData::parseData(sourceBuffer,numBytes); - // pull the position from the interface agent data packet - memcpy(&position, sourceBuffer, sizeof(float) * 3); + // make sure our class knows it's position + memcpy(&position, &_bodyPosition, sizeof(_bodyPosition)); } + diff --git a/voxel-server/src/VoxelAgentData.h b/voxel-server/src/VoxelAgentData.h index 98ec7e9ed7..1a7293a5a1 100644 --- a/voxel-server/src/VoxelAgentData.h +++ b/voxel-server/src/VoxelAgentData.h @@ -11,9 +11,10 @@ #include #include +#include #include "MarkerNode.h" -class VoxelAgentData : public AgentData { +class VoxelAgentData : public AvatarData { public: float position[3]; MarkerNode *rootMarkerNode;