mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 06:23:06 +02:00
cr cleanup
This commit is contained in:
parent
91ca787e2f
commit
747cfc04be
3 changed files with 14 additions and 14 deletions
|
@ -27,7 +27,7 @@ void VoxelAgentData::init() {
|
||||||
void VoxelAgentData::resetVoxelPacket() {
|
void VoxelAgentData::resetVoxelPacket() {
|
||||||
_voxelPacket[0] = PACKET_HEADER_VOXEL_DATA;
|
_voxelPacket[0] = PACKET_HEADER_VOXEL_DATA;
|
||||||
_voxelPacketAt = &_voxelPacket[1];
|
_voxelPacketAt = &_voxelPacket[1];
|
||||||
_voxelPacketAvailableBytes = MAX_VOXEL_PACKET_SIZE-1;
|
_voxelPacketAvailableBytes = MAX_VOXEL_PACKET_SIZE - 1;
|
||||||
_voxelPacketWaiting = false;
|
_voxelPacketWaiting = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ public:
|
||||||
void writeToPacket(unsigned char* buffer, int bytes); // writes to end of packet
|
void writeToPacket(unsigned char* buffer, int bytes); // writes to end of packet
|
||||||
|
|
||||||
const unsigned char* getPacket() const { return _voxelPacket; }
|
const unsigned char* getPacket() const { return _voxelPacket; }
|
||||||
int getPacketLength() const { return (MAX_VOXEL_PACKET_SIZE-_voxelPacketAvailableBytes); }
|
int getPacketLength() const { return (MAX_VOXEL_PACKET_SIZE - _voxelPacketAvailableBytes); }
|
||||||
bool isPacketWaiting() const { return _voxelPacketWaiting; }
|
bool isPacketWaiting() const { return _voxelPacketWaiting; }
|
||||||
int getAvailable() const { return _voxelPacketAvailableBytes; }
|
int getAvailable() const { return _voxelPacketAvailableBytes; }
|
||||||
int getMaxSearchLevel() const { return _maxSearchLevel; };
|
int getMaxSearchLevel() const { return _maxSearchLevel; };
|
||||||
|
|
|
@ -82,36 +82,36 @@ void addSphereScene(VoxelTree * tree, bool wantColorRandomizer) {
|
||||||
|
|
||||||
int sphereBaseSize = 256;
|
int sphereBaseSize = 256;
|
||||||
|
|
||||||
tree->createSphere(0.25,0.5,0.5,0.5,(1.0/sphereBaseSize),true,wantColorRandomizer);
|
tree->createSphere(0.25, 0.5, 0.5, 0.5, (1.0 / sphereBaseSize), true, wantColorRandomizer);
|
||||||
printf("one sphere added...\n");
|
printf("one sphere added...\n");
|
||||||
tree->createSphere(0.030625,0.5,0.5,(0.25-0.06125),(1.0/(sphereBaseSize*2)),true,true);
|
tree->createSphere(0.030625, 0.5, 0.5, (0.25-0.06125), (1.0 / (sphereBaseSize * 2)), true, true);
|
||||||
|
|
||||||
|
|
||||||
printf("two spheres added...\n");
|
printf("two spheres added...\n");
|
||||||
tree->createSphere(0.030625,(1.0-0.030625),(1.0-0.030625),(1.0-0.06125),(1.0/(sphereBaseSize*2)),true,true);
|
tree->createSphere(0.030625, (1.0 - 0.030625), (1.0 - 0.030625), (1.0 - 0.06125), (1.0 / (sphereBaseSize * 2)), true, true);
|
||||||
printf("three spheres added...\n");
|
printf("three spheres added...\n");
|
||||||
tree->createSphere(0.030625,(1.0-0.030625),(1.0-0.030625),0.06125,(1.0/(sphereBaseSize*2)),true,true);
|
tree->createSphere(0.030625, (1.0 - 0.030625), (1.0 - 0.030625), 0.06125, (1.0 / (sphereBaseSize * 2)), true, true);
|
||||||
printf("four spheres added...\n");
|
printf("four spheres added...\n");
|
||||||
tree->createSphere(0.030625,(1.0-0.030625),0.06125,(1.0-0.06125),(1.0/(sphereBaseSize*2)),true,true);
|
tree->createSphere(0.030625, (1.0 - 0.030625), 0.06125, (1.0 - 0.06125), (1.0 / (sphereBaseSize * 2)), true, true);
|
||||||
printf("five spheres added...\n");
|
printf("five spheres added...\n");
|
||||||
tree->createSphere(0.06125,0.125,0.125,(1.0-0.125),(1.0/(sphereBaseSize*2)),true,true);
|
tree->createSphere(0.06125, 0.125, 0.125, (1.0 - 0.125), (1.0 / (sphereBaseSize * 2)), true, true);
|
||||||
|
|
||||||
float radius = 0.0125f;
|
float radius = 0.0125f;
|
||||||
printf("6 spheres added...\n");
|
printf("6 spheres added...\n");
|
||||||
tree->createSphere(radius,0.25,radius*5.0f,0.25,(1.0/(4096)),true,true);
|
tree->createSphere(radius, 0.25, radius * 5.0f, 0.25, (1.0 / 4096), true, true);
|
||||||
printf("7 spheres added...\n");
|
printf("7 spheres added...\n");
|
||||||
tree->createSphere(radius,0.125,radius*5.0f,0.25,(1.0/(4096)),true,true);
|
tree->createSphere(radius, 0.125, radius * 5.0f, 0.25, (1.0 / 4096), true, true);
|
||||||
printf("8 spheres added...\n");
|
printf("8 spheres added...\n");
|
||||||
tree->createSphere(radius,0.075,radius*5.0f,0.25,(1.0/(4096)),true,true);
|
tree->createSphere(radius, 0.075, radius * 5.0f, 0.25, (1.0 / 4096), true, true);
|
||||||
printf("9 spheres added...\n");
|
printf("9 spheres added...\n");
|
||||||
tree->createSphere(radius,0.05,radius*5.0f,0.25,(1.0/(4096)),true,true);
|
tree->createSphere(radius, 0.05, radius * 5.0f, 0.25, (1.0 / 4096), true, true);
|
||||||
printf("10 spheres added...\n");
|
printf("10 spheres added...\n");
|
||||||
tree->createSphere(radius,0.025,radius*5.0f,0.25,(1.0/(4096)),true,true);
|
tree->createSphere(radius, 0.025, radius * 5.0f, 0.25, (1.0 / 4096), true, true);
|
||||||
printf("11 spheres added...\n");
|
printf("11 spheres added...\n");
|
||||||
|
|
||||||
_nodeCount=0;
|
_nodeCount=0;
|
||||||
tree->recurseTreeWithOperation(countVoxelsOperation);
|
tree->recurseTreeWithOperation(countVoxelsOperation);
|
||||||
printf("Nodes after adding scene %d nodes\n",_nodeCount);
|
printf("Nodes after adding scene %d nodes\n", _nodeCount);
|
||||||
|
|
||||||
|
|
||||||
printf("DONE adding scene of spheres...\n");
|
printf("DONE adding scene of spheres...\n");
|
||||||
|
|
Loading…
Reference in a new issue