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, unsigned char * VoxelTree::loadBitstreamBuffer(unsigned char *& bitstreamBuffer,
VoxelNode *currentVoxelNode, VoxelNode *currentVoxelNode,
MarkerNode *currentMarkerNode, MarkerNode *currentMarkerNode,
float * agentPosition, const glm::vec3& agentPosition,
float thisNodePosition[3], float thisNodePosition[3],
const ViewFrustum& viewFrustum, const ViewFrustum& viewFrustum,
bool viewFrustumCulling, bool viewFrustumCulling,

View file

@ -51,7 +51,7 @@ public:
unsigned char * loadBitstreamBuffer(unsigned char *& bitstreamBuffer, unsigned char * loadBitstreamBuffer(unsigned char *& bitstreamBuffer,
VoxelNode *currentVoxelNode, VoxelNode *currentVoxelNode,
MarkerNode *currentMarkerNode, MarkerNode *currentMarkerNode,
float * agentPosition, const glm::vec3& agentPosition,
float thisNodePosition[3], float thisNodePosition[3],
const ViewFrustum& viewFrustum, const ViewFrustum& viewFrustum,
bool viewFrustumCulling, bool viewFrustumCulling,

View file

@ -19,19 +19,10 @@ VoxelAgentData::~VoxelAgentData() {
} }
VoxelAgentData::VoxelAgentData(const VoxelAgentData &otherAgentData) { VoxelAgentData::VoxelAgentData(const VoxelAgentData &otherAgentData) {
memcpy(position, otherAgentData.position, sizeof(float) * 3); memcpy(&_bodyPosition, &otherAgentData._bodyPosition, sizeof(_bodyPosition));
rootMarkerNode = new MarkerNode(); rootMarkerNode = new MarkerNode();
} }
VoxelAgentData* VoxelAgentData::clone() const { VoxelAgentData* VoxelAgentData::clone() const {
return new VoxelAgentData(*this); 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 { class VoxelAgentData : public AvatarData {
public: public:
float position[3];
MarkerNode *rootMarkerNode; MarkerNode *rootMarkerNode;
VoxelAgentData(); VoxelAgentData();
~VoxelAgentData(); ~VoxelAgentData();
VoxelAgentData(const VoxelAgentData &otherAgentData); VoxelAgentData(const VoxelAgentData &otherAgentData);
void parseData(unsigned char* sourceBuffer, int numBytes);
VoxelAgentData* clone() const; VoxelAgentData* clone() const;
}; };

View file

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