diff --git a/RecastDemo/Include/Sample.h b/RecastDemo/Include/Sample.h index d645b32a..3323c1ae 100644 --- a/RecastDemo/Include/Sample.h +++ b/RecastDemo/Include/Sample.h @@ -106,10 +106,10 @@ struct SampleToolState { class Sample { protected: - InputGeom* m_inputGeometry; - dtNavMesh* m_navMesh; - dtNavMeshQuery* m_navQuery; - dtCrowd* m_crowd; + InputGeom* m_inputGeometry = nullptr; + dtNavMesh* m_navMesh = nullptr; + dtNavMeshQuery* m_navQuery = nullptr; + dtCrowd* m_crowd = nullptr; unsigned char m_navMeshDrawFlags; @@ -128,14 +128,14 @@ protected: float m_detailSampleMaxError; int m_partitionType; - bool m_filterLowHangingObstacles; - bool m_filterLedgeSpans; - bool m_filterWalkableLowHeightSpans; + bool m_filterLowHangingObstacles = true; + bool m_filterLedgeSpans = true; + bool m_filterWalkableLowHeightSpans = true; - SampleTool* m_tool; + SampleTool* m_tool = nullptr; SampleToolState* m_toolStates[static_cast(SampleToolType::MAX_TOOLS)]; - BuildContext* m_buildContext; + BuildContext* m_buildContext = nullptr; SampleDebugDraw m_debugDraw; diff --git a/RecastDemo/Source/Sample.cpp b/RecastDemo/Source/Sample.cpp index 0af9efd6..9ee1cf50 100644 --- a/RecastDemo/Source/Sample.cpp +++ b/RecastDemo/Source/Sample.cpp @@ -65,17 +65,8 @@ unsigned int SampleDebugDraw::areaToCol(unsigned int area) } } -Sample::Sample() : - m_inputGeometry(0), - m_navMesh(0), - m_navQuery(0), - m_crowd(0), - m_navMeshDrawFlags(DU_DRAWNAVMESH_OFFMESHCONS|DU_DRAWNAVMESH_CLOSEDLIST), - m_filterLowHangingObstacles(true), - m_filterLedgeSpans(true), - m_filterWalkableLowHeightSpans(true), - m_tool(0), - m_buildContext(0) +Sample::Sample() +: m_navMeshDrawFlags(DU_DRAWNAVMESH_OFFMESHCONS|DU_DRAWNAVMESH_CLOSEDLIST) { resetCommonSettings(); m_navQuery = dtAllocNavMeshQuery();