#include <assimprenderer.h>
Public Member Functions | |
AssetHelper * | LoadAssetFromFile (aiString filename) |
Creates an AssetHelper object from a file that has been created using SaveAssetToFile(). | |
int | SaveAssetToFile (const AssetHelper &asset, aiString filename) |
Serializes the given AssetHelper to a file with the given filename. | |
LPDIRECT3DDEVICE9 | CreateD3dDevice (LPDIRECT3D9 d3d, D3DPRESENT_PARAMETERS *d3dpp, const RenderOptions &renderOptions) |
Have the AssimpRenderer create your Direct3D Device object. | |
void | RenderAsset (const AssetHelper &assetHelper, aiMatrix4x4 argMatrix) |
Renders an Asset. | |
void | RenderAsset (const AssetHelper &assetHelper, const aiVector3D &vPos, const aiVector3D &vRot, const aiVector3D &vScale) |
Renders an Asset. | |
void | SetCamera (const Camera &sourceCamera) |
int | AttachLogStream (Assimp::LogStream *logstr, unsigned int severity) |
Attaches a LogStream for receiving logging information from the AssimpRenderer. | |
int | DetachLogStream (Assimp::LogStream *logstr, unsigned int severity) |
Static Public Member Functions | |
static AssimpRenderer * | Instance () |
static AssetHelper * | ImportAsset (const char *pFile, unsigned int aiImportFlags) |
Imports the Asset file with the given filename. | |
static AssetHelper * | ImportAsset (const char *pFile, unsigned int aiImportFlags, const D3DXMATRIX &matTransform) |
Imports the Asset file with the given filename. | |
static D3DXMATRIX | CreateTransformMatrix (float rotX, float rotY, float rotZ, float scaleFactor) |
Creates a transformation matrix for rotating and scaling an Asset upon import. | |
Friends | |
class | AssetHelper |
class | CMaterialManager |
class | CMeshRenderer |
int AssimpRendererD3d::AssimpRenderer::AttachLogStream | ( | Assimp::LogStream * | logstr, | |
unsigned int | severity | |||
) |
Attaches a LogStream for receiving logging information from the AssimpRenderer.
Assimp comes with a DefaultLogger class for receiving debug information from the Assimp library. Party of this mechanism is the LogStream interface, where you can attach your own functionality for handling debug information. If you already implemented this interface, you can pass the same instance of your implementation to AssimpRenderer::AttachLogStream(), and have the debug info from AssimpRenderer handled the same way.
logstr | your implementation of the LogStream interface that comes with Assimp | |
severity | the known flags from Logger class ORed together: Logger::DEBUGGING, Logger::INFO, Logger::WARN, Logger::ERR; |
LPDIRECT3DDEVICE9 AssimpRendererD3d::AssimpRenderer::CreateD3dDevice | ( | LPDIRECT3D9 | d3d, | |
D3DPRESENT_PARAMETERS * | d3dpp, | |||
const RenderOptions & | renderOptions | |||
) |
Have the AssimpRenderer create your Direct3D Device object.
The AssimpRenderer Instance will use the this D3d Device for every rendering operation. In this version it's not yet possible to create the d3ddevice object somewhere else and have it passed to the AssimpRenderer. Therefore it's mandatory to call this method before you can use the AssimpRenderer.
d3d | pointer to your IDirect3D9 Interface | |
d3dpp | Direct3D Presentation parameters for the Direct3D Device to be created. The object will be altered within the call. Make sure to set the following values:
| |
gameWindow | the structure containing the screen dimensions and a window handle | |
renderOptions | the global rendering settings for all Assets |
D3DXMATRIX AssimpRendererD3d::AssimpRenderer::CreateTransformMatrix | ( | float | rotX, | |
float | rotY, | |||
float | rotZ, | |||
float | scaleFactor | |||
) | [static] |
Creates a transformation matrix for rotating and scaling an Asset upon import.
Sometimes it may be necessary to rotate an Asset to a certain direction to match your game logic. To do Pass the returned D3DXMATRIX to ImportAsset(), if you Method: CreateTransformMatrix FullName: AssimpRendererD3d::AssimpRenderer::CreateTransformMatrix Access: public Returns: D3DXMATRIX Qualifier:
rotX | rotate each vertex by this angle (degree) | |
rotY | rotate each vertex by this angle (degree) | |
rotZ | rotate each vertex by this angle (degree) | |
scaleFactor,: | have each vertex multiplied by this value to scale the Asset. |
AssetHelper * AssimpRendererD3d::AssimpRenderer::ImportAsset | ( | const char * | pFile, | |
unsigned int | aiProcessFlags, | |||
const D3DXMATRIX & | matTransform | |||
) | [static] |
Imports the Asset file with the given filename.
This method creates a new AssetHelper object and returns a pointer to it. The caller is responsible to release the object.
pFile | ||
aiProcessFlags | - aiProcess flags ORed together. Please have a look at the Assimp documentation for the list of aiProcess flags. | |
matTransform | - pass a transformation matrix to have each vertex transformed upon import. Use AssimpRenderer::CreateTransformationMatrix() for this. |
AssetHelper * AssimpRendererD3d::AssimpRenderer::ImportAsset | ( | const char * | pFile, | |
unsigned int | aiProcessFlags | |||
) | [static] |
Imports the Asset file with the given filename.
This method creates a new AssetHelper object and returns a pointer to it. The caller is responsible to release the object. //
pFile | ||
aiProcessFlags | - aiProcess flags ORed together. Please have a look at the Assimp documentation for the list of aiProcess flags. |
AssimpRenderer * AssimpRendererD3d::AssimpRenderer::Instance | ( | ) | [static] |
Returns the AssimpRenderer Instance (Singleton)
AssetHelper * AssimpRendererD3d::AssimpRenderer::LoadAssetFromFile | ( | aiString | filename | ) |
Creates an AssetHelper object from a file that has been created using SaveAssetToFile().
filename | path of the file to load |
void AssimpRendererD3d::AssimpRenderer::RenderAsset | ( | const AssetHelper & | assetHelper, | |
const aiVector3D & | vPos, | |||
const aiVector3D & | vRot, | |||
const aiVector3D & | vScale | |||
) |
Renders an Asset.
This method signature provides aiVector parameters for rendering the Asset at the given position, with a given rotation and scaling.
vPos | the position | |
vRot | the rotation in degrees | |
vScale | the scaling factors for each axis |
void AssimpRendererD3d::AssimpRenderer::RenderAsset | ( | const AssetHelper & | assetHelper, | |
aiMatrix4x4 | matTranspose | |||
) |
Renders an Asset.
This method renders an Asset using the given transpose matrix.
matTranspose | a matrix containing the scale, translation and rotation values for transposing the asset to world coordinates. |
int AssimpRendererD3d::AssimpRenderer::SaveAssetToFile | ( | const AssetHelper & | asset, | |
aiString | filename | |||
) |
Serializes the given AssetHelper to a file with the given filename.
asset | the asset to store | |
aiString | path of the file to create / replace |
void AssimpRendererD3d::AssimpRenderer::SetCamera | ( | const Camera & | sourceCamera | ) |
Sets the AssimpRenderer's position of the Camera.