AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
MeshReaderAssimp.h
Go to the documentation of this file.
1/*
2Copyright 2007-2024. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#pragma once
18
19#include <agx/config/AGX_USE_ASSIMP.h>
20#if AGX_USE_ASSIMP()
21
22#include <agxIO/MeshReader.h>
23
24namespace Assimp
25{
26 class Importer;
27}
28
29namespace agxIO
30{
31
37 class AGXPHYSICS_EXPORT MeshReaderAssimp : public MeshReader
38 {
39 public:
40
42 MeshReaderAssimp();
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
72 using MeshReader::readString;
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
81 agx::Vec3Vector& m_assimp_vertices;
82 agx::Vec3Vector& m_assimp_normals;
83 agx::UInt32Vector& m_assimp_indices;
84 agx::Vec2Vector& m_assimp_texCoordinates;
85 };
86
87 typedef agx::ref_ptr<MeshReaderAssimp> MeshReaderAssimpRef;
88}
89
90// AGX_USE_ASSIMP.
91#endif
#define AGXPHYSICS_EXPORT
Smart pointer for handling referenced counted objects.
Definition ref_ptr.h:30
The agxIO namespace contains classes for reading, writing and finding files.
Definition Material.h:42
void AGXCORE_EXPORT readFile(agx::String &result, const agx::String &filePath)