The Dirtchamber
A mixed reality testing environment for real-time global illumination algorithms
Classes | Public Member Functions | Protected Member Functions | List of all members
dune::assimp_mesh Class Referenceabstract

A d3d_mesh created with the help of Assimp. More...

#include <assimp_mesh.h>

Inheritance diagram for dune::assimp_mesh:
dune::d3d_mesh dune::mesh< DirectX::XMFLOAT3 > dune::aabb< DirectX::XMFLOAT3 > dune::gilga_mesh skydome

Classes

struct  mesh_info
 A helper struct to supply information about submeshes loaded by Assimp. More...
 
struct  vertex
 A vertex with all its attributes as loaded by Assimp. More...
 

Public Member Functions

virtual void destroy ()
 Destroy a mesh and free all its resources.
 
size_t num_vertices ()
 Returns the number of vertices of a mesh.
 
size_t num_faces ()
 Returns the number of faces of a mesh.
 
- Public Member Functions inherited from dune::d3d_mesh
virtual void set_shader (ID3D11Device *device, ID3DBlob *input_binary, ID3D11VertexShader *vs, ID3D11PixelShader *ps)
 Sets the input layout, vertex- and pixel shader of this mesh.
 
virtual void set_shader_slots (INT diffuse_tex=-1, INT normal_tex=-1, INT specular_tex=-1)
 Sets three register numbers to identify the slots the pixel shader is looking for surface textures.
 
virtual void create (ID3D11Device *device, const tstring &filename)=0
 Create a mesh from a given filename.
 
virtual void render (ID3D11DeviceContext *context, DirectX::XMFLOAT4X4 *to_clip=nullptr)=0
 Renders the mesh using the shaders previously set. More...
 
- Public Member Functions inherited from dune::aabb< DirectX::XMFLOAT3 >
DirectX::XMFLOAT3 center () const
 Returns the center of the bounding-box.
 
DirectX::XMFLOAT3 bb_max () const
 Returns the maximum (upper/right/back) of the bounding-box.
 
DirectX::XMFLOAT3 bb_min () const
 Returns the minimum (lower/left/front) of the bounding-box.
 
virtual void set_world (const DirectX::XMFLOAT4X4 &world)
 Update the world matrix of this mesh.
 
const DirectX::XMFLOAT4X4 & world ()
 Returns the current world matrix of this mesh.
 

Protected Member Functions

virtual void push_back (vertex v)=0
 Push back a new vertex: this member needs to be overloaded in derived assimp_mesh objects.
 
- Protected Member Functions inherited from dune::aabb< DirectX::XMFLOAT3 >
void init_bb (const DirectX::XMFLOAT3 &p)
 Initialize the bounding-box with a first point. More...
 
void update_bb (const DirectX::XMFLOAT3 &p)
 Update the bounding-box with a new point. More...
 

Detailed Description

A d3d_mesh created with the help of Assimp.

This is the base interface class for a d3d_mesh loading a file via Assimp. When the model is loaded, each single vertex of the model is copied over into a vertex structure and then handed to a method push_back(). Because this method is virtual, derived classes from assimp_mesh may handle vertex data differently. For instance, a PRT loader may discard several vertex attributes which another loader might not. In any case, the push_back() method is responsible to put the vertex into a structure that will later be sent to the GPU.


The documentation for this class was generated from the following files: