change VoxelAgentData to not include position, use AvatarData _bodyPosition instead

This commit is contained in:
ZappoMan 2013-04-22 15:22:41 -07:00
parent cea4170270
commit a79659a5d4
5 changed files with 4 additions and 15 deletions

View file

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

View file

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

View file

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

View file

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

View file

@ -199,7 +199,7 @@ void *distributeVoxelsToListeners(void *args) {
stopOctal = randomTree.loadBitstreamBuffer(voxelPacketEnd,
randomTree.rootNode,
agentData->rootMarkerNode,
agentData->position,
agentData->getBodyPosition(),
treeRoot,
viewFrustum,
::viewFrustumCulling,