From a79659a5d488963eecf815fed2a698f9d923ed52 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Mon, 22 Apr 2013 15:22:41 -0700 Subject: [PATCH] change VoxelAgentData to not include position, use AvatarData _bodyPosition instead --- libraries/voxels/src/VoxelTree.cpp | 2 +- libraries/voxels/src/VoxelTree.h | 2 +- voxel-server/src/VoxelAgentData.cpp | 11 +---------- voxel-server/src/VoxelAgentData.h | 2 -- voxel-server/src/main.cpp | 2 +- 5 files changed, 4 insertions(+), 15 deletions(-) diff --git a/libraries/voxels/src/VoxelTree.cpp b/libraries/voxels/src/VoxelTree.cpp index 31d39de3de..3e75f76184 100644 --- a/libraries/voxels/src/VoxelTree.cpp +++ b/libraries/voxels/src/VoxelTree.cpp @@ -267,7 +267,7 @@ void VoxelTree::readCodeColorBufferToTree(unsigned char *codeColorBuffer) { unsigned char * VoxelTree::loadBitstreamBuffer(unsigned char *& bitstreamBuffer, VoxelNode *currentVoxelNode, MarkerNode *currentMarkerNode, - float * agentPosition, + const glm::vec3& agentPosition, float thisNodePosition[3], const ViewFrustum& viewFrustum, bool viewFrustumCulling, diff --git a/libraries/voxels/src/VoxelTree.h b/libraries/voxels/src/VoxelTree.h index 77c00b2e63..60c66925ec 100644 --- a/libraries/voxels/src/VoxelTree.h +++ b/libraries/voxels/src/VoxelTree.h @@ -51,7 +51,7 @@ public: unsigned char * loadBitstreamBuffer(unsigned char *& bitstreamBuffer, VoxelNode *currentVoxelNode, MarkerNode *currentMarkerNode, - float * agentPosition, + const glm::vec3& agentPosition, float thisNodePosition[3], const ViewFrustum& viewFrustum, bool viewFrustumCulling, diff --git a/voxel-server/src/VoxelAgentData.cpp b/voxel-server/src/VoxelAgentData.cpp index 5860106e34..4476cff056 100644 --- a/voxel-server/src/VoxelAgentData.cpp +++ b/voxel-server/src/VoxelAgentData.cpp @@ -19,19 +19,10 @@ VoxelAgentData::~VoxelAgentData() { } VoxelAgentData::VoxelAgentData(const VoxelAgentData &otherAgentData) { - memcpy(position, otherAgentData.position, sizeof(float) * 3); + memcpy(&_bodyPosition, &otherAgentData._bodyPosition, sizeof(_bodyPosition)); rootMarkerNode = new MarkerNode(); } VoxelAgentData* VoxelAgentData::clone() const { return new VoxelAgentData(*this); } - -void VoxelAgentData::parseData(unsigned char* sourceBuffer, int numBytes) { - // call base class to parse the data - AvatarData::parseData(sourceBuffer,numBytes); - - // 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 1a7293a5a1..4ca7949b92 100644 --- a/voxel-server/src/VoxelAgentData.h +++ b/voxel-server/src/VoxelAgentData.h @@ -16,14 +16,12 @@ class VoxelAgentData : public AvatarData { public: - float position[3]; MarkerNode *rootMarkerNode; VoxelAgentData(); ~VoxelAgentData(); VoxelAgentData(const VoxelAgentData &otherAgentData); - void parseData(unsigned char* sourceBuffer, int numBytes); VoxelAgentData* clone() const; }; diff --git a/voxel-server/src/main.cpp b/voxel-server/src/main.cpp index 808e33a96d..d85154abc5 100644 --- a/voxel-server/src/main.cpp +++ b/voxel-server/src/main.cpp @@ -199,7 +199,7 @@ void *distributeVoxelsToListeners(void *args) { stopOctal = randomTree.loadBitstreamBuffer(voxelPacketEnd, randomTree.rootNode, agentData->rootMarkerNode, - agentData->position, + agentData->getBodyPosition(), treeRoot, viewFrustum, ::viewFrustumCulling,