class mrpt::viz::CAssimpModel
Overview
This class can load & render 3D models in a number of different formats (requires the library assimp).
All supported formats: http://assimp.sourceforge.net/main_features_formats.html
Most common ones: AutoCAD DXF ( .dxf ), Collada ( .dae ), Blender 3D ( .blend ), 3ds Max 3DS ( .3ds ), 3ds Max ASE ( .ase ), Quake I ( .mdl ), Quake II ( .md2 ), Quake III Mesh ( .md3 ), etc.
Models are loaded via CAssimpModel::loadScene()
See also:
#include <mrpt/viz/CAssimpModel.h> class CAssimpModel: public mrpt::viz::CVisualObject { public: // typedefs typedef std::string filepath_t; // structs struct LoadFlags; // construction CAssimpModel(); // methods void loadScene(const std::string& file_name, const int flags = LoadFlags::RealTimeMaxQuality|LoadFlags::FlipUVs|LoadFlags::Verbose); void clear(); virtual bool traceRay(const mrpt::poses::CPose3D& o, double& dist) const; virtual mrpt::math::TBoundingBoxf internalBoundingBoxLocal() const; void split_triangles_rendering_bbox(const float bbox_size); float split_triangles_rendering_bbox() const; };
Inherited Members
public: // structs struct OutdatedState; struct State;
Methods
void loadScene(const std::string& file_name, const int flags = LoadFlags::RealTimeMaxQuality|LoadFlags::FlipUVs|LoadFlags::Verbose)
Loads a scene from a file in any supported file.
Parameters:
std::runtime_error |
On any error during loading or importing the file. |
void clear()
Empty the object.
virtual bool traceRay(const mrpt::poses::CPose3D& o, double& dist) const
Simulation of ray-trace, given a pose.
Returns true if the ray effectively collisions with the object (returning the distance to the origin of the ray in “dist”), or false in other case. “dist” variable yields undefined behaviour when false is returned
virtual mrpt::math::TBoundingBoxf internalBoundingBoxLocal() const
Must be implemented by derived classes to provide the updated bounding box in the object local frame of coordinates.
This will be called only once after each time the derived class reports to notifyChange() that the object geometry changed.
See also:
getBoundingBox(), getBoundingBoxLocal(), getBoundingBoxLocalf()
void split_triangles_rendering_bbox(const float bbox_size)
Enable (or disable if set to .0f) a feature in which textured triangles are split into different renderizable smaller objects.
This is required only for semitransparent objects with overlaping regions.