38 #ifndef FCL_COLLISIONRESULT_INL_H 39 #define FCL_COLLISIONRESULT_INL_H 41 #include "fcl/narrowphase/collision_result.h" 48 struct CollisionResult<double>;
52 CollisionResult<S>::CollisionResult()
61 contacts.push_back(c);
69 cost_sources.insert(c);
70 while (cost_sources.size() > num_max_cost_sources)
71 cost_sources.erase(--cost_sources.end());
78 return contacts.size() > 0;
85 return contacts.size();
92 return cost_sources.size();
99 if(i < contacts.size())
102 return contacts.back();
106 template <
typename S>
110 contacts_.resize(contacts.size());
111 std::copy(contacts.begin(), contacts.end(), contacts_.begin());
115 template <
typename S>
119 cost_sources_.resize(cost_sources.size());
120 std::copy(cost_sources.begin(), cost_sources.end(), cost_sources_.begin());
124 template <
typename S>
128 cost_sources.clear();
void addCostSource(const CostSource< S > &c, std::size_t num_max_cost_sources)
add one cost source into result structure
Definition: collision_result-inl.h:66
Main namespace.
Definition: broadphase_bruteforce-inl.h:45
bool isCollision() const
return binary collision result
Definition: collision_result-inl.h:76
const Contact< S > & getContact(size_t i) const
get the i-th contact calculated
Definition: collision_result-inl.h:97
size_t numContacts() const
number of contacts found
Definition: collision_result-inl.h:83
void getContacts(std::vector< Contact< S >> &contacts_)
get all the contacts
Definition: collision_result-inl.h:107
size_t numCostSources() const
number of cost sources found
Definition: collision_result-inl.h:90
void getCostSources(std::vector< CostSource< S >> &cost_sources_)
get all the cost sources
Definition: collision_result-inl.h:116
Cost source describes an area with a cost. The area is described by an AABB<S> region.
Definition: cost_source.h:49
void clear()
clear the results obtained
Definition: collision_result-inl.h:125
void addContact(const Contact< S > &c)
add one contact into result structure
Definition: collision_result-inl.h:59