[Bf-blender-cvs] [176538f] master: Update Recast version to 1.5.0

Reinier de Blois noreply at git.blender.org
Tue Apr 5 21:35:50 CEST 2016


Commit: 176538f61360fb54f0e4ce209fc7d7632bce1401
Author: Reinier de Blois
Date:   Tue Apr 5 20:34:00 2016 +0200
Branches: master
https://developer.blender.org/rB176538f61360fb54f0e4ce209fc7d7632bce1401

Update Recast version to 1.5.0

The version of Recast that Blender ships with is from 2009.  This patch updates the Recast version to the latest version, 1.5.0.  The Detour version remains untouched.

Reviewers: campbellbarton, moguri

Reviewed By: moguri

Projects: #bf_blender

Differential Revision: https://developer.blender.org/D1747

===================================================================

M	extern/recastnavigation/Recast/Include/Recast.h
M	extern/recastnavigation/Recast/Include/RecastAlloc.h
M	extern/recastnavigation/Recast/Include/RecastAssert.h
D	extern/recastnavigation/Recast/Include/RecastLog.h
D	extern/recastnavigation/Recast/Include/RecastTimer.h
M	extern/recastnavigation/Recast/Source/Recast.cpp
M	extern/recastnavigation/Recast/Source/RecastAlloc.cpp
M	extern/recastnavigation/Recast/Source/RecastArea.cpp
M	extern/recastnavigation/Recast/Source/RecastContour.cpp
M	extern/recastnavigation/Recast/Source/RecastFilter.cpp
M	extern/recastnavigation/Recast/Source/RecastLayers.cpp
D	extern/recastnavigation/Recast/Source/RecastLog.cpp
M	extern/recastnavigation/Recast/Source/RecastMesh.cpp
M	extern/recastnavigation/Recast/Source/RecastMeshDetail.cpp
M	extern/recastnavigation/Recast/Source/RecastRasterization.cpp
M	extern/recastnavigation/Recast/Source/RecastRegion.cpp
D	extern/recastnavigation/Recast/Source/RecastTimer.cpp
A	extern/recastnavigation/readme-blender.txt
M	extern/recastnavigation/recast-capi.cpp
M	extern/recastnavigation/recast-capi.h
M	source/blender/editors/mesh/mesh_navmesh.c

===================================================================

diff --git a/extern/recastnavigation/Recast/Include/Recast.h b/extern/recastnavigation/Recast/Include/Recast.h
index 4e20b0f..6f18247 100644
--- a/extern/recastnavigation/Recast/Include/Recast.h
+++ b/extern/recastnavigation/Recast/Include/Recast.h
@@ -15,7 +15,7 @@
 //    misrepresented as being the original software.
 // 3. This notice may not be removed or altered from any source distribution.
 //
- 
+
 #ifndef RECAST_H
 #define RECAST_H
 
@@ -27,8 +27,8 @@ static const float RC_PI = 3.14159265f;
 enum rcLogCategory
 {
 	RC_LOG_PROGRESS = 1,	///< A progress log entry.
-	RC_LOG_WARNING,	 	    ///< A warning log entry.
-	RC_LOG_ERROR,	   	    ///< An error log entry.
+	RC_LOG_WARNING,			///< A warning log entry.
+	RC_LOG_ERROR,			///< An error log entry.
 };
 
 /// Recast performance timer categories.
@@ -86,7 +86,7 @@ enum rcTimerLabel
 	/// The time to filter out small regions. (See: #rcBuildRegions, #rcBuildRegionsMonotone)
 	RC_TIMER_BUILD_REGIONS_FILTER,
 	/// The time to build heightfield layers. (See: #rcBuildHeightfieldLayers)
-	RC_TIMER_BUILD_LAYERS, 
+	RC_TIMER_BUILD_LAYERS,
 	/// The time to build the polygon mesh detail. (See: #rcBuildPolyMeshDetail)
 	RC_TIMER_BUILD_POLYMESHDETAIL,
 	/// The time to merge polygon mesh details. (See: #rcMergePolyMeshDetails)
@@ -95,7 +95,7 @@ enum rcTimerLabel
 	RC_MAX_TIMERS
 };
 
-/// Provides an interface for optional logging and performance tracking of the Recast 
+/// Provides an interface for optional logging and performance tracking of the Recast
 /// build process.
 /// @ingroup recast
 class rcContext
@@ -103,39 +103,39 @@ class rcContext
 public:
 
 	/// Contructor.
-	///  @param[in] state  TRUE if the logging and performance timers should be enabled.  [Default: true]
+	///  @param[in]		state	TRUE if the logging and performance timers should be enabled.  [Default: true]
 	inline rcContext(bool state = true) : m_logEnabled(state), m_timerEnabled(state) {}
 	virtual ~rcContext() {}
 
 	/// Enables or disables logging.
-	///  @param[in] state TRUE if logging should be enabled.
+	///  @param[in]		state	TRUE if logging should be enabled.
 	inline void enableLog(bool state) { m_logEnabled = state; }
 
 	/// Clears all log entries.
 	inline void resetLog() { if (m_logEnabled) doResetLog(); }
 
 	/// Logs a message.
-	///  @param[in] category The category of the message.
-	///  @param[in] format The message.
+	///  @param[in]		category	The category of the message.
+	///  @param[in]		format		The message.
 	void log(const rcLogCategory category, const char* format, ...);
 
 	/// Enables or disables the performance timers.
-	///  @param[in] state  TRUE if timers should be enabled.
+	///  @param[in]		state	TRUE if timers should be enabled.
 	inline void enableTimer(bool state) { m_timerEnabled = state; }
 
 	/// Clears all peformance timers. (Resets all to unused.)
 	inline void resetTimers() { if (m_timerEnabled) doResetTimers(); }
 
 	/// Starts the specified performance timer.
-	///  @param label  The category of timer.
+	///  @param	label	The category of the timer.
 	inline void startTimer(const rcTimerLabel label) { if (m_timerEnabled) doStartTimer(label); }
 
 	/// Stops the specified performance timer.
-	///  @param label  The category of the timer.
+	///  @param	label	The category of the timer.
 	inline void stopTimer(const rcTimerLabel label) { if (m_timerEnabled) doStopTimer(label); }
 
 	/// Returns the total accumulated time of the specified performance timer.
-	///  @param label  The category of the timer.
+	///  @param	label	The category of the timer.
 	///  @return The accumulated time of the timer, or -1 if timers are disabled or the timer has never been started.
 	inline int getAccumulatedTime(const rcTimerLabel label) const { return m_timerEnabled ? doGetAccumulatedTime(label) : -1; }
 
@@ -145,27 +145,27 @@ protected:
 	virtual void doResetLog() {}
 
 	/// Logs a message.
-	///  @param[in] category The category of the message.
-	///  @param[in] msg The formatted message.
-	///  @param[in] len The length of the formatted message.
+	///  @param[in]		category	The category of the message.
+	///  @param[in]		msg			The formatted message.
+	///  @param[in]		len			The length of the formatted message.
 	virtual void doLog(const rcLogCategory /*category*/, const char* /*msg*/, const int /*len*/) {}
 
 	/// Clears all timers. (Resets all to unused.)
 	virtual void doResetTimers() {}
 
 	/// Starts the specified performance timer.
-	///  @param[in] label  The category of timer.
+	///  @param[in]		label	The category of timer.
 	virtual void doStartTimer(const rcTimerLabel /*label*/) {}
 
 	/// Stops the specified performance timer.
-	///  @param[in] label  The category of the timer.
+	///  @param[in]		label	The category of the timer.
 	virtual void doStopTimer(const rcTimerLabel /*label*/) {}
 
 	/// Returns the total accumulated time of the specified performance timer.
-	///  @param[in] label  The category of the timer.
+	///  @param[in]		label	The category of the timer.
 	///  @return The accumulated time of the timer, or -1 if timers are disabled or the timer has never been started.
 	virtual int doGetAccumulatedTime(const rcTimerLabel /*label*/) const { return -1; }
-	
+
 	/// True if logging is enabled.
 	bool m_logEnabled;
 
@@ -173,6 +173,26 @@ protected:
 	bool m_timerEnabled;
 };
 
+/// A helper to first start a timer and then stop it when this helper goes out of scope.
+/// @see rcContext
+class rcScopedTimer
+{
+public:
+	/// Constructs an instance and starts the timer.
+	///  @param[in]		ctx		The context to use.
+	///  @param[in]		label	The category of the timer.
+	inline rcScopedTimer(rcContext* ctx, const rcTimerLabel label) : m_ctx(ctx), m_label(label) { m_ctx->startTimer(m_label); }
+	inline ~rcScopedTimer() { m_ctx->stopTimer(m_label); }
+
+private:
+	// Explicitly disabled copy constructor and copy assignment operator.
+	rcScopedTimer(const rcScopedTimer&);
+	rcScopedTimer& operator=(const rcScopedTimer&);
+
+	rcContext* const m_ctx;
+	const rcTimerLabel m_label;
+};
+
 /// Specifies a configuration to use when performing Recast builds.
 /// @ingroup recast
 struct rcConfig
@@ -181,71 +201,71 @@ struct rcConfig
 	int width;
 
 	/// The height of the field along the z-axis. [Limit: >= 0] [Units: vx]
-	int height;	
-	
+	int height;
+
 	/// The width/height size of tile's on the xz-plane. [Limit: >= 0] [Units: vx]
-	int tileSize;	
-	
+	int tileSize;
+
 	/// The size of the non-navigable border around the heightfield. [Limit: >=0] [Units: vx]
 	int borderSize;
 
-	/// The xz-plane cell size to use for fields. [Limit: > 0] [Units: wu] 
+	/// The xz-plane cell size to use for fields. [Limit: > 0] [Units: wu]
 	float cs;
 
 	/// The y-axis cell size to use for fields. [Limit: > 0] [Units: wu]
 	float ch;
 
 	/// The minimum bounds of the field's AABB. [(x, y, z)] [Units: wu]
-	float bmin[3]; 
+	float bmin[3];
 
 	/// The maximum bounds of the field's AABB. [(x, y, z)] [Units: wu]
 	float bmax[3];
 
-	/// The maximum slope that is considered walkable. [Limits: 0 <= value < 90] [Units: Degrees] 
+	/// The maximum slope that is considered walkable. [Limits: 0 <= value < 90] [Units: Degrees]
 	float walkableSlopeAngle;
 
-	/// Minimum floor to 'ceiling' height that will still allow the floor area to 
-	/// be considered walkable. [Limit: >= 3] [Units: vx] 
-	int walkableHeight;				
-	
-	/// Maximum ledge height that is considered to still be traversable. [Limit: >=0] [Units: vx] 
-	int walkableClimb;				
-	
-	/// The distance to erode/shrink the walkable area of the heightfield away from 
-	/// obstructions.  [Limit: >=0] [Units: vx] 
-	int walkableRadius;				
-	
-	/// The maximum allowed length for contour edges along the border of the mesh. [Limit: >=0] [Units: vx] 
-	int maxEdgeLen;					
-	
-	/// The maximum distance a simplfied contour's border edges should deviate 
-	/// the original raw contour. [Limit: >=0] [Units: wu]
-	float maxSimplificationError;	
-	
-	/// The minimum number of cells allowed to form isolated island areas. [Limit: >=0] [Units: vx] 
-	int minRegionArea;				
-	
-	/// Any regions with a span count smaller than this value will, if possible, 
-	/// be merged with larger regions. [Limit: >=0] [Units: vx] 
-	int mergeRegionArea;			
-	
-	/// The maximum number of vertices allowed for polygons generated during the 
-	/// contour to polygon conversion process. [Limit: >= 3] 
+	/// Minimum floor to 'ceiling' height that will still allow the floor area to
+	/// be considered walkable. [Limit: >= 3] [Units: vx]
+	int walkableHeight;
+
+	/// Maximum ledge height that is considered to still be traversable. [Limit: >=0] [Units: vx]
+	int walkableClimb;
+
+	/// The distance to erode/shrink the walkable area of the heightfield away from
+	/// obstructions.  [Limit: >=0] [Units: vx]
+	int walkableRadius;
+
+	/// The maximum allowed length for contour edges along the border of the mesh. [Limit: >=0] [Units: vx]
+	int maxEdgeLen;
+
+	/// The maximum distance a simplfied contour's border edges should deviate
+	/// the original raw contour. [Limit: >=0] [Units: vx]
+	float maxSimplificationError;
+
+	/// The minimum number of cells allowed to form isolated island areas. [Limit: >=0] [Units: vx]
+	int minRegionArea;
+
+	/// Any regions with a span count smaller than this value will, if possible,
+	/// be merged with larger regions. [Limit: >=0] [Units: vx]
+	int mergeRegionArea;
+
+	/// The maximum number of vertices allowed for polygons generated during the
+	/// contour to polygon conversion process. [Limit: >= 3]
 	int maxVertsPerPoly;
-	
+
 	/// Sets the sampling distance to use when generating the detail mesh.
-	/// (For height detail only.) [Limits: 0 or >= 0.9] [Units: wu] 
+	/// (For height detail only.) [Limits: 0 or >= 0.9] [Units: wu]
 	float detailSampleDist;
-	
+
 	/// The maximum distance the detail mesh surface should deviate from heightfield
-	/// data. (For height detail only.) [Limit: >=0] [Units: wu] 
+	/// data. (For height detail only.) [Limit: >=0] [Units: wu]
 	float detailSampleMaxError;
 };
 
 /// Defines the number of bits allocated to rcSpan::smin and rcSpan::smax.
 static const int RC_SPAN_HEIGHT_BITS = 13;
 /// Defines the maximum value for rcSpan::smin an

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list