#include <Mesh.h>
Public Member Functions | |
Mesh (LPCWSTR fileName, LPCWSTR texFileName, float preferredDiameter, D3DXVECTOR3 position) | |
~Mesh () | |
Destructor. Deletes dynamically created resources. | |
void | Load (LPCWSTR fileName) |
LOADS THE SPECIFIED .X FILE Eliminates mesh offset (centers the mesh to the origin) and determines mesh size (originalSize, originalDiameter). | |
void | Move (D3DXVECTOR3 offset, bool bContainerOnly=false) |
HRESULT | Draw () |
Draws the mesh. Before drawing, use GetMeshScale() to get the appropriate scaling factor. | |
D3DXVECTOR3 | GetMeshSize () |
current mesh size | |
float | GetMeshScale () |
current mesh scale | |
D3DXVECTOR3 | GetMeshPosition () |
current mesh position | |
IDirect3DTexture9 * | GetTexture () |
mesh texture | |
void | SetContainerSize (D3DXVECTOR3 size) |
Sets the size of the encapsulating room. | |
void | SetMeshPosition (D3DXVECTOR3 pos) |
Sets mesh position. | |
void | SetPreferredDiameter (float d) |
Sets preferred mesh size (diameter). | |
Protected Member Functions | |
HRESULT | CalculateMeshSize () |
Calculates mesh size and updates originalSize and originalDiameter. | |
Private Attributes | |
ID3DXMesh * | pMesh |
THE .X MESH OBJECT. | |
IDirect3DTexture9 * | pMeshTexture |
DWORD | numMaterials |
D3DXVECTOR3 | originalSize |
float | originalDiameter |
float | preferredDiameter |
D3DXVECTOR3 | containerSize |
HRESULT | hr |
D3DXVECTOR3 | position |
|
Loads the specified .X file
|
|
Destructor. Deletes dynamically created resources.
|
|
Calculates mesh size and updates originalSize and originalDiameter.
|
|
Draws the mesh. Before drawing, use GetMeshScale() to get the appropriate scaling factor.
|
|
current mesh position
|
|
current mesh scale
|
|
current mesh size
|
|
mesh texture
|
|
LOADS THE SPECIFIED .X FILE Eliminates mesh offset (centers the mesh to the origin) and determines mesh size (originalSize, originalDiameter).
|
|
Adds the specified offset to the mesh position.
|
|
Sets the size of the encapsulating room.
|
|
Sets mesh position.
|
|
Sets preferred mesh size (diameter).
|
|
|
|
|
|
|
|
|
|
|
|
THE .X MESH OBJECT.
|
|
|
|
|
|
|