Derive VoxelAgentData from AvatarData to get access to camera details

- Changed base class for VoxelAgentData
- changed parseData() method to call base class implementation
- added avatars library to cmake scripts
This commit is contained in:
ZappoMan 2013-04-22 14:15:47 -07:00
parent e1da39e2bb
commit 893996675a
3 changed files with 10 additions and 5 deletions

View file

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

View file

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

View file

@ -11,9 +11,10 @@
#include <iostream>
#include <AgentData.h>
#include <AvatarData.h>
#include "MarkerNode.h"
class VoxelAgentData : public AgentData {
class VoxelAgentData : public AvatarData {
public:
float position[3];
MarkerNode *rootMarkerNode;