# DXGfxLib.MeshObject Class Reference

Inherits DXGfxLib::SceneObject, and DXGfxLib::SceneObject.

Inherited by DXGfxLib.Area, DXGfxLib.Area, DXGfxLib.ArticulatedModel, DXGfxLib.ArticulatedModel, DXGfxLib.Cursor, DXGfxLib.Cursor, DXGfxLib.MeshObjectWithLOD, DXGfxLib.MeshObjectWithLOD, DXGfxLib.ObjectFromMeshRessource, DXGfxLib.ObjectFromMeshRessource, DXGfxLib.ObjectFromObj, DXGfxLib.ObjectFromObj, DXGfxLib.SkyBox, DXGfxLib.SkyBox, DXGfxLib.SkyDome, DXGfxLib.SkyDome, DXGfxLib.TerrainTile, DXGfxLib.TerrainTile, DXGfxLib.TexturedPlane, and DXGfxLib.TexturedPlane.

Collaboration diagram for DXGfxLib.MeshObject:

[legend]

List of all members.

## Public Member Functions
| MeshObject ()
| Default constructor. Don't do anything.
override void | Initialize ()
| MeshObject (string fileName)
| Ok this constructor does also load the specified file, using the current device that DXGfxManager should have information on.
| MeshObject (Device d3ddevice, string fileName)
| This one also.
override void | GetPrepared ()
| For a Mesh object, when we are required to get prepared in fact we are going to load any DXResource needed to render.
override void | LoadFromFile (Device d3ddevice, string fileName)
| For loading a scene from the XML file this method is pretty useful as we just get the filename from the file, create an instance of the desired type and instruct that instance to populate its internal state from the specified file.
MeshObject | Clone ()
| I am not sure why I added this so be carefull.
virtual void | Attach (Mesh mesh)
| This method is used to associate a FrameworkMesh instance to the SceneObject.
override void | Draw (Device device)
| In its draw method the scene will call the Draw method on all scene object (or derived class instances) that have registered to be rendered in the AttachForRendering method.
virtual void | DrawSubset (int index)
| This might be interesting if derived class want to set the device state in a specif way and just used the base MeshObject to perform the DrawSubset. Instead of a DrawSubset call on the full mesh this method will perform the DrawSubset on the right progressive mesh if possible.
override bool | Intersect (Vector3 rayPos, Vector3 rayDir, out IntersectInformation closestHit)
| This method can be used to decide whether a ray intersect with the scene object or not. RayPos and RayDir have to be given in world space coordinates. They will be transform to local coordinates to perform the testing by the the method itself. This method return IntersectInformation on the closest hit to the RayPos.
override bool | Intersect (Vector3 rayOri, Vector3 rayDir, ref List< SceneObject > collidingSceneObjects)
| This method is somehow similar to the previous one except that instead of returning the closest hit information it does return a list of colliding objects.
override bool | Intersect (Vector3 rayOri, Vector3 rayDir, ref List< SceneObject > collidingSceneObjects, System.Type desiredType)
| This method is somehow similar to the previous one except that you can specify here the desired type of the scene objects you will get back in the list of objects colliding with the ray.
| MeshObject ()
| Default constructor. Don't do anything.
override void | Initialize ()
| MeshObject (string fileName)
| Ok this constructor does also load the specified file, using the current device that DXGfxManager should have information on.
| MeshObject (Device d3ddevice, string fileName)
| This one also.
override void | GetPrepared ()
| For a Mesh object, when we are required to get prepared in fact we are going to load any DXResource needed to render.
override void | LoadFromFile (Device d3ddevice, string fileName)
| For loading a scene from the XML file this method is pretty useful as we just get the filename from the file, create an instance of the desired type and instruct that instance to populate its internal state from the specified file.
MeshObject | Clone ()
| I am not sure why I added this so be carefull.
virtual void | Attach (Mesh mesh)
| This method is used to associate a FrameworkMesh instance to the SceneObject.
override void | Draw (Device device)
| In its draw method the scene will call the Draw method on all scene object (or derived class instances) that have registered to be rendered in the AttachForRendering method.
virtual void | DrawSubset (int index)
| This might be interesting if derived class want to set the device state in a specif way and just used the base MeshObject to perform the DrawSubset. Instead of a DrawSubset call on the full mesh this method will perform the DrawSubset on the right progressive mesh if possible.
override bool | Intersect (Vector3 rayPos, Vector3 rayDir, out IntersectInformation closestHit)
| This method can be used to decide whether a ray intersect with the scene object or not. RayPos and RayDir have to be given in world space coordinates. They will be transform to local coordinates to perform the testing by the the method itself. This method return IntersectInformation on the closest hit to the RayPos.
override bool | Intersect (Vector3 rayOri, Vector3 rayDir, ref List< SceneObject > collidingSceneObjects)
| This method is somehow similar to the previous one except that instead of returning the closest hit information it does return a list of colliding objects.
override bool | Intersect (Vector3 rayOri, Vector3 rayDir, ref List< SceneObject > collidingSceneObjects, System.Type desiredType)
| This method is somehow similar to the previous one except that you can specify here the desired type of the scene objects you will get back in the list of objects colliding with the ray.
## Public Attributes
Vector3 | barycenter = new Vector3()
| Barycenter of our vertices.
float | bSphereRadius
| Radius of the bounding sphere in case we need it.
float | objectRadius = 0.0f
| We also want to keep this information around.
Vector3 | objectCenter
| We also want to keep this information around.
## Protected Attributes
Mesh | originalMesh = null
| We keep a mesh object associated with our Scene object!
ExtendedMaterial[] | extendedMaterials
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!
EffectInstance[] | effects
| Same as for adjacencyBugger and materials if we are given effects we want to keep them.

## Detailed Description

Definition at line 27 of file MeshObject.cs.

## Constructor & Destructor Documentation

DXGfxLib.MeshObject.MeshObject | ( |  | ) |

Default constructor. Don't do anything.

Definition at line 75 of file MeshObject.cs.

Here is the call graph for this function:

Here is the caller graph for this function:

DXGfxLib.MeshObject.MeshObject | ( | string | fileName | ) |

Ok this constructor does also load the specified file, using the current device that DXGfxManager should have information on.

Parameters:

  | fileName |

Definition at line 89 of file MeshObject.cs.

Here is the call graph for this function:

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

This one also.

Parameters:

  | d3ddevice |
  | fileName |

Definition at line 103 of file MeshObject.cs.

Here is the call graph for this function:

DXGfxLib.MeshObject.MeshObject | ( |  | ) |

Default constructor. Don't do anything.

Definition at line 75 of file MeshObject.cs.

Here is the call graph for this function:

DXGfxLib.MeshObject.MeshObject | ( | string | fileName | ) |

Ok this constructor does also load the specified file, using the current device that DXGfxManager should have information on.

Parameters:

  | fileName |

Definition at line 89 of file MeshObject.cs.

Here is the call graph for this function:

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

This one also.

Parameters:

  | d3ddevice |
  | fileName |

Definition at line 103 of file MeshObject.cs.

Here is the call graph for this function:

## Member Function Documentation

virtual void DXGfxLib.MeshObject.Attach | ( | Mesh | mesh | ) | `[virtual]`

This method is used to associate a FrameworkMesh instance to the SceneObject.

Parameters:

  | meshToAttach |

Definition at line 204 of file MeshObject.cs.

Here is the call graph for this function:

virtual void DXGfxLib.MeshObject.Attach | ( | Mesh | mesh | ) | `[virtual]`

This method is used to associate a FrameworkMesh instance to the SceneObject.

Parameters:

  | meshToAttach |

Definition at line 204 of file MeshObject.cs.

Here is the call graph for this function:

Here is the caller graph for this function:

MeshObject DXGfxLib.MeshObject.Clone | ( |  | ) |

I am not sure why I added this so be carefull.

Returns:

Definition at line 181 of file MeshObject.cs.

Here is the call graph for this function:

MeshObject DXGfxLib.MeshObject.Clone | ( |  | ) |

I am not sure why I added this so be carefull.

Returns:

Definition at line 181 of file MeshObject.cs.

Here is the call graph for this function:

override void DXGfxLib.MeshObject.Draw | ( | Device | device | ) | `[virtual]`

In its draw method the scene will call the Draw method on all scene object (or derived class instances) that have registered to be rendered in the AttachForRendering method.

Parameters:

  | device |

Reimplemented from DXGfxLib.SceneObject.

Reimplemented in DXGfxLib.ArticulatedModel, DXGfxLib.Billboard, DXGfxLib.Cursor, DXGfxLib.FrameworkMeshObject, DXGfxLib.MeshObjectWithLOD, DXGfxLib.ObjectFromMeshRessource, DXGfxLib.ObjectFromObj, DXGfxLib.SkyBox, DXGfxLib.TerrainTile, DXGfxLib.TexturedPlane, DXGfxLib.Water, DXGfxLib.ArticulatedModel, DXGfxLib.Billboard, DXGfxLib.Cursor, DXGfxLib.FrameworkMeshObject, DXGfxLib.MeshObjectWithLOD, DXGfxLib.ObjectFromMeshRessource, DXGfxLib.ObjectFromObj, DXGfxLib.SkyBox, DXGfxLib.TerrainTile, DXGfxLib.TexturedPlane, and DXGfxLib.Water.

Definition at line 234 of file MeshObject.cs.

override void DXGfxLib.MeshObject.Draw | ( | Device | device | ) | `[virtual]`

In its draw method the scene will call the Draw method on all scene object (or derived class instances) that have registered to be rendered in the AttachForRendering method.

Parameters:

  | device |

Reimplemented from DXGfxLib.SceneObject.

Reimplemented in DXGfxLib.ArticulatedModel, DXGfxLib.Billboard, DXGfxLib.Cursor, DXGfxLib.FrameworkMeshObject, DXGfxLib.MeshObjectWithLOD, DXGfxLib.ObjectFromMeshRessource, DXGfxLib.ObjectFromObj, DXGfxLib.SkyBox, DXGfxLib.TerrainTile, DXGfxLib.TexturedPlane, DXGfxLib.Water, DXGfxLib.ArticulatedModel, DXGfxLib.Billboard, DXGfxLib.Cursor, DXGfxLib.FrameworkMeshObject, DXGfxLib.MeshObjectWithLOD, DXGfxLib.ObjectFromMeshRessource, DXGfxLib.ObjectFromObj, DXGfxLib.SkyBox, DXGfxLib.TerrainTile, DXGfxLib.TexturedPlane, and DXGfxLib.Water.

Definition at line 234 of file MeshObject.cs.

virtual void DXGfxLib.MeshObject.DrawSubset | ( | int | index | ) | `[virtual]`

This might be interesting if derived class want to set the device state in a specif way and just used the base MeshObject to perform the DrawSubset. Instead of a DrawSubset call on the full mesh this method will perform the DrawSubset on the right progressive mesh if possible.

Parameters:

  | index |

Reimplemented in DXGfxLib.MeshObjectWithLOD, and DXGfxLib.MeshObjectWithLOD.

Definition at line 255 of file MeshObject.cs.

virtual void DXGfxLib.MeshObject.DrawSubset | ( | int | index | ) | `[virtual]`

This might be interesting if derived class want to set the device state in a specif way and just used the base MeshObject to perform the DrawSubset. Instead of a DrawSubset call on the full mesh this method will perform the DrawSubset on the right progressive mesh if possible.

Parameters:

  | index |

Reimplemented in DXGfxLib.MeshObjectWithLOD, and DXGfxLib.MeshObjectWithLOD.

Definition at line 255 of file MeshObject.cs.

override void DXGfxLib.MeshObject.GetPrepared | ( |  | ) | `[virtual]`

For a Mesh object, when we are required to get prepared in fact we are going to load any DXResource needed to render.

Reimplemented from DXGfxLib.SceneNode.

Reimplemented in DXGfxLib.Cursor, DXGfxLib.SkyDome, DXGfxLib.Cursor, and DXGfxLib.SkyDome.

Definition at line 111 of file MeshObject.cs.

Here is the call graph for this function:

override void DXGfxLib.MeshObject.GetPrepared | ( |  | ) | `[virtual]`

For a Mesh object, when we are required to get prepared in fact we are going to load any DXResource needed to render.

Reimplemented from DXGfxLib.SceneNode.

Reimplemented in DXGfxLib.Cursor, DXGfxLib.SkyDome, DXGfxLib.Cursor, and DXGfxLib.SkyDome.

Definition at line 111 of file MeshObject.cs.

Here is the call graph for this function:

override void DXGfxLib.MeshObject.Initialize | ( |  | ) | `[virtual]`

Reimplemented from DXGfxLib.SceneObject.

Reimplemented in DXGfxLib.SkyDome, and DXGfxLib.SkyDome.

Definition at line 80 of file MeshObject.cs.

override void DXGfxLib.MeshObject.Initialize | ( |  | ) | `[virtual]`

Reimplemented from DXGfxLib.SceneObject.

Reimplemented in DXGfxLib.SkyDome, and DXGfxLib.SkyDome.

Definition at line 80 of file MeshObject.cs.

Here is the caller graph for this function:

override bool DXGfxLib.MeshObject.Intersect | ( | Vector3 | rayOri,
|  | Vector3 | rayDir,
|  | ref List< SceneObject > | collidingSceneObjects,
|  | System.Type | desiredType |
| ) |  |  | `[virtual]`

This method is somehow similar to the previous one except that you can specify here the desired type of the scene objects you will get back in the list of objects colliding with the ray.

Parameters:

  | rayOri |
  | rayDir |
  | collidingSceneObjects |
  | desiredType |

Returns:

Reimplemented from DXGfxLib.SceneObject.

Definition at line 353 of file MeshObject.cs.

Here is the call graph for this function:

override bool DXGfxLib.MeshObject.Intersect | ( | Vector3 | rayOri,
|  | Vector3 | rayDir,
|  | ref List< SceneObject > | collidingSceneObjects |
| ) |  |  | `[virtual]`

This method is somehow similar to the previous one except that instead of returning the closest hit information it does return a list of colliding objects.

Parameters:

  | rayOri |
  | rayDir |
  | collidingSceneObjects |

Returns:

Reimplemented from DXGfxLib.SceneObject.

Definition at line 296 of file MeshObject.cs.

Here is the call graph for this function:

override bool DXGfxLib.MeshObject.Intersect | ( | Vector3 | rayPos,
|  | Vector3 | rayDir,
|  | out IntersectInformation | closestHit |
| ) |  |  | `[virtual]`

This method can be used to decide whether a ray intersect with the scene object or not. RayPos and RayDir have to be given in world space coordinates. They will be transform to local coordinates to perform the testing by the the method itself. This method return IntersectInformation on the closest hit to the RayPos.

Parameters:

  | rayPos |
  | rayDir |
  | closestHit |

Returns:

Reimplemented from DXGfxLib.SceneObject.

Reimplemented in DXGfxLib.TerrainTile, and DXGfxLib.TerrainTile.

Definition at line 269 of file MeshObject.cs.

override bool DXGfxLib.MeshObject.Intersect | ( | Vector3 | rayOri,
|  | Vector3 | rayDir,
|  | ref List< SceneObject > | collidingSceneObjects,
|  | System.Type | desiredType |
| ) |  |  | `[virtual]`

This method is somehow similar to the previous one except that you can specify here the desired type of the scene objects you will get back in the list of objects colliding with the ray.

Parameters:

  | rayOri |
  | rayDir |
  | collidingSceneObjects |
  | desiredType |

Returns:

Reimplemented from DXGfxLib.SceneObject.

Definition at line 353 of file MeshObject.cs.

Here is the call graph for this function:

override bool DXGfxLib.MeshObject.Intersect | ( | Vector3 | rayOri,
|  | Vector3 | rayDir,
|  | ref List< SceneObject > | collidingSceneObjects |
| ) |  |  | `[virtual]`

This method is somehow similar to the previous one except that instead of returning the closest hit information it does return a list of colliding objects.

Parameters:

  | rayOri |
  | rayDir |
  | collidingSceneObjects |

Returns:

Reimplemented from DXGfxLib.SceneObject.

Definition at line 296 of file MeshObject.cs.

Here is the call graph for this function:

override bool DXGfxLib.MeshObject.Intersect | ( | Vector3 | rayPos,
|  | Vector3 | rayDir,
|  | out IntersectInformation | closestHit |
| ) |  |  | `[virtual]`

This method can be used to decide whether a ray intersect with the scene object or not. RayPos and RayDir have to be given in world space coordinates. They will be transform to local coordinates to perform the testing by the the method itself. This method return IntersectInformation on the closest hit to the RayPos.

Parameters:

  | rayPos |
  | rayDir |
  | closestHit |

Returns:

Reimplemented from DXGfxLib.SceneObject.

Reimplemented in DXGfxLib.TerrainTile, and DXGfxLib.TerrainTile.

Definition at line 269 of file MeshObject.cs.

override void DXGfxLib.MeshObject.LoadFromFile | ( | Device | d3ddevice,
|  | string | fileName |
| ) |  |  | `[virtual]`

For loading a scene from the XML file this method is pretty useful as we just get the filename from the file, create an instance of the desired type and instruct that instance to populate its internal state from the specified file.

Parameters:

  | d3ddevice |
  | fileName |

Reimplemented from DXGfxLib.SceneObject.

Reimplemented in DXGfxLib.ArticulatedModel, DXGfxLib.Cursor, DXGfxLib.SkyBox, DXGfxLib.SkyDome, DXGfxLib.Water, DXGfxLib.ArticulatedModel, DXGfxLib.Cursor, DXGfxLib.SkyBox, DXGfxLib.SkyDome, and DXGfxLib.Water.

Definition at line 130 of file MeshObject.cs.

Here is the call graph for this function:

override void DXGfxLib.MeshObject.LoadFromFile | ( | Device | d3ddevice,
|  | string | fileName |
| ) |  |  | `[virtual]`

For loading a scene from the XML file this method is pretty useful as we just get the filename from the file, create an instance of the desired type and instruct that instance to populate its internal state from the specified file.

Parameters:

  | d3ddevice |
  | fileName |

Reimplemented from DXGfxLib.SceneObject.

Reimplemented in DXGfxLib.ArticulatedModel, DXGfxLib.Cursor, DXGfxLib.SkyBox, DXGfxLib.SkyDome, DXGfxLib.Water, DXGfxLib.ArticulatedModel, DXGfxLib.Cursor, DXGfxLib.SkyBox, DXGfxLib.SkyDome, and DXGfxLib.Water.

Definition at line 130 of file MeshObject.cs.

Here is the call graph for this function:

Here is the caller graph for this function:

## Member Data Documentation

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

Barycenter of our vertices.

Definition at line 32 of file MeshObject.cs.

float DXGfxLib.MeshObject::bSphereRadius

Radius of the bounding sphere in case we need it.

Definition at line 37 of file MeshObject.cs.

EffectInstance [] DXGfxLib.MeshObject.effects`[protected]`

Same as for adjacencyBugger and materials if we are given effects we want to keep them.

Definition at line 60 of file MeshObject.cs.

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

Definition at line 44 of file MeshObject.cs.

Material [] DXGfxLib.MeshObject.meshMaterials`[protected]`

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

Definition at line 50 of file MeshObject.cs.

Texture [] DXGfxLib.MeshObject.meshTextures`[protected]`

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

Definition at line 55 of file MeshObject.cs.

Vector3 DXGfxLib.MeshObject::objectCenter

We also want to keep this information around.

Definition at line 70 of file MeshObject.cs.

float DXGfxLib.MeshObject::objectRadius = 0.0f

We also want to keep this information around.

Definition at line 65 of file MeshObject.cs.

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

We keep a mesh object associated with our Scene object!

Definition at line 42 of file MeshObject.cs.

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

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