Showing the changes to interface/src/VoxelSystem.cpp (1 of 12 files). Show all
Unified · Split
| @@ -659,7 +659,8 @@ void VoxelSystem::render(bool texture) { · 658 unmodified lines | ||
| 659 | 659 | // draw the number of voxels we have |
| 660 | 660 | glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _vboIndicesID); |
| 661 | 661 | glScalef(TREE_SCALE, TREE_SCALE, TREE_SCALE); |
| 662 | − glDrawElements(GL_TRIANGLES, 36 * _voxelsInReadArrays, GL_UNSIGNED_INT, 0); | |
| 662 | + glDrawRangeElementsEXT(GL_TRIANGLES, 0, VERTICES_PER_VOXEL * _voxelsInReadArrays, | |
| 663 | + 36 * _voxelsInReadArrays, GL_UNSIGNED_INT, 0); | |
| 663 | 664 | |
| 664 | 665 | glEnable(GL_BLEND); |
| 665 | 666 | glDisable(GL_CULL_FACE); |
| @@ -925,6 +926,20 @@ bool VoxelSystem::findRayIntersection(const glm::vec3& origin, const glm::vec3& · 259 unmodified lines | ||
| 925 | 926 | return true; |
| 926 | 927 | } |
| 927 | 928 | |
| 929 | +bool VoxelSystem::findSpherePenetration(const glm::vec3& center, float radius, glm::vec3& penetration) { | |
| 930 | + pthread_mutex_lock(&_treeLock); | |
| 931 | + bool result = _tree->findSpherePenetration(center, radius, penetration); | |
| 932 | + pthread_mutex_unlock(&_treeLock); | |
| 933 | + return result; | |
| 934 | +} | |
| 935 | + | |
| 936 | +bool VoxelSystem::findCapsulePenetration(const glm::vec3& start, const glm::vec3& end, float radius, glm::vec3& penetration) { | |
| 937 | + pthread_mutex_lock(&_treeLock); | |
| 938 | + bool result = _tree->findCapsulePenetration(start, end, radius, penetration); | |
| 939 | + pthread_mutex_unlock(&_treeLock); | |
| 940 | + return result; | |
| 941 | +} | |
| 942 | + | |
| 928 | 943 | class falseColorizeRandomEveryOtherArgs { |
| 929 | 944 | public: |
| 930 | 945 | falseColorizeRandomEveryOtherArgs() : totalNodes(0), colorableNodes(0), coloredNodes(0), colorThis(true) {}; |