History

Added support for "destructive" vs "non-destructive" voxel create - changed VoxelTree to support destructive and non-destructive mode - added protocol packet headers to differentiate - added new UI to switch modes - default mode now, non-destructive.

ZappoMan committed 13 years ago

Commit 8dc61d81 parent a0179078 files · +79 −52Browse files

Showing the changes to interface/src/VoxelSystem.cpp (1 of 8 files). Show all

Unified · Split

interface/src/VoxelSystem.cpp+8−6
@@ -1020,22 +1020,24 @@ VoxelNode* VoxelSystem::getVoxelAt(float x, float y, float z, float s) const { · 1019 unmodified lines
1020 return _tree->getVoxelAt(x, y, z, s); 1020 return _tree->getVoxelAt(x, y, z, s);
1021};1021};
1022 1022
1023void VoxelSystem::createVoxel(float x, float y, float z, float s, unsigned char red, unsigned char green, unsigned char blue) {1023void VoxelSystem::createVoxel(float x, float y, float z, float s,
1024 unsigned char red, unsigned char green, unsigned char blue, bool destructive) {
1024 pthread_mutex_lock(&_treeLock);1025 pthread_mutex_lock(&_treeLock);
1025 1026
1026 //printLog("VoxelSystem::createVoxel(%f,%f,%f,%f)\n",x,y,z,s);1027 //printLog("VoxelSystem::createVoxel(%f,%f,%f,%f)\n",x,y,z,s);
1027 _tree->createVoxel(x, y, z, s, red, green, blue); 1028 _tree->createVoxel(x, y, z, s, red, green, blue, destructive);
1028 setupNewVoxelsForDrawing(); 1029 setupNewVoxelsForDrawing();
1029 1030
1030 pthread_mutex_unlock(&_treeLock);1031 pthread_mutex_unlock(&_treeLock);
1031};1032};
1032 1033
1033void VoxelSystem::createLine(glm::vec3 point1, glm::vec3 point2, float unitSize, rgbColor color) { 1034void VoxelSystem::createLine(glm::vec3 point1, glm::vec3 point2, float unitSize, rgbColor color, bool destructive) {
1034 _tree->createLine(point1, point2, unitSize, color); 1035 _tree->createLine(point1, point2, unitSize, color, destructive);
1035 setupNewVoxelsForDrawing(); 1036 setupNewVoxelsForDrawing();
1036};1037};
1037 1038
1038void VoxelSystem::createSphere(float r,float xc, float yc, float zc, float s, bool solid, creationMode mode, bool debug) { 1039void VoxelSystem::createSphere(float r,float xc, float yc, float zc, float s, bool solid,
1039 _tree->createSphere(r, xc, yc, zc, s, solid, mode, debug); 1040 creationMode mode, bool destructive, bool debug) {
1041 _tree->createSphere(r, xc, yc, zc, s, solid, mode, destructive, debug);
1040 setupNewVoxelsForDrawing(); 1042 setupNewVoxelsForDrawing();
1041};1043};

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t