Public Member Functions | |
| Terrain () | |
| Terrain (float desiredWidth, float desiredHeigth) | |
| Default constructor for Terrain. After that you won't have much until you effectively load a bitmap to really build the terrain. | |
| void | Initialize () |
| void | Initialize (float desiredWidth, float desiredHeigth) |
| void | DeviceChanged (Device d3ddevice, OutDoorScene scene) |
| If your device has changed you need to call this one. | |
| void | Load (Device d3ddevice, OutDoorScene scene, string ressourceName) |
| This method is the most CPU intensive method of this class. It will use the bitmap to generate the terrain tiles geometry. Also each newly generated tile is going to be attached to the provided Outdoorscene. With our base implementation of Ourdoorscene this means that position in the quadtree will be determine for each newly created tile. | |
| void | LoadFromFile (Device d3ddevice, OutDoorScene scene, string fileName) |
| Load the terrain from a bitmap image used as an heigthmap. In Eter 3D Control the Terrain class will then load two texture grass.bmp and snow.bmp as well as an alphamap lightmap.dds and used those to texture the terrain. As in your specific situation I expect that your textured might be named differently, you should consider using the other load method. The lightmap.dds is used only for alpha value to know where on the terrain the snow texture should be applied. The grass texture is applied everywhere. | |
| void | Load (Device d3ddevice, OutDoorScene scene, string fileName, string baseTextureFile, string secondTextureFile) |
| Load the terrain from the bitmap in the filename file. base texture will be loaded then and applied everywhere. Then the secondtexture will also be tiled on the terrain geometry based on the alpha information in the alphamap dds file. As far as I am concerned I made up the dds file with the texture tool in the directx sdk. | |
| float | GetHeigth (OutDoorScene scene, float x, float z) |
| This method return the heigth of the terrain at the specified x and z coordinate. Remember that the z coordinate is going far away with directx default convention. The y is pointing up. | |
| float | GetHeigth (OutDoorScene scene, float x, float y, float z) |
| This method return the heigth of the terrain at the specified x and z coordinate and below the y value provided. In DX the ray intersection with a mesh is sensible to the distance between the point from which the ray is cast and the mesh here using an y value allow us to have a better precision than by cast the ray from a very high point in the sky :). This will also be consistant with a world getheigth that would be able to deal with houses with several level. | |
| float | GetHeigth (OutDoorScene scene, Vector3 underPoint) |
| Get the heigth of the tile under the point given in parameter. If the point is under the terrain level at that x and z 65536 is returned. | |
| void | AddInstances (OutDoorScene scene, FrameworkMesh mesh, InstanceInfo[] instancesInfo) |
| Terrain () | |
| Terrain (float desiredWidth, float desiredHeigth) | |
| Default constructor for Terrain. After that you won't have much until you effectively load a bitmap to really build the terrain. | |
| void | Initialize () |
| void | Initialize (float desiredWidth, float desiredHeigth) |
| void | DeviceChanged (Device d3ddevice, OutDoorScene scene) |
| If your device has changed you need to call this one. | |
| void | Load (Device d3ddevice, OutDoorScene scene, string ressourceName) |
| This method is the most CPU intensive method of this class. It will use the bitmap to generate the terrain tiles geometry. Also each newly generated tile is going to be attached to the provided Outdoorscene. With our base implementation of Ourdoorscene this means that position in the quadtree will be determine for each newly created tile. | |
| void | LoadFromFile (Device d3ddevice, OutDoorScene scene, string fileName) |
| Load the terrain from a bitmap image used as an heigthmap. In Eter 3D Control the Terrain class will then load two texture grass.bmp and snow.bmp as well as an alphamap lightmap.dds and used those to texture the terrain. As in your specific situation I expect that your textured might be named differently, you should consider using the other load method. The lightmap.dds is used only for alpha value to know where on the terrain the snow texture should be applied. The grass texture is applied everywhere. | |
| void | Load (Device d3ddevice, OutDoorScene scene, string fileName, string baseTextureFile, string secondTextureFile) |
| Load the terrain from the bitmap in the filename file. base texture will be loaded then and applied everywhere. Then the secondtexture will also be tiled on the terrain geometry based on the alpha information in the alphamap dds file. As far as I am concerned I made up the dds file with the texture tool in the directx sdk. | |
| float | GetHeigth (OutDoorScene scene, float x, float z) |
| This method return the heigth of the terrain at the specified x and z coordinate. Remember that the z coordinate is going far away with directx default convention. The y is pointing up. | |
| float | GetHeigth (OutDoorScene scene, float x, float y, float z) |
| This method return the heigth of the terrain at the specified x and z coordinate and below the y value provided. In DX the ray intersection with a mesh is sensible to the distance between the point from which the ray is cast and the mesh here using an y value allow us to have a better precision than by cast the ray from a very high point in the sky :). This will also be consistant with a world getheigth that would be able to deal with houses with several level. | |
| float | GetHeigth (OutDoorScene scene, Vector3 underPoint) |
| Get the heigth of the tile under the point given in parameter. If the point is under the terrain level at that x and z 65536 is returned. | |
| void | AddInstances (OutDoorScene scene, FrameworkMesh mesh, InstanceInfo[] instancesInfo) |
Public Attributes | |
| Texture | texture = null |
| Our terrain is going to use a default texture. | |
| Material | material |
| It is also going to use a default material. | |
| string | heightmapFile |
| For some obscure reason we want to keep the filename of the bitmap used to build the terrain. | |
| string | baseTextureFile |
| The filename of the 'default' texture. | |
| string | secondTextureFile |
| Filename of a second texture that will be rendered only on the areas specified through the alphamap. | |
| float | maxTerrainHeigth |
| Out Terrain has a maximum heigth. | |
| float | minTerrainHeigth |
| A minimal height. | |
| float | secondTexHeigth |
| Not used. :). | |
| Texture | secondTexture = null |
| The second texture texture. Will be used for areas specified through the alphaMap texture. | |
| Texture | alphaMap = null |
| Used to specify where the secondTexture should be used. | |
| float | desiredWidth |
| We certainly want our terrain to have a specific width. This can be specified upon terrain creation and we keep the value in this member variable. | |
| float | desiredHeigth |
| We certainly want our terrain to have a specific heigth. This can be specified upon terrain creation and we keep the value in this member variable. | |
| int | width |
| Number of tiles along X. | |
| int | heigth |
| Number of tiles along Z (remember Z is looking far away, y is up and x is looking to the right). | |
| float | xSpacing |
| Dimension of a tile along x axis. | |
| float | zSpacing |
| Dimension of a tile along z axis. | |
| float | stretchFactor |
Static Public Attributes | |
| static string | terrainEffectFile = "terrainTile.fx" |
| The effect file used for Terrain2 tiles. We load it once in the Terrain2 class and we pass a reference to the newly created effectGroup to all Terrain2 tiles. | |
Definition at line 39 of file Terrain.cs.
| DXGfxLib.Terrain.Terrain | ( | ) |
| DXGfxLib.Terrain.Terrain | ( | float | desiredWidth, | |
| float | desiredHeigth | |||
| ) |
Default constructor for Terrain. After that you won't have much until you effectively load a bitmap to really build the terrain.
| desiredWidth | ||
| desiredHeigth |
Definition at line 155 of file Terrain.cs.

| DXGfxLib.Terrain.Terrain | ( | ) |
| DXGfxLib.Terrain.Terrain | ( | float | desiredWidth, | |
| float | desiredHeigth | |||
| ) |
Default constructor for Terrain. After that you won't have much until you effectively load a bitmap to really build the terrain.
| desiredWidth | ||
| desiredHeigth |
Definition at line 155 of file Terrain.cs.

| void DXGfxLib.Terrain.AddInstances | ( | OutDoorScene | scene, | |
| FrameworkMesh | mesh, | |||
| InstanceInfo[] | instancesInfo | |||
| ) |
| void DXGfxLib.Terrain.AddInstances | ( | OutDoorScene | scene, | |
| FrameworkMesh | mesh, | |||
| InstanceInfo[] | instancesInfo | |||
| ) |
| void DXGfxLib.Terrain.DeviceChanged | ( | Device | d3ddevice, | |
| OutDoorScene | scene | |||
| ) |
If your device has changed you need to call this one.
| d3ddevice | ||
| scene |
Definition at line 197 of file Terrain.cs.

| void DXGfxLib.Terrain.DeviceChanged | ( | Device | d3ddevice, | |
| OutDoorScene | scene | |||
| ) |
If your device has changed you need to call this one.
| d3ddevice | ||
| scene |
Definition at line 197 of file Terrain.cs.


| float DXGfxLib.Terrain.GetHeigth | ( | OutDoorScene | scene, | |
| Vector3 | underPoint | |||
| ) |
Get the heigth of the tile under the point given in parameter. If the point is under the terrain level at that x and z 65536 is returned.
| underPoint |
Definition at line 341 of file Terrain.cs.

| float DXGfxLib.Terrain.GetHeigth | ( | OutDoorScene | scene, | |
| float | x, | |||
| float | y, | |||
| float | z | |||
| ) |
This method return the heigth of the terrain at the specified x and z coordinate and below the y value provided. In DX the ray intersection with a mesh is sensible to the distance between the point from which the ray is cast and the mesh here using an y value allow us to have a better precision than by cast the ray from a very high point in the sky :). This will also be consistant with a world getheigth that would be able to deal with houses with several level.
| x | ||
| y | ||
| z |
Definition at line 328 of file Terrain.cs.

| float DXGfxLib.Terrain.GetHeigth | ( | OutDoorScene | scene, | |
| float | x, | |||
| float | z | |||
| ) |
This method return the heigth of the terrain at the specified x and z coordinate. Remember that the z coordinate is going far away with directx default convention. The y is pointing up.
| x | ||
| z |
Definition at line 311 of file Terrain.cs.

| float DXGfxLib.Terrain.GetHeigth | ( | OutDoorScene | scene, | |
| Vector3 | underPoint | |||
| ) |
Get the heigth of the tile under the point given in parameter. If the point is under the terrain level at that x and z 65536 is returned.
| underPoint |
Definition at line 341 of file Terrain.cs.

| float DXGfxLib.Terrain.GetHeigth | ( | OutDoorScene | scene, | |
| float | x, | |||
| float | y, | |||
| float | z | |||
| ) |
This method return the heigth of the terrain at the specified x and z coordinate and below the y value provided. In DX the ray intersection with a mesh is sensible to the distance between the point from which the ray is cast and the mesh here using an y value allow us to have a better precision than by cast the ray from a very high point in the sky :). This will also be consistant with a world getheigth that would be able to deal with houses with several level.
| x | ||
| y | ||
| z |
Definition at line 328 of file Terrain.cs.

| float DXGfxLib.Terrain.GetHeigth | ( | OutDoorScene | scene, | |
| float | x, | |||
| float | z | |||
| ) |
This method return the heigth of the terrain at the specified x and z coordinate. Remember that the z coordinate is going far away with directx default convention. The y is pointing up.
| x | ||
| z |
Definition at line 311 of file Terrain.cs.


| void DXGfxLib.Terrain.Initialize | ( | float | desiredWidth, | |
| float | desiredHeigth | |||
| ) |
Definition at line 165 of file Terrain.cs.
| void DXGfxLib.Terrain.Initialize | ( | ) |
| void DXGfxLib.Terrain.Initialize | ( | float | desiredWidth, | |
| float | desiredHeigth | |||
| ) |
Definition at line 165 of file Terrain.cs.
| void DXGfxLib.Terrain.Initialize | ( | ) |
| void DXGfxLib.Terrain.Load | ( | Device | d3ddevice, | |
| OutDoorScene | scene, | |||
| string | fileName, | |||
| string | baseTextureFile, | |||
| string | secondTextureFile | |||
| ) |
Load the terrain from the bitmap in the filename file. base texture will be loaded then and applied everywhere. Then the secondtexture will also be tiled on the terrain geometry based on the alpha information in the alphamap dds file. As far as I am concerned I made up the dds file with the texture tool in the directx sdk.
| fileName | ||
| baseTexture | ||
| secondTexture | ||
| alphaMap |
Definition at line 254 of file Terrain.cs.
| void DXGfxLib.Terrain.Load | ( | Device | d3ddevice, | |
| OutDoorScene | scene, | |||
| string | ressourceName | |||
| ) |
This method is the most CPU intensive method of this class. It will use the bitmap to generate the terrain tiles geometry. Also each newly generated tile is going to be attached to the provided Outdoorscene. With our base implementation of Ourdoorscene this means that position in the quadtree will be determine for each newly created tile.
| d3ddevice | ||
| scene | ||
| ressourceName |
Definition at line 211 of file Terrain.cs.

| void DXGfxLib.Terrain.Load | ( | Device | d3ddevice, | |
| OutDoorScene | scene, | |||
| string | fileName, | |||
| string | baseTextureFile, | |||
| string | secondTextureFile | |||
| ) |
Load the terrain from the bitmap in the filename file. base texture will be loaded then and applied everywhere. Then the secondtexture will also be tiled on the terrain geometry based on the alpha information in the alphamap dds file. As far as I am concerned I made up the dds file with the texture tool in the directx sdk.
| fileName | ||
| baseTexture | ||
| secondTexture | ||
| alphaMap |
Definition at line 254 of file Terrain.cs.
| void DXGfxLib.Terrain.Load | ( | Device | d3ddevice, | |
| OutDoorScene | scene, | |||
| string | ressourceName | |||
| ) |
This method is the most CPU intensive method of this class. It will use the bitmap to generate the terrain tiles geometry. Also each newly generated tile is going to be attached to the provided Outdoorscene. With our base implementation of Ourdoorscene this means that position in the quadtree will be determine for each newly created tile.
| d3ddevice | ||
| scene | ||
| ressourceName |
Definition at line 211 of file Terrain.cs.


| void DXGfxLib.Terrain.LoadFromFile | ( | Device | d3ddevice, | |
| OutDoorScene | scene, | |||
| string | fileName | |||
| ) |
Load the terrain from a bitmap image used as an heigthmap. In Eter 3D Control the Terrain class will then load two texture grass.bmp and snow.bmp as well as an alphamap lightmap.dds and used those to texture the terrain. As in your specific situation I expect that your textured might be named differently, you should consider using the other load method. The lightmap.dds is used only for alpha value to know where on the terrain the snow texture should be applied. The grass texture is applied everywhere.
| fileName | The bitmap used as heigthmap |
Definition at line 225 of file Terrain.cs.

| void DXGfxLib.Terrain.LoadFromFile | ( | Device | d3ddevice, | |
| OutDoorScene | scene, | |||
| string | fileName | |||
| ) |
Load the terrain from a bitmap image used as an heigthmap. In Eter 3D Control the Terrain class will then load two texture grass.bmp and snow.bmp as well as an alphamap lightmap.dds and used those to texture the terrain. As in your specific situation I expect that your textured might be named differently, you should consider using the other load method. The lightmap.dds is used only for alpha value to know where on the terrain the snow texture should be applied. The grass texture is applied everywhere.
| fileName | The bitmap used as heigthmap |
Definition at line 225 of file Terrain.cs.


| Texture DXGfxLib.Terrain::alphaMap = null |
We certainly want our terrain to have a specific heigth. This can be specified upon terrain creation and we keep the value in this member variable.
Definition at line 112 of file Terrain.cs.
We certainly want our terrain to have a specific width. This can be specified upon terrain creation and we keep the value in this member variable.
Definition at line 106 of file Terrain.cs.
For some obscure reason we want to keep the filename of the bitmap used to build the terrain.
Definition at line 65 of file Terrain.cs.
Number of tiles along Z (remember Z is looking far away, y is up and x is looking to the right).
Definition at line 122 of file Terrain.cs.
| Material DXGfxLib.Terrain::material |
| Texture DXGfxLib.Terrain::secondTexture = null |
The second texture texture. Will be used for areas specified through the alphaMap texture.
Definition at line 95 of file Terrain.cs.
Filename of a second texture that will be rendered only on the areas specified through the alphamap.
Definition at line 75 of file Terrain.cs.
Definition at line 137 of file Terrain.cs.
static string DXGfxLib.Terrain::terrainEffectFile = "terrainTile.fx" [static] |
The effect file used for Terrain2 tiles. We load it once in the Terrain2 class and we pass a reference to the newly created effectGroup to all Terrain2 tiles.
Definition at line 45 of file Terrain.cs.
| Texture DXGfxLib.Terrain::texture = null |
1.5.8