AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MeshReaderAssimp.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2021. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #pragma once
18 
20 #if AGX_USE_ASSIMP()
21 
22 #include <agxIO/MeshReader.h>
23 
24 namespace Assimp
25 {
26  class Importer;
27 }
28 
29 namespace agxIO
30 {
31 
38  {
39  public:
40 
43 
47  MeshReaderAssimp(agx::Vec3Vector& vertices, agx::Vec3Vector& normals, agx::UInt32Vector& indices, agx::Vec2Vector& texCoordinates);
48 
55  size_t readFile( const agx::String& fileName ) override;
56 
62  size_t readString( const agx::String& meshString, FileExtension::FileType fet) override;
63 
64 
70  size_t readStream(std::istream& stream, FileExtension::FileType fet) override;
71 
73 
74  protected:
75  size_t importModel(std::stringstream& stream, const agx::String& fileName, FileExtension::FileType fet, Assimp::Importer& importer);
76 
77 
78  virtual ~MeshReaderAssimp();
80 
85  };
86 
88 }
89 
90 // AGX_USE_ASSIMP.
91 #endif
agx::UInt32Vector & m_assimp_indices
agx::Vec3Vector & m_assimp_normals
agx::ref_ptr< agx::Referenced > m_logger
agx::Vec3Vector & m_assimp_vertices
#define AGXPHYSICS_EXPORT
void AGXCORE_EXPORT readFile(agx::String &result, const agx::String &filePath)
agx::Vec2Vector & m_assimp_texCoordinates
agx::ref_ptr< MeshReaderAssimp > MeshReaderAssimpRef
Vector containing &#39;raw&#39; data.
Definition: Vector.h:245
Data is returned as vertices (getVertices()) and indices (getIndices()) Some formats supports non-tri...
Class for reading a mesh object from file and extracting vertices, normals and indices for collision ...
Definition: MeshReader.h:82
virtual size_t readString(const agx::String &mesh, FileExtension::FileType fet)
Read a specified string containing a mesh description in some mesh format defined as a string...