contact cluster return number of iterations
This commit is contained in:
parent
ffed35d10a
commit
231b9c29d0
@ -69,6 +69,9 @@ public:
|
|||||||
//
|
//
|
||||||
void AddObservation(const b3Observation& observation);
|
void AddObservation(const b3Observation& observation);
|
||||||
|
|
||||||
|
//
|
||||||
|
u32 GetIterations() const;
|
||||||
|
|
||||||
//
|
//
|
||||||
const b3Array<b3Observation>& GetObservations() const;
|
const b3Array<b3Observation>& GetObservations() const;
|
||||||
|
|
||||||
@ -92,6 +95,8 @@ private:
|
|||||||
//
|
//
|
||||||
u32 BestCluster(const b3Vec3& point) const;
|
u32 BestCluster(const b3Vec3& point) const;
|
||||||
|
|
||||||
|
u32 m_iterations;
|
||||||
|
|
||||||
b3StackArray<b3Observation, 32> m_observations;
|
b3StackArray<b3Observation, 32> m_observations;
|
||||||
b3StackArray<b3Cluster, 32> m_clusters;
|
b3StackArray<b3Cluster, 32> m_clusters;
|
||||||
};
|
};
|
||||||
@ -101,6 +106,11 @@ inline void b3ClusterSolver::AddObservation(const b3Observation& observation)
|
|||||||
m_observations.PushBack(observation);
|
m_observations.PushBack(observation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline u32 b3ClusterSolver::GetIterations() const
|
||||||
|
{
|
||||||
|
return m_iterations;
|
||||||
|
}
|
||||||
|
|
||||||
inline const b3Array<b3Observation>& b3ClusterSolver::GetObservations() const
|
inline const b3Array<b3Observation>& b3ClusterSolver::GetObservations() const
|
||||||
{
|
{
|
||||||
return m_observations;
|
return m_observations;
|
||||||
|
@ -201,7 +201,7 @@ void b3ReducePolygon(b3ClusterPolygon& pOut,
|
|||||||
|
|
||||||
b3ClusterSolver::b3ClusterSolver()
|
b3ClusterSolver::b3ClusterSolver()
|
||||||
{
|
{
|
||||||
|
m_iterations = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
b3ClusterSolver::~b3ClusterSolver()
|
b3ClusterSolver::~b3ClusterSolver()
|
||||||
@ -443,6 +443,8 @@ void b3ClusterSolver::Solve()
|
|||||||
++iter;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_iterations = iter;
|
||||||
|
|
||||||
// Remove empty clusters
|
// Remove empty clusters
|
||||||
b3StackArray<b3Cluster, 32> usedClusters;
|
b3StackArray<b3Cluster, 32> usedClusters;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user