History

Added basic capsule/sphere collisions between avatar and voxels.

Andrzej Kapolka committed 13 years ago

Commit 597769a1 parent b15162a9 files · +151 −16Browse files

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

Unified · Split

interface/src/VoxelSystem.cpp+14−0
@@ -930,6 +930,20 @@ bool VoxelSystem::findRayIntersection(const glm::vec3& origin, const glm::vec3& · 929 unmodified lines
930930 return true;
931931 }
932932
933+bool VoxelSystem::findSpherePenetration(const glm::vec3& center, float radius, glm::vec3& penetration) {
934+ pthread_mutex_lock(&_treeLock);
935+ bool result = _tree->findSpherePenetration(center, radius, penetration);
936+ pthread_mutex_unlock(&_treeLock);
937+ return result;
938+}
939+
940+bool VoxelSystem::findCapsulePenetration(const glm::vec3& start, const glm::vec3& end, float radius, glm::vec3& penetration) {
941+ pthread_mutex_lock(&_treeLock);
942+ bool result = _tree->findCapsulePenetration(start, end, radius, penetration);
943+ pthread_mutex_unlock(&_treeLock);
944+ return result;
945+}
946+
933947 class falseColorizeRandomEveryOtherArgs {
934948 public:
935949 falseColorizeRandomEveryOtherArgs() : totalNodes(0), colorableNodes(0), coloredNodes(0), colorThis(true) {};

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