History

Fix voxel erase bug in nudge code. Fix rendering of nudge guide.

LionTurtle committed 13 years ago

Commit cef48371 parent 30c8af23 files · +99 −20Browse files

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

Unified · Split

interface/src/Application.cpp+19−10
@@ -1160,8 +1160,16 @@ const glm::vec3 Application::getMouseVoxelWorldCoordinates(const VoxelDetail _mo · 1159 unmodified lines
1160 (_mouseVoxel.z + _mouseVoxel.s / 2.f) * TREE_SCALE);1160 (_mouseVoxel.z + _mouseVoxel.s / 2.f) * TREE_SCALE);
1161}1161}
1162 1162
1163const float NUDGE_PRECISION_LIMIT = 1 / pow(2.0, 12.0);
1164
1163void Application::decreaseVoxelSize() {1165void Application::decreaseVoxelSize() {
1164 _mouseVoxelScale /= 2;1166 if (Menu::getInstance()->isOptionChecked(MenuOption::VoxelNudgeMode)) {
1167 if (_mouseVoxelScale >= NUDGE_PRECISION_LIMIT) {
1168 _mouseVoxelScale /= 2;
1169 }
1170 } else {
1171 _mouseVoxelScale /= 2;
1172 }
1165}1173}
1166 1174
1167void Application::increaseVoxelSize() {1175void Application::increaseVoxelSize() {
@@ -2315,17 +2323,18 @@ void Application::displaySide(Camera& whichCamera) { · 1147 unmodified lines
2315 } else {2323 } else {
2316 glColor3ub(_mouseVoxel.red, _mouseVoxel.green, _mouseVoxel.blue);2324 glColor3ub(_mouseVoxel.red, _mouseVoxel.green, _mouseVoxel.blue);
2317 }2325 }
2318 glTranslatef(_mouseVoxel.x + _mouseVoxel.s*0.5f,2326
2319 _mouseVoxel.y + _mouseVoxel.s*0.5f,
2320 _mouseVoxel.z + _mouseVoxel.s*0.5f);
2321 glLineWidth(4.0f);
2322 if (Menu::getInstance()->isOptionChecked(MenuOption::VoxelNudgeMode)) {2327 if (Menu::getInstance()->isOptionChecked(MenuOption::VoxelNudgeMode)) {
2323 if (_nudgeVoxel.s) {2328 glTranslatef(_mouseVoxel.x + _nudgeVoxel.s*0.5f,
2324 glutWireCube(_nudgeVoxel.s);2329 _mouseVoxel.y + _nudgeVoxel.s*0.5f,
2325 } else {2330 _mouseVoxel.z + _nudgeVoxel.s*0.5f);
2326 glutWireCube(_mouseVoxel.s);2331 glLineWidth(4.0f);
2327 } 2332 glutWireCube(_nudgeVoxel.s);
2328 } else {2333 } else {
2334 glTranslatef(_mouseVoxel.x + _mouseVoxel.s*0.5f,
2335 _mouseVoxel.y + _mouseVoxel.s*0.5f,
2336 _mouseVoxel.z + _mouseVoxel.s*0.5f);
2337 glLineWidth(4.0f);
2329 glutWireCube(_mouseVoxel.s);2338 glutWireCube(_mouseVoxel.s);
2330 }2339 }
2331 glLineWidth(1.0f);2340 glLineWidth(1.0f);

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