mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 13:09:52 +02:00
change VoxelAgentData to not include position, use AvatarData _bodyPosition instead
This commit is contained in:
parent
cea4170270
commit
a79659a5d4
5 changed files with 4 additions and 15 deletions
|
@ -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,
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue