Commit 69c3ad5c authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

[BVH] Update MeshLoader

parent ec397df2
......@@ -55,7 +55,7 @@ namespace fcl {
/// \param bvType ignored
/// \deprecated Use MeshLoader::load(const std::string&, const Vec3f&)
CollisionGeometryPtr_t load (const std::string& filename,
BVHModelPtr_t load (const std::string& filename,
const Vec3f& scale,
const NODE_TYPE& bvType) HPP_FCL_DEPRECATED
{
......@@ -63,7 +63,7 @@ namespace fcl {
return load (filename, scale);
}
virtual CollisionGeometryPtr_t load (const std::string& filename,
virtual BVHModelPtr_t load (const std::string& filename,
const Vec3f& scale);
MeshLoader (const NODE_TYPE& bvType = BV_OBBRSS) : bvType_ (bvType) {}
......@@ -83,7 +83,7 @@ namespace fcl {
CachedMeshLoader (const NODE_TYPE& bvType = BV_OBBRSS) : MeshLoader (bvType) {}
virtual CollisionGeometryPtr_t load (const std::string& filename,
virtual BVHModelPtr_t load (const std::string& filename,
const Vec3f& scale);
struct Key {
......@@ -95,7 +95,7 @@ namespace fcl {
bool operator< (const CachedMeshLoader::Key& b) const;
};
typedef std::map <Key, CollisionGeometryPtr_t> Cache_t;
typedef std::map <Key, BVHModelPtr_t> Cache_t;
const Cache_t cache () const { return cache_; }
private:
......
......@@ -53,14 +53,14 @@ namespace fcl {
}
template <typename BV>
CollisionGeometryPtr_t _load (const std::string& filename, const Vec3f& scale)
BVHModelPtr_t _load (const std::string& filename, const Vec3f& scale)
{
boost::shared_ptr < BVHModel<BV> > polyhedron (new BVHModel<BV>);
loadPolyhedronFromResource (filename, scale, polyhedron);
return polyhedron;
}
CollisionGeometryPtr_t MeshLoader::load (const std::string& filename,
BVHModelPtr_t MeshLoader::load (const std::string& filename,
const Vec3f& scale)
{
switch (bvType_) {
......@@ -77,13 +77,13 @@ namespace fcl {
}
}
CollisionGeometryPtr_t CachedMeshLoader::load (const std::string& filename,
BVHModelPtr_t CachedMeshLoader::load (const std::string& filename,
const Vec3f& scale)
{
Key key (filename, scale);
Cache_t::const_iterator _cached = cache_.find (key);
if (_cached == cache_.end()) {
CollisionGeometryPtr_t geom = MeshLoader::load (filename, scale);
BVHModelPtr_t geom = MeshLoader::load (filename, scale);
cache_.insert (std::make_pair(key, geom));
return geom;
} else {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment