diff --git a/Recast/Source/RecastMeshDetail.cpp b/Recast/Source/RecastMeshDetail.cpp
index 42fe11e..454d89c 100644
--- a/Recast/Source/RecastMeshDetail.cpp
+++ b/Recast/Source/RecastMeshDetail.cpp
@@ -101,15 +101,15 @@ static float distPtTri(const float* p, const float* a, const float* b, const flo
const float dot12 = vdot2(v1, v2);
// Compute barycentric coordinates
- float invDenom = 1.0f / (dot00 * dot11 - dot01 * dot01);
- float u = (dot11 * dot02 - dot01 * dot12) * invDenom;
+ const float invDenom = 1.0f / (dot00 * dot11 - dot01 * dot01);
+ const float u = (dot11 * dot02 - dot01 * dot12) * invDenom;
float v = (dot00 * dot12 - dot01 * dot02) * invDenom;
// If point lies inside the triangle, return interpolated y-coord.
static const float EPS = 1e-4f;
if (u >= -EPS && v >= -EPS && (u+v) <= 1+EPS)
{
- float y = a[1] + v0[1]*u + v1[1]*v;
+ const float y = a[1] + v0[1]*u + v1[1]*v;
return fabsf(y-p[1]);
}
return FLT_MAX;
diff --git a/RecastDemo/Bin/Recast.app/Contents/MacOS/Recast b/RecastDemo/Bin/Recast.app/Contents/MacOS/Recast
index 38b13c3..a57d68e 100755
Binary files a/RecastDemo/Bin/Recast.app/Contents/MacOS/Recast and b/RecastDemo/Bin/Recast.app/Contents/MacOS/Recast differ
diff --git a/RecastDemo/Build/Xcode/Recast.xcodeproj/memon.pbxuser b/RecastDemo/Build/Xcode/Recast.xcodeproj/memon.pbxuser
index 12add6a..1ff5a1f 100644
--- a/RecastDemo/Build/Xcode/Recast.xcodeproj/memon.pbxuser
+++ b/RecastDemo/Build/Xcode/Recast.xcodeproj/memon.pbxuser
@@ -143,6 +143,13 @@
6B6C4655117C9962002CDD36 /* PBXTextBookmark */ = 6B6C4655117C9962002CDD36 /* PBXTextBookmark */;
6B6C4658117C998D002CDD36 /* PBXTextBookmark */ = 6B6C4658117C998D002CDD36 /* PBXTextBookmark */;
6B6C465F117C998D002CDD36 /* PBXTextBookmark */ = 6B6C465F117C998D002CDD36 /* PBXTextBookmark */;
+ 6B6C466F117D8D60002CDD36 /* PBXTextBookmark */ = 6B6C466F117D8D60002CDD36 /* PBXTextBookmark */;
+ 6B6C4670117D8D60002CDD36 /* PBXTextBookmark */ = 6B6C4670117D8D60002CDD36 /* PBXTextBookmark */;
+ 6B6C4671117D8D60002CDD36 /* PBXTextBookmark */ = 6B6C4671117D8D60002CDD36 /* PBXTextBookmark */;
+ 6B6C4672117D8D60002CDD36 /* PBXTextBookmark */ = 6B6C4672117D8D60002CDD36 /* PBXTextBookmark */;
+ 6B6C4673117D8D60002CDD36 /* PBXTextBookmark */ = 6B6C4673117D8D60002CDD36 /* PBXTextBookmark */;
+ 6B6C4674117D8D60002CDD36 /* PBXTextBookmark */ = 6B6C4674117D8D60002CDD36 /* PBXTextBookmark */;
+ 6B6C4675117D8D60002CDD36 /* PBXTextBookmark */ = 6B6C4675117D8D60002CDD36 /* PBXTextBookmark */;
6BBB4A96115B4F3400CF791D = 6BBB4A96115B4F3400CF791D /* PBXTextBookmark */;
6BBB4A9E115B4F3400CF791D = 6BBB4A9E115B4F3400CF791D /* PBXTextBookmark */;
6BBB4AA1115B4F3400CF791D = 6BBB4AA1115B4F3400CF791D /* PBXTextBookmark */;
@@ -390,9 +397,9 @@
};
6B1185FC10068B040018F96F /* DetourCommon.h */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {909, 3264}}";
- sepNavSelRange = "{5773, 0}";
- sepNavVisRange = "{4630, 1251}";
+ sepNavIntBoundsRect = "{{0, 0}, {909, 2912}}";
+ sepNavSelRange = "{5273, 0}";
+ sepNavVisRange = "{4789, 1092}";
};
};
6B1185FD10068B150018F96F /* DetourCommon.cpp */ = {
@@ -540,9 +547,9 @@
};
6B25B6180FFA62BE004F1BC4 /* main.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {909, 14032}}";
- sepNavSelRange = "{10727, 0}";
- sepNavVisRange = "{10443, 687}";
+ sepNavIntBoundsRect = "{{0, 0}, {909, 14208}}";
+ sepNavSelRange = "{7642, 0}";
+ sepNavVisRange = "{7154, 809}";
};
};
6B2AEC510FFB8946005BE9CC /* Sample_TileMesh.h */ = {
@@ -609,7 +616,7 @@
fRef = 6B25B6180FFA62BE004F1BC4 /* main.cpp */;
name = "main.cpp: 429";
rLen = 0;
- rLoc = 10727;
+ rLoc = 10818;
rType = 0;
vrLen = 687;
vrLoc = 10443;
@@ -629,7 +636,7 @@
fRef = 6B25B6180FFA62BE004F1BC4 /* main.cpp */;
name = "main.cpp: 429";
rLen = 0;
- rLoc = 10727;
+ rLoc = 10818;
rType = 0;
vrLen = 687;
vrLoc = 10443;
@@ -677,7 +684,7 @@
fRef = 6B25B6180FFA62BE004F1BC4 /* main.cpp */;
name = "main.cpp: 429";
rLen = 0;
- rLoc = 10727;
+ rLoc = 10818;
rType = 0;
vrLen = 687;
vrLoc = 10443;
@@ -762,6 +769,76 @@
vrLen = 501;
vrLoc = 0;
};
+ 6B6C466F117D8D60002CDD36 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */;
+ name = "DetourNavMesh.cpp: 1603";
+ rLen = 0;
+ rLoc = 43554;
+ rType = 0;
+ vrLen = 718;
+ vrLoc = 43246;
+ };
+ 6B6C4670117D8D60002CDD36 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = 6B1185FC10068B040018F96F /* DetourCommon.h */;
+ name = "DetourCommon.h: 189";
+ rLen = 0;
+ rLoc = 5273;
+ rType = 0;
+ vrLen = 1092;
+ vrLoc = 4789;
+ };
+ 6B6C4671117D8D60002CDD36 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = 6B25B6180FFA62BE004F1BC4 /* main.cpp */;
+ name = "main.cpp: 429";
+ rLen = 0;
+ rLoc = 10818;
+ rType = 0;
+ vrLen = 601;
+ vrLoc = 10443;
+ };
+ 6B6C4672117D8D60002CDD36 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */;
+ name = "DetourNavMesh.cpp: 1603";
+ rLen = 0;
+ rLoc = 43554;
+ rType = 0;
+ vrLen = 718;
+ vrLoc = 43246;
+ };
+ 6B6C4673117D8D60002CDD36 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = 6B1185FC10068B040018F96F /* DetourCommon.h */;
+ name = "DetourCommon.h: 189";
+ rLen = 0;
+ rLoc = 5273;
+ rType = 0;
+ vrLen = 1092;
+ vrLoc = 4789;
+ };
+ 6B6C4674117D8D60002CDD36 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = 6B25B6180FFA62BE004F1BC4 /* main.cpp */;
+ name = "main.cpp: 311";
+ rLen = 0;
+ rLoc = 7642;
+ rType = 0;
+ vrLen = 809;
+ vrLoc = 7154;
+ };
+ 6B6C4675117D8D60002CDD36 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = 6BF5F3761175AACB000502A6 /* glimage.h */;
+ name = "glimage.h: 30";
+ rLen = 71;
+ rLoc = 419;
+ rType = 0;
+ vrLen = 501;
+ vrLoc = 0;
+ };
6B8036AC113BAABE005ED67B /* Sample_Debug.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {815, 896}}";
@@ -3313,7 +3390,7 @@
fRef = 6B25B6180FFA62BE004F1BC4 /* main.cpp */;
name = "main.cpp: 434";
rLen = 0;
- rLoc = 10873;
+ rLoc = 10964;
rType = 0;
vrLen = 687;
vrLoc = 10443;
diff --git a/RecastDemo/Build/Xcode/Recast.xcodeproj/memon.perspectivev3 b/RecastDemo/Build/Xcode/Recast.xcodeproj/memon.perspectivev3
index 80a9ede..0fb08e5 100644
--- a/RecastDemo/Build/Xcode/Recast.xcodeproj/memon.perspectivev3
+++ b/RecastDemo/Build/Xcode/Recast.xcodeproj/memon.perspectivev3
@@ -216,7 +216,7 @@
_historyCapacity
0
bookmark
- 6B6C465F117C998D002CDD36
+ 6B6C4675117D8D60002CDD36
history
6BF5F55B1176FEC8000502A6
@@ -323,14 +323,13 @@
PBXSmartGroupTreeModuleOutlineStateSelectionKey
- 18
- 11
+ 46
1
0
PBXSmartGroupTreeModuleOutlineStateVisibleRectKey
- {{0, 102}, {264, 643}}
+ {{0, 427}, {264, 643}}
PBXTopSmartGroupGIDs
@@ -365,7 +364,7 @@
PBXProjectModuleGUID
6B8632A30F78115100E2684A
PBXProjectModuleLabel
- DetourNavMesh.cpp
+ main.cpp
PBXSplitModuleInNavigatorKey
Split0
@@ -373,11 +372,11 @@
PBXProjectModuleGUID
6B8632A40F78115100E2684A
PBXProjectModuleLabel
- DetourNavMesh.cpp
+ main.cpp
_historyCapacity
0
bookmark
- 6B6C4658117C998D002CDD36
+ 6B6C4674117D8D60002CDD36
history
6BBB4A96115B4F3400CF791D
@@ -440,11 +439,11 @@
6BF5F50C1176F5F8000502A6
6BF5F50D1176F5F8000502A6
6BF5F52C1176FA0B000502A6
- 6B6C464A117C9962002CDD36
- 6B6C464B117C9962002CDD36
6B6C464C117C9962002CDD36
6B6C464D117C9962002CDD36
- 6B6C464E117C9962002CDD36
+ 6B6C466F117D8D60002CDD36
+ 6B6C4670117D8D60002CDD36
+ 6B6C4671117D8D60002CDD36
prevStack
@@ -517,6 +516,8 @@
6B6C4651117C9962002CDD36
6B6C4652117C9962002CDD36
6B6C4653117C9962002CDD36
+ 6B6C4672117D8D60002CDD36
+ 6B6C4673117D8D60002CDD36
SplitCount
@@ -530,18 +531,18 @@
GeometryConfiguration
Frame
- {{0, 0}, {970, 490}}
+ {{0, 0}, {970, 572}}
RubberWindowFrame
13 75 1256 702 0 0 1280 778
Module
PBXNavigatorGroup
Proportion
- 490pt
+ 572pt
Proportion
- 166pt
+ 84pt
Tabs
@@ -609,7 +610,7 @@
GeometryConfiguration
Frame
- {{10, 27}, {970, 139}}
+ {{10, 27}, {970, 57}}
RubberWindowFrame
13 75 1256 702 0 0 1280 778
diff --git a/RecastDemo/Source/main.cpp b/RecastDemo/Source/main.cpp
index f377a4b..2f327b4 100644
--- a/RecastDemo/Source/main.cpp
+++ b/RecastDemo/Source/main.cpp
@@ -293,16 +293,22 @@ int main(int /*argc*/, char** /*argv*/)
if (event.button.button == SDL_BUTTON_RIGHT)
{
rotate = false;
- if (!movedDuringRotate)
+ if (!mouseOverMenu)
{
- processHitTest = true;
- processHitTestShift = true;
+ if (!movedDuringRotate)
+ {
+ processHitTest = true;
+ processHitTestShift = true;
+ }
}
}
else if (event.button.button == SDL_BUTTON_LEFT)
{
- processHitTest = true;
- processHitTestShift = (SDL_GetModState() & KMOD_SHIFT) ? true : false;
+ if (!mouseOverMenu)
+ {
+ processHitTest = true;
+ processHitTestShift = (SDL_GetModState() & KMOD_SHIFT) ? true : false;
+ }
}
break;