7 #ifndef NAZARA_MODEL_HPP 8 #define NAZARA_MODEL_HPP 10 #include <Nazara/Prerequesites.hpp> 11 #include <Nazara/Core/Resource.hpp> 12 #include <Nazara/Core/ResourceLoader.hpp> 13 #include <Nazara/Core/ResourceParameters.hpp> 14 #include <Nazara/Graphics/InstancedRenderable.hpp> 15 #include <Nazara/Graphics/Material.hpp> 16 #include <Nazara/Utility/Mesh.hpp> 20 struct NAZARA_GRAPHICS_API ModelParameters : ResourceParameters
24 bool loadMaterials =
true;
25 MaterialParams material;
33 using ModelConstRef = ObjectRef<const Model>;
34 using ModelLoader = ResourceLoader<Model, ModelParameters>;
35 using ModelRef = ObjectRef<Model>;
47 void AddToRenderQueue(
AbstractRenderQueue* renderQueue,
const InstanceData& instanceData)
const override;
52 const MaterialRef& GetMaterial(std::size_t skinIndex,
const String& subMeshName)
const;
53 Mesh* GetMesh()
const;
55 virtual bool IsAnimated()
const;
57 bool LoadFromFile(
const String& filePath,
const ModelParameters& params = ModelParameters());
58 bool LoadFromMemory(
const void* data, std::size_t size,
const ModelParameters& params = ModelParameters());
59 bool LoadFromStream(
Stream& stream,
const ModelParameters& params = ModelParameters());
63 bool SetMaterial(std::size_t skinIndex,
const String& subMeshName,
MaterialRef material);
65 virtual void SetMesh(Mesh* mesh);
70 template<
typename... Args>
static ModelRef New(Args&&... args);
73 void MakeBoundingVolume()
const override;
77 static ModelLoader::LoaderList s_loaders;
81 #include <Nazara/Graphics/Model.inl> 83 #endif // NAZARA_MODEL_HPP TODO: Inherit SoundEmitter from Node.
Definition: Algorithm.hpp:12
Graphics class that represents a model.
Definition: Model.hpp:37
Core class that represents a string.
Definition: String.hpp:22
Graphics class that represents the rendering queue for our scene.
Definition: AbstractRenderQueue.hpp:26
const MaterialRef & GetMaterial(std::size_t matIndex=0) const
Gets one of the material used by the object.
Definition: InstancedRenderable.inl:54
void SetMaterial(std::size_t matIndex, MaterialRef material)
Changes the material used at the specified index by another one.
Definition: InstancedRenderable.inl:216
Graphics class that represents an instancer renderable.
Definition: InstancedRenderable.hpp:30
Core class that represents a loader of resources.
Definition: ResourceLoader.hpp:23
Core class that represents a resource.
Definition: Resource.hpp:15
Core class that represents a stream.
Definition: Stream.hpp:19