# DXGfxLib.MeshRessource Class Reference

FrameworkMesh is very a very convenient class when you only want to load a Mesh. This class does a bit the same thing except that it does only what I want and I might extend it in the future. Still basically it does pretty much the same thing as FrameworkMesh at this stage. It loads mesh geometry and textures. Also most of the time you will ask the ressource manager to get a MeshRessource for you and it will only load it once. Refcounting for a ressource might be desirable and I might end doing something just like that. At this stage it is not done though. It is easy to do but I still have to decide if I really need a ressource manager in this library or not. More...

Collaboration diagram for DXGfxLib.MeshRessource:

[legend]

List of all members.

## Public Member Functions
| MeshRessource (string fileName)
| A constructor that will load everything from the provided file. This needs DXGfxManager to be initialized and to reference a valid D3D device.
| MeshRessource (Device d3ddevice, string fileName)
| Another constructor. That one does not need DXGfxManager to be initialized.
void | LoadFromFile (Device d3ddevice, string fileName)
| This method is used by both constructor to perform the work of loading the information from the .X file and then loading all the textures it might depends on.
virtual void | Draw (Device d3ddevice, int subsetId, bool setMeshMaterial)
| The Draw method!
virtual void | Draw (Device d3ddevice, int subsetId)
| Another Draw method.
virtual void | Draw (Device d3ddevice)
| Idem.
BBox | CalculateLocalBBox (Mesh meshToUse)
| This will calculate a local bounding box based on associated geometry.
Mesh | GetDXMesh ()
| This will return the copy of the Mesh we keep in system memory (that copy will remain there even if the D3D device is invalidated.
| MeshRessource (string fileName)
| A constructor that will load everything from the provided file. This needs DXGfxManager to be initialized and to reference a valid D3D device.
| MeshRessource (Device d3ddevice, string fileName)
| Another constructor. That one does not need DXGfxManager to be initialized.
void | LoadFromFile (Device d3ddevice, string fileName)
| This method is used by both constructor to perform the work of loading the information from the .X file and then loading all the textures it might depends on.
virtual void | Draw (Device d3ddevice, int subsetId, bool setMeshMaterial)
| The Draw method!
virtual void | Draw (Device d3ddevice, int subsetId)
| Another Draw method.
virtual void | Draw (Device d3ddevice)
| Idem.
BBox | CalculateLocalBBox (Mesh meshToUse)
| This will calculate a local bounding box based on associated geometry.
Mesh | GetDXMesh ()
| This will return the copy of the Mesh we keep in system memory (that copy will remain there even if the D3D device is invalidated.
## Public Attributes
Material[] | meshMaterials
| If we are given material we want to keep that information. It is used among other things for rendering!
Texture[] | meshTextures
| If we are given materials to render our mesh we will need to load the associated textures!
Effect[] | effects
| The effects that were referenced in the X file.
float | bSphereRadius = 1.0f
| A default radius for our bounding sphere.
Vector3 | barycenter = new Vector3()
| A default barycenter for our vertices.
BBox | localBoundingBox = new BBox()
| The bounding box of the geometry in the Mesh local coordinate space.
Vector3 | extents = new Vector3()
| Extends of the geomtry still in the mesh local coordinate space.
## Protected Attributes
Mesh | originalMesh = null
| We keep a mesh object associated with our Scene object!
Mesh | localMemMesh = null
| Yep this is the Mesh in local memory (default pool).
ExtendedMaterial[] | extendedMaterials
| The extended materials associated with our mesh. I keep that information because for exemple if you want to move a file it is interesting to move also the files it depends on!
EffectInstance[] | effectIntances
| Same as above but for effects.
GraphicsStream | adjacency = null

## Detailed Description

FrameworkMesh is very a very convenient class when you only want to load a Mesh. This class does a bit the same thing except that it does only what I want and I might extend it in the future. Still basically it does pretty much the same thing as FrameworkMesh at this stage. It loads mesh geometry and textures. Also most of the time you will ask the ressource manager to get a MeshRessource for you and it will only load it once. Refcounting for a ressource might be desirable and I might end doing something just like that. At this stage it is not done though. It is easy to do but I still have to decide if I really need a ressource manager in this library or not.

Definition at line 19 of file MeshRessource.cs.

## Constructor & Destructor Documentation

DXGfxLib.MeshRessource.MeshRessource | ( | string | fileName | ) |

A constructor that will load everything from the provided file. This needs DXGfxManager to be initialized and to reference a valid D3D device.

Parameters:

  | fileName |

Definition at line 95 of file MeshRessource.cs.

Here is the call graph for this function:

DXGfxLib.MeshRessource.MeshRessource | ( | Device | d3ddevice,
|  | string | fileName |
| ) |  |  |

Another constructor. That one does not need DXGfxManager to be initialized.

Parameters:

  | d3ddevice |
  | fileName |

Definition at line 109 of file MeshRessource.cs.

Here is the call graph for this function:

DXGfxLib.MeshRessource.MeshRessource | ( | string | fileName | ) |

A constructor that will load everything from the provided file. This needs DXGfxManager to be initialized and to reference a valid D3D device.

Parameters:

  | fileName |

Definition at line 95 of file MeshRessource.cs.

Here is the call graph for this function:

DXGfxLib.MeshRessource.MeshRessource | ( | Device | d3ddevice,
|  | string | fileName |
| ) |  |  |

Another constructor. That one does not need DXGfxManager to be initialized.

Parameters:

  | d3ddevice |
  | fileName |

Definition at line 109 of file MeshRessource.cs.

Here is the call graph for this function:

## Member Function Documentation

BBox DXGfxLib.MeshRessource.CalculateLocalBBox | ( | Mesh | meshToUse | ) |

This will calculate a local bounding box based on associated geometry.

Parameters:

  | meshToUse |

Returns:

Definition at line 213 of file MeshRessource.cs.

BBox DXGfxLib.MeshRessource.CalculateLocalBBox | ( | Mesh | meshToUse | ) |

This will calculate a local bounding box based on associated geometry.

Parameters:

  | meshToUse |

Returns:

Definition at line 213 of file MeshRessource.cs.

Here is the caller graph for this function:

virtual void DXGfxLib.MeshRessource.Draw | ( | Device | d3ddevice | ) | `[virtual]`

Idem.

Parameters:

  | d3ddevice |

Definition at line 200 of file MeshRessource.cs.

Here is the call graph for this function:

virtual void DXGfxLib.MeshRessource.Draw | ( | Device | d3ddevice,
|  | int | subsetId |
| ) |  |  | `[virtual]`

Another Draw method.

Parameters:

  | d3ddevice |
  | subsetId |

Definition at line 191 of file MeshRessource.cs.

Here is the call graph for this function:

virtual void DXGfxLib.MeshRessource.Draw | ( | Device | d3ddevice,
|  | int | subsetId,
|  | bool | setMeshMaterial |
| ) |  |  | `[virtual]`

The Draw method!

Parameters:

  | d3ddevice |
  | subsetId |
  | setMeshMaterial |

Definition at line 176 of file MeshRessource.cs.

virtual void DXGfxLib.MeshRessource.Draw | ( | Device | d3ddevice | ) | `[virtual]`

Idem.

Parameters:

  | d3ddevice |

Definition at line 200 of file MeshRessource.cs.

Here is the call graph for this function:

virtual void DXGfxLib.MeshRessource.Draw | ( | Device | d3ddevice,
|  | int | subsetId |
| ) |  |  | `[virtual]`

Another Draw method.

Parameters:

  | d3ddevice |
  | subsetId |

Definition at line 191 of file MeshRessource.cs.

Here is the call graph for this function:

virtual void DXGfxLib.MeshRessource.Draw | ( | Device | d3ddevice,
|  | int | subsetId,
|  | bool | setMeshMaterial |
| ) |  |  | `[virtual]`

The Draw method!

Parameters:

  | d3ddevice |
  | subsetId |
  | setMeshMaterial |

Definition at line 176 of file MeshRessource.cs.

Here is the caller graph for this function:

Mesh DXGfxLib.MeshRessource.GetDXMesh | ( |  | ) |

This will return the copy of the Mesh we keep in system memory (that copy will remain there even if the D3D device is invalidated.

Returns:

Definition at line 223 of file MeshRessource.cs.

Mesh DXGfxLib.MeshRessource.GetDXMesh | ( |  | ) |

This will return the copy of the Mesh we keep in system memory (that copy will remain there even if the D3D device is invalidated.

Returns:

Definition at line 223 of file MeshRessource.cs.

Here is the caller graph for this function:

void DXGfxLib.MeshRessource.LoadFromFile | ( | Device | d3ddevice,
|  | string | fileName |
| ) |  |  |

This method is used by both constructor to perform the work of loading the information from the .X file and then loading all the textures it might depends on.

Parameters:

  | d3ddevice |
  | fileName |

Definition at line 120 of file MeshRessource.cs.

Here is the call graph for this function:

void DXGfxLib.MeshRessource.LoadFromFile | ( | Device | d3ddevice,
|  | string | fileName |
| ) |  |  |

This method is used by both constructor to perform the work of loading the information from the .X file and then loading all the textures it might depends on.

Parameters:

  | d3ddevice |
  | fileName |

Definition at line 120 of file MeshRessource.cs.

Here is the call graph for this function:

Here is the caller graph for this function:

## Member Data Documentation

GraphicsStream DXGfxLib.MeshRessource::adjacency = null`[protected]`

Definition at line 52 of file MeshRessource.cs.

Vector3 DXGfxLib.MeshRessource::barycenter = new Vector3()

A default barycenter for our vertices.

Definition at line 78 of file MeshRessource.cs.

float DXGfxLib.MeshRessource::bSphereRadius = 1.0f

A default radius for our bounding sphere.

Definition at line 73 of file MeshRessource.cs.

EffectInstance [] DXGfxLib.MeshRessource.effectIntances`[protected]`

Same as above but for effects.

Definition at line 50 of file MeshRessource.cs.

Effect [] DXGfxLib.MeshRessource.effects

The effects that were referenced in the X file.

Definition at line 68 of file MeshRessource.cs.

ExtendedMaterial [] DXGfxLib.MeshRessource.extendedMaterials`[protected]`

The extended materials associated with our mesh. I keep that information because for exemple if you want to move a file it is interesting to move also the files it depends on!

Definition at line 45 of file MeshRessource.cs.

Vector3 DXGfxLib.MeshRessource::extents = new Vector3()

Extends of the geomtry still in the mesh local coordinate space.

Definition at line 88 of file MeshRessource.cs.

BBox DXGfxLib.MeshRessource::localBoundingBox = new BBox()

The bounding box of the geometry in the Mesh local coordinate space.

Definition at line 83 of file MeshRessource.cs.

Mesh DXGfxLib.MeshRessource::localMemMesh = null`[protected]`

Yep this is the Mesh in local memory (default pool).

Definition at line 39 of file MeshRessource.cs.

Material [] DXGfxLib.MeshRessource.meshMaterials

If we are given material we want to keep that information. It is used among other things for rendering!

Definition at line 58 of file MeshRessource.cs.

Texture [] DXGfxLib.MeshRessource.meshTextures

If we are given materials to render our mesh we will need to load the associated textures!

Definition at line 63 of file MeshRessource.cs.

Mesh DXGfxLib.MeshRessource::originalMesh = null`[protected]`

We keep a mesh object associated with our Scene object!

Definition at line 34 of file MeshRessource.cs.

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

- D:/guillaume/guillara/3D/DXGfx/Backup/DXGfxLib/MeshRessource.cs
- D:/guillaume/guillara/3D/DXGfx/DXGfxLib/MeshRessource.cs