diff --git a/school/informatik/id3lib/id3lib-3.8.3.zip b/school/informatik/id3lib/id3lib-3.8.3.zip
new file mode 100644
index 00000000..fb29c480
Binary files /dev/null and b/school/informatik/id3lib/id3lib-3.8.3.zip differ
diff --git a/school/informatik/id3lib/id3lib-3.8.3binaries.zip b/school/informatik/id3lib/id3lib-3.8.3binaries.zip
new file mode 100644
index 00000000..b37c6634
Binary files /dev/null and b/school/informatik/id3lib/id3lib-3.8.3binaries.zip differ
diff --git a/school/informatik/id3lib/id3lib-doc-3.8.0pre1.tar.gz b/school/informatik/id3lib/id3lib-doc-3.8.0pre1.tar.gz
new file mode 100644
index 00000000..61c3e65a
Binary files /dev/null and b/school/informatik/id3lib/id3lib-doc-3.8.0pre1.tar.gz differ
diff --git a/school/informatik/id3lib/id3tags-20000623.zip b/school/informatik/id3lib/id3tags-20000623.zip
new file mode 100644
index 00000000..cd4bfba1
Binary files /dev/null and b/school/informatik/id3lib/id3tags-20000623.zip differ
diff --git a/school/informatik/stringlist/stringlist.cpp b/school/informatik/stringlist/stringlist.cpp
new file mode 100644
index 00000000..064163b7
--- /dev/null
+++ b/school/informatik/stringlist/stringlist.cpp
@@ -0,0 +1,76 @@
+#include "stringlist.h"
+
+// element am Endy anfügen
+//string gelesenes_element;
+//...
+//dyn_array.push_back( gelesenes_element );
+
+//Und so kannst du abschliessend auf alle Elems zugreifen:
+
+
+//for( vector::iterator it=dyn_array.begin(); it!=dyn_array.end();++it)
+//{
+ //coord& elem = *it;
+ // ...
+//}
+//n = str_array.size()
+
+std::string* CStringList::getLine(int lineId)
+{
+ if(countLines() > lineId) return &std::string("");
+
+ return &(lines[lineId]);
+}
+
+void CStringList::addLine(std::string *line)
+{
+ lines.push_back(*(line));
+}
+
+bool CStringList::delLine(int id)
+{
+ return true;//lines.erase(id);
+}
+
+int CStringList::insertLine(int pos, std::string *line)
+{
+ //dummy
+ return 0;
+}
+
+bool CStringList::loadFromFile(std::string *file)
+{
+ clear();
+
+ std::ifstream in(file->c_str()); // Open for reading
+
+ std::string s;
+
+ while(getline(in, s)) // Discards newline char
+ addLine(&s);
+
+ return true;
+}
+
+int CStringList::countLines()
+{
+ return int(lines.size());
+}
+
+int CStringList::countChars()
+{
+ int result = 0;
+ for(int i=0;i<=int(lines.size());i++)
+ {
+ result += (int)getLine(i)->length();
+ }
+
+ return result;
+}
+
+void CStringList::clear()
+{
+
+ lines.clear();
+
+}
\ No newline at end of file
diff --git a/school/informatik/stringlist/stringlist.h b/school/informatik/stringlist/stringlist.h
new file mode 100644
index 00000000..57edc7c3
--- /dev/null
+++ b/school/informatik/stringlist/stringlist.h
@@ -0,0 +1,22 @@
+#pragma once
+
+#include
+#include
+#include
+
+class CStringList
+{
+ std::vector lines;
+
+public:
+
+ std::string* getLine(int lineId);
+ void addLine(std::string *line);
+ bool delLine(int id);
+ int insertLine(int pos, std::string *line);
+ bool loadFromFile(std::string *file);
+ int countLines();
+ int countChars();
+ void clear();
+
+};
\ No newline at end of file
diff --git a/school/informatik/typecasts/typecasts.cpp b/school/informatik/typecasts/typecasts.cpp
new file mode 100644
index 00000000..4eb2b407
--- /dev/null
+++ b/school/informatik/typecasts/typecasts.cpp
@@ -0,0 +1,13 @@
+#include "typecasts.h"
+#include
+
+std::string inttostr(int i)
+{
+ std::string s;
+
+ std::stringstream sstr;
+ sstr << i;
+ sstr >> s;
+
+ return s;
+}
\ No newline at end of file
diff --git a/school/informatik/typecasts/typecasts.h b/school/informatik/typecasts/typecasts.h
new file mode 100644
index 00000000..6420ba24
--- /dev/null
+++ b/school/informatik/typecasts/typecasts.h
@@ -0,0 +1,5 @@
+#pragma once
+
+#include
+
+std::string inttostr(int i);
\ No newline at end of file
diff --git a/school/informatik/verkerhssimulation/bin/OIS.dll b/school/informatik/verkerhssimulation/bin/OIS.dll
new file mode 100644
index 00000000..84b21610
Binary files /dev/null and b/school/informatik/verkerhssimulation/bin/OIS.dll differ
diff --git a/school/informatik/verkerhssimulation/bin/Ogre.log b/school/informatik/verkerhssimulation/bin/Ogre.log
new file mode 100644
index 00000000..b1b4ba96
--- /dev/null
+++ b/school/informatik/verkerhssimulation/bin/Ogre.log
@@ -0,0 +1,315 @@
+07:31:02: Creating resource group General
+07:31:02: Creating resource group Internal
+07:31:02: Creating resource group Autodetect
+07:31:02: SceneManagerFactory for type 'DefaultSceneManager' registered.
+07:31:02: Registering ResourceManager for type Material
+07:31:02: Registering ResourceManager for type Mesh
+07:31:02: Registering ResourceManager for type Skeleton
+07:31:02: MovableObjectFactory for type 'ParticleSystem' registered.
+07:31:02: OverlayElementFactory for type Panel registered.
+07:31:02: OverlayElementFactory for type BorderPanel registered.
+07:31:02: OverlayElementFactory for type TextArea registered.
+07:31:02: Registering ResourceManager for type Font
+07:31:02: ArchiveFactory for archive type FileSystem registered.
+07:31:02: ArchiveFactory for archive type Zip registered.
+07:31:02: FreeImage version: 3.9.2
+07:31:02: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
+07:31:02: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi
+07:31:02: DDS codec registering
+07:31:02: Registering ResourceManager for type HighLevelGpuProgram
+07:31:02: Registering ResourceManager for type Compositor
+07:31:02: MovableObjectFactory for type 'Entity' registered.
+07:31:02: MovableObjectFactory for type 'Light' registered.
+07:31:02: MovableObjectFactory for type 'BillboardSet' registered.
+07:31:02: MovableObjectFactory for type 'ManualObject' registered.
+07:31:02: MovableObjectFactory for type 'BillboardChain' registered.
+07:31:02: MovableObjectFactory for type 'RibbonTrail' registered.
+07:31:02: Loading library Plugins\RenderSystem_Direct3D9
+07:31:02: Installing plugin: D3D9 RenderSystem
+07:31:02: D3D9 : Direct3D9 Rendering Subsystem created.
+07:31:02: D3D9: Driver Detection Starts
+07:31:02: D3D9: Driver Detection Ends
+07:31:02: Plugin successfully installed
+07:31:02: Loading library Plugins\RenderSystem_GL
+07:31:02: Installing plugin: GL RenderSystem
+07:31:02: OpenGL Rendering Subsystem created.
+07:31:03: Plugin successfully installed
+07:31:03: Loading library Plugins\Plugin_ParticleFX
+07:31:03: Installing plugin: ParticleFX
+07:31:03: Particle Emitter Type 'Point' registered
+07:31:03: Particle Emitter Type 'Box' registered
+07:31:03: Particle Emitter Type 'Ellipsoid' registered
+07:31:03: Particle Emitter Type 'Cylinder' registered
+07:31:03: Particle Emitter Type 'Ring' registered
+07:31:03: Particle Emitter Type 'HollowEllipsoid' registered
+07:31:03: Particle Affector Type 'LinearForce' registered
+07:31:03: Particle Affector Type 'ColourFader' registered
+07:31:03: Particle Affector Type 'ColourFader2' registered
+07:31:03: Particle Affector Type 'ColourImage' registered
+07:31:03: Particle Affector Type 'ColourInterpolator' registered
+07:31:03: Particle Affector Type 'Scaler' registered
+07:31:03: Particle Affector Type 'Rotator' registered
+07:31:03: Particle Affector Type 'DirectionRandomiser' registered
+07:31:03: Particle Affector Type 'DeflectorPlane' registered
+07:31:03: Plugin successfully installed
+07:31:03: Loading library Plugins\Plugin_BSPSceneManager
+07:31:03: Installing plugin: BSP Scene Manager
+07:31:03: Plugin successfully installed
+07:31:03: Loading library Plugins\Plugin_OctreeSceneManager
+07:31:03: Installing plugin: Octree & Terrain Scene Manager
+07:31:03: Plugin successfully installed
+07:31:03: Loading library Plugins\Plugin_CgProgramManager
+07:31:03: Installing plugin: Cg Program Manager
+07:31:03: Plugin successfully installed
+07:31:03: *-*-* OGRE Initialising
+07:31:03: *-*-* Version 1.4.4 (Eihort)
+07:31:03: Added resource location 'c:\Dokumente und Einstellungen\Rylon\Desktop\source\Verkerhssimulation M&U\media' of type 'FileSystem' to resource group 'General'
+07:31:03: Added resource location 'c:\Dokumente und Einstellungen\Rylon\Desktop\source\Verkerhssimulation M&U\media\fonts' of type 'FileSystem' to resource group 'General'
+07:31:03: Added resource location 'c:\Dokumente und Einstellungen\Rylon\Desktop\source\Verkerhssimulation M&U\media\materials\programs' of type 'FileSystem' to resource group 'General'
+07:31:03: Added resource location 'c:\Dokumente und Einstellungen\Rylon\Desktop\source\Verkerhssimulation M&U\media\materials\scripts' of type 'FileSystem' to resource group 'General'
+07:31:03: Added resource location 'c:\Dokumente und Einstellungen\Rylon\Desktop\source\Verkerhssimulation M&U\media\materials\textures' of type 'FileSystem' to resource group 'General'
+07:31:03: Added resource location 'c:\Dokumente und Einstellungen\Rylon\Desktop\source\Verkerhssimulation M&U\media\models' of type 'FileSystem' to resource group 'General'
+07:31:03: Added resource location 'c:\Dokumente und Einstellungen\Rylon\Desktop\source\Verkerhssimulation M&U\media\overlays' of type 'FileSystem' to resource group 'General'
+07:31:03: Added resource location 'c:\Dokumente und Einstellungen\Rylon\Desktop\source\Verkerhssimulation M&U\media\particle' of type 'FileSystem' to resource group 'General'
+07:31:03: Added resource location 'c:\Dokumente und Einstellungen\Rylon\Desktop\source\Verkerhssimulation M&U\media\gui' of type 'FileSystem' to resource group 'General'
+07:31:03: Added resource location 'c:\Dokumente und Einstellungen\Rylon\Desktop\source\Verkerhssimulation M&U\media\DeferredShadingMedia' of type 'FileSystem' to resource group 'General'
+07:31:03: Added resource location 'c:\Dokumente und Einstellungen\Rylon\Desktop\source\Verkerhssimulation M&U\media\packs\cubemap.zip' of type 'Zip' to resource group 'General'
+07:31:03: Added resource location 'c:\Dokumente und Einstellungen\Rylon\Desktop\source\Verkerhssimulation M&U\media\packs\cubemapsJS.zip' of type 'Zip' to resource group 'General'
+07:31:03: Added resource location 'c:\Dokumente und Einstellungen\Rylon\Desktop\source\Verkerhssimulation M&U\media\packs\dragon.zip' of type 'Zip' to resource group 'General'
+07:31:03: Added resource location 'c:\Dokumente und Einstellungen\Rylon\Desktop\source\Verkerhssimulation M&U\media\packs\fresneldemo.zip' of type 'Zip' to resource group 'General'
+07:31:03: Added resource location 'c:\Dokumente und Einstellungen\Rylon\Desktop\source\Verkerhssimulation M&U\media\packs\ogretestmap.zip' of type 'Zip' to resource group 'General'
+07:31:03: Added resource location 'c:\Dokumente und Einstellungen\Rylon\Desktop\source\Verkerhssimulation M&U\media\packs\skybox.zip' of type 'Zip' to resource group 'General'
+07:31:03: Added resource location 'c:\Dokumente und Einstellungen\Rylon\Desktop\source\Verkerhssimulation M&U\media\packs\OgreCore.zip' of type 'Zip' to resource group 'General'
+07:31:03: D3D9 : RenderSystem Option: Allow NVPerfHUD = Yes
+07:31:03: D3D9 : RenderSystem Option: Anti aliasing = None
+07:31:03: D3D9 : RenderSystem Option: Floating-point mode = Fastest
+07:31:03: D3D9 : RenderSystem Option: Full Screen = No
+07:31:03: D3D9 : RenderSystem Option: Rendering Device = NVIDIA GeForce Go 6800
+07:31:03: D3D9 : RenderSystem Option: VSync = No
+07:31:03: D3D9 : RenderSystem Option: Video Mode = 800 x 600 @ 32-bit colour
+07:31:07: CPU Identifier & Features
+07:31:07: -------------------------
+07:31:07: * CPU ID: GenuineIntel: Intel(R) Pentium(R) M processor 2.00GHz
+07:31:07: * SSE: yes
+07:31:07: * SSE2: yes
+07:31:07: * SSE3: no
+07:31:07: * MMX: yes
+07:31:07: * MMXEXT: yes
+07:31:07: * 3DNOW: no
+07:31:07: * 3DNOWEXT: no
+07:31:07: * CMOV: yes
+07:31:07: * TSC: yes
+07:31:07: * FPU: yes
+07:31:07: * PRO: no
+07:31:07: * HT: no
+07:31:07: -------------------------
+07:31:07: D3D9 : Subsystem Initialising
+07:31:07: D3D9RenderSystem::createRenderWindow "OGRE Render Window", 800x600 windowed miscParams: FSAA=0 FSAAQuality=0 colourDepth=32 useNVPerfHUD=true vsync=false
+07:31:07: D3D9 : Created D3D9 Rendering Window 'OGRE Render Window' : 800x600, 32bpp
+07:31:07: D3D9 : WARNING - disabling VSync in windowed mode can cause timing issues at lower frame rates, turn VSync on if you observe this problem.
+07:31:07: Registering ResourceManager for type Texture
+07:31:07: Registering ResourceManager for type GpuProgram
+07:31:07: D3D9: Vertex texture format supported - PF_FLOAT32_RGB
+07:31:07: D3D9: Vertex texture format supported - PF_FLOAT32_RGBA
+07:31:07: D3D9: Vertex texture format supported - PF_FLOAT32_R
+07:31:07: RenderSystem capabilities
+07:31:07: -------------------------
+07:31:07: * Hardware generation of mipmaps: yes
+07:31:07: * Texture blending: yes
+07:31:07: * Anisotropic texture filtering: yes
+07:31:07: * Dot product texture operation: yes
+07:31:07: * Cube mapping: yes
+07:31:07: * Hardware stencil buffer: yes
+07:31:07: - Stencil depth: 8
+07:31:07: - Two sided stencil support: yes
+07:31:07: - Wrap stencil values: yes
+07:31:07: * Hardware vertex / index buffers: yes
+07:31:07: * Vertex programs: yes
+07:31:07: - Max vertex program version: vs_3_0
+07:31:07: * Fragment programs: yes
+07:31:07: - Max fragment program version: ps_3_0
+07:31:07: * Texture Compression: yes
+07:31:07: - DXT: yes
+07:31:07: - VTC: no
+07:31:07: * Scissor Rectangle: yes
+07:31:07: * Hardware Occlusion Query: yes
+07:31:07: * User clip planes: yes
+07:31:07: * VET_UBYTE4 vertex element type: yes
+07:31:07: * Infinite far plane projection: yes
+07:31:07: * Hardware render-to-texture: yes
+07:31:07: * Floating point textures: yes
+07:31:07: * Non-power-of-two textures: yes
+07:31:07: * Volume textures: yes
+07:31:07: * Multiple Render Targets: 4
+07:31:07: * Point Sprites: yes
+07:31:07: * Extended point parameters: yes
+07:31:07: * Max Point Size: 8192
+07:31:07: * Vertex texture fetch: yes
+07:31:07: - Max vertex textures: 4
+07:31:07: - Vertex textures shared: no
+07:31:07: ***************************************
+07:31:07: *** D3D9 : Subsystem Initialised OK ***
+07:31:07: ***************************************
+07:31:07: ResourceBackgroundQueue - threading disabled
+07:31:07: Particle Renderer Type 'billboard' registered
+07:31:07: SceneManagerFactory for type 'OctreeSceneManager' registered.
+07:31:07: SceneManagerFactory for type 'TerrainSceneManager' registered.
+07:31:07: SceneManagerFactory for type 'BspSceneManager' registered.
+07:31:07: Registering ResourceManager for type BspLevel
+07:31:07: TerrainSceneManager: Registered a new PageSource for type Heightmap
+07:31:07: Parsing scripts for resource group Autodetect
+07:31:07: Finished parsing scripts for resource group Autodetect
+07:31:07: Parsing scripts for resource group General
+07:31:08: Parsing script Examples.program
+07:31:08: Parsing script StdQuad_vp.program
+07:31:08: Parsing script deferred.glsl.program
+07:31:08: Parsing script deferred.hlsl.program
+07:31:08: Parsing script deferred_post_debug.glsl.program
+07:31:08: Parsing script deferred_post_debug.hlsl.program
+07:31:08: Parsing script deferred_post_minilight.glsl.program
+07:31:08: Parsing script deferred_post_minilight.hlsl.program
+07:31:08: OGRE EXCEPTION(2:InvalidParametersException): Parameter called lightSpecularColor does not exist. in GpuProgramParameters::_findNamedConstantDefinition at ..\src\OgreGpuProgram.cpp (line 883)
+07:31:08: Error at line 29 of deferred_post_minilight.hlsl.program: Invalid param_named_auto attribute - Parameter called lightSpecularColor does not exist.
+07:31:08: Parsing script deferred_post_multipass.glsl.program
+07:31:08: Parsing script deferred_post_multipass.hlsl.program
+07:31:08: Parsing script deferred_post_onepass.glsl.program
+07:31:08: Parsing script deferred_post_onepass.hlsl.program
+07:31:08: Parsing script BlackAndWhite.material
+07:31:08: Parsing script Bloom.material
+07:31:08: Parsing script DepthShadowmap.material
+07:31:08: Parsing script DOF.material
+07:31:08: Parsing script Embossed.material
+07:31:08: Parsing script Example-DynTex.material
+07:31:08: Parsing script Example-Water.material
+07:31:08: Parsing script Example.material
+07:31:09: Parsing script Examples-Advanced.material
+07:31:09: Parsing script facial.material
+07:31:09: Parsing script Glass.material
+07:31:09: Parsing script hdr.material
+07:31:09: Parsing script HeatVision.material
+07:31:09: Parsing script Hurt.material
+07:31:09: Parsing script instancing.material
+07:31:10: Parsing script Invert.material
+07:31:10: Parsing script Laplace.material
+07:31:10: Parsing script MotionBlur.material
+07:31:10: Parsing script Ocean.material
+07:31:10: Parsing script OffsetMapping.material
+07:31:10: Parsing script Ogre.material
+07:31:10: Parsing script OldMovie.material
+07:31:10: Parsing script OldTV.material
+07:31:10: Parsing script Posterize.material
+07:31:10: Parsing script RZR-002.material
+07:31:10: Parsing script SharpenEdges.material
+07:31:10: Parsing script smoke.material
+07:31:10: Parsing script Tiling.material
+07:31:10: Parsing script VarianceShadowmap.material
+07:31:10: Parsing script deferred.material
+07:31:10: Parsing script deferreddemo.material
+07:31:10: Parsing script deferred_post_debug.material
+07:31:10: Parsing script deferred_post_minilight.material
+07:31:10: Parsing script deferred_post_multipass.material
+07:31:10: Parsing script deferred_post_onepass.material
+07:31:10: Parsing script RomanBath.material
+07:31:10: Parsing script OgreCore.material
+07:31:10: Parsing script OgreProfiler.material
+07:31:10: Parsing script Examples.compositor
+07:31:10: Parsing script sample.fontdef
+07:31:10: Parsing script Ogre.fontdef
+07:31:10: Parsing script emitted_emitter.particle
+07:31:10: Parsing script Example-Water.particle
+07:31:10: Parsing script Example.particle
+07:31:10: Parsing script smoke.particle
+07:31:10: Parsing script Compositor.overlay
+07:31:10: Texture: New_Ogre_Border_Center.png: Loading 1 faces(PF_A8R8G8B8,256x128x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x128x1.
+07:31:10: Texture: New_Ogre_Border.png: Loading 1 faces(PF_A8R8G8B8,256x256x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x256x1.
+07:31:10: Font BlueHighwayusing texture size 512x512
+07:31:10: Info: Freetype returned null for character 127 in font BlueHighway
+07:31:10: Info: Freetype returned null for character 128 in font BlueHighway
+07:31:10: Info: Freetype returned null for character 129 in font BlueHighway
+07:31:10: Info: Freetype returned null for character 130 in font BlueHighway
+07:31:10: Info: Freetype returned null for character 131 in font BlueHighway
+07:31:10: Info: Freetype returned null for character 132 in font BlueHighway
+07:31:10: Info: Freetype returned null for character 133 in font BlueHighway
+07:31:10: Info: Freetype returned null for character 134 in font BlueHighway
+07:31:10: Info: Freetype returned null for character 135 in font BlueHighway
+07:31:10: Info: Freetype returned null for character 136 in font BlueHighway
+07:31:10: Info: Freetype returned null for character 137 in font BlueHighway
+07:31:10: Info: Freetype returned null for character 138 in font BlueHighway
+07:31:10: Info: Freetype returned null for character 139 in font BlueHighway
+07:31:10: Info: Freetype returned null for character 140 in font BlueHighway
+07:31:10: Info: Freetype returned null for character 141 in font BlueHighway
+07:31:10: Info: Freetype returned null for character 142 in font BlueHighway
+07:31:10: Info: Freetype returned null for character 143 in font BlueHighway
+07:31:10: Info: Freetype returned null for character 144 in font BlueHighway
+07:31:10: Info: Freetype returned null for character 145 in font BlueHighway
+07:31:10: Info: Freetype returned null for character 146 in font BlueHighway
+07:31:10: Info: Freetype returned null for character 147 in font BlueHighway
+07:31:10: Info: Freetype returned null for character 148 in font BlueHighway
+07:31:10: Info: Freetype returned null for character 149 in font BlueHighway
+07:31:10: Info: Freetype returned null for character 150 in font BlueHighway
+07:31:10: Info: Freetype returned null for character 151 in font BlueHighway
+07:31:10: Info: Freetype returned null for character 152 in font BlueHighway
+07:31:10: Info: Freetype returned null for character 153 in font BlueHighway
+07:31:10: Info: Freetype returned null for character 154 in font BlueHighway
+07:31:10: Info: Freetype returned null for character 155 in font BlueHighway
+07:31:10: Info: Freetype returned null for character 156 in font BlueHighway
+07:31:10: Info: Freetype returned null for character 157 in font BlueHighway
+07:31:10: Info: Freetype returned null for character 158 in font BlueHighway
+07:31:10: Info: Freetype returned null for character 159 in font BlueHighway
+07:31:10: Info: Freetype returned null for character 160 in font BlueHighway
+07:31:10: Texture: BlueHighwayTexture: Loading 1 faces(PF_BYTE_LA,512x512x1) with 0 generated mipmaps from Image. Internal format is PF_BYTE_LA,512x512x1.
+07:31:10: Parsing script DP3.overlay
+07:31:10: Parsing script Example-CubeMapping.overlay
+07:31:10: Parsing script Example-DynTex.overlay
+07:31:10: Parsing script Example-Water.overlay
+07:31:10: Parsing script Shadows.overlay
+07:31:10: Parsing script OgreDebugPanel.overlay
+07:31:10: Texture: New_Ogre_Border_Break.png: Loading 1 faces(PF_A8R8G8B8,32x32x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,32x32x1.
+07:31:10: Texture: ogretext.png: Loading 1 faces(PF_A8R8G8B8,256x128x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x128x1.
+07:31:10: Parsing script OgreLoadingPanel.overlay
+07:31:11: Finished parsing scripts for resource group General
+07:31:11: Parsing scripts for resource group Internal
+07:31:11: Finished parsing scripts for resource group Internal
+07:31:11: Creating viewport on target 'OGRE Render Window', rendering from camera 'PlayerCam', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
+07:31:11: Mesh: Loading ninja.mesh.
+07:31:11: Skeleton: Loading ninja.skeleton
+07:31:11: Texture: nskingr.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
+07:31:11: Texture: BumpyMetal.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
+07:31:11: TerrainSceneManager: Activated PageSource Heightmap
+07:31:11: Texture: terrain_texture.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
+07:31:11: Texture: terrain_detail.jpg: Loading 1 faces(PF_R8G8B8,256x256x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
+07:31:11: Texture: clouds.jpg: Loading 1 faces(PF_R8G8B8,256x256x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
+07:31:11: *** Initializing OIS ***
+07:31:11: Texture: spot_shadow_fade.png: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
+07:31:13: Unregistering ResourceManager for type BspLevel
+07:31:13: *-*-* OGRE Shutdown
+07:31:13: Unregistering ResourceManager for type Compositor
+07:31:13: Unregistering ResourceManager for type Font
+07:31:13: Unregistering ResourceManager for type Skeleton
+07:31:13: Unregistering ResourceManager for type Mesh
+07:31:13: Unregistering ResourceManager for type HighLevelGpuProgram
+07:31:13: Uninstalling plugin: Cg Program Manager
+07:31:13: Plugin successfully uninstalled
+07:31:13: Unloading library Plugins\Plugin_CgProgramManager
+07:31:13: Uninstalling plugin: Octree & Terrain Scene Manager
+07:31:13: Plugin successfully uninstalled
+07:31:13: Unloading library Plugins\Plugin_OctreeSceneManager
+07:31:13: Uninstalling plugin: BSP Scene Manager
+07:31:13: Plugin successfully uninstalled
+07:31:13: Unloading library Plugins\Plugin_BSPSceneManager
+07:31:13: Uninstalling plugin: ParticleFX
+07:31:13: Plugin successfully uninstalled
+07:31:13: Unloading library Plugins\Plugin_ParticleFX
+07:31:13: Uninstalling plugin: GL RenderSystem
+07:31:13: *** Stopping Win32GL Subsystem ***
+07:31:13: Plugin successfully uninstalled
+07:31:13: Unloading library Plugins\RenderSystem_GL
+07:31:13: Uninstalling plugin: D3D9 RenderSystem
+07:31:13: Render Target 'OGRE Render Window' Average FPS: 397.602 Best FPS: 397.602 Worst FPS: 397.602
+07:31:13: D3D9 : Shutting down cleanly.
+07:31:13: Unregistering ResourceManager for type Texture
+07:31:13: Unregistering ResourceManager for type GpuProgram
+07:31:13: D3D9 : Direct3D9 Rendering Subsystem destroyed.
+07:31:13: Plugin successfully uninstalled
+07:31:13: Unloading library Plugins\RenderSystem_Direct3D9
+07:31:13: Unregistering ResourceManager for type Material
diff --git a/school/informatik/verkerhssimulation/bin/OgreGUIRenderer.dll b/school/informatik/verkerhssimulation/bin/OgreGUIRenderer.dll
new file mode 100644
index 00000000..d2896f27
Binary files /dev/null and b/school/informatik/verkerhssimulation/bin/OgreGUIRenderer.dll differ
diff --git a/school/informatik/verkerhssimulation/bin/OgreMain.dll b/school/informatik/verkerhssimulation/bin/OgreMain.dll
new file mode 100644
index 00000000..e213e070
Binary files /dev/null and b/school/informatik/verkerhssimulation/bin/OgreMain.dll differ
diff --git a/school/informatik/verkerhssimulation/bin/OgreMain.dll.org b/school/informatik/verkerhssimulation/bin/OgreMain.dll.org
new file mode 100644
index 00000000..eabcf5d5
Binary files /dev/null and b/school/informatik/verkerhssimulation/bin/OgreMain.dll.org differ
diff --git a/school/informatik/verkerhssimulation/bin/Plugins.cfg b/school/informatik/verkerhssimulation/bin/Plugins.cfg
new file mode 100644
index 00000000..95bb8c92
--- /dev/null
+++ b/school/informatik/verkerhssimulation/bin/Plugins.cfg
@@ -0,0 +1,14 @@
+# Defines plugins to load
+
+# Define plugin folder
+PluginFolder=Plugins
+
+# Define plugins
+Plugin=RenderSystem_Direct3D9
+Plugin=RenderSystem_GL
+Plugin=Plugin_ParticleFX
+Plugin=Plugin_BSPSceneManager
+Plugin=Plugin_OctreeSceneManager
+Plugin=Plugin_CgProgramManager
+
+
diff --git a/school/informatik/verkerhssimulation/bin/Plugins/Plugin_BSPSceneManager.dll b/school/informatik/verkerhssimulation/bin/Plugins/Plugin_BSPSceneManager.dll
new file mode 100644
index 00000000..31f214b7
Binary files /dev/null and b/school/informatik/verkerhssimulation/bin/Plugins/Plugin_BSPSceneManager.dll differ
diff --git a/school/informatik/verkerhssimulation/bin/Plugins/Plugin_CgProgramManager.dll b/school/informatik/verkerhssimulation/bin/Plugins/Plugin_CgProgramManager.dll
new file mode 100644
index 00000000..2b83c1e2
Binary files /dev/null and b/school/informatik/verkerhssimulation/bin/Plugins/Plugin_CgProgramManager.dll differ
diff --git a/school/informatik/verkerhssimulation/bin/Plugins/Plugin_OctreeSceneManager.dll b/school/informatik/verkerhssimulation/bin/Plugins/Plugin_OctreeSceneManager.dll
new file mode 100644
index 00000000..8122770e
Binary files /dev/null and b/school/informatik/verkerhssimulation/bin/Plugins/Plugin_OctreeSceneManager.dll differ
diff --git a/school/informatik/verkerhssimulation/bin/Plugins/Plugin_ParticleFX.dll b/school/informatik/verkerhssimulation/bin/Plugins/Plugin_ParticleFX.dll
new file mode 100644
index 00000000..9fce5540
Binary files /dev/null and b/school/informatik/verkerhssimulation/bin/Plugins/Plugin_ParticleFX.dll differ
diff --git a/school/informatik/verkerhssimulation/bin/Plugins/RenderSystem_Direct3D9.dll b/school/informatik/verkerhssimulation/bin/Plugins/RenderSystem_Direct3D9.dll
new file mode 100644
index 00000000..bb4f078c
Binary files /dev/null and b/school/informatik/verkerhssimulation/bin/Plugins/RenderSystem_Direct3D9.dll differ
diff --git a/school/informatik/verkerhssimulation/bin/Plugins/RenderSystem_GL.dll b/school/informatik/verkerhssimulation/bin/Plugins/RenderSystem_GL.dll
new file mode 100644
index 00000000..239fe8f2
Binary files /dev/null and b/school/informatik/verkerhssimulation/bin/Plugins/RenderSystem_GL.dll differ
diff --git a/school/informatik/verkerhssimulation/bin/Verkehrssimulation.exe b/school/informatik/verkerhssimulation/bin/Verkehrssimulation.exe
new file mode 100644
index 00000000..7b12621e
Binary files /dev/null and b/school/informatik/verkerhssimulation/bin/Verkehrssimulation.exe differ
diff --git a/school/informatik/verkerhssimulation/bin/cg.dll b/school/informatik/verkerhssimulation/bin/cg.dll
new file mode 100644
index 00000000..67df3529
Binary files /dev/null and b/school/informatik/verkerhssimulation/bin/cg.dll differ
diff --git a/school/informatik/verkerhssimulation/bin/ogre.cfg b/school/informatik/verkerhssimulation/bin/ogre.cfg
new file mode 100644
index 00000000..b31dce70
--- /dev/null
+++ b/school/informatik/verkerhssimulation/bin/ogre.cfg
@@ -0,0 +1,19 @@
+Render System=Direct3D9 Rendering Subsystem
+
+[Direct3D9 Rendering Subsystem]
+Allow NVPerfHUD=Yes
+Anti aliasing=None
+Floating-point mode=Fastest
+Full Screen=No
+Rendering Device=NVIDIA GeForce Go 6800
+VSync=No
+Video Mode=800 x 600 @ 32-bit colour
+
+[OpenGL Rendering Subsystem]
+Colour Depth=32
+Display Frequency=N/A
+FSAA=0
+Full Screen=No
+RTT Preferred Mode=FBO
+VSync=Yes
+Video Mode=1024 x 768
diff --git a/school/informatik/verkerhssimulation/bin/resources.cfg b/school/informatik/verkerhssimulation/bin/resources.cfg
new file mode 100644
index 00000000..88a66b4f
--- /dev/null
+++ b/school/informatik/verkerhssimulation/bin/resources.cfg
@@ -0,0 +1,24 @@
+# Resource locations to be added to the 'boostrap' path
+# This also contains the minimum you need to use the Ogre example framework
+# [Bootstrap]
+# Zip=..\media\packs\OgreCore.zip
+
+# Resource locations to be added to the default path
+[General]
+FileSystem=..\media
+FileSystem=..\media\fonts
+FileSystem=..\media\materials\programs
+FileSystem=..\media\materials\scripts
+FileSystem=..\media\materials\textures
+FileSystem=..\media\models
+FileSystem=..\media\overlays
+FileSystem=..\media\particle
+FileSystem=..\media\gui
+FileSystem=..\media\DeferredShadingMedia
+Zip=..\media\packs\cubemap.zip
+Zip=..\media\packs\cubemapsJS.zip
+Zip=..\media\packs\dragon.zip
+Zip=..\media\packs\fresneldemo.zip
+Zip=..\media\packs\ogretestmap.zip
+Zip=..\media\packs\skybox.zip
+Zip=..\media\packs\OgreCore.zip
\ No newline at end of file
diff --git a/school/informatik/verkerhssimulation/bin/test.bat b/school/informatik/verkerhssimulation/bin/test.bat
new file mode 100644
index 00000000..814d1350
--- /dev/null
+++ b/school/informatik/verkerhssimulation/bin/test.bat
@@ -0,0 +1,2 @@
+Verkehrssimulation.exe
+pause
\ No newline at end of file
diff --git a/school/informatik/verkerhssimulation/doc/cmd-line cmds.txt b/school/informatik/verkerhssimulation/doc/cmd-line cmds.txt
new file mode 100644
index 00000000..0b64ccfc
--- /dev/null
+++ b/school/informatik/verkerhssimulation/doc/cmd-line cmds.txt
@@ -0,0 +1,2 @@
+-ncle Keine Fehlermeldungen bei unbekannten CMD-Line-CMDs
+-ne Keine Fehlermeldungen
\ No newline at end of file
diff --git a/school/informatik/verkerhssimulation/doc/pixel auslesen.txt b/school/informatik/verkerhssimulation/doc/pixel auslesen.txt
new file mode 100644
index 00000000..3440c1e8
--- /dev/null
+++ b/school/informatik/verkerhssimulation/doc/pixel auslesen.txt
@@ -0,0 +1,4 @@
+http://msdn2.microsoft.com/de-de/library/system.drawing.bitmap.getpixel(VS.80).aspx
+http://www.c-plusplus.de/forum/viewtopic-var-p-is-944370.html
+http://www.as-hu.de/heightmap/hm.php
+http://www.gamedev.net/reference/articles/article2246.asp
\ No newline at end of file
diff --git a/school/informatik/verkerhssimulation/installer/vcredist_x86.exe b/school/informatik/verkerhssimulation/installer/vcredist_x86.exe
new file mode 100644
index 00000000..92b225aa
Binary files /dev/null and b/school/informatik/verkerhssimulation/installer/vcredist_x86.exe differ
diff --git a/school/informatik/verkerhssimulation/maps/motorway/heightmaps/field001.bmp b/school/informatik/verkerhssimulation/maps/motorway/heightmaps/field001.bmp
new file mode 100644
index 00000000..e69de29b
diff --git a/school/informatik/verkerhssimulation/maps/motorway/models/car001.model b/school/informatik/verkerhssimulation/maps/motorway/models/car001.model
new file mode 100644
index 00000000..e69de29b
diff --git a/school/informatik/verkerhssimulation/maps/motorway/models/tree001.model b/school/informatik/verkerhssimulation/maps/motorway/models/tree001.model
new file mode 100644
index 00000000..e69de29b
diff --git a/school/informatik/verkerhssimulation/maps/motorway/motorway.ini b/school/informatik/verkerhssimulation/maps/motorway/motorway.ini
new file mode 100644
index 00000000..80d919e6
--- /dev/null
+++ b/school/informatik/verkerhssimulation/maps/motorway/motorway.ini
@@ -0,0 +1,13 @@
+[Scripts]
+Scrips\terrain.ini
+scripts\cars.ini
+
+[Config]
+//Verkehrsdichte: 1.0 ist Optimum = 1 Auto pro Feld mit Fahrbahn
+trafficdensity=1.0
+
+//Colors
+//Alle Werte +/- 100
+righthandtrafficcolor=1000
+lefthandtrafficcolor=2000
+notrafficcolor=3000
\ No newline at end of file
diff --git a/school/informatik/verkerhssimulation/maps/motorway/roadmaps/field001.bmp b/school/informatik/verkerhssimulation/maps/motorway/roadmaps/field001.bmp
new file mode 100644
index 00000000..e69de29b
diff --git a/school/informatik/verkerhssimulation/maps/motorway/scripts/cars.ini b/school/informatik/verkerhssimulation/maps/motorway/scripts/cars.ini
new file mode 100644
index 00000000..de0e6ed8
--- /dev/null
+++ b/school/informatik/verkerhssimulation/maps/motorway/scripts/cars.ini
@@ -0,0 +1,3 @@
+[Cars]
+//Verschiedene Autos, die zur Verfügung stehen. Diese werden wiederholt auf die Straße gesetzt
+Car=car001.model;maxacceleration;maxbrake;maxvelocity;numberplate;cartype;
diff --git a/school/informatik/verkerhssimulation/maps/motorway/scripts/terrain.ini b/school/informatik/verkerhssimulation/maps/motorway/scripts/terrain.ini
new file mode 100644
index 00000000..78bd19db
--- /dev/null
+++ b/school/informatik/verkerhssimulation/maps/motorway/scripts/terrain.ini
@@ -0,0 +1,5 @@
+[Terrain]
+Terrain=scripts\Terrain\field001;posx;posy;posz;
+
+[Models]
+model=models\tree001.model;posx;posy;posz;strechfactorx;strechfactory;strechfactorz;rotate;
\ No newline at end of file
diff --git a/school/informatik/verkerhssimulation/maps/motorway/scripts/terrain/field001.ini b/school/informatik/verkerhssimulation/maps/motorway/scripts/terrain/field001.ini
new file mode 100644
index 00000000..cb940b61
--- /dev/null
+++ b/school/informatik/verkerhssimulation/maps/motorway/scripts/terrain/field001.ini
@@ -0,0 +1,4 @@
+[Terrain]
+heightmap=heightmaps\field001.bmp
+texture=textures\field001.bmp
+roadmap=roadmaps\field001.bmp
\ No newline at end of file
diff --git a/school/informatik/verkerhssimulation/maps/motorway/textures/field001.bmp b/school/informatik/verkerhssimulation/maps/motorway/textures/field001.bmp
new file mode 100644
index 00000000..e69de29b
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/COPYING b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/COPYING
new file mode 100644
index 00000000..f73ddcf2
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/COPYING
@@ -0,0 +1,18 @@
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/glsl/nm_notex_ps.glsl b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/glsl/nm_notex_ps.glsl
new file mode 100644
index 00000000..29c18115
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/glsl/nm_notex_ps.glsl
@@ -0,0 +1,54 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+ // W.J. :wumpus: van der Laan 2005 //
+
+ Material shader: Single colour normal mapped
+*/
+
+#extension GL_ARB_draw_buffers : enable
+
+varying vec3 normal;
+varying vec3 tangent_;
+varying vec3 binormal;
+
+varying vec2 texCoord0;
+varying float depth;
+
+uniform sampler2D normTex;
+
+uniform float specularity;
+uniform vec3 colour;
+
+void main()
+{
+ // Frame for normal mapping
+ mat3 rotation = mat3(tangent_, binormal, normal);
+ vec3 texnormal = (vec3(texture2D(normTex, texCoord0))-0.5)*2.0;
+
+ gl_FragData[0].rgb = colour;
+ gl_FragData[0].a = specularity;
+ // rotation*texnormal is reversed for GL because matrices are stored transposed internally
+ // compared to HLSL
+ gl_FragData[1].xyz = normalize(rotation*texnormal); // Do normalisation here, saves an operation per light
+ gl_FragData[1].w = depth;
+
+}
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/glsl/nm_ps.glsl b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/glsl/nm_ps.glsl
new file mode 100644
index 00000000..8363b5e6
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/glsl/nm_ps.glsl
@@ -0,0 +1,52 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+ // W.J. :wumpus: van der Laan 2005 //
+
+ Material shader: Textured normal mapped
+*/
+
+#extension GL_ARB_draw_buffers : enable
+
+varying vec3 normal;
+varying vec3 tangent_;
+varying vec3 binormal;
+
+varying vec2 texCoord0;
+varying float depth;
+uniform sampler2D tex0;
+uniform sampler2D normTex;
+
+uniform float specularity;
+
+void main()
+{
+ // Frame for normal mapping
+ mat3 rotation = mat3(tangent_, binormal, normal);
+ vec3 texnormal = (vec3(texture2D(normTex, texCoord0))-0.5)*2.0;
+
+ gl_FragData[0].rgb = vec3(texture2D(tex0, texCoord0));
+ gl_FragData[0].a = specularity;
+ // rotation*texnormal is reversed for GL because matrices are stored transposed internally
+ // compared to HLSL
+ gl_FragData[1].xyz = normalize(rotation*texnormal); // Do normalisation here, saves an operation per light
+ gl_FragData[1].w = depth;
+}
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/glsl/nm_vs.glsl b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/glsl/nm_vs.glsl
new file mode 100644
index 00000000..a03e5220
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/glsl/nm_vs.glsl
@@ -0,0 +1,47 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+ // W.J. :wumpus: van der Laan 2005 //
+
+ Material shader: Normal mapped
+*/
+varying vec3 normal;
+varying vec3 tangent_;
+varying vec3 binormal;
+
+varying vec2 texCoord0;
+varying float depth;
+
+attribute vec3 tangent;
+
+void main()
+{
+ vec4 projPos = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ gl_Position = projPos;
+ depth = projPos.w;
+ texCoord0 = vec2(gl_MultiTexCoord0);
+
+ normal = vec3(gl_ModelViewMatrix*vec4(gl_Normal,0));
+ tangent_ = vec3(gl_ModelViewMatrix*vec4(tangent,0));
+ binormal = cross(normal, tangent_);
+
+}
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/glsl/notex_ps.glsl b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/glsl/notex_ps.glsl
new file mode 100644
index 00000000..6ab6c2af
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/glsl/notex_ps.glsl
@@ -0,0 +1,42 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+ // W.J. :wumpus: van der Laan 2005 //
+
+ Material shader: Single colour phong
+*/
+
+#extension GL_ARB_draw_buffers : enable
+
+varying vec3 normal;
+varying vec2 texCoord0;
+varying float depth;
+
+uniform float specularity;
+uniform vec3 colour;
+
+void main()
+{
+ gl_FragData[0].rgb = colour;
+ gl_FragData[0].a = specularity;
+ gl_FragData[1].xyz = normalize(normal); // Do normalisation here, saves an operation per light
+ gl_FragData[1].w = depth;
+}
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/glsl/ps.glsl b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/glsl/ps.glsl
new file mode 100644
index 00000000..3dbe9eb5
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/glsl/ps.glsl
@@ -0,0 +1,42 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+ // W.J. :wumpus: van der Laan 2005 //
+
+ Material shader: Textured phongs
+*/
+
+#extension GL_ARB_draw_buffers : enable
+
+varying vec3 normal;
+varying vec2 texCoord0;
+varying float depth;
+
+uniform sampler2D Tex0;
+uniform float specularity;
+
+void main()
+{
+ gl_FragData[0].rgb = vec3(texture2D(Tex0, texCoord0));
+ gl_FragData[0].a = specularity;
+ gl_FragData[1].xyz = normalize(normal); // Do normalisation here, saves an operation per light
+ gl_FragData[1].w = depth;
+}
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/glsl/vs.glsl b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/glsl/vs.glsl
new file mode 100644
index 00000000..51634eba
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/glsl/vs.glsl
@@ -0,0 +1,40 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+ // W.J. :wumpus: van der Laan 2005 //
+
+ Material shader: Phong material vertex shader
+*/
+varying vec3 normal;
+varying vec2 texCoord0;
+varying float depth;
+
+void main()
+{
+
+ vec4 projPos = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ gl_Position = projPos;
+ depth = projPos.w;
+ texCoord0 = vec2(gl_MultiTexCoord0);
+
+ normal = vec3(gl_ModelViewMatrix*vec4(gl_Normal,0));
+}
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/hlsl/nm_notex_ps.hlsl b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/hlsl/nm_notex_ps.hlsl
new file mode 100644
index 00000000..5b681afe
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/hlsl/nm_notex_ps.hlsl
@@ -0,0 +1,56 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+ // W.J. :wumpus: van der Laan 2005 //
+
+ Material shader: Single colour normal mapped
+*/
+sampler Tex0: register(s0);
+
+struct OUTPUT
+{
+ float4 color0 : COLOR0; // Diffuse color + ?
+ float4 color1 : COLOR1; // Normal + depth
+};
+
+float3 colour;
+float specularity;
+
+OUTPUT main(
+ float3 normal: TEXCOORD0,
+ float4 texCoord0: TEXCOORD1,
+ float depth: TEXCOORD2,
+ float3 tangent: TEXCOORD3,
+ float3 binormal: TEXCOORD4
+)
+{
+ OUTPUT output;
+ // Frame for normal mapping
+ float3x3 rotation = float3x3(tangent, binormal, normal);
+ float3 texnormal = (tex2D(Tex0, texCoord0)-0.5)*2;
+
+ output.color0.rgb = colour;
+ output.color0.a = specularity;
+ output.color1.xyz = normalize(mul(texnormal,rotation)); // Do normalisation here, saves an operation per light
+ output.color1.w = depth;
+
+ return output;
+}
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/hlsl/nm_ps.hlsl b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/hlsl/nm_ps.hlsl
new file mode 100644
index 00000000..9b858713
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/hlsl/nm_ps.hlsl
@@ -0,0 +1,56 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+ // W.J. :wumpus: van der Laan 2005 //
+
+ Material shader: Textured normal mapped
+*/
+sampler Tex0: register(s0);
+sampler Tex1: register(s1);
+
+struct OUTPUT
+{
+ float4 color0 : COLOR0; // Diffuse color + ?
+ float4 color1 : COLOR1; // Normal + depth
+};
+
+float specularity;
+
+OUTPUT main(
+ float3 normal: TEXCOORD0,
+ float4 texCoord0: TEXCOORD1,
+ float depth: TEXCOORD2,
+ float3 tangent: TEXCOORD3,
+ float3 binormal: TEXCOORD4
+)
+{
+ OUTPUT output;
+ // Frame for normal mapping
+ float3x3 rotation = float3x3(tangent, binormal, normal);
+ float3 texnormal = (tex2D(Tex1, texCoord0)-0.5)*2;
+
+ output.color0.rgb = tex2D(Tex0, texCoord0);
+ output.color0.a = specularity;
+ output.color1.xyz = normalize(mul(texnormal,rotation)); // Do normalisation here, saves an operation per light
+ output.color1.w = depth;
+
+ return output;
+}
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/hlsl/nm_vs.hlsl b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/hlsl/nm_vs.hlsl
new file mode 100644
index 00000000..16c9274c
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/hlsl/nm_vs.hlsl
@@ -0,0 +1,61 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+ // W.J. :wumpus: van der Laan 2005 //
+
+ Material shader: Normal mapped
+*/
+struct VS_OUTPUT {
+ float4 pos: POSITION;
+ float4 normal: TEXCOORD0;
+ float2 texCoord0: TEXCOORD1;
+ float depth: TEXCOORD2;
+ float3 tangent: TEXCOORD3;
+ float3 binormal: TEXCOORD4;
+};
+
+float4x4 worldViewProj;
+float4x4 world;
+float4x4 worldView;
+
+VS_OUTPUT main(
+ float4 Pos: POSITION,
+ float3 normal: NORMAL,
+ float2 texCoord0: TEXCOORD0,
+ float3 tangent: TANGENT0
+){
+ VS_OUTPUT Out;
+
+ Out.normal = mul(worldView, normal);
+ float4 projPos = mul(worldViewProj, Pos);
+
+ Out.tangent = mul(worldView, tangent);
+ Out.binormal = cross(Out.normal, Out.tangent);
+
+ Out.pos = projPos;
+ Out.texCoord0 = texCoord0;
+ Out.depth = projPos.w;
+ //Out.depth = projPos.z/projPos.w;
+
+ return Out;
+}
+
+
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/hlsl/notex_ps.hlsl b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/hlsl/notex_ps.hlsl
new file mode 100644
index 00000000..c7daeebe
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/hlsl/notex_ps.hlsl
@@ -0,0 +1,47 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+ // W.J. :wumpus: van der Laan 2005 //
+
+ Material shader: Single colour phong
+*/
+struct OUTPUT
+{
+ float4 color0 : COLOR0; // Diffuse color
+ float4 color1 : COLOR1; // Position
+};
+
+float3 colour;
+float specularity;
+
+OUTPUT main(
+ float4 normal: TEXCOORD0,
+ float4 texCoord0: TEXCOORD1,
+ float depth: TEXCOORD2
+)
+{
+ OUTPUT output;
+ output.color0.rgb = colour;
+ output.color0.a = specularity;
+ output.color1.xyz = normal;
+ output.color1.w = depth;
+ return output;
+}
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/hlsl/ps.hlsl b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/hlsl/ps.hlsl
new file mode 100644
index 00000000..1e5f6965
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/hlsl/ps.hlsl
@@ -0,0 +1,48 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+ // W.J. :wumpus: van der Laan 2005 //
+
+ Material shader: Textured phongs
+*/
+sampler Tex0: register(s0);
+
+struct OUTPUT
+{
+ float4 color0 : COLOR0; // Diffuse color
+ float4 color1 : COLOR1; // Position
+};
+
+float specularity;
+
+OUTPUT main(
+ float4 normal: TEXCOORD0,
+ float4 texCoord0: TEXCOORD1,
+ float depth: TEXCOORD2
+)
+{
+ OUTPUT output;
+ output.color0.rgb = tex2D(Tex0, texCoord0);
+ output.color0.a = specularity;
+ output.color1.xyz = normalize(normal); // Do normalisation here, saves an operation per light
+ output.color1.w = depth;
+ return output;
+}
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/hlsl/vs.hlsl b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/hlsl/vs.hlsl
new file mode 100644
index 00000000..5292c3d0
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/material/hlsl/vs.hlsl
@@ -0,0 +1,54 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+ // W.J. :wumpus: van der Laan 2005 //
+
+ Material shader: Phong material vertex shader
+*/
+struct VS_OUTPUT {
+ float4 pos: POSITION;
+ float4 normal: TEXCOORD0;
+ float2 texCoord0: TEXCOORD1;
+ float1 depth: TEXCOORD2;
+};
+
+float4x4 worldViewProj;
+float4x4 world;
+float4x4 worldView;
+
+VS_OUTPUT main(
+ float4 Pos: POSITION,
+ float3 Normal: NORMAL,
+ float2 texCoord0: TEXCOORD0
+){
+ VS_OUTPUT Out;
+
+ Out.normal = mul(worldView, Normal);
+ float4 projPos = mul(worldViewProj, Pos);
+ Out.pos = projPos;
+ Out.texCoord0 = texCoord0;
+ Out.depth = projPos.w;
+ //Out.depth = projPos.z/projPos.w;
+
+ return Out;
+}
+
+
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/glsl/Ambient_ps.glsl b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/glsl/Ambient_ps.glsl
new file mode 100644
index 00000000..2984aefe
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/glsl/Ambient_ps.glsl
@@ -0,0 +1,56 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+ // W.J. :wumpus: van der Laan 2005 //
+
+ Post shader: Multipass, ambient (base) pass
+*/
+uniform sampler2D tex0;
+uniform sampler2D tex1;
+
+varying vec2 texCoord;
+varying vec3 projCoord;
+
+uniform mat4 proj;
+
+uniform vec3 ambientColor;
+
+void main()
+{
+ vec4 a0 = texture2D(tex0, texCoord); // Attribute 0: Diffuse color+shininess
+ vec4 a1 = texture2D(tex1, texCoord); // Attribute 1: Normal+depth
+
+ // Clip fragment if depth is too far, so the skybox can be rendered on the background
+ if(a1.w==0.0)
+ discard;
+
+ // Attributes
+ vec3 colour = a0.rgb;
+ float alpha = a0.a; // Specularity
+ float distance = a1.w; // Distance from viewer -- is zero if no lighting wanted
+
+ // Calculate ambient colour of fragment
+ gl_FragColor = vec4( ambientColor*colour ,0);
+
+ // Calculate depth of fragment; GL requires a 2.0* here as the range is [-1, 1]
+ // Also, see again how matrix is transposed ([3][2] instead of [2][3])
+ gl_FragDepth = projCoord.z*proj[2][2] + proj[3][2]/(2.0*distance);
+}
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/glsl/GlobalLight_ps.glsl b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/glsl/GlobalLight_ps.glsl
new file mode 100644
index 00000000..b77c4fc9
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/glsl/GlobalLight_ps.glsl
@@ -0,0 +1,96 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+ // W.J. :wumpus: van der Laan 2005 //
+
+ Post shader: Multipass, one light
+*/
+uniform sampler2D tex0;
+uniform sampler2D tex1;
+
+varying vec2 texCoord;
+varying vec3 projCoord;
+
+// Attributes of light
+uniform vec4 lightPos0;
+uniform vec3 lightDiffuseColor0;
+uniform vec3 lightSpecularColor0;
+
+// Global parameters for lights
+struct LightGlobal
+{
+ vec3 position;
+ vec3 normal;
+ vec3 viewDir;
+};
+
+// Current state of light
+struct LightAccum
+{
+ vec3 light_diffuse;
+ vec3 light_specular;
+};
+
+// Do lighting calculations for one light
+void processLight(
+ inout LightAccum accum,
+ LightGlobal global,
+ vec4 lightPos,
+ vec3 lightDiffuseColor,
+ vec3 lightSpecularColor)
+{
+ vec3 lightVec = vec3(lightPos) - global.position;
+ vec3 lightDir = normalize(lightVec);
+ accum.light_diffuse += max(0.0,dot(lightDir, global.normal)) * lightDiffuseColor;
+
+ vec3 h = normalize(global.viewDir + lightDir);
+ accum.light_specular += pow(dot(global.normal, h),32.0) * lightSpecularColor;
+}
+
+void main()
+{
+ vec4 a0 = texture2D(tex0, texCoord); // Attribute 0: Diffuse color+shininess
+ vec4 a1 = texture2D(tex1, texCoord); // Attribute 1: Normal+depth
+
+ // Attributes
+ vec3 colour = a0.rgb;
+ float alpha = a0.a; // Specularity
+ float distance = a1.w; // Distance from viewer -- is zero if no lighting wanted
+
+ LightGlobal global;
+ global.normal = a1.xyz;
+ global.position = projCoord*distance;
+
+ // Apply light
+ LightAccum accum;
+ accum.light_diffuse = vec3(0,0,0);
+ accum.light_specular = vec3(0,0,0);
+ global.viewDir = -normalize(global.position);
+
+ processLight(accum, global, lightPos0, lightDiffuseColor0, lightSpecularColor0);
+
+ // Calcalate total lighting for this fragment
+ vec3 total_light_contrib;
+ total_light_contrib = accum.light_diffuse+alpha*accum.light_specular;
+
+ // Calculate colour of fragment
+ gl_FragColor = vec4( total_light_contrib*colour ,0);
+}
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/glsl/LightMaterial_ps.glsl b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/glsl/LightMaterial_ps.glsl
new file mode 100644
index 00000000..e11b938a
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/glsl/LightMaterial_ps.glsl
@@ -0,0 +1,85 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+ // W.J. :wumpus: van der Laan 2005 //
+
+ Post shader: Light geometry material
+*/
+uniform sampler2D tex0;
+uniform sampler2D tex1;
+
+varying vec2 texCoord;
+varying vec3 projCoord;
+
+// World view matrix to get object position in view space
+uniform mat4 worldView;
+
+// Attributes of light
+uniform vec3 lightDiffuseColor;
+uniform vec3 lightSpecularColor;
+uniform vec3 lightFalloff;
+
+void main()
+{
+ vec4 a0 = texture2D(tex0, texCoord); // Attribute 0: Diffuse color+shininess
+ vec4 a1 = texture2D(tex1, texCoord); // Attribute 1: Normal+depth
+
+ // Attributes
+ vec3 colour = a0.rgb;
+ float alpha = a0.a; // Specularity
+ float distance = a1.w; // Distance from viewer (w)
+ vec3 normal = a1.xyz;
+
+ // Calculate position of texel in view space
+ vec3 position = projCoord*distance;
+
+ // Extract position in view space from worldView matrix
+ //vec3 lightPos = vec3(worldView[0][3],worldView[1][3],worldView[2][3]);
+ vec3 lightPos = vec3(worldView[3][0],worldView[3][1],worldView[3][2]);
+
+ // Calculate light direction and distance
+ vec3 lightVec = lightPos - position;
+ float len_sq = dot(lightVec, lightVec);
+ float len = sqrt(len_sq);
+ vec3 lightDir = lightVec/len;
+
+ /// Calculate attenuation
+ float attenuation = dot(lightFalloff, vec3(1, len, len_sq));
+
+ /// Calculate diffuse colour
+ vec3 light_diffuse = max(0.0,dot(lightDir, normal)) * lightDiffuseColor;
+
+ /// Calculate specular component
+ vec3 viewDir = -normalize(position);
+ vec3 h = normalize(viewDir + lightDir);
+ vec3 light_specular = pow(dot(normal, h),32.0) * lightSpecularColor;
+
+ // Calcalate total lighting for this fragment
+ vec3 total_light_contrib;
+ total_light_contrib = light_diffuse;
+ // Uncomment next line if specular desired
+ //total_light_contrib += alpha * light_specular;
+
+ gl_FragColor = vec4(total_light_contrib*colour/attenuation, 0);
+ //gl_FragColor = vec4(1.0/attenuation, 0.0,0.0,0.0);
+ //gl_FragColor = vec4(a1.xyz, 0.0);
+}
+
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/glsl/LightMaterial_vs.glsl b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/glsl/LightMaterial_vs.glsl
new file mode 100644
index 00000000..67fb852d
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/glsl/LightMaterial_vs.glsl
@@ -0,0 +1,61 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+ // W.J. :wumpus: van der Laan 2005 //
+
+ Post shader: Light geometry material
+*/
+varying vec2 texCoord;
+varying vec3 projCoord;
+
+uniform float vpWidth;
+uniform float vpHeight;
+uniform mat4 invProj;
+
+void main()
+{
+ vec4 projPos = gl_ModelViewProjectionMatrix * gl_Vertex;
+ projPos = projPos/projPos.w;
+
+ // projPos is now in nonhomogeneous 2d space -- this makes sure no perspective interpolation is
+ // done that could mess with our concept.
+ //gl_Position = projPos;
+ vec2 texSize = vec2(vpWidth, vpHeight);
+ vec2 tcTemp = vec2(projPos[0], projPos[1])/2.0+0.5;
+ tcTemp = (floor(tcTemp * texSize)+0.5)/texSize;
+
+ //float3 position = mul(invProj, float4(projCoord, 0, 1))*distance;
+ // Acquire view space position via inverse projection transformation
+ // Optimisation for perspective, symmetric view frustrums
+ // These interpolate over the frustrum plane for w=1
+
+ projCoord = vec3(projPos[0], projPos[1], 1)*vec3(
+ invProj[0][0], // X vector component from X
+ invProj[1][1], // Y vector component from Y
+ invProj[3][2] // Z vector component from W
+ );
+
+ //projCoord = vec3(invProj*vec4(projPos[0], projPos[1], 0, 1));
+
+ // Texture coordinate magic, this compensates for jitter
+ texCoord = vec2(tcTemp[0], 1.0-tcTemp[1]);
+ gl_Position = vec4((tcTemp-0.5)*2.0, 0.0, 1.0);
+}
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/glsl/ShowColour_ps.glsl b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/glsl/ShowColour_ps.glsl
new file mode 100644
index 00000000..463237d7
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/glsl/ShowColour_ps.glsl
@@ -0,0 +1,39 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+ // W.J. :wumpus: van der Laan 2005 //
+
+ Post shader: Debug, show colour channel
+*/
+uniform sampler2D tex0;
+uniform sampler2D tex1;
+
+varying vec2 texCoord;
+varying vec3 projCoord;
+
+void main()
+{
+ vec4 a0 = texture2D(tex0, texCoord); // Attribute 0: Diffuse color+shininess
+ vec4 a1 = texture2D(tex1, texCoord); // Attribute 1: Normal+depth
+
+ gl_FragColor=vec4(a0.xyz, 0);
+}
+
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/glsl/ShowDS_ps.glsl b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/glsl/ShowDS_ps.glsl
new file mode 100644
index 00000000..21929a7d
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/glsl/ShowDS_ps.glsl
@@ -0,0 +1,39 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+ // W.J. :wumpus: van der Laan 2005 //
+
+ Post shader: Debug, show depth and specularity channel
+*/
+uniform sampler2D tex0;
+uniform sampler2D tex1;
+
+varying vec2 texCoord;
+varying vec3 projCoord;
+
+void main()
+{
+ vec4 a0 = texture2D(tex0, texCoord); // Attribute 0: Diffuse color+shininess
+ vec4 a1 = texture2D(tex1, texCoord); // Attribute 1: Normal+depth
+
+ gl_FragColor=vec4(a0.w, 0, a1.w/1000.0, 0);
+}
+
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/glsl/ShowNormal_ps.glsl b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/glsl/ShowNormal_ps.glsl
new file mode 100644
index 00000000..3e0c5238
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/glsl/ShowNormal_ps.glsl
@@ -0,0 +1,39 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+ // W.J. :wumpus: van der Laan 2005 //
+
+ Post shader: Debug, show normal channel
+*/
+uniform sampler2D tex0;
+uniform sampler2D tex1;
+
+varying vec2 texCoord;
+varying vec3 projCoord;
+
+void main()
+{
+ vec4 a0 = texture2D(tex0, texCoord); // Attribute 0: Diffuse color+shininess
+ vec4 a1 = texture2D(tex1, texCoord); // Attribute 1: Normal+depth
+
+ gl_FragColor=vec4((a1.xyz+vec3(1))*0.5,0);
+}
+
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/glsl/SinglePass_ps.glsl b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/glsl/SinglePass_ps.glsl
new file mode 100644
index 00000000..f55b3c18
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/glsl/SinglePass_ps.glsl
@@ -0,0 +1,111 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+ // W.J. :wumpus: van der Laan 2005 //
+
+ Post shader: Single pass
+*/
+uniform sampler2D tex0;
+uniform sampler2D tex1;
+
+varying vec2 texCoord;
+varying vec3 projCoord;
+
+uniform mat4 proj;
+
+uniform vec3 ambientColor;
+// Attributes of light 0
+uniform vec4 lightPos0;
+uniform vec3 lightDiffuseColor0;
+uniform vec3 lightSpecularColor0;
+// Attributes of light 1
+uniform vec4 lightPos1;
+uniform vec3 lightDiffuseColor1;
+uniform vec3 lightSpecularColor1;
+
+// Global parameters for lights
+struct LightGlobal
+{
+ vec3 position;
+ vec3 normal;
+ vec3 viewDir;
+};
+
+// Current state of light
+struct LightAccum
+{
+ vec3 light_diffuse;
+ vec3 light_specular;
+};
+
+// Do lighting calculations for one light
+void processLight(
+ inout LightAccum accum,
+ LightGlobal global,
+ vec4 lightPos,
+ vec3 lightDiffuseColor,
+ vec3 lightSpecularColor)
+{
+ vec3 lightVec = vec3(lightPos) - global.position;
+ vec3 lightDir = normalize(lightVec);
+ accum.light_diffuse += max(0.0,dot(lightDir, global.normal)) * lightDiffuseColor;
+
+ vec3 h = normalize(global.viewDir + lightDir);
+ accum.light_specular += pow(dot(global.normal, h),32.0) * lightSpecularColor;
+}
+
+void main()
+{
+ vec4 a0 = texture2D(tex0, texCoord); // Attribute 0: Diffuse color+shininess
+ vec4 a1 = texture2D(tex1, texCoord); // Attribute 1: Normal+depth
+
+ // Clip fragment if depth is too far, so the skybox can be rendered on the background
+ if(a1.w==0.0)
+ discard;
+
+ // Attributes
+ vec3 colour = a0.rgb;
+ float alpha = a0.a; // Specularity
+ float distance = a1.w; // Distance from viewer -- is zero if no lighting wanted
+
+ LightGlobal global;
+ global.normal = a1.xyz;
+ global.position = projCoord*distance;
+
+ // Apply light
+ LightAccum accum;
+ accum.light_diffuse = vec3(0,0,0);
+ accum.light_specular = vec3(0,0,0);
+ global.viewDir = -normalize(global.position);
+
+ processLight(accum, global, lightPos0, lightDiffuseColor0, lightSpecularColor0);
+ processLight(accum, global, lightPos1, lightDiffuseColor1, lightSpecularColor1);
+
+ // Calcalate total lighting for this fragment
+ vec3 total_light_contrib;
+ total_light_contrib = ambientColor+accum.light_diffuse+alpha*accum.light_specular;
+
+ // Calculate colour of fragment
+ gl_FragColor = vec4( total_light_contrib*colour ,0);
+
+ // Calculate depth of fragment; GL requires a 2.0* here as the range is [-1, 1]
+ gl_FragDepth = projCoord.z*proj[2][2] + proj[3][2]/(2.0*distance);
+}
\ No newline at end of file
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/glsl/vs.glsl b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/glsl/vs.glsl
new file mode 100644
index 00000000..51b46227
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/glsl/vs.glsl
@@ -0,0 +1,42 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+ // W.J. :wumpus: van der Laan 2005 //
+
+ Post shader: Generic fullscreen quad
+*/
+varying vec2 texCoord;
+varying vec3 projCoord;
+
+uniform mat4 invProj;
+
+void main()
+{
+ vec2 inPos = sign(gl_Vertex.xy);
+ gl_Position = vec4(inPos.xy, 0.0, 1.0);
+
+ texCoord = (vec2(inPos.x, -inPos.y) + 1.0)/2.0;
+
+ // Projection coordinates
+ // Inverted projection matrix
+ // These interpolate over the frustrum plane for w=1
+ projCoord = vec3(invProj*vec4(inPos.x, inPos.y, 0, 1));
+}
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/hlsl/Ambient_ps.hlsl b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/hlsl/Ambient_ps.hlsl
new file mode 100644
index 00000000..feb4f01d
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/hlsl/Ambient_ps.hlsl
@@ -0,0 +1,55 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+ // W.J. :wumpus: van der Laan 2005 //
+
+ Post shader: Multipass, ambient (base) pass
+*/
+sampler Tex0: register(s0);
+sampler Tex1: register(s1);
+
+// Ambient and depth pass
+float4 ambientColor;
+
+float4x4 proj;
+
+struct POUTPUT
+{
+ float4 colour: COLOR;
+ float depth: DEPTH;
+};
+
+POUTPUT main(float2 texCoord: TEXCOORD0, float3 projCoord: TEXCOORD1)
+{
+ float4 a0 = tex2D(Tex0, texCoord); // Attribute 0: Diffuse color+shininess
+ float4 a1 = tex2D(Tex1, texCoord); // Attribute 1: Normal+depth
+
+ // Clip fragment if depth is too close, so the skybox can be rendered on the background
+ clip(a1.w-0.001);
+
+ // Attributes
+ POUTPUT o;
+ float3 colour = a0.rgb;
+ o.colour = float4( ambientColor*colour ,0);
+ o.depth = projCoord.z*proj[2][2] + proj[2][3]/a1.w;
+ return o;
+}
+
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/hlsl/GlobalLight_ps.hlsl b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/hlsl/GlobalLight_ps.hlsl
new file mode 100644
index 00000000..6e7fc28d
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/hlsl/GlobalLight_ps.hlsl
@@ -0,0 +1,101 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+ // W.J. :wumpus: van der Laan 2005 //
+
+ Post shader: Multipass, one light
+*/
+sampler Tex0: register(s0);
+sampler Tex1: register(s1);
+
+// Attributes of light 0
+float4 lightPos0;
+float4 lightDiffuseColor0;
+float4 lightSpecularColor0;
+
+// Global parameters for lights
+struct LightGlobal
+{
+ float3 position;
+ float3 normal;
+ float3 viewDir;
+};
+
+// Current state of light
+struct LightAccum
+{
+ float3 light_diffuse;
+ float3 light_specular;
+};
+
+// Do lighting calculations for one light
+void processLight(
+ inout LightAccum accum,
+ LightGlobal global,
+ float4 lightPos,
+ float4 lightDiffuseColor,
+ float4 lightSpecularColor)
+{
+ float3 lightVec = lightPos - global.position;
+ float3 lightDir = normalize(lightVec);
+ accum.light_diffuse += max(0,dot(lightDir, global.normal)) * lightDiffuseColor;
+
+ float3 h = normalize(global.viewDir + lightDir);
+ accum.light_specular += pow(dot(global.normal, h),32) * lightSpecularColor;
+}
+
+float4 main(float2 texCoord: TEXCOORD0, float3 projCoord: TEXCOORD1) : COLOR
+{
+ float4 a0 = tex2D(Tex0, texCoord); // Attribute 0: Diffuse color+shininess
+ float4 a1 = tex2D(Tex1, texCoord); // Attribute 1: Normal+depth
+
+ LightGlobal global;
+
+ // Clip fragment if depth is too close, so the skybox can be rendered on the background
+ //clip(a1.w-0.001);
+
+ // Attributes
+ float3 colour = a0.rgb;
+ float alpha = a0.a; // Specularity
+ float distance = a1.w; // Distance from viewer
+ //global.normal = normalize(a1.xyz);
+ global.normal = a1.xyz;
+
+ // Acquire view space position via inverse projection transformation
+ //global.position = mul(invProj, float4(projCoord, 0, 1))*distance;
+ global.position = projCoord*distance;
+
+ // Apply light
+ LightAccum accum;
+ accum.light_diffuse = float3(0,0,0);
+ accum.light_specular = float3(0,0,0);
+ global.viewDir = -normalize(global.position);
+
+ processLight(accum, global, lightPos0, lightDiffuseColor0, lightSpecularColor0);
+
+ // Calcalate total lighting for this fragment
+ float3 total_light_contrib;
+ total_light_contrib = accum.light_diffuse+alpha*accum.light_specular;
+ return float4( total_light_contrib*colour ,0);
+ //return float4(accum.light_diffuse,0);
+ //return float4(global.position/1000.0,0);
+}
+
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/hlsl/LightMaterial_ps.hlsl b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/hlsl/LightMaterial_ps.hlsl
new file mode 100644
index 00000000..ede10ddd
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/hlsl/LightMaterial_ps.hlsl
@@ -0,0 +1,89 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+ // W.J. :wumpus: van der Laan 2005 //
+
+ Post shader: Light geometry material
+*/
+sampler Tex0: register(s0);
+sampler Tex1: register(s1);
+
+float4x4 worldView;
+
+// Attributes of light
+float4 lightDiffuseColor;
+float4 lightSpecularColor;
+float4 lightFalloff;
+
+float4 main(float2 texCoord: TEXCOORD0, float3 projCoord: TEXCOORD1) : COLOR
+{
+ float4 a0 = tex2D(Tex0, texCoord); // Attribute 0: Diffuse color+shininess
+ float4 a1 = tex2D(Tex1, texCoord); // Attribute 1: Normal+depth
+
+ // Attributes
+ float3 colour = a0.rgb;
+ float alpha = a0.a; // Specularity
+ float distance = a1.w; // Distance from viewer (w)
+ float3 normal = a1.xyz;
+
+ // Calculate position of texel in view space
+ float3 position = projCoord*distance;
+
+ // Extract position in view space from worldView matrix
+ float3 lightPos = float3(worldView[0][3],worldView[1][3],worldView[2][3]);
+
+ // Calculate light direction and distance
+ float3 lightVec = lightPos - position;
+ float len_sq = dot(lightVec, lightVec);
+ float len = sqrt(len_sq);
+ float3 lightDir = lightVec/len;
+
+ /// Calculate attenuation
+ float attenuation = dot(lightFalloff, float3(1, len, len_sq));
+
+ /// Calculate diffuse colour
+ float3 light_diffuse = max(0,dot(lightDir, normal)) * lightDiffuseColor;
+
+ /// Calculate specular component
+ float3 viewDir = -normalize(position);
+ float3 h = normalize(viewDir + lightDir);
+ float3 light_specular = pow(dot(normal, h),32) * lightSpecularColor;
+
+ // Calcalate total lighting for this fragment
+ float3 total_light_contrib;
+ total_light_contrib = light_diffuse;
+ // Uncomment next line if specular desired
+ //total_light_contrib += alpha * light_specular;
+
+ return float4(total_light_contrib*colour/attenuation, 0);
+}
+// Debugging only
+ //return lightDiffuseColor;
+ //return lightDiffuseColor/attenuation;
+ //return float4(abs(position-position2),0);
+ //return length(lightPos-position)/1000.0;
+ //return float4(abs(lightPos-lightPos2),0);
+ //return float4(lightPos-position,0);
+ //return float4(-global.position/1000.0f,0);
+ //return float4(global.position/1000.0,0);
+ ///return float4(lightPos[0], lightPos[1], -lightPos[2], 0)/1000.0f;
+ //return lightDiffuseColor*a0.xyzw/2;
+
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/hlsl/LightMaterial_vs.hlsl b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/hlsl/LightMaterial_vs.hlsl
new file mode 100644
index 00000000..2c3229be
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/hlsl/LightMaterial_vs.hlsl
@@ -0,0 +1,69 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+ // W.J. :wumpus: van der Laan 2005 //
+
+ Post shader: Light geometry material
+*/
+struct VS_OUTPUT {
+ float4 pos: POSITION;
+ float2 texCoord: TEXCOORD0;
+ float3 projCoord: TEXCOORD1;
+};
+
+uniform float vpWidth, vpHeight;
+uniform float4x4 worldViewProj;
+uniform float4x4 invProj;
+
+VS_OUTPUT main(
+ float4 Pos: POSITION
+){
+ VS_OUTPUT Out;
+
+ float4 projPos = mul(worldViewProj, Pos);
+ projPos = projPos/projPos.w;
+ //projPos[2] = 0;
+
+ // projPos is now in nonhomogeneous 2d space -- this makes sure no perspective interpolation is
+ // done that could mess with our concept.
+ Out.pos = projPos;
+
+ //float3 position = mul(invProj, float4(projCoord, 0, 1))*distance;
+ // Acquire view space position via inverse projection transformation
+ // Optimisation for perspective, symmetric view frustrums
+ // These interpolate over the frustrum plane for w=1
+ Out.projCoord = float3(projPos[0], projPos[1], 1)*float3(
+ invProj[0][0], // X vector component from X
+ invProj[1][1], // Y vector component from Y
+ invProj[2][3] // Z vector component from W
+ );
+
+ // Texture coordinate magic, this compensates for jitter
+ float2 texCoord = float2(projPos[0]/2+0.5, -projPos[1]/2+0.5);
+ float2 texSize = float2(vpWidth, vpHeight);
+ texCoord = floor(texCoord * texSize)/texSize;
+ Out.texCoord = texCoord;
+
+
+ return Out;
+}
+
+
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/hlsl/ShowColour_ps.hlsl b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/hlsl/ShowColour_ps.hlsl
new file mode 100644
index 00000000..bed4b630
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/hlsl/ShowColour_ps.hlsl
@@ -0,0 +1,36 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+ // W.J. :wumpus: van der Laan 2005 //
+
+ Post shader: Debug, show colour channel
+*/
+sampler Tex0: register(s0);
+sampler Tex1: register(s1);
+
+float4 main(float2 texCoord: TEXCOORD0, float2 projCoord: TEXCOORD1) : COLOR
+{
+ float4 a0 = tex2D(Tex0, texCoord); // Attribute 0: Diffuse color+shininess
+ float4 a1 = tex2D(Tex1, texCoord); // Attribute 1: Normal+depth
+
+ return float4(a0.xyz, 0);
+}
+
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/hlsl/ShowDS_ps.hlsl b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/hlsl/ShowDS_ps.hlsl
new file mode 100644
index 00000000..9512f92d
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/hlsl/ShowDS_ps.hlsl
@@ -0,0 +1,36 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+ // W.J. :wumpus: van der Laan 2005 //
+
+ Post shader: Debug, show depth and specularity channel
+*/
+sampler Tex0: register(s0);
+sampler Tex1: register(s1);
+
+float4 main(float2 texCoord: TEXCOORD0, float2 projCoord: TEXCOORD1) : COLOR
+{
+ float4 a0 = tex2D(Tex0, texCoord); // Attribute 0: Diffuse color+shininess
+ float4 a1 = tex2D(Tex1, texCoord); // Attribute 1: Normal+depth
+
+ return float4(a0.w, 0, a1.w/1000.0, 0);
+}
+
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/hlsl/ShowNormal_ps.hlsl b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/hlsl/ShowNormal_ps.hlsl
new file mode 100644
index 00000000..dd767899
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/hlsl/ShowNormal_ps.hlsl
@@ -0,0 +1,38 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+ // W.J. :wumpus: van der Laan 2005 //
+
+ Post shader: Debug, show normal channel
+*/
+sampler Tex0: register(s0);
+sampler Tex1: register(s1);
+
+float4 main(float2 texCoord: TEXCOORD0, float2 projCoord: TEXCOORD1) : COLOR
+{
+ float4 a0 = tex2D(Tex0, texCoord); // Attribute 0: Diffuse color+shininess
+ float4 a1 = tex2D(Tex1, texCoord); // Attribute 1: Normal+depth
+
+ return float4((a1.xyz+1)*0.5,0);
+ //float d=dot(a1.xyz,float3(0,0,1))*2.0+0.5;
+ //return float4(1,0,0,0)*d+float4(0,0,1,0)*(1-d);
+}
+
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/hlsl/SinglePass_ps.hlsl b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/hlsl/SinglePass_ps.hlsl
new file mode 100644
index 00000000..c3175349
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/hlsl/SinglePass_ps.hlsl
@@ -0,0 +1,132 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+ // W.J. :wumpus: van der Laan 2005 //
+
+ Post shader: Single pass
+*/
+sampler Tex0: register(s0);
+sampler Tex1: register(s1);
+
+float4x4 proj;
+
+float4 ambientColor;
+// Attributes of light 0
+float4 lightPos0;
+float4 lightDiffuseColor0;
+float4 lightSpecularColor0;
+// Attributes of light 1
+float4 lightPos1;
+float4 lightDiffuseColor1;
+float4 lightSpecularColor1;
+
+// Global parameters for lights
+struct LightGlobal
+{
+ float3 position;
+ float3 normal;
+ float3 viewDir;
+};
+
+// Current state of light
+struct LightAccum
+{
+ float3 light_diffuse;
+ float3 light_specular;
+};
+
+// Do lighting calculations for one light
+void processLight(
+ inout LightAccum accum,
+ LightGlobal global,
+ float4 lightPos,
+ float4 lightDiffuseColor,
+ float4 lightSpecularColor)
+{
+ float3 lightVec = lightPos - global.position;
+ float3 lightDir = normalize(lightVec);
+ accum.light_diffuse += max(0,dot(lightDir, global.normal)) * lightDiffuseColor;
+
+ float3 h = normalize(global.viewDir + lightDir);
+ accum.light_specular += pow(dot(global.normal, h),32) * lightSpecularColor;
+}
+
+struct POUTPUT
+{
+ float4 colour: COLOR;
+ float depth: DEPTH;
+};
+
+POUTPUT main(float2 texCoord: TEXCOORD0, float3 projCoord: TEXCOORD1)
+{
+ POUTPUT o;
+
+ float4 a0 = tex2D(Tex0, texCoord); // Attribute 0: Diffuse color+shininess
+ float4 a1 = tex2D(Tex1, texCoord); // Attribute 1: Normal+depth
+
+ LightGlobal global;
+
+ // Clip fragment if depth is too far, so the skybox can be rendered on the background
+ clip(a1.w-0.001);
+
+ // Attributes
+ float3 colour = a0.rgb;
+ float alpha = a0.a; // Specularity
+ float distance = a1.w; // Distance from viewer -- is zero if no lighting wanted
+ //global.normal = normalize(a1.xyz); // normalizing done already
+ global.normal = a1.xyz;
+
+ // Acquire view space position via inverse projection transformation
+ //global.position = mul(invProj, float4(projCoord, 0, 1))*distance;
+ // Acquire view space position via inverse projection transformation
+ //float4 tpos;
+ //tpos = float4(projCoord, distance, 1.0);
+ //tpos = mul(invProj, tpos);
+ //tpos = tpos / tpos.w;
+ //global.position = tpos;
+ //global.position = float3(
+ // invProj[0][0], // X vector component from X
+ // invProj[1][1], // Y vector component from Y
+ // invProj[2][3] // Z vector component from W
+ //)*projCoord*distance;
+ global.position = projCoord*distance;
+
+ // Apply light
+ LightAccum accum;
+ accum.light_diffuse = float3(0,0,0);
+ accum.light_specular = float3(0,0,0);
+ global.viewDir = -normalize(global.position);
+
+ processLight(accum, global, lightPos0, lightDiffuseColor0, lightSpecularColor0);
+ processLight(accum, global, lightPos1, lightDiffuseColor1, lightSpecularColor1);
+
+ // Calcalate total lighting for this fragment
+ float3 total_light_contrib;
+ total_light_contrib = ambientColor+accum.light_diffuse+alpha*accum.light_specular;
+
+ o.colour = float4( total_light_contrib*colour ,0);
+ // Depth buffer value
+ // Transfering depth makes it possible to render particle effects and other transparent
+ // things unaffected by light in the postprocessing phase.
+ o.depth = projCoord.z*proj[2][2] + proj[2][3]/distance;
+ return o;
+}
+
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/hlsl/vs.hlsl b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/hlsl/vs.hlsl
new file mode 100644
index 00000000..9a16edd2
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/DeferredShading/post/hlsl/vs.hlsl
@@ -0,0 +1,59 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+ // W.J. :wumpus: van der Laan 2005 //
+
+ Post shader: Generic fullscreen quad
+*/
+struct VS_OUTPUT {
+ float4 Pos: POSITION;
+ float2 texCoord: TEXCOORD0;
+ float3 projCoord: TEXCOORD1;
+};
+float4x4 invProj;
+
+VS_OUTPUT main(float4 Pos: POSITION){
+ VS_OUTPUT Out;
+
+ // Clean up inaccuracies
+ Pos.xy = sign(Pos.xy);
+
+ Out.Pos = float4(Pos.xy, 0, 1);
+
+ // Image-space
+ Out.texCoord.x = 0.5 * (1 + Pos.x);
+ Out.texCoord.y = 0.5 * (1 - Pos.y);
+
+ // Projection coordinates
+ // Inverted projection matrix
+ // These interpolate over the frustrum plane for w=1
+ Out.projCoord = float3(Pos.x, Pos.y, 1) *
+ float3(
+ invProj[0][0], // X vector component from X
+ invProj[1][1], // Y vector component from Y
+ invProj[2][3] // Z vector component from W
+ );
+
+ return Out;
+}
+
+
+
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred.glsl.program b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred.glsl.program
new file mode 100644
index 00000000..17c9ca54
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred.glsl.program
@@ -0,0 +1,50 @@
+// Materials for rendering to the fat buffer
+
+// Plain phong
+vertex_program DeferredShading/material/glsl/vs glsl
+{
+ source DeferredShading/material/glsl/vs.glsl
+}
+fragment_program DeferredShading/material/glsl/ps glsl
+{
+ source DeferredShading/material/glsl/ps.glsl
+ default_params
+ {
+ param_named specularity float 0.0
+ }
+}
+fragment_program DeferredShading/material/glsl/notex_ps glsl
+{
+ source DeferredShading/material/glsl/notex_ps.glsl
+ default_params
+ {
+ param_named specularity float 0.0
+ param_named colour float3 0.7 0.7 0.7
+ }
+}
+
+// Normal mapping
+vertex_program DeferredShading/material/glsl/nm_vs glsl
+{
+ source DeferredShading/material/glsl/nm_vs.glsl
+}
+fragment_program DeferredShading/material/glsl/nm_ps glsl
+{
+ source DeferredShading/material/glsl/nm_ps.glsl
+ default_params
+ {
+ param_named specularity float 0.0
+ param_named tex0 int 0
+ param_named normTex int 1
+ }
+}
+fragment_program DeferredShading/material/glsl/nm_notex_ps glsl
+{
+ source DeferredShading/material/glsl/nm_notex_ps.glsl
+ default_params
+ {
+ param_named colour float3 0.7 0.7 0.7
+ param_named specularity float 0.0
+ param_named normTex int 0
+ }
+}
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred.hlsl.program b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred.hlsl.program
new file mode 100644
index 00000000..7772fa1f
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred.hlsl.program
@@ -0,0 +1,70 @@
+// Materials for rendering to the fat buffer
+
+// Plain phong
+vertex_program DeferredShading/material/hlsl/vs hlsl
+{
+ source DeferredShading/material/hlsl/vs.hlsl
+ target vs_1_1
+ entry_point main
+
+ default_params
+ {
+ param_named_auto worldView worldview_matrix
+ param_named_auto worldViewProj worldviewproj_matrix
+ }
+}
+fragment_program DeferredShading/material/hlsl/ps hlsl
+{
+ source DeferredShading/material/hlsl/ps.hlsl
+ target ps_2_0
+ entry_point main
+ default_params
+ {
+ param_named specularity float 0.0
+ }
+}
+fragment_program DeferredShading/material/hlsl/notex_ps hlsl
+{
+ source DeferredShading/material/hlsl/notex_ps.hlsl
+ target ps_2_0
+ entry_point main
+ default_params
+ {
+ param_named specularity float 0.0
+ }
+}
+
+// Normal mapping
+vertex_program DeferredShading/material/hlsl/nm_vs hlsl
+{
+ source DeferredShading/material/hlsl/nm_vs.hlsl
+ target vs_1_1
+ entry_point main
+
+ default_params
+ {
+ param_named_auto worldView worldview_matrix
+ param_named_auto worldViewProj worldviewproj_matrix
+ }
+}
+fragment_program DeferredShading/material/hlsl/nm_ps hlsl
+{
+ source DeferredShading/material/hlsl/nm_ps.hlsl
+ target ps_2_0
+ entry_point main
+ default_params
+ {
+ param_named specularity float 0.0
+ }
+}
+fragment_program DeferredShading/material/hlsl/nm_notex_ps hlsl
+{
+ source DeferredShading/material/hlsl/nm_notex_ps.hlsl
+ target ps_2_0
+ entry_point main
+ default_params
+ {
+ param_named colour float3 0.7 0.7 0.7
+ param_named specularity float 0.0
+ }
+}
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred.material b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred.material
new file mode 100644
index 00000000..88c6ae5b
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred.material
@@ -0,0 +1,152 @@
+// Materials for rendering to the fat buffer
+
+// Textured Phong shading material
+material DeferredShading/Material/TexturedPhong
+{
+ technique hlsl
+ {
+ pass main
+ {
+ vertex_program_ref DeferredShading/material/hlsl/vs
+ {
+ }
+ fragment_program_ref DeferredShading/material/hlsl/ps
+ {
+ }
+
+ texture_unit
+ {
+ }
+ }
+ }
+ technique glsl
+ {
+ pass main
+ {
+ vertex_program_ref DeferredShading/material/glsl/vs
+ {
+ }
+ fragment_program_ref DeferredShading/material/glsl/ps
+ {
+ }
+
+ texture_unit
+ {
+ }
+ }
+ }
+}
+
+// Untextured Phong shading material
+material DeferredShading/Material/UntexturedPhong
+{
+ technique hlsl
+ {
+ pass main
+ {
+ vertex_program_ref DeferredShading/material/hlsl/vs
+ {
+ }
+ fragment_program_ref DeferredShading/material/hlsl/notex_ps
+ {
+ }
+ }
+ }
+ technique glsl
+ {
+ pass main
+ {
+ vertex_program_ref DeferredShading/material/glsl/vs
+ {
+ }
+ fragment_program_ref DeferredShading/material/glsl/notex_ps
+ {
+ }
+ }
+ }
+}
+
+// Textured normal mapped material
+material DeferredShading/Material/TexturedNormalMapped
+{
+ technique hlsl
+ {
+ pass main
+ {
+ vertex_program_ref DeferredShading/material/hlsl/nm_vs
+ {
+ }
+ fragment_program_ref DeferredShading/material/hlsl/nm_ps
+ {
+ }
+
+ texture_unit
+ {
+ }
+ texture_unit
+ {
+ tex_coord_set 1
+ }
+ }
+ }
+ technique glsl
+ {
+ pass main
+ {
+ vertex_program_ref DeferredShading/material/glsl/nm_vs
+ {
+ }
+ fragment_program_ref DeferredShading/material/glsl/nm_ps
+ {
+ }
+
+ texture_unit
+ {
+ }
+ texture_unit
+ {
+ tex_coord_set 1
+ }
+ }
+ }
+}
+
+// Untextured normal mapped material
+material DeferredShading/Material/UntexturedNormalMapped
+{
+ technique hlsl
+ {
+ pass main
+ {
+ vertex_program_ref DeferredShading/material/hlsl/nm_vs
+ {
+ }
+ fragment_program_ref DeferredShading/material/hlsl/nm_notex_ps
+ {
+ }
+ texture_unit
+ {
+ }
+ }
+ }
+ technique glsl
+ {
+ pass main
+ {
+ vertex_program_ref DeferredShading/material/glsl/nm_vs
+ {
+ }
+ fragment_program_ref DeferredShading/material/glsl/nm_notex_ps
+ {
+ }
+ texture_unit
+ {
+ tex_coord_set 0
+ }
+ texture_unit
+ {
+ tex_coord_set 1
+ }
+ }
+ }
+}
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_debug.glsl.program b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_debug.glsl.program
new file mode 100644
index 00000000..98151f31
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_debug.glsl.program
@@ -0,0 +1,27 @@
+fragment_program DeferredShading/post/glsl/ShowNormal_ps glsl
+{
+ source DeferredShading/post/glsl/ShowNormal_ps.glsl
+ default_params
+ {
+ param_named tex0 int 0
+ param_named tex1 int 1
+ }
+}
+fragment_program DeferredShading/post/glsl/ShowDS_ps glsl
+{
+ source DeferredShading/post/glsl/ShowDS_ps.glsl
+ default_params
+ {
+ param_named tex0 int 0
+ param_named tex1 int 1
+ }
+}
+fragment_program DeferredShading/post/glsl/ShowColour_ps glsl
+{
+ source DeferredShading/post/glsl/ShowColour_ps.glsl
+ default_params
+ {
+ param_named tex0 int 0
+ param_named tex1 int 1
+ }
+}
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_debug.hlsl.program b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_debug.hlsl.program
new file mode 100644
index 00000000..494c640e
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_debug.hlsl.program
@@ -0,0 +1,18 @@
+fragment_program DeferredShading/post/hlsl/ShowNormal_ps hlsl
+{
+ source DeferredShading/post/hlsl/ShowNormal_ps.hlsl
+ target ps_2_0
+ entry_point main
+}
+fragment_program DeferredShading/post/hlsl/ShowDS_ps hlsl
+{
+ source DeferredShading/post/hlsl/ShowDS_ps.hlsl
+ target ps_2_0
+ entry_point main
+}
+fragment_program DeferredShading/post/hlsl/ShowColour_ps hlsl
+{
+ source DeferredShading/post/hlsl/ShowColour_ps.hlsl
+ target ps_2_0
+ entry_point main
+}
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_debug.material b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_debug.material
new file mode 100644
index 00000000..b74a6e6f
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_debug.material
@@ -0,0 +1,172 @@
+material DeferredShading/Post/ShowNormal
+{
+ technique
+ {
+ pass
+ {
+ cull_hardware none
+ cull_software none
+ depth_func always_pass
+
+ fragment_program_ref DeferredShading/post/hlsl/ShowNormal_ps
+ {
+ }
+ vertex_program_ref DeferredShading/post/hlsl/vs
+ {
+ }
+ texture_unit
+ {
+ tex_address_mode clamp
+ filtering none
+ }
+ texture_unit
+ {
+ tex_coord_set 1
+ tex_address_mode clamp
+ filtering none
+ }
+ }
+ }
+ technique
+ {
+ pass
+ {
+ cull_hardware none
+ cull_software none
+ depth_func always_pass
+
+ fragment_program_ref DeferredShading/post/glsl/ShowNormal_ps
+ {
+ }
+ vertex_program_ref DeferredShading/post/glsl/vs
+ {
+ }
+ texture_unit
+ {
+ tex_address_mode clamp
+ filtering none
+ }
+ texture_unit
+ {
+ tex_coord_set 1
+ tex_address_mode clamp
+ filtering none
+ }
+ }
+ }
+}
+
+material DeferredShading/Post/ShowDS
+{
+ technique
+ {
+ pass
+ {
+ cull_hardware none
+ cull_software none
+ depth_func always_pass
+
+ fragment_program_ref DeferredShading/post/hlsl/ShowDS_ps
+ {
+ }
+ vertex_program_ref DeferredShading/post/hlsl/vs
+ {
+ }
+ texture_unit
+ {
+ tex_address_mode clamp
+ filtering none
+ }
+ texture_unit
+ {
+ tex_coord_set 1
+ tex_address_mode clamp
+ filtering none
+ }
+ }
+ }
+ technique
+ {
+ pass
+ {
+ cull_hardware none
+ cull_software none
+ depth_func always_pass
+
+ fragment_program_ref DeferredShading/post/glsl/ShowDS_ps
+ {
+ }
+ vertex_program_ref DeferredShading/post/glsl/vs
+ {
+ }
+ texture_unit
+ {
+ tex_address_mode clamp
+ filtering none
+ }
+ texture_unit
+ {
+ tex_coord_set 1
+ tex_address_mode clamp
+ filtering none
+ }
+ }
+ }
+}
+material DeferredShading/Post/ShowColour
+{
+ technique
+ {
+ pass
+ {
+ cull_hardware none
+ cull_software none
+ depth_func always_pass
+
+ fragment_program_ref DeferredShading/post/hlsl/ShowColour_ps
+ {
+ }
+ vertex_program_ref DeferredShading/post/hlsl/vs
+ {
+ }
+ texture_unit
+ {
+ tex_address_mode clamp
+ filtering none
+ }
+ texture_unit
+ {
+ tex_coord_set 1
+ tex_address_mode clamp
+ filtering none
+ }
+ }
+ }
+ technique
+ {
+ pass
+ {
+ cull_hardware none
+ cull_software none
+ depth_func always_pass
+
+ fragment_program_ref DeferredShading/post/glsl/ShowColour_ps
+ {
+ }
+ vertex_program_ref DeferredShading/post/glsl/vs
+ {
+ }
+ texture_unit
+ {
+ tex_address_mode clamp
+ filtering none
+ }
+ texture_unit
+ {
+ tex_coord_set 1
+ tex_address_mode clamp
+ filtering none
+ }
+ }
+ }
+}
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_minilight.glsl.program b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_minilight.glsl.program
new file mode 100644
index 00000000..6e831add
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_minilight.glsl.program
@@ -0,0 +1,26 @@
+// Auxilary lights
+vertex_program DeferredShading/post/glsl/LightMaterial_vs glsl
+{
+ source DeferredShading/post/glsl/LightMaterial_vs.glsl
+ default_params
+ {
+ param_named_auto invProj inverse_projection_matrix
+ param_named_auto vpWidth viewport_width
+ param_named_auto vpHeight viewport_height
+ }
+}
+fragment_program DeferredShading/post/glsl/LightMaterial_ps glsl
+{
+ source DeferredShading/post/glsl/LightMaterial_ps.glsl
+ default_params
+ {
+ param_named_auto worldView worldview_matrix
+
+ param_named_auto lightDiffuseColor custom 1
+ param_named_auto lightSpecularColor custom 2
+ param_named_auto lightFalloff custom 3
+
+ param_named tex0 int 0
+ param_named tex1 int 1
+ }
+}
\ No newline at end of file
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_minilight.hlsl.program b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_minilight.hlsl.program
new file mode 100644
index 00000000..e1639a39
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_minilight.hlsl.program
@@ -0,0 +1,29 @@
+// Auxilary lights
+vertex_program DeferredShading/post/hlsl/LightMaterial_vs hlsl
+{
+ source DeferredShading/post/hlsl/LightMaterial_vs.hlsl
+ target vs_1_1
+ entry_point main
+ default_params
+ {
+ param_named_auto worldViewProj worldviewproj_matrix
+ param_named_auto invProj inverse_projection_matrix
+ param_named_auto vpWidth viewport_width
+ param_named_auto vpHeight viewport_height
+ }
+}
+fragment_program DeferredShading/post/hlsl/LightMaterial_ps hlsl
+{
+ source DeferredShading/post/hlsl/LightMaterial_ps.hlsl
+ target ps_2_0
+ entry_point main
+
+ default_params
+ {
+ param_named_auto worldView worldview_matrix
+
+ param_named_auto lightDiffuseColor custom 1
+ param_named_auto lightSpecularColor custom 2
+ param_named_auto lightFalloff custom 3
+ }
+}
\ No newline at end of file
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_minilight.material b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_minilight.material
new file mode 100644
index 00000000..1c0c42f0
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_minilight.material
@@ -0,0 +1,56 @@
+// Auxilary lights
+
+/// Reference material [geometry]
+material DeferredShading/LightMaterial
+{
+ technique
+ {
+ pass
+ {
+ // Don't disable depth test, because the light doesn't have to be rendered
+ // if the bounding geometry is obscured.
+ scene_blend add
+ depth_write off
+ depth_check on
+ lighting off
+
+
+ texture_unit
+ {
+ tex_address_mode clamp
+ filtering none
+ }
+ texture_unit
+ {
+ tex_address_mode clamp
+ filtering none
+ }
+ }
+ }
+}
+/// Reference material [quad]
+material DeferredShading/LightMaterialQuad
+{
+ technique
+ {
+ pass
+ {
+ scene_blend add
+ depth_write off
+ depth_check off
+ lighting off
+
+ texture_unit
+ {
+ tex_address_mode clamp
+ filtering none
+ }
+ texture_unit
+ {
+ tex_address_mode clamp
+ filtering none
+ }
+ }
+ }
+}
+
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_multipass.glsl.program b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_multipass.glsl.program
new file mode 100644
index 00000000..855a99c0
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_multipass.glsl.program
@@ -0,0 +1,26 @@
+// Post processors
+fragment_program DeferredShading/post/glsl/Ambient_ps glsl
+{
+ source DeferredShading/post/glsl/Ambient_ps.glsl
+
+ default_params
+ {
+ param_named_auto ambientColor ambient_light_colour 0
+ param_named_auto proj projection_matrix
+ param_named tex0 int 0
+ param_named tex1 int 1
+ }
+}
+fragment_program DeferredShading/post/glsl/GlobalLight_ps glsl
+{
+ source DeferredShading/post/glsl/GlobalLight_ps.glsl
+
+ default_params
+ {
+ param_named_auto lightPos0 light_position_view_space 0
+ param_named_auto lightDiffuseColor0 light_diffuse_colour 0
+ param_named_auto lightSpecularColor0 light_specular_colour 0
+ param_named tex0 int 0
+ param_named tex1 int 1
+ }
+}
\ No newline at end of file
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_multipass.hlsl.program b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_multipass.hlsl.program
new file mode 100644
index 00000000..8a67dc46
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_multipass.hlsl.program
@@ -0,0 +1,28 @@
+// Post processors
+fragment_program DeferredShading/post/hlsl/Ambient_ps hlsl
+{
+ source DeferredShading/post/hlsl/Ambient_ps.hlsl
+ target ps_2_0
+ entry_point main
+
+ default_params
+ {
+ param_named_auto ambientColor ambient_light_colour 0
+ param_named_auto proj projection_matrix
+ }
+}
+fragment_program DeferredShading/post/hlsl/GlobalLight_ps hlsl
+{
+ source DeferredShading/post/hlsl/GlobalLight_ps.hlsl
+ target ps_2_0
+ entry_point main
+
+ default_params
+ {
+ //param_named_auto invProj inverse_projection_matrix
+
+ param_named_auto lightPos0 light_position_view_space 0
+ param_named_auto lightDiffuseColor0 light_diffuse_colour 0
+ param_named_auto lightSpecularColor0 light_specular_colour 0
+ }
+}
\ No newline at end of file
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_multipass.material b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_multipass.material
new file mode 100644
index 00000000..bebff742
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_multipass.material
@@ -0,0 +1,118 @@
+// Post processors
+
+material DeferredShading/Post/Multi
+{
+ technique
+ {
+ pass
+ {
+ // Ambient and depth write pass
+ cull_hardware none
+ cull_software none
+ //depth_check off
+ depth_write on
+
+ fragment_program_ref DeferredShading/post/hlsl/Ambient_ps
+ {
+ }
+ vertex_program_ref DeferredShading/post/hlsl/vs
+ {
+ }
+ texture_unit
+ {
+ tex_address_mode clamp
+ filtering none
+ }
+ texture_unit
+ {
+ tex_coord_set 1
+ tex_address_mode clamp
+ filtering none
+ }
+ }
+ pass
+ {
+ scene_blend add
+ cull_hardware none
+ cull_software none
+ iteration once_per_light
+ depth_write off
+ //depth_check off
+
+ fragment_program_ref DeferredShading/post/hlsl/GlobalLight_ps
+ {
+ }
+ vertex_program_ref DeferredShading/post/hlsl/vs
+ {
+ }
+ texture_unit
+ {
+ tex_address_mode clamp
+ filtering none
+ }
+ texture_unit
+ {
+ tex_coord_set 1
+ tex_address_mode clamp
+ filtering none
+ }
+ }
+ }
+ technique
+ {
+ pass
+ {
+ // Ambient and depth write pass
+ cull_hardware none
+ cull_software none
+ //depth_check off
+ depth_write on
+
+ fragment_program_ref DeferredShading/post/glsl/Ambient_ps
+ {
+ }
+ vertex_program_ref DeferredShading/post/glsl/vs
+ {
+ }
+ texture_unit
+ {
+ tex_address_mode clamp
+ filtering none
+ }
+ texture_unit
+ {
+ tex_coord_set 1
+ tex_address_mode clamp
+ filtering none
+ }
+ }
+ pass
+ {
+ scene_blend add
+ cull_hardware none
+ cull_software none
+ iteration once_per_light
+ depth_write off
+ depth_check off
+
+ fragment_program_ref DeferredShading/post/glsl/GlobalLight_ps
+ {
+ }
+ vertex_program_ref DeferredShading/post/glsl/vs
+ {
+ }
+ texture_unit
+ {
+ tex_address_mode clamp
+ filtering none
+ }
+ texture_unit
+ {
+ tex_coord_set 1
+ tex_address_mode clamp
+ filtering none
+ }
+ }
+ }
+}
+
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_onepass.glsl.program b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_onepass.glsl.program
new file mode 100644
index 00000000..8b58c160
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_onepass.glsl.program
@@ -0,0 +1,27 @@
+// Post processors
+
+vertex_program DeferredShading/post/glsl/vs glsl
+{
+ source DeferredShading/post/glsl/vs.glsl
+ default_params
+ {
+ param_named_auto invProj inverse_projection_matrix
+ }
+}
+fragment_program DeferredShading/post/glsl/SinglePass_ps glsl
+{
+ source DeferredShading/post/glsl/SinglePass_ps.glsl
+ default_params
+ {
+ param_named_auto proj projection_matrix
+ param_named_auto ambientColor ambient_light_colour 0
+ param_named_auto lightPos0 light_position_view_space 0
+ param_named_auto lightDiffuseColor0 light_diffuse_colour 0
+ param_named_auto lightSpecularColor0 light_specular_colour 0
+ param_named_auto lightPos1 light_position_view_space 1
+ param_named_auto lightDiffuseColor1 light_diffuse_colour 1
+ param_named_auto lightSpecularColor1 light_specular_colour 1
+ param_named tex0 int 0
+ param_named tex1 int 1
+ }
+}
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_onepass.hlsl.program b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_onepass.hlsl.program
new file mode 100644
index 00000000..31157639
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_onepass.hlsl.program
@@ -0,0 +1,29 @@
+// Post processors
+vertex_program DeferredShading/post/hlsl/vs hlsl
+{
+ source DeferredShading/post/hlsl/vs.hlsl
+ target vs_1_1
+ entry_point main
+ default_params
+ {
+ param_named_auto invProj inverse_projection_matrix
+ }
+}
+fragment_program DeferredShading/post/hlsl/SinglePass_ps hlsl
+{
+ source DeferredShading/post/hlsl/SinglePass_ps.hlsl
+ target ps_2_0
+ entry_point main
+
+ default_params
+ {
+ param_named_auto proj projection_matrix
+ param_named_auto ambientColor ambient_light_colour 0
+ param_named_auto lightPos0 light_position_view_space 0
+ param_named_auto lightDiffuseColor0 light_diffuse_colour 0
+ param_named_auto lightSpecularColor0 light_specular_colour 0
+ param_named_auto lightPos1 light_position_view_space 1
+ param_named_auto lightDiffuseColor1 light_diffuse_colour 1
+ param_named_auto lightSpecularColor1 light_specular_colour 1
+ }
+}
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_onepass.material b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_onepass.material
new file mode 100644
index 00000000..c97c107b
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferred_post_onepass.material
@@ -0,0 +1,65 @@
+// Post processors
+material DeferredShading/Post/Single
+{
+ technique
+ {
+ pass
+ {
+ cull_hardware none
+ cull_software none
+ depth_func always_pass
+ depth_write on
+ // Doesn't work for some reason
+ //depth_check off
+
+ fragment_program_ref DeferredShading/post/hlsl/SinglePass_ps
+ {
+ }
+ vertex_program_ref DeferredShading/post/hlsl/vs
+ {
+ }
+ texture_unit
+ {
+ tex_address_mode clamp
+ filtering none
+ }
+ texture_unit
+ {
+ tex_coord_set 1
+ tex_address_mode clamp
+ filtering none
+ }
+ }
+ }
+ technique
+ {
+ pass
+ {
+ cull_hardware none
+ cull_software none
+ depth_func always_pass
+ depth_write on
+ // Doesn't work for some reason
+ //depth_check off
+
+ fragment_program_ref DeferredShading/post/glsl/SinglePass_ps
+ {
+ }
+ vertex_program_ref DeferredShading/post/glsl/vs
+ {
+ }
+ texture_unit
+ {
+ tex_address_mode clamp
+ filtering none
+ }
+ texture_unit
+ {
+ tex_coord_set 1
+ tex_address_mode clamp
+ filtering none
+ }
+ }
+ }
+}
+
diff --git a/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferreddemo.material b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferreddemo.material
new file mode 100644
index 00000000..7124ec5f
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/DeferredShadingMedia/deferreddemo.material
@@ -0,0 +1,228 @@
+// Materials for deferred shading test
+
+// Sky box
+material Test13/SkyBox
+{
+ technique
+ {
+ pass
+ {
+ depth_write off
+ lighting off
+ texture_unit
+ {
+ cubic_texture evening.jpg separateUV
+ tex_address_mode clamp
+ }
+ }
+ }
+}
+
+// Ground plane
+material Test13/Ground: DeferredShading/Material/TexturedPhong
+{
+ technique hlsl
+ {
+ pass main
+ {
+ texture_unit
+ {
+ texture grass_1024.jpg
+ }
+ }
+ }
+ technique glsl
+ {
+ pass main
+ {
+ texture_unit
+ {
+ texture grass_1024.jpg
+ }
+ }
+ }
+}
+
+// Rock wall texture [bumpmapped]
+material Test13/RockWall: DeferredShading/Material/TexturedNormalMapped
+{
+ technique hlsl
+ {
+ pass main
+ {
+ texture_unit
+ {
+ texture rockwall.tga
+ }
+ texture_unit
+ {
+ texture rockwall_NH.tga
+ }
+ }
+ }
+ technique glsl
+ {
+ pass main
+ {
+ texture_unit
+ {
+ texture rockwall.tga
+ }
+ texture_unit
+ {
+ texture rockwall_NH.tga
+ }
+ }
+ }
+}
+
+
+// Athena texture [bumpmapped, untextured]
+material Test13/DeferredAthena: DeferredShading/Material/UntexturedNormalMapped
+{
+ technique hlsl
+ {
+ pass main
+ {
+ texture_unit
+ {
+ texture atheneNormalMap.png
+ }
+ fragment_program_ref
+ {
+ param_named specularity float 0.5
+ }
+ }
+ }
+ technique glsl
+ {
+ pass main
+ {
+ texture_unit
+ {
+ texture atheneNormalMap.png
+ }
+ fragment_program_ref
+ {
+ param_named specularity float 0.5
+ }
+ }
+ }
+}
+
+/// Ogre parts
+material Test13/DeferredOgre/Skin: DeferredShading/Material/TexturedPhong
+{
+ technique hlsl
+ {
+ pass main
+ {
+ cull_hardware none
+ texture_unit
+ {
+ texture GreenSkin.jpg
+ tex_address_mode mirror
+ }
+ }
+ }
+ technique glsl
+ {
+ pass main
+ {
+ cull_hardware none
+ texture_unit
+ {
+ texture GreenSkin.jpg
+ tex_address_mode mirror
+ }
+ }
+ }
+}
+material Test13/DeferredOgre/EarRing: DeferredShading/Material/UntexturedPhong
+{
+ technique hlsl
+ {
+ pass main
+ {
+ fragment_program_ref
+ {
+ param_named specularity float 1.5
+ param_named colour float3 0.5 0.5 0
+ }
+ }
+ }
+ technique glsl
+ {
+ pass main
+ {
+ fragment_program_ref
+ {
+ param_named specularity float 1.5
+ param_named colour float3 0.5 0.5 0
+ }
+ }
+ }
+}
+material Test13/DeferredOgre/Tusks: DeferredShading/Material/TexturedPhong
+{
+ technique hlsl
+ {
+ pass main
+ {
+ fragment_program_ref
+ {
+ param_named specularity float 0.5
+ }
+ texture_unit
+ {
+ texture dirt01.jpg
+ }
+ }
+ }
+ technique glsl
+ {
+ pass main
+ {
+ fragment_program_ref
+ {
+ param_named specularity float 0.5
+ }
+ texture_unit
+ {
+ texture dirt01.jpg
+ }
+ }
+ }
+}
+material Test13/DeferredOgre/Eyes: DeferredShading/Material/TexturedPhong
+{
+ technique hlsl
+ {
+ pass main
+ {
+ fragment_program_ref
+ {
+ param_named specularity float 1.0
+ }
+ texture_unit
+ {
+ texture WeirdEye.png
+ }
+ }
+ }
+ technique glsl
+ {
+ pass main
+ {
+ fragment_program_ref
+ {
+ param_named specularity float 1.0
+ }
+ texture_unit
+ {
+ texture WeirdEye.png
+ }
+ }
+ }
+}
+
diff --git a/school/informatik/verkerhssimulation/media/fonts/bluebold.ttf b/school/informatik/verkerhssimulation/media/fonts/bluebold.ttf
new file mode 100644
index 00000000..ce5d9048
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/fonts/bluebold.ttf differ
diff --git a/school/informatik/verkerhssimulation/media/fonts/bluecond.ttf b/school/informatik/verkerhssimulation/media/fonts/bluecond.ttf
new file mode 100644
index 00000000..4c5b01f9
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/fonts/bluecond.ttf differ
diff --git a/school/informatik/verkerhssimulation/media/fonts/bluehigh.ttf b/school/informatik/verkerhssimulation/media/fonts/bluehigh.ttf
new file mode 100644
index 00000000..14d45c5a
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/fonts/bluehigh.ttf differ
diff --git a/school/informatik/verkerhssimulation/media/fonts/read_me.html b/school/informatik/verkerhssimulation/media/fonts/read_me.html
new file mode 100644
index 00000000..9f53dc86
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/fonts/read_me.html
@@ -0,0 +1,2 @@
+Larabie Fonts "read me" file, license and FAQLARABIE FONTS “README.TXT”
All Larabie Fonts in this file are free to use for personal and/or commercial purposes. No payment is necessary to use these fonts for personal or commercial use. For Software Products who want to include Larabie Fonts see the License Agreement below. You can add this font to a website but do not combine fonts into a single archive or alter them in any way.
All Larabie Fonts are free for commercial use but a sample of your product would be gratefully appreciated so I can see how the font looks in use. Contact www.larabiefonts.com/donation.html for mailing information.
Some Larabie Fonts have enhanced and expanded families available for sale at www.typodermic.com.
If you'd like to make a voluntary donation to Larabie Fonts for the use of the free fonts in any amount please go to www.larabiefonts.com/donation.html
I accept CDs, magazines, t-shirts, a sample of your merchandise or anything featuring Larabie Fonts. Please remember to list your item as a ‘gift’ on the customs form or I will have to pay import duties and taxes on the item. Mailing information is provided at the link above.
Font installation help is available at www.larabiefonts.com/help.html
LARABIE FONTS FREQUENTLY ASKED QUESTIONS
- Q: How do use these fonts in my favourite software?
- A: In Windows, you take the fonts out of the ZIP archive and place them in your fonts folder which can be found in your Control Panel. The next time you run your software, the font will be available. For example: If you install a new font, the next time you run Microsoft Word, that font will be available in the menu under Format / Font. For anything more complicated, or Mac installation, visit www.larabiefonts.com/help.html
- Q: How can I use this font in AOL Instant Messenger, MSN Messenger, Outlook, Outlook Express, Euodora or any other email software?
- A: At the time of this writing (Feb 2004) you can’t. After installing one of my fonts, you may be able to select it in the above applications but the person at the other end won’t see that same thing unless they have the font installed. If you really want to use my fonts in these applications, make sure the people at the other end have the same fonts installed.
- Q: How can I use these fonts on a web page?
- A: If you’re creating a web page using Flash, it’s easy. Consult your Flash manual. If you’re using Acrobat, make sure the font embedding settings are turned on. Consult your Acrobat manual. For anything else there are limitations: If you want to use one of my fonts as your main, text font you’re pretty much out of luck unless you explore a font embedding tool such as WEFT but I don’t recommend it. To use my fonts as headings or titles, use image creation software such as The Gimp, Photoshop, Paint Shop Pro, Pixia etc. Save the images as GIF files and place them on your web page. There’s a lot more to it than can be explained here but there are countless books available on web page design.
- Q: How can I make these fonts bigger?
- A: All my fonts are infinitely scalable; the limitations are in your software. A common problem is scaling fonts in Microsoft Word. If you choose Format / Font you can type in any number you like under “size”.
- Q: Are these fonts really free?
- A: Yes they are. Some fonts such as Neuropol have expanded font families available for sale at www.typodermic.com but the version you downloaded at Larabie Fonts is free.
- Q: Your licence agreement states that the fonts can’t be altered. Does that mean I can’t mess around with your fonts in Photoshop/Illustrator/Publisher etc?
- A: Those license restrictions refer to altering the actual fonts themselves, not what you make with them. As long as you don’t alter the font files in font creation software such as FontLab or Fontographer you’re free to create anything you like with them.
- Q: Can I use your fonts in a logo?
- A: Yes. But check with a lawyer if you’re not sure. It’s okay with me if you use it but do so at your own risk.
- Q: Can you make a custom font for me?
- A: Possibly. Check typodermic.com/custom.html for details. Keep in mind that making fonts is my full-time job so no freebies.
- Q: I want to sell rubber stamp alphabets, alphabet punches or stencil alphabets using your font designs.
- A: Contact me first at www.larabiefonts.com/email.html.
- Q: My software won’t let me embed one of your fonts.
- A: You may have an old version of one of my fonts. Uninstall it and install a current version on Larabie Fonts.
- Q: Can you help me find a font?
- A: I really don’t have the time but if you send a donation, I can give it a try. If not. post your question on my font forum: www.larabiefonts.com/info.html.
LARABIE FONTS END-USER LICENSE AGREEMENT FOR SOFTWARE PRODUCTS
SOFTWARE PRODUCT LICENSE
The SOFTWARE PRODUCT is protected by copyright laws and International copyright treaties, as well as other intellectual property laws and treaties. The SOFTWARE PRODUCT is licensed, not sold.
1. GRANT OF LICENSE. This document grants you the following rights:
- Installation and Use. You may install and use an unlimited number of copies of the SOFTWARE PRODUCT. You may copy and distribute unlimited copies of the SOFTWARE PRODUCT as you receive them, in any medium, provided that you publish on each copy an appropriate copyright notice. Keep intact all the notices that refer to this License and give any other recipients of the fonts a copy of this License along with the fonts.
2. DESCRIPTION OF OTHER RIGHTS AND LIMITATIONS.
- You may modify your copy or copies of the SOFTWARE PRODUCT or any portion of it, provided that you also meet all of these rules:
a) Do not alter in any way alphanumeric characters (A-Z, a-z, 1-9) contained in the font. An exception is converting between formats, here is allowed the nominal distortion that occurs during conversion from second order to third order quadratic curves (TrueType to Postscript) and vice versa.
b) Extra characters may be added; here it is allowed to use curves (shapes) from alphanumeric characters in fonts under same license.
c) It is allowed to modify and remove analpahbetics (punctuation, special characters, ligatures and symbols).
d) The original font name must be retained but can be augmented. (ie. a Font named Blue Highway can be renamed Blue Highway Cyrillic or Blue Highway ANSI, etc.)
e) Character mapping may be altered.
f) If the kerning information is altered or discarded it must be stated in the user notes or documentation.
g) All modifications must be released under this license.
LIMITED WARRANTY NO WARRANTIES. Larabie Fonts expressly disclaims any warranty for the SOFTWARE PRODUCT. The SOFTWARE PRODUCT and any related documentation is provided "as is" without warranty of any kind, either express or implied, including, without limitation, the implied warranties or merchantability, fitness for a particular purpose, or non-infringement. The entire risk arising out of use or performance of the SOFTWARE PRODUCT remains with you.NO LIABILITY FOR CONSEQUENTIAL DAMAGES. In no event shall Larabie Fonts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising out of the use of or inability to use this product, even if Larabie Fonts has been advised of the possibility of such damages.
3. MISCELLANEOUS
Should you have any questions concerning this document, or if you desire to contact Larabie Fonts for any reason, please email www.larabiefonts.com/email.html.
+
diff --git a/school/informatik/verkerhssimulation/media/fonts/sample.fontdef b/school/informatik/verkerhssimulation/media/fonts/sample.fontdef
new file mode 100644
index 00000000..462defc5
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/fonts/sample.fontdef
@@ -0,0 +1,11 @@
+StarWars
+{
+ // Now this one I agree with ;)
+ // A Star Wars font :)
+ type truetype
+ source solo5.ttf
+ size 16
+ resolution 96
+}
+
+
diff --git a/school/informatik/verkerhssimulation/media/fonts/solo5.ttf b/school/informatik/verkerhssimulation/media/fonts/solo5.ttf
new file mode 100644
index 00000000..c723496e
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/fonts/solo5.ttf differ
diff --git a/school/informatik/verkerhssimulation/media/gui/CompositorDemo.layout b/school/informatik/verkerhssimulation/media/gui/CompositorDemo.layout
new file mode 100644
index 00000000..4e8fda95
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/gui/CompositorDemo.layout
@@ -0,0 +1,182 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/school/informatik/verkerhssimulation/media/gui/CompositorDemoCegui.config b/school/informatik/verkerhssimulation/media/gui/CompositorDemoCegui.config
new file mode 100644
index 00000000..3623f0b8
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/gui/CompositorDemoCegui.config
@@ -0,0 +1,6 @@
+
+
diff --git a/school/informatik/verkerhssimulation/media/gui/CrowdDemo.layout b/school/informatik/verkerhssimulation/media/gui/CrowdDemo.layout
new file mode 100644
index 00000000..471968b4
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/gui/CrowdDemo.layout
@@ -0,0 +1,201 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/school/informatik/verkerhssimulation/media/gui/Falagard.xsd b/school/informatik/verkerhssimulation/media/gui/Falagard.xsd
new file mode 100644
index 00000000..09c1b20c
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/gui/Falagard.xsd
@@ -0,0 +1,391 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/school/informatik/verkerhssimulation/media/gui/Font.xsd b/school/informatik/verkerhssimulation/media/gui/Font.xsd
new file mode 100644
index 00000000..5ab529cd
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/gui/Font.xsd
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/school/informatik/verkerhssimulation/media/gui/GUILayout.xsd b/school/informatik/verkerhssimulation/media/gui/GUILayout.xsd
new file mode 100644
index 00000000..0a3a5b9c
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/gui/GUILayout.xsd
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/school/informatik/verkerhssimulation/media/gui/GUIScheme.xsd b/school/informatik/verkerhssimulation/media/gui/GUIScheme.xsd
new file mode 100644
index 00000000..24dba207
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/gui/GUIScheme.xsd
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/school/informatik/verkerhssimulation/media/gui/Imageset.xsd b/school/informatik/verkerhssimulation/media/gui/Imageset.xsd
new file mode 100644
index 00000000..49ced132
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/gui/Imageset.xsd
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/school/informatik/verkerhssimulation/media/gui/InstancingDemo.layout b/school/informatik/verkerhssimulation/media/gui/InstancingDemo.layout
new file mode 100644
index 00000000..33469a88
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/gui/InstancingDemo.layout
@@ -0,0 +1,214 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/school/informatik/verkerhssimulation/media/gui/OceanDemoCegui.config b/school/informatik/verkerhssimulation/media/gui/OceanDemoCegui.config
new file mode 100644
index 00000000..bf6ac773
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/gui/OceanDemoCegui.config
@@ -0,0 +1,6 @@
+
+
diff --git a/school/informatik/verkerhssimulation/media/gui/OceanDemoLayout.xml b/school/informatik/verkerhssimulation/media/gui/OceanDemoLayout.xml
new file mode 100644
index 00000000..62e323ac
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/gui/OceanDemoLayout.xml
@@ -0,0 +1,264 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/school/informatik/verkerhssimulation/media/gui/TaharezLook.imageset b/school/informatik/verkerhssimulation/media/gui/TaharezLook.imageset
new file mode 100644
index 00000000..e5aef981
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/gui/TaharezLook.imageset
@@ -0,0 +1,242 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/school/informatik/verkerhssimulation/media/gui/TaharezLook.looknfeel b/school/informatik/verkerhssimulation/media/gui/TaharezLook.looknfeel
new file mode 100644
index 00000000..e9c8b1c9
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/gui/TaharezLook.looknfeel
@@ -0,0 +1,4315 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/school/informatik/verkerhssimulation/media/gui/TaharezLook.tga b/school/informatik/verkerhssimulation/media/gui/TaharezLook.tga
new file mode 100644
index 00000000..81c00dec
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/gui/TaharezLook.tga differ
diff --git a/school/informatik/verkerhssimulation/media/gui/TaharezLookSkin.scheme b/school/informatik/verkerhssimulation/media/gui/TaharezLookSkin.scheme
new file mode 100644
index 00000000..9babf932
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/gui/TaharezLookSkin.scheme
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/school/informatik/verkerhssimulation/media/gui/TaharezLookWidgetAliases.scheme b/school/informatik/verkerhssimulation/media/gui/TaharezLookWidgetAliases.scheme
new file mode 100644
index 00000000..dfe66ac6
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/gui/TaharezLookWidgetAliases.scheme
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/school/informatik/verkerhssimulation/media/gui/bluehighway-10.font b/school/informatik/verkerhssimulation/media/gui/bluehighway-10.font
new file mode 100644
index 00000000..23a7bc7e
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/gui/bluehighway-10.font
@@ -0,0 +1,2 @@
+
+
diff --git a/school/informatik/verkerhssimulation/media/gui/bluehighway-12.font b/school/informatik/verkerhssimulation/media/gui/bluehighway-12.font
new file mode 100644
index 00000000..e6aac73e
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/gui/bluehighway-12.font
@@ -0,0 +1,2 @@
+
+
diff --git a/school/informatik/verkerhssimulation/media/gui/bluehighway-8.font b/school/informatik/verkerhssimulation/media/gui/bluehighway-8.font
new file mode 100644
index 00000000..ba3ac2e6
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/gui/bluehighway-8.font
@@ -0,0 +1,2 @@
+
+
diff --git a/school/informatik/verkerhssimulation/media/gui/cegui8.layout b/school/informatik/verkerhssimulation/media/gui/cegui8.layout
new file mode 100644
index 00000000..b8623ec5
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/gui/cegui8.layout
@@ -0,0 +1,130 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/school/informatik/verkerhssimulation/media/gui/facial.layout b/school/informatik/verkerhssimulation/media/gui/facial.layout
new file mode 100644
index 00000000..ffc882ba
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/gui/facial.layout
@@ -0,0 +1,379 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/school/informatik/verkerhssimulation/media/gui/ogregui.layout b/school/informatik/verkerhssimulation/media/gui/ogregui.layout
new file mode 100644
index 00000000..fc0eb0fc
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/gui/ogregui.layout
@@ -0,0 +1,79 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/school/informatik/verkerhssimulation/media/gui/shadows.layout b/school/informatik/verkerhssimulation/media/gui/shadows.layout
new file mode 100644
index 00000000..9ed8fdd1
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/gui/shadows.layout
@@ -0,0 +1,247 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/AmbientOneTexture.glsl b/school/informatik/verkerhssimulation/media/materials/programs/AmbientOneTexture.glsl
new file mode 100644
index 00000000..66b4bcd3
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/AmbientOneTexture.glsl
@@ -0,0 +1,13 @@
+uniform vec4 ambient;
+
+/*
+ Basic ambient lighting vertex program
+*/
+void main()
+{
+ gl_Position = ftransform();
+ gl_TexCoord[0] = gl_MultiTexCoord0;
+ gl_FrontColor = ambient;
+}
+
+
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/Bloom_ps20.hlsl b/school/informatik/verkerhssimulation/media/materials/programs/Bloom_ps20.hlsl
new file mode 100644
index 00000000..15aa068c
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/Bloom_ps20.hlsl
@@ -0,0 +1,52 @@
+sampler Blur1: register(s1);
+sampler RT: register(s0);
+
+
+float luminance(float3 c)
+{
+ return dot( c, float3(0.3, 0.59, 0.11) );
+}
+
+float4 main(float2 texCoord: TEXCOORD0) : COLOR {
+ float4 sharp = tex2D(RT, texCoord);
+ float4 blur = tex2D(Blur1, texCoord);
+
+
+
+ return ( sharp + blur * 1.8 ) / 2;
+
+// float4 color = lerp( sharp, blur, 0.4f );
+
+// return color;
+
+
+/*
+ return ( sharp + blur * 1.8 ) / 2 +
+ luminance(blur) *
+ float4( 0.5, 0.5, 0.5, 0) +
+ luminance(sharp) *
+ float4( 0.3, 0.3, 0.3, 0);
+*/
+/*
+ return ( sharp + blur * 0.9) / 2 +
+ luminance(blur) * float4(0.1, 0.15, 0.7, 0);
+*/
+
+/*
+ return ( sharp + blur * 0.9) / 2 +
+ luminance(blur) * float4(0.1, 0.15, 0.7, 0);
+*/
+
+// float4 retColor = luminance( sharp ) +
+// luminance( blur ) + blur / 2;
+// return retColor;
+}
+
+
+
+
+
+
+
+
+
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/Bloom_vs11.hlsl b/school/informatik/verkerhssimulation/media/materials/programs/Bloom_vs11.hlsl
new file mode 100644
index 00000000..b6e49a3e
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/Bloom_vs11.hlsl
@@ -0,0 +1,21 @@
+
+struct VS_OUTPUT {
+ float4 Pos: POSITION;
+ float2 texCoord: TEXCOORD0;
+};
+
+VS_OUTPUT main(float4 Pos: POSITION){
+ VS_OUTPUT Out;
+
+ // Clean up inaccuracies
+ Pos.xy = sign(Pos.xy);
+
+ Out.Pos = float4(Pos.xy, 0, 1);
+ // Image-space
+ Out.texCoord.x = 0.5 * (1 + Pos.x);
+ Out.texCoord.y = 0.5 * (1 - Pos.y);
+
+ return Out;
+}
+
+
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/Blur0_ps20.hlsl b/school/informatik/verkerhssimulation/media/materials/programs/Blur0_ps20.hlsl
new file mode 100644
index 00000000..5790dce5
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/Blur0_ps20.hlsl
@@ -0,0 +1,31 @@
+sampler RT: register(s0);
+// Simple blur filter
+
+float4 main(float2 texCoord: TEXCOORD0) : COLOR {
+
+ float2 samples[12] = {
+ -0.326212, -0.405805,
+ -0.840144, -0.073580,
+ -0.695914, 0.457137,
+ -0.203345, 0.620716,
+ 0.962340, -0.194983,
+ 0.473434, -0.480026,
+ 0.519456, 0.767022,
+ 0.185461, -0.893124,
+ 0.507431, 0.064425,
+ 0.896420, 0.412458,
+ -0.321940, -0.932615,
+ -0.791559, -0.597705,
+ };
+
+ float4 sum = tex2D(RT, texCoord);
+ for (int i = 0; i < 12; i++){
+ sum += tex2D(RT, texCoord + 0.025 * samples[i]);
+ }
+ return sum / 13;
+
+}
+
+
+
+
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/Blur0_vs.glsl b/school/informatik/verkerhssimulation/media/materials/programs/Blur0_vs.glsl
new file mode 100644
index 00000000..24212edd
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/Blur0_vs.glsl
@@ -0,0 +1,15 @@
+varying vec2 texCoord[5];
+
+void main()
+{
+ vec2 inPos = sign(gl_Vertex.xy);
+ gl_Position = vec4(inPos.xy, 0.0, 1.0);
+
+ texCoord[0] = (vec2(inPos.x, -inPos.y) + 1.0)/2.0;
+
+ const float size = 0.01;
+ texCoord[1] = texCoord[0] + vec2(1.0, 0.0)*size;
+ texCoord[2] = texCoord[0] + vec2(2.0, 0.0)*size;
+ texCoord[3] = texCoord[0] + vec2(-1.0, 0.0)*size;
+ texCoord[4] = texCoord[0] + vec2(-2.0, 0.0)*size;
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/Blur0_vs11.hlsl b/school/informatik/verkerhssimulation/media/materials/programs/Blur0_vs11.hlsl
new file mode 100644
index 00000000..3979eae9
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/Blur0_vs11.hlsl
@@ -0,0 +1,22 @@
+struct VS_OUTPUT {
+ float4 Pos: POSITION;
+ float2 texCoord: TEXCOORD0;
+};
+
+VS_OUTPUT main(float4 Pos: POSITION){
+ VS_OUTPUT Out;
+
+ // Clean up inaccuracies
+ Pos.xy = sign(Pos.xy);
+
+ Out.Pos = float4(Pos.xy, 0, 1);
+ // Image-space
+ Out.texCoord.x = 0.5 * (1 + Pos.x);
+ Out.texCoord.y = 0.5 * (1 - Pos.y);
+
+ return Out;
+}
+
+
+
+
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/Blur1_ps20.hlsl b/school/informatik/verkerhssimulation/media/materials/programs/Blur1_ps20.hlsl
new file mode 100644
index 00000000..95e754b2
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/Blur1_ps20.hlsl
@@ -0,0 +1,28 @@
+sampler Blur0: register(s0);
+// Simple blur filter
+
+float4 main(float2 texCoord: TEXCOORD0) : COLOR {
+
+ float2 samples[12] = {
+ -0.326212, -0.405805,
+ -0.840144, -0.073580,
+ -0.695914, 0.457137,
+ -0.203345, 0.620716,
+ 0.962340, -0.194983,
+ 0.473434, -0.480026,
+ 0.519456, 0.767022,
+ 0.185461, -0.893124,
+ 0.507431, 0.064425,
+ 0.896420, 0.412458,
+ -0.321940, -0.932615,
+ -0.791559, -0.597705,
+ };
+
+ float4 sum = tex2D(Blur0, texCoord);
+ for (int i = 0; i < 12; i++){
+ sum += tex2D(Blur0, texCoord + 0.025 * samples[i]);
+ }
+ return sum / 13;
+
+}
+
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/Blur1_vs.glsl b/school/informatik/verkerhssimulation/media/materials/programs/Blur1_vs.glsl
new file mode 100644
index 00000000..dd201519
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/Blur1_vs.glsl
@@ -0,0 +1,15 @@
+varying vec2 texCoord[5];
+
+void main()
+{
+ vec2 inPos = sign(gl_Vertex.xy);
+ gl_Position = vec4(inPos.xy, 0.0, 1.0);
+
+ texCoord[0] = (vec2(inPos.x, -inPos.y) + 1.0)/2.0;
+
+ const float size = 0.01;
+ texCoord[1] = texCoord[0] + vec2(0.0, 1.0)*size;
+ texCoord[2] = texCoord[0] + vec2(0.0, 2.0)*size;
+ texCoord[3] = texCoord[0] + vec2(0.0, -1.0)*size;
+ texCoord[4] = texCoord[0] + vec2(0.0, -2.0)*size;
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/Blur1_vs11.hlsl b/school/informatik/verkerhssimulation/media/materials/programs/Blur1_vs11.hlsl
new file mode 100644
index 00000000..49b316f1
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/Blur1_vs11.hlsl
@@ -0,0 +1,19 @@
+struct VS_OUTPUT {
+ float4 Pos: POSITION;
+ float2 texCoord: TEXCOORD0;
+};
+
+VS_OUTPUT main(float4 Pos: POSITION){
+ VS_OUTPUT Out;
+
+ // Clean up inaccuracies
+ Pos.xy = sign(Pos.xy);
+
+ Out.Pos = float4(Pos.xy, 0, 1);
+ // Image-space
+ Out.texCoord.x = 0.5 * (1 + Pos.x);
+ Out.texCoord.y = 0.5 * (1 - Pos.y);
+
+ return Out;
+}
+
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/Blur_ps.glsl b/school/informatik/verkerhssimulation/media/materials/programs/Blur_ps.glsl
new file mode 100644
index 00000000..d6bb1939
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/Blur_ps.glsl
@@ -0,0 +1,14 @@
+uniform sampler2D tex0;
+
+varying vec2 texCoord[5];
+
+void main()
+{
+ vec4 sum = texture2D(tex0, texCoord[0]) +
+ texture2D(tex0, texCoord[1]) +
+ texture2D(tex0, texCoord[2]) +
+ texture2D(tex0, texCoord[3]) +
+ texture2D(tex0, texCoord[4]);
+ gl_FragColor = sum / 5.0;
+}
+
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/Combine_fp.cg b/school/informatik/verkerhssimulation/media/materials/programs/Combine_fp.cg
new file mode 100644
index 00000000..6ad9c7b7
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/Combine_fp.cg
@@ -0,0 +1,15 @@
+float4 Combine_fp
+(
+ in float2 texCoord: TEXCOORD0,
+
+ uniform sampler RT : register(s0),
+ uniform sampler Sum : register(s1),
+
+ uniform float blur
+) : COLOR
+{
+ float4 render = tex2D(RT, texCoord);
+ float4 sum = tex2D(Sum, texCoord);
+
+ return lerp(render, sum, blur);
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/DOF_ps.cg b/school/informatik/verkerhssimulation/media/materials/programs/DOF_ps.cg
new file mode 100644
index 00000000..ecf8ce06
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/DOF_ps.cg
@@ -0,0 +1,47 @@
+// Simple blur filter
+
+const float2 samples[8] = {
+ {-1, 1},
+ {-1, 0},
+ {-1, -1},
+ {0, -1},
+ {1, -1},
+ {1, 0},
+ {1, 1},
+ {0, 1}
+};
+
+float4 blur(
+
+ in float2 texCoord: TEXCOORD0,
+ uniform float sampleDistance: register(c0),
+ uniform sampler Blur0: register(s0)
+
+) : COLOR
+{
+ float4 sum = tex2D(Blur0, texCoord);
+ for (int i = 0; i < 8; ++i){
+ sum += tex2D(Blur0, texCoord + sampleDistance * samples[i]);
+ }
+ return sum / 9;
+}
+
+
+
+float4 blend
+(
+ in float2 texCoord: TEXCOORD0,
+
+ uniform sampler Blur0 : register(s0),
+ uniform sampler Blur1 : register(s1),
+
+ uniform float focus: register(c0),
+ uniform float range: register(c1)
+) : COLOR
+{
+ float4 sharp = tex2D(Blur0, texCoord);
+ float4 blur = tex2D(Blur1, texCoord);
+
+ // alpha channel of sharp RT has depth info
+ return lerp(sharp, blur, saturate(range * abs(focus - sharp.a)));
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/DepthShadowmap.hlsl b/school/informatik/verkerhssimulation/media/materials/programs/DepthShadowmap.hlsl
new file mode 100644
index 00000000..f7913434
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/DepthShadowmap.hlsl
@@ -0,0 +1,309 @@
+/* This file implements standard programs for depth shadow mapping.
+ These particular ones are suitable for additive lighting models, and
+ include 3 techniques to reduce depth fighting on self-shadowed surfaces,
+ constant bias, gradient (slope-scale) bias, and a fuzzy shadow map comparison*/
+
+
+// Shadow caster vertex program.
+void casterVP(
+ float4 position : POSITION,
+ out float4 outPos : POSITION,
+ out float2 outDepth : TEXCOORD0,
+
+ uniform float4x4 worldViewProj,
+ uniform float4 texelOffsets,
+ uniform float4 depthRange
+ )
+{
+ outPos = mul(worldViewProj, position);
+
+ // fix pixel / texel alignment
+ outPos.xy += texelOffsets.zw * outPos.w;
+ // linear depth storage
+ // offset / scale range output
+#if LINEAR_RANGE
+ outDepth.x = (outPos.z - depthRange.x) * depthRange.w;
+#else
+ outDepth.x = outPos.z;
+#endif
+ outDepth.y = outPos.w;
+}
+
+
+// Shadow caster fragment program for high-precision single-channel textures
+void casterFP(
+ float2 depth : TEXCOORD0,
+ out float4 result : COLOR)
+
+{
+#if LINEAR_RANGE
+ float finalDepth = depth.x;
+#else
+ float finalDepth = depth.x / depth.y;
+#endif
+ // just smear across all components
+ // therefore this one needs high individual channel precision
+ result = float4(finalDepth, finalDepth, finalDepth, 1);
+}
+
+
+
+void receiverVP(
+ float4 position : POSITION,
+ float4 normal : NORMAL,
+
+ out float4 outPos : POSITION,
+ out float4 outColour : COLOR,
+ out float4 outShadowUV : TEXCOORD0,
+
+ uniform float4x4 world,
+ uniform float4x4 worldIT,
+ uniform float4x4 worldViewProj,
+ uniform float4x4 texViewProj,
+ uniform float4 lightPosition,
+ uniform float4 lightColour,
+ uniform float4 shadowDepthRange
+ )
+{
+ float4 worldPos = mul(world, position);
+ outPos = mul(worldViewProj, position);
+
+ float3 worldNorm = mul(worldIT, normal).xyz;
+
+ // calculate lighting (simple vertex lighting)
+ float3 lightDir = normalize(
+ lightPosition.xyz - (worldPos.xyz * lightPosition.w));
+
+ outColour = lightColour * max(dot(lightDir, worldNorm), 0.0);
+
+ // calculate shadow map coords
+ outShadowUV = mul(texViewProj, worldPos);
+#if LINEAR_RANGE
+ // adjust by fixed depth bias, rescale into range
+ outShadowUV.z = (outShadowUV.z - shadowDepthRange.x) * shadowDepthRange.w;
+#endif
+
+
+
+
+}
+
+void receiverFP(
+ float4 position : POSITION,
+ float4 shadowUV : TEXCOORD0,
+ float4 vertexColour : COLOR,
+
+ uniform sampler2D shadowMap : register(s0),
+ uniform float inverseShadowmapSize,
+ uniform float fixedDepthBias,
+ uniform float gradientClamp,
+ uniform float gradientScaleBias,
+ uniform float shadowFuzzyWidth,
+
+ out float4 result : COLOR)
+{
+ // point on shadowmap
+#if LINEAR_RANGE
+ shadowUV.xy = shadowUV.xy / shadowUV.w;
+#else
+ shadowUV = shadowUV / shadowUV.w;
+#endif
+ float centerdepth = tex2D(shadowMap, shadowUV.xy).x;
+
+ // gradient calculation
+ float pixeloffset = inverseShadowmapSize;
+ float4 depths = float4(
+ tex2D(shadowMap, shadowUV.xy + float2(-pixeloffset, 0)).x,
+ tex2D(shadowMap, shadowUV.xy + float2(+pixeloffset, 0)).x,
+ tex2D(shadowMap, shadowUV.xy + float2(0, -pixeloffset)).x,
+ tex2D(shadowMap, shadowUV.xy + float2(0, +pixeloffset)).x);
+
+ float2 differences = abs( depths.yw - depths.xz );
+ float gradient = min(gradientClamp, max(differences.x, differences.y));
+ float gradientFactor = gradient * gradientScaleBias;
+
+ // visibility function
+ float depthAdjust = gradientFactor + (fixedDepthBias * centerdepth);
+ float finalCenterDepth = centerdepth + depthAdjust;
+
+ // shadowUV.z contains lightspace position of current object
+
+#if FUZZY_TEST
+ // fuzzy test - introduces some ghosting in result and doesn't appear to be needed?
+ //float visibility = saturate(1 + delta_z / (gradient * shadowFuzzyWidth));
+ float visibility = saturate(1 + (finalCenterDepth - shadowUV.z) * shadowFuzzyWidth * shadowUV.w);
+
+ result = vertexColour * visibility;
+#else
+ // hard test
+#if PCF
+ // use depths from prev, calculate diff
+ depths += depthAdjust.xxxx;
+ float final = (finalCenterDepth > shadowUV.z) ? 1.0f : 0.0f;
+ final += (depths.x > shadowUV.z) ? 1.0f : 0.0f;
+ final += (depths.y > shadowUV.z) ? 1.0f : 0.0f;
+ final += (depths.z > shadowUV.z) ? 1.0f : 0.0f;
+ final += (depths.w > shadowUV.z) ? 1.0f : 0.0f;
+
+ final *= 0.2f;
+
+ result = float4(vertexColour.xyz * final, 1);
+
+#else
+ result = (finalCenterDepth > shadowUV.z) ? vertexColour : float4(0,0,0,1);
+#endif
+
+#endif
+
+
+
+}
+
+
+
+
+// Expand a range-compressed vector
+float3 expand(float3 v)
+{
+ return (v - 0.5) * 2;
+}
+
+
+/* Normal mapping plus depth shadowmapping receiver programs
+*/
+void normalMapShadowReceiverVp(float4 position : POSITION,
+ float3 normal : NORMAL,
+ float2 uv : TEXCOORD0,
+ float3 tangent : TANGENT0,
+
+ // outputs
+ out float4 outPos : POSITION,
+ out float4 outShadowUV : TEXCOORD0,
+ out float2 oUv : TEXCOORD1,
+ out float3 oTSLightDir : TEXCOORD2,
+ // parameters
+ uniform float4 lightPosition, // object space
+ uniform float4x4 world,
+ uniform float4x4 worldViewProj,
+ uniform float4x4 texViewProj)
+{
+ float4 worldPos = mul(world, position);
+ outPos = mul(worldViewProj, position);
+
+ // calculate shadow map coords
+ outShadowUV = mul(texViewProj, worldPos);
+#if LINEAR_RANGE
+ // adjust by fixed depth bias, rescale into range
+ outShadowUV.z = (outShadowUV.z - shadowDepthRange.x) * shadowDepthRange.w;
+#endif
+
+ // pass the main uvs straight through unchanged
+ oUv = uv;
+
+ // calculate tangent space light vector
+ // Get object space light direction
+ // Non-normalised since we'll do that in the fragment program anyway
+ float3 lightDir = lightPosition.xyz - (position * lightPosition.w);
+
+ // Calculate the binormal (NB we assume both normal and tangent are
+ // already normalised)
+ // NB looks like nvidia cross params are BACKWARDS to what you'd expect
+ // this equates to NxT, not TxN
+ float3 binormal = cross(tangent, normal);
+
+ // Form a rotation matrix out of the vectors
+ float3x3 rotation = float3x3(tangent, binormal, normal);
+
+ // Transform the light vector according to this matrix
+ oTSLightDir = mul(rotation, lightDir);
+
+
+}
+
+
+void normalMapShadowReceiverFp(
+ float4 shadowUV : TEXCOORD0,
+ float2 uv : TEXCOORD1,
+ float3 TSlightDir : TEXCOORD2,
+
+ out float4 result : COLOR,
+
+ uniform float4 lightColour,
+ uniform float inverseShadowmapSize,
+ uniform float fixedDepthBias,
+ uniform float gradientClamp,
+ uniform float gradientScaleBias,
+ uniform float shadowFuzzyWidth,
+
+ uniform sampler2D shadowMap : register(s0),
+ uniform sampler2D normalMap : register(s1),
+ uniform samplerCUBE normalCubeMap : register(s2))
+{
+
+ // retrieve normalised light vector, expand from range-compressed
+ float3 lightVec = expand(texCUBE(normalCubeMap, TSlightDir).xyz);
+
+ // get bump map vector, again expand from range-compressed
+ float3 bumpVec = expand(tex2D(normalMap, uv).xyz);
+
+ // Calculate dot product
+ float4 vertexColour = lightColour * dot(bumpVec, lightVec);
+
+
+ // point on shadowmap
+#if LINEAR_RANGE
+ shadowUV.xy = shadowUV.xy / shadowUV.w;
+#else
+ shadowUV = shadowUV / shadowUV.w;
+#endif
+ float centerdepth = tex2D(shadowMap, shadowUV.xy).x;
+
+ // gradient calculation
+ float pixeloffset = inverseShadowmapSize;
+ float4 depths = float4(
+ tex2D(shadowMap, shadowUV.xy + float2(-pixeloffset, 0)).x,
+ tex2D(shadowMap, shadowUV.xy + float2(+pixeloffset, 0)).x,
+ tex2D(shadowMap, shadowUV.xy + float2(0, -pixeloffset)).x,
+ tex2D(shadowMap, shadowUV.xy + float2(0, +pixeloffset)).x);
+
+ float2 differences = abs( depths.yw - depths.xz );
+ float gradient = min(gradientClamp, max(differences.x, differences.y));
+ float gradientFactor = gradient * gradientScaleBias;
+
+ // visibility function
+ float depthAdjust = gradientFactor + (fixedDepthBias * centerdepth);
+ float finalCenterDepth = centerdepth + depthAdjust;
+
+ // shadowUV.z contains lightspace position of current object
+
+#if FUZZY_TEST
+ // fuzzy test - introduces some ghosting in result and doesn't appear to be needed?
+ //float visibility = saturate(1 + delta_z / (gradient * shadowFuzzyWidth));
+ float visibility = saturate(1 + (finalCenterDepth - shadowUV.z) * shadowFuzzyWidth * shadowUV.w);
+
+ result = vertexColour * visibility;
+#else
+ // hard test
+#if PCF
+ // use depths from prev, calculate diff
+ depths += depthAdjust.xxxx;
+ float final = (finalCenterDepth > shadowUV.z) ? 1.0f : 0.0f;
+ final += (depths.x > shadowUV.z) ? 1.0f : 0.0f;
+ final += (depths.y > shadowUV.z) ? 1.0f : 0.0f;
+ final += (depths.z > shadowUV.z) ? 1.0f : 0.0f;
+ final += (depths.w > shadowUV.z) ? 1.0f : 0.0f;
+
+ final *= 0.2f;
+
+ result = float4(vertexColour.xyz * final, 1);
+
+#else
+ result = (finalCenterDepth > shadowUV.z) ? vertexColour : float4(0,0,0,1);
+#endif
+
+#endif
+
+
+
+}
+
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/DepthShadowmapCasterFp.glsl b/school/informatik/verkerhssimulation/media/materials/programs/DepthShadowmapCasterFp.glsl
new file mode 100644
index 00000000..1e32d262
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/DepthShadowmapCasterFp.glsl
@@ -0,0 +1,16 @@
+
+varying vec2 depth;
+
+void main()
+{
+#if LINEAR_RANGE
+ float finalDepth = depth.x;
+#else
+ float finalDepth = depth.x / depth.y;
+#endif
+ // just smear across all components
+ // therefore this one needs high individual channel precision
+ gl_FragColor = vec4(finalDepth, finalDepth, finalDepth, 1);
+
+}
+
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/DepthShadowmapCasterVp.glsl b/school/informatik/verkerhssimulation/media/materials/programs/DepthShadowmapCasterVp.glsl
new file mode 100644
index 00000000..2f19c759
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/DepthShadowmapCasterVp.glsl
@@ -0,0 +1,24 @@
+uniform mat4 worldViewProj;
+uniform vec4 texelOffsets;
+uniform vec4 depthRange;
+
+varying vec2 depth;
+
+void main()
+{
+ gl_Position = ftransform();
+
+ // fix pixel / texel alignment
+ gl_Position.xy += texelOffsets.zw * gl_Position.w;
+ // linear depth storage
+ // offset / scale range output
+#if LINEAR_RANGE
+ depth.x = (gl_Position.z - depthRange.x) * depthRange.w;
+#else
+ depth.x = gl_Position.z;
+#endif
+ depth.y = gl_Position.w;
+
+
+}
+
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/DepthShadowmapNormalMapReceiverFp.glsl b/school/informatik/verkerhssimulation/media/materials/programs/DepthShadowmapNormalMapReceiverFp.glsl
new file mode 100644
index 00000000..2c45a545
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/DepthShadowmapNormalMapReceiverFp.glsl
@@ -0,0 +1,84 @@
+uniform float inverseShadowmapSize;
+uniform float fixedDepthBias;
+uniform float gradientClamp;
+uniform float gradientScaleBias;
+uniform float shadowFuzzyWidth;
+uniform vec4 lightColour;
+
+uniform sampler2D shadowMap;
+uniform sampler2D normalMap;
+
+varying vec3 tangentLightDir;
+
+
+// Expand a range-compressed vector
+vec3 expand(vec3 v)
+{
+ return (v - 0.5) * 2.0;
+}
+
+void main()
+{
+
+ // get the new normal and diffuse values
+ vec3 normal = normalize(expand(texture2D(normalMap, gl_TexCoord[1].xy).xyz));
+
+ vec4 vertexColour = clamp(dot(normal, tangentLightDir),0.0,1.0) * lightColour;
+
+
+ vec4 shadowUV = gl_TexCoord[0];
+ // point on shadowmap
+#if LINEAR_RANGE
+ shadowUV.xy = shadowUV.xy / shadowUV.w;
+#else
+ shadowUV = shadowUV / shadowUV.w;
+#endif
+ float centerdepth = texture2D(shadowMap, shadowUV.xy).x;
+
+ // gradient calculation
+ float pixeloffset = inverseShadowmapSize;
+ vec4 depths = vec4(
+ texture2D(shadowMap, shadowUV.xy + vec2(-pixeloffset, 0)).x,
+ texture2D(shadowMap, shadowUV.xy + vec2(+pixeloffset, 0)).x,
+ texture2D(shadowMap, shadowUV.xy + vec2(0, -pixeloffset)).x,
+ texture2D(shadowMap, shadowUV.xy + vec2(0, +pixeloffset)).x);
+
+ vec2 differences = abs( depths.yw - depths.xz );
+ float gradient = min(gradientClamp, max(differences.x, differences.y));
+ float gradientFactor = gradient * gradientScaleBias;
+
+ // visibility function
+ float depthAdjust = gradientFactor + (fixedDepthBias * centerdepth);
+ float finalCenterDepth = centerdepth + depthAdjust;
+
+ // shadowUV.z contains lightspace position of current object
+
+#if FUZZY_TEST
+ // fuzzy test - introduces some ghosting in result and doesn't appear to be needed?
+ //float visibility = saturate(1 + delta_z / (gradient * shadowFuzzyWidth));
+ float visibility = saturate(1 + (finalCenterDepth - shadowUV.z) * shadowFuzzyWidth * shadowUV.w);
+
+ gl_FragColor = vertexColour * visibility;
+#else
+ // hard test
+#if PCF
+ // use depths from prev, calculate diff
+ depths += depthAdjust;
+ float final = (finalCenterDepth > shadowUV.z) ? 1.0 : 0.0;
+ final += (depths.x > shadowUV.z) ? 1.0 : 0.0;
+ final += (depths.y > shadowUV.z) ? 1.0 : 0.0;
+ final += (depths.z > shadowUV.z) ? 1.0 : 0.0;
+ final += (depths.w > shadowUV.z) ? 1.0 : 0.0;
+
+ final *= 0.2;
+
+ gl_FragColor = vec4(vertexColour.xyz * final, 1);
+
+#else
+ gl_FragColor = (finalCenterDepth > shadowUV.z) ? vertexColour : vec4(0,0,0,1);
+#endif
+
+#endif
+
+}
+
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/DepthShadowmapNormalMapReceiverVp.glsl b/school/informatik/verkerhssimulation/media/materials/programs/DepthShadowmapNormalMapReceiverVp.glsl
new file mode 100644
index 00000000..66762f3e
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/DepthShadowmapNormalMapReceiverVp.glsl
@@ -0,0 +1,42 @@
+attribute vec3 tangent;
+
+uniform mat4 world;
+uniform mat4 worldViewProj;
+uniform mat4 texViewProj;
+uniform vec4 lightPosition; // object space
+uniform vec4 shadowDepthRange;
+
+varying vec3 tangentLightDir;
+
+
+void main()
+{
+ gl_Position = ftransform();
+
+ vec4 worldPos = world * gl_Vertex;
+
+ // Get object space light direction
+ vec3 lightDir = normalize(lightPosition.xyz - (gl_Vertex.xyz * lightPosition.w));
+
+ // calculate shadow map coords
+ gl_TexCoord[0] = texViewProj * worldPos;
+#if LINEAR_RANGE
+ // adjust by fixed depth bias, rescale into range
+ gl_TexCoord[0].z = (gl_TexCoord[0].z - shadowDepthRange.x) * shadowDepthRange.w;
+#endif
+
+ // pass the main uvs straight through unchanged
+ gl_TexCoord[1] = gl_MultiTexCoord0;
+
+ // Calculate the binormal (NB we assume both normal and tangent are
+ // already normalised)
+ vec3 binormal = cross(gl_Normal, tangent);
+
+ // Form a rotation matrix out of the vectors
+ mat3 rotation = mat3(tangent, binormal, gl_Normal);
+
+ // Transform the light vector according to this matrix
+ tangentLightDir = normalize(rotation * lightDir);
+
+}
+
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/DepthShadowmapReceiverFp.glsl b/school/informatik/verkerhssimulation/media/materials/programs/DepthShadowmapReceiverFp.glsl
new file mode 100644
index 00000000..04ebeaad
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/DepthShadowmapReceiverFp.glsl
@@ -0,0 +1,66 @@
+uniform float inverseShadowmapSize;
+uniform float fixedDepthBias;
+uniform float gradientClamp;
+uniform float gradientScaleBias;
+uniform float shadowFuzzyWidth;
+
+uniform sampler2D shadowMap;
+
+void main()
+{
+ vec4 shadowUV = gl_TexCoord[0];
+ // point on shadowmap
+#if LINEAR_RANGE
+ shadowUV.xy = shadowUV.xy / shadowUV.w;
+#else
+ shadowUV = shadowUV / shadowUV.w;
+#endif
+ float centerdepth = texture2D(shadowMap, shadowUV.xy).x;
+
+ // gradient calculation
+ float pixeloffset = inverseShadowmapSize;
+ vec4 depths = vec4(
+ texture2D(shadowMap, shadowUV.xy + vec2(-pixeloffset, 0)).x,
+ texture2D(shadowMap, shadowUV.xy + vec2(+pixeloffset, 0)).x,
+ texture2D(shadowMap, shadowUV.xy + vec2(0, -pixeloffset)).x,
+ texture2D(shadowMap, shadowUV.xy + vec2(0, +pixeloffset)).x);
+
+ vec2 differences = abs( depths.yw - depths.xz );
+ float gradient = min(gradientClamp, max(differences.x, differences.y));
+ float gradientFactor = gradient * gradientScaleBias;
+
+ // visibility function
+ float depthAdjust = gradientFactor + (fixedDepthBias * centerdepth);
+ float finalCenterDepth = centerdepth + depthAdjust;
+
+ // shadowUV.z contains lightspace position of current object
+
+#if FUZZY_TEST
+ // fuzzy test - introduces some ghosting in result and doesn't appear to be needed?
+ //float visibility = saturate(1 + delta_z / (gradient * shadowFuzzyWidth));
+ float visibility = saturate(1 + (finalCenterDepth - shadowUV.z) * shadowFuzzyWidth * shadowUV.w);
+
+ gl_FragColor = vertexColour * visibility;
+#else
+ // hard test
+#if PCF
+ // use depths from prev, calculate diff
+ depths += depthAdjust;
+ float final = (finalCenterDepth > shadowUV.z) ? 1.0 : 0.0;
+ final += (depths.x > shadowUV.z) ? 1.0 : 0.0;
+ final += (depths.y > shadowUV.z) ? 1.0 : 0.0;
+ final += (depths.z > shadowUV.z) ? 1.0 : 0.0;
+ final += (depths.w > shadowUV.z) ? 1.0 : 0.0;
+
+ final *= 0.2;
+
+ gl_FragColor = vec4(gl_Color.xyz * final, 1);
+
+#else
+ gl_FragColor = (finalCenterDepth > shadowUV.z) ? gl_Color : vec4(0,0,0,1);
+#endif
+
+#endif
+
+}
+
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/DepthShadowmapReceiverVp.glsl b/school/informatik/verkerhssimulation/media/materials/programs/DepthShadowmapReceiverVp.glsl
new file mode 100644
index 00000000..85c32e6a
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/DepthShadowmapReceiverVp.glsl
@@ -0,0 +1,32 @@
+uniform mat4 world;
+uniform mat4 worldIT;
+uniform mat4 worldViewProj;
+uniform mat4 texViewProj;
+uniform vec4 lightPosition;
+uniform vec4 lightColour;
+uniform vec4 shadowDepthRange;
+
+
+void main()
+{
+ gl_Position = ftransform();
+
+ vec4 worldPos = world * gl_Vertex;
+
+ vec3 worldNorm = (worldIT * vec4(gl_Normal, 1)).xyz;
+
+ // calculate lighting (simple vertex lighting)
+ vec3 lightDir = normalize(
+ lightPosition.xyz - (worldPos.xyz * lightPosition.w));
+
+ gl_FrontColor = lightColour * max(dot(lightDir, worldNorm), 0.0);
+
+ // calculate shadow map coords
+ gl_TexCoord[0] = texViewProj * worldPos;
+#if LINEAR_RANGE
+ // adjust by fixed depth bias, rescale into range
+ gl_TexCoord[0].z = (gl_TexCoord[0].z - shadowDepthRange.x) * shadowDepthRange.w;
+#endif
+
+}
+
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/Example_Basic.cg b/school/informatik/verkerhssimulation/media/materials/programs/Example_Basic.cg
new file mode 100644
index 00000000..dbeb1e7b
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/Example_Basic.cg
@@ -0,0 +1,272 @@
+/*
+ Basic ambient lighting vertex program
+*/
+void ambientOneTexture_vp(float4 position : POSITION,
+ float2 uv : TEXCOORD0,
+
+ out float4 oPosition : POSITION,
+ out float2 oUv : TEXCOORD0,
+ out float4 colour : COLOR,
+
+ uniform float4x4 worldViewProj,
+ uniform float4 ambient)
+{
+ oPosition = mul(worldViewProj, position);
+ oUv = uv;
+ colour = ambient;
+}
+
+/*
+ Single-weight-per-vertex hardware skinning, 2 lights
+ The trouble with vertex programs is they're not general purpose, but
+ fixed function hardware skinning is very poorly supported
+*/
+void hardwareSkinningOneWeight_vp(
+ float4 position : POSITION,
+ float3 normal : NORMAL,
+ float2 uv : TEXCOORD0,
+ float blendIdx : BLENDINDICES,
+
+
+ out float4 oPosition : POSITION,
+ out float2 oUv : TEXCOORD0,
+ out float4 colour : COLOR,
+ // Support up to 24 bones of float3x4
+ // vs_1_1 only supports 96 params so more than this is not feasible
+ uniform float3x4 worldMatrix3x4Array[24],
+ uniform float4x4 viewProjectionMatrix,
+ uniform float4 lightPos[2],
+ uniform float4 lightDiffuseColour[2],
+ uniform float4 ambient)
+{
+ // transform by indexed matrix
+ float4 blendPos = float4(mul(worldMatrix3x4Array[blendIdx], position).xyz, 1.0);
+ // view / projection
+ oPosition = mul(viewProjectionMatrix, blendPos);
+ // transform normal
+ float3 norm = mul((float3x3)worldMatrix3x4Array[blendIdx], normal);
+ // Lighting - support point and directional
+ float3 lightDir0 = normalize(
+ lightPos[0].xyz - (blendPos.xyz * lightPos[0].w));
+ float3 lightDir1 = normalize(
+ lightPos[1].xyz - (blendPos.xyz * lightPos[1].w));
+
+ oUv = uv;
+ colour = ambient +
+ (saturate(dot(lightDir0, norm)) * lightDiffuseColour[0]) +
+ (saturate(dot(lightDir1, norm)) * lightDiffuseColour[1]);
+
+}
+
+/*
+ Single-weight-per-vertex hardware skinning, shadow-caster pass
+*/
+void hardwareSkinningOneWeightCaster_vp(
+ float4 position : POSITION,
+ float3 normal : NORMAL,
+ float blendIdx : BLENDINDICES,
+
+
+ out float4 oPosition : POSITION,
+ out float4 colour : COLOR,
+ // Support up to 24 bones of float3x4
+ // vs_1_1 only supports 96 params so more than this is not feasible
+ uniform float3x4 worldMatrix3x4Array[24],
+ uniform float4x4 viewProjectionMatrix,
+ uniform float4 ambient)
+{
+ // transform by indexed matrix
+ float4 blendPos = float4(mul(worldMatrix3x4Array[blendIdx], position).xyz, 1.0);
+ // view / projection
+ oPosition = mul(viewProjectionMatrix, blendPos);
+
+ colour = ambient;
+
+}
+
+/*
+ Two-weight-per-vertex hardware skinning, 2 lights
+ The trouble with vertex programs is they're not general purpose, but
+ fixed function hardware skinning is very poorly supported
+*/
+void hardwareSkinningTwoWeights_vp(
+ float4 position : POSITION,
+ float3 normal : NORMAL,
+ float2 uv : TEXCOORD0,
+ float4 blendIdx : BLENDINDICES,
+ float4 blendWgt : BLENDWEIGHT,
+
+
+ out float4 oPosition : POSITION,
+ out float2 oUv : TEXCOORD0,
+ out float4 colour : COLOR,
+ // Support up to 24 bones of float3x4
+ // vs_1_1 only supports 96 params so more than this is not feasible
+ uniform float3x4 worldMatrix3x4Array[24],
+ uniform float4x4 viewProjectionMatrix,
+ uniform float4 lightPos[2],
+ uniform float4 lightDiffuseColour[2],
+ uniform float4 ambient)
+{
+ // transform by indexed matrix
+ float4 blendPos = float4(0,0,0,0);
+ int i;
+ for (i = 0; i < 2; ++i)
+ {
+ blendPos += float4(mul(worldMatrix3x4Array[blendIdx[i]], position).xyz, 1.0) * blendWgt[i];
+ }
+ // view / projection
+ oPosition = mul(viewProjectionMatrix, blendPos);
+ // transform normal
+ float3 norm = float3(0,0,0);
+ for (i = 0; i < 2; ++i)
+ {
+ norm += mul((float3x3)worldMatrix3x4Array[blendIdx[i]], normal) *
+ blendWgt[i];
+ }
+ norm = normalize(norm);
+ // Lighting - support point and directional
+ float3 lightDir0 = normalize(
+ lightPos[0].xyz - (blendPos.xyz * lightPos[0].w));
+ float3 lightDir1 = normalize(
+ lightPos[1].xyz - (blendPos.xyz * lightPos[1].w));
+
+
+ oUv = uv;
+ colour = float4(0.5, 0.5, 0.5, 1) +
+ (saturate(dot(lightDir0, norm)) * lightDiffuseColour[0]) +
+ (saturate(dot(lightDir1, norm)) * lightDiffuseColour[1]);
+
+}
+
+/*
+ Two-weight-per-vertex hardware skinning, shadow caster pass
+*/
+void hardwareSkinningTwoWeightsCaster_vp(
+ float4 position : POSITION,
+ float3 normal : NORMAL,
+ float2 uv : TEXCOORD0,
+ float4 blendIdx : BLENDINDICES,
+ float4 blendWgt : BLENDWEIGHT,
+
+
+ out float4 oPosition : POSITION,
+ out float4 colour : COLOR,
+ // Support up to 24 bones of float3x4
+ // vs_1_1 only supports 96 params so more than this is not feasible
+ uniform float3x4 worldMatrix3x4Array[24],
+ uniform float4x4 viewProjectionMatrix,
+ uniform float4 ambient)
+{
+ // transform by indexed matrix
+ float4 blendPos = float4(0,0,0,0);
+ int i;
+ for (i = 0; i < 2; ++i)
+ {
+ blendPos += float4(mul(worldMatrix3x4Array[blendIdx[i]], position).xyz, 1.0) * blendWgt[i];
+ }
+ // view / projection
+ oPosition = mul(viewProjectionMatrix, blendPos);
+
+
+ colour = ambient;
+
+
+}
+
+
+/*
+ Four-weight-per-vertex hardware skinning, 2 lights
+ The trouble with vertex programs is they're not general purpose, but
+ fixed function hardware skinning is very poorly supported
+*/
+void hardwareSkinningFourWeights_vp(
+ float4 position : POSITION,
+ float3 normal : NORMAL,
+ float2 uv : TEXCOORD0,
+ float4 blendIdx : BLENDINDICES,
+ float4 blendWgt : BLENDWEIGHT,
+
+
+ out float4 oPosition : POSITION,
+ out float2 oUv : TEXCOORD0,
+ out float4 colour : COLOR,
+ // Support up to 24 bones of float3x4
+ // vs_1_1 only supports 96 params so more than this is not feasible
+ uniform float3x4 worldMatrix3x4Array[24],
+ uniform float4x4 viewProjectionMatrix,
+ uniform float4 lightPos[2],
+ uniform float4 lightDiffuseColour[2],
+ uniform float4 ambient)
+{
+ // transform by indexed matrix
+ float4 blendPos = float4(0,0,0,0);
+ int i;
+ for (i = 0; i < 4; ++i)
+ {
+ blendPos += float4(mul(worldMatrix3x4Array[blendIdx[i]], position).xyz, 1.0) * blendWgt[i];
+ }
+ // view / projection
+ oPosition = mul(viewProjectionMatrix, blendPos);
+ // transform normal
+ float3 norm = float3(0,0,0);
+ for (i = 0; i < 4; ++i)
+ {
+ norm += mul((float3x3)worldMatrix3x4Array[blendIdx[i]], normal) *
+ blendWgt[i];
+ }
+ norm = normalize(norm);
+ // Lighting - support point and directional
+ float3 lightDir0 = normalize(
+ lightPos[0].xyz - (blendPos.xyz * lightPos[0].w));
+ float3 lightDir1 = normalize(
+ lightPos[1].xyz - (blendPos.xyz * lightPos[1].w));
+
+
+ oUv = uv;
+ colour = ambient +
+ (saturate(dot(lightDir0, norm)) * lightDiffuseColour[0]) +
+ (saturate(dot(lightDir1, norm)) * lightDiffuseColour[1]);
+
+}
+
+void hardwareMorphAnimation(float3 pos1 : POSITION,
+ float4 normal : NORMAL,
+ float2 uv : TEXCOORD0,
+ float3 pos2 : TEXCOORD1,
+
+ out float4 oPosition : POSITION,
+ out float2 oUv : TEXCOORD0,
+ out float4 colour : COLOR,
+
+ uniform float4x4 worldViewProj,
+ uniform float4 anim_t)
+{
+ // interpolate
+ float4 interp = float4(pos1 + anim_t.x*(pos2 - pos1), 1.0f);
+
+ oPosition = mul(worldViewProj, interp);
+ oUv = uv;
+ colour = float4(1,0,0,1);
+}
+
+void hardwarePoseAnimation(float3 pos : POSITION,
+ float4 normal : NORMAL,
+ float2 uv : TEXCOORD0,
+ float3 pose1 : TEXCOORD1,
+ float3 pose2 : TEXCOORD2,
+
+ out float4 oPosition : POSITION,
+ out float2 oUv : TEXCOORD0,
+ out float4 colour : COLOR,
+
+ uniform float4x4 worldViewProj,
+ uniform float4 anim_t)
+{
+ // interpolate
+ float4 interp = float4(pos + anim_t.x*pose1 + anim_t.y*pose2, 1.0f);
+
+ oPosition = mul(worldViewProj, interp);
+ oUv = uv;
+ colour = float4(1,0,0,1);
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/Example_Basic.hlsl b/school/informatik/verkerhssimulation/media/materials/programs/Example_Basic.hlsl
new file mode 100644
index 00000000..b7a2f51a
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/Example_Basic.hlsl
@@ -0,0 +1,273 @@
+/*
+ Basic ambient lighting vertex program
+*/
+void ambientOneTexture_vp(float4 position : POSITION,
+ float2 uv : TEXCOORD0,
+
+ out float4 oPosition : POSITION,
+ out float2 oUv : TEXCOORD0,
+ out float4 colour : COLOR,
+
+ uniform float4x4 worldViewProj,
+ uniform float4 ambient)
+{
+ oPosition = mul(worldViewProj, position);
+ oUv = uv;
+ colour = ambient;
+}
+
+/*
+ Single-weight-per-vertex hardware skinning, 2 lights
+ The trouble with vertex programs is they're not general purpose, but
+ fixed function hardware skinning is very poorly supported
+*/
+void hardwareSkinningOneWeight_vp(
+ float4 position : POSITION,
+ float3 normal : NORMAL,
+ float2 uv : TEXCOORD0,
+ float blendIdx : BLENDINDICES,
+
+
+ out float4 oPosition : POSITION,
+ out float2 oUv : TEXCOORD0,
+ out float4 colour : COLOR,
+ // Support up to 24 bones of float3x4
+ // vs_1_1 only supports 96 params so more than this is not feasible
+ uniform float3x4 worldMatrix3x4Array[24],
+ uniform float4x4 viewProjectionMatrix,
+ uniform float4 lightPos[2],
+ uniform float4 lightDiffuseColour[2],
+ uniform float4 ambient)
+{
+ // transform by indexed matrix
+ float4 blendPos = float4(mul(worldMatrix3x4Array[blendIdx], position).xyz, 1.0);
+ // view / projection
+ oPosition = mul(viewProjectionMatrix, blendPos);
+ // transform normal
+ float3 norm = mul((float3x3)worldMatrix3x4Array[blendIdx], normal);
+ // Lighting - support point and directional
+ float3 lightDir0 = normalize(
+ lightPos[0].xyz - (blendPos.xyz * lightPos[0].w));
+ float3 lightDir1 = normalize(
+ lightPos[1].xyz - (blendPos.xyz * lightPos[1].w));
+
+ oUv = uv;
+ colour = ambient +
+ (saturate(dot(lightDir0, norm)) * lightDiffuseColour[0]) +
+ (saturate(dot(lightDir1, norm)) * lightDiffuseColour[1]);
+
+}
+
+/*
+ Single-weight-per-vertex hardware skinning, shadow-caster pass
+*/
+void hardwareSkinningOneWeightCaster_vp(
+ float4 position : POSITION,
+ float3 normal : NORMAL,
+ float blendIdx : BLENDINDICES,
+
+
+ out float4 oPosition : POSITION,
+ out float4 colour : COLOR,
+ // Support up to 24 bones of float3x4
+ // vs_1_1 only supports 96 params so more than this is not feasible
+ uniform float3x4 worldMatrix3x4Array[24],
+ uniform float4x4 viewProjectionMatrix,
+ uniform float4 ambient)
+{
+ // transform by indexed matrix
+ float4 blendPos = float4(mul(worldMatrix3x4Array[blendIdx], position).xyz, 1.0);
+ // view / projection
+ oPosition = mul(viewProjectionMatrix, blendPos);
+
+ colour = ambient;
+
+}
+
+/*
+ Two-weight-per-vertex hardware skinning, 2 lights
+ The trouble with vertex programs is they're not general purpose, but
+ fixed function hardware skinning is very poorly supported
+*/
+void hardwareSkinningTwoWeights_vp(
+ float4 position : POSITION,
+ float3 normal : NORMAL,
+ float2 uv : TEXCOORD0,
+ float4 blendIdx : BLENDINDICES,
+ float4 blendWgt : BLENDWEIGHT,
+
+
+ out float4 oPosition : POSITION,
+ out float2 oUv : TEXCOORD0,
+ out float4 colour : COLOR,
+ // Support up to 24 bones of float3x4
+ // vs_1_1 only supports 96 params so more than this is not feasible
+ uniform float3x4 worldMatrix3x4Array[24],
+ uniform float4x4 viewProjectionMatrix,
+ uniform float4 lightPos[2],
+ uniform float4 lightDiffuseColour[2],
+ uniform float4 ambient)
+{
+ // transform by indexed matrix
+ float4 blendPos = float4(0,0,0,0);
+ int i;
+ for (i = 0; i < 2; ++i)
+ {
+ blendPos += float4(mul(worldMatrix3x4Array[blendIdx[i]], position).xyz, 1.0) * blendWgt[i];
+ }
+ // view / projection
+ oPosition = mul(viewProjectionMatrix, blendPos);
+ // transform normal
+ float3 norm = float3(0,0,0);
+ for (i = 0; i < 2; ++i)
+ {
+ norm += mul((float3x3)worldMatrix3x4Array[blendIdx[i]], normal) *
+ blendWgt[i];
+ }
+ norm = normalize(norm);
+ // Lighting - support point and directional
+ float3 lightDir0 = normalize(
+ lightPos[0].xyz - (blendPos.xyz * lightPos[0].w));
+ float3 lightDir1 = normalize(
+ lightPos[1].xyz - (blendPos.xyz * lightPos[1].w));
+
+
+ oUv = uv;
+ colour = ambient +
+ (saturate(dot(lightDir0, norm)) * lightDiffuseColour[0]) +
+ (saturate(dot(lightDir1, norm)) * lightDiffuseColour[1]);
+
+}
+
+/*
+ Two-weight-per-vertex hardware skinning, shadow caster pass
+*/
+void hardwareSkinningTwoWeightsCaster_vp(
+ float4 position : POSITION,
+ float3 normal : NORMAL,
+ float2 uv : TEXCOORD0,
+ float4 blendIdx : BLENDINDICES,
+ float4 blendWgt : BLENDWEIGHT,
+
+
+ out float4 oPosition : POSITION,
+ out float4 colour : COLOR,
+ // Support up to 24 bones of float3x4
+ // vs_1_1 only supports 96 params so more than this is not feasible
+ uniform float3x4 worldMatrix3x4Array[24],
+ uniform float4x4 viewProjectionMatrix,
+ uniform float4 ambient)
+{
+ // transform by indexed matrix
+ float4 blendPos = float4(0,0,0,0);
+ int i;
+ for (i = 0; i < 2; ++i)
+ {
+ blendPos += float4(mul(worldMatrix3x4Array[blendIdx[i]], position).xyz, 1.0) * blendWgt[i];
+ }
+ // view / projection
+ oPosition = mul(viewProjectionMatrix, blendPos);
+
+
+ colour = ambient;
+
+
+}
+
+
+/*
+ Four-weight-per-vertex hardware skinning, 2 lights
+ The trouble with vertex programs is they're not general purpose, but
+ fixed function hardware skinning is very poorly supported
+*/
+void hardwareSkinningFourWeights_vp(
+ float4 position : POSITION,
+ float3 normal : NORMAL,
+ float2 uv : TEXCOORD0,
+ float4 blendIdx : BLENDINDICES,
+ float4 blendWgt : BLENDWEIGHT,
+
+
+ out float4 oPosition : POSITION,
+ out float2 oUv : TEXCOORD0,
+ out float4 colour : COLOR,
+ // Support up to 24 bones of float3x4
+ // vs_1_1 only supports 96 params so more than this is not feasible
+ uniform float3x4 worldMatrix3x4Array[24],
+ uniform float4x4 viewProjectionMatrix,
+ uniform float4 lightPos[2],
+ uniform float4 lightDiffuseColour[2],
+ uniform float4 ambient)
+{
+ // transform by indexed matrix
+ float4 blendPos = float4(0,0,0,0);
+ int i;
+ for (i = 0; i < 4; ++i)
+ {
+ blendPos += float4(mul(worldMatrix3x4Array[blendIdx[i]], position).xyz, 1.0) * blendWgt[i];
+ }
+ // view / projection
+ oPosition = mul(viewProjectionMatrix, blendPos);
+ // transform normal
+ float3 norm = float3(0,0,0);
+ for (i = 0; i < 4; ++i)
+ {
+ norm += mul((float3x3)worldMatrix3x4Array[blendIdx[i]], normal) *
+ blendWgt[i];
+ }
+ norm = normalize(norm);
+ // Lighting - support point and directional
+ float3 lightDir0 = normalize(
+ lightPos[0].xyz - (blendPos.xyz * lightPos[0].w));
+ float3 lightDir1 = normalize(
+ lightPos[1].xyz - (blendPos.xyz * lightPos[1].w));
+
+
+ oUv = uv;
+ colour = ambient +
+ (saturate(dot(lightDir0, norm)) * lightDiffuseColour[0]) +
+ (saturate(dot(lightDir1, norm)) * lightDiffuseColour[1]);
+
+}
+
+void hardwareMorphAnimation(float3 pos1 : POSITION,
+ float4 normal : NORMAL,
+ float2 uv : TEXCOORD0,
+ float3 pos2 : TEXCOORD1,
+
+ out float4 oPosition : POSITION,
+ out float2 oUv : TEXCOORD0,
+ out float4 colour : COLOR,
+
+ uniform float4x4 worldViewProj,
+ uniform float4 anim_t)
+{
+ // interpolate
+ float4 interp = float4(pos1 + anim_t.x*(pos2 - pos1), 1.0f);
+
+ oPosition = mul(worldViewProj, interp);
+ oUv = uv;
+ colour = float4(1,0,0,1);
+}
+
+void hardwarePoseAnimation(float3 pos : POSITION,
+ float4 normal : NORMAL,
+ float2 uv : TEXCOORD0,
+ float3 pose1 : TEXCOORD1,
+ float3 pose2 : TEXCOORD2,
+
+ out float4 oPosition : POSITION,
+ out float2 oUv : TEXCOORD0,
+ out float4 colour : COLOR,
+
+ uniform float4x4 worldViewProj,
+ uniform float4 anim_t)
+{
+ // interpolate
+ float4 interp = float4(pos + anim_t.x*pose1 + anim_t.y*pose2, 1.0f);
+
+ oPosition = mul(worldViewProj, interp);
+ oUv = uv;
+ colour = float4(1,0,0,1);
+}
+
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/Example_BumpMapping.cg b/school/informatik/verkerhssimulation/media/materials/programs/Example_BumpMapping.cg
new file mode 100644
index 00000000..17225317
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/Example_BumpMapping.cg
@@ -0,0 +1,236 @@
+// General functions
+
+// Expand a range-compressed vector
+float3 expand(float3 v)
+{
+ return (v - 0.5) * 2;
+}
+
+
+/* Bump mapping vertex program
+ In this program, we want to calculate the tangent space light vector
+ on a per-vertex level which will get passed to the fragment program,
+ or to the fixed function dot3 operation, to produce the per-pixel
+ lighting effect.
+*/
+void main_vp(float4 position : POSITION,
+ float3 normal : NORMAL,
+ float2 uv : TEXCOORD0,
+ float3 tangent : TANGENT0,
+ // outputs
+ out float4 oPosition : POSITION,
+ out float2 oUv : TEXCOORD0,
+ out float3 oTSLightDir : TEXCOORD1,
+ // parameters
+ uniform float4 lightPosition, // object space
+ uniform float4x4 worldViewProj)
+{
+ // calculate output position
+ oPosition = mul(worldViewProj, position);
+
+ // pass the main uvs straight through unchanged
+ oUv = uv;
+
+ // calculate tangent space light vector
+ // Get object space light direction
+ // Non-normalised since we'll do that in the fragment program anyway
+ float3 lightDir = lightPosition.xyz - (position * lightPosition.w);
+
+ // Calculate the binormal (NB we assume both normal and tangent are
+ // already normalised)
+ // NB looks like nvidia cross params are BACKWARDS to what you'd expect
+ // this equates to NxT, not TxN
+ float3 binormal = cross(tangent, normal);
+
+ // Form a rotation matrix out of the vectors
+ float3x3 rotation = float3x3(tangent, binormal, normal);
+
+ // Transform the light vector according to this matrix
+ oTSLightDir = mul(rotation, lightDir);
+
+
+}
+
+/* Bump mapping vertex program for shadow receiving
+ In this program, we want to calculate the tangent space light vector
+ on a per-vertex level which will get passed to the fragment program,
+ or to the fixed function dot3 operation, to produce the per-pixel
+ lighting effect.
+*/
+void main_shadowreceiver_vp(float4 position : POSITION,
+ float3 normal : NORMAL,
+ float2 uv : TEXCOORD0,
+ float3 tangent : TANGENT0,
+
+ // outputs
+ out float4 oPosition : POSITION,
+ out float4 uvproj : TEXCOORD0,
+ out float2 oUv : TEXCOORD1,
+ out float3 oTSLightDir : TEXCOORD2,
+
+ // parameters
+ uniform float4 lightPosition, // object space
+ uniform float4x4 worldViewProj,
+ uniform float4x4 worldMatrix,
+ uniform float4x4 texViewProj)
+{
+ // calculate output position
+ oPosition = mul(worldViewProj, position);
+
+ // pass the main uvs straight through unchanged
+ oUv = uv;
+
+ // calculate tangent space light vector
+ // Get object space light direction
+ // Non-normalised since we'll do that in the fragment program anyway
+ float3 lightDir = lightPosition.xyz - (position * lightPosition.w);
+
+ // Calculate the binormal (NB we assume both normal and tangent are
+ // already normalised)
+ // NB looks like nvidia cross params are BACKWARDS to what you'd expect
+ // this equates to NxT, not TxN
+ float3 binormal = cross(tangent, normal);
+
+ // Form a rotation matrix out of the vectors
+ float3x3 rotation = float3x3(tangent, binormal, normal);
+
+ // Transform the light vector according to this matrix
+ oTSLightDir = mul(rotation, lightDir);
+
+ // Projection
+ uvproj = mul(worldMatrix, position);
+ uvproj = mul(texViewProj, uvproj);
+
+}
+
+
+void main_fp( float2 uv : TEXCOORD0,
+ float3 TSlightDir : TEXCOORD1,
+
+ out float4 colour : COLOR,
+
+ uniform float4 lightDiffuse,
+ uniform sampler2D normalMap : register(s0),
+ uniform samplerCUBE normalCubeMap : register(s1) )
+{
+ // retrieve normalised light vector, expand from range-compressed
+ float3 lightVec = expand(texCUBE(normalCubeMap, TSlightDir).xyz);
+
+ // get bump map vector, again expand from range-compressed
+ float3 bumpVec = expand(tex2D(normalMap, uv).xyz);
+
+ // Calculate dot product
+ colour = lightDiffuse * dot(bumpVec, lightVec);
+
+}
+
+void main_shadowreceiver_fp(
+ float4 uvproj : TEXCOORD0,
+ float2 uv : TEXCOORD1,
+ float3 TSlightDir : TEXCOORD2,
+
+ out float4 colour : COLOR,
+
+ uniform float4 lightDiffuse,
+ uniform sampler2D shadowMap : register(s0),
+ uniform sampler2D normalMap : register(s1),
+ uniform samplerCUBE normalCubeMap : register(s2))
+{
+
+
+ // retrieve normalised light vector, expand from range-compressed
+ float3 lightVec = expand(texCUBE(normalCubeMap, TSlightDir).xyz);
+
+ // get bump map vector, again expand from range-compressed
+ float3 bumpVec = expand(tex2D(normalMap, uv).xyz);
+
+ // get shadow value
+ float3 shadow = tex2Dproj(shadowMap, uvproj).xyz;
+
+ // Calculate dot product
+ colour = float4(shadow * lightDiffuse * dot(bumpVec, lightVec), 1.0f);
+
+}
+
+/* Vertex program which includes specular component */
+void specular_vp(float4 position : POSITION,
+ float3 normal : NORMAL,
+ float2 uv : TEXCOORD0,
+ float3 tangent : TANGENT0,
+ // outputs
+ out float4 oPosition : POSITION,
+ out float2 oUv : TEXCOORD0,
+ out float3 oTSLightDir : TEXCOORD1,
+ out float3 oTSHalfAngle : TEXCOORD2,
+ // parameters
+ uniform float4 lightPosition, // object space
+ uniform float3 eyePosition, // object space
+ uniform float4x4 worldViewProj)
+{
+ // calculate output position
+ oPosition = mul(worldViewProj, position);
+
+ // pass the main uvs straight through unchanged
+ oUv = uv;
+
+ // calculate tangent space light vector
+ // Get object space light direction
+ float3 lightDir = normalize(lightPosition.xyz - (position * lightPosition.w));
+
+ // Calculate the binormal (NB we assume both normal and tangent are
+ // already normalised)
+ // NB looks like nvidia cross params are BACKWARDS to what you'd expect
+ // this equates to NxT, not TxN
+ float3 binormal = cross(tangent, normal);
+
+ // Form a rotation matrix out of the vectors
+ float3x3 rotation = float3x3(tangent, binormal, normal);
+
+ // Transform the light vector according to this matrix
+ oTSLightDir = mul(rotation, lightDir);
+
+ // Calculate half-angle in tangent space
+ float3 eyeDir = normalize(eyePosition - position.xyz);
+ float3 halfAngle = normalize(eyeDir + lightDir);
+ oTSHalfAngle = mul(rotation, halfAngle);
+
+
+}
+
+/* Fragment program which supports specular component */
+void specular_fp( float2 uv : TEXCOORD0,
+ float3 TSlightDir : TEXCOORD1,
+ float3 TShalfAngle: TEXCOORD2,
+
+ out float4 colour : COLOR,
+
+ uniform float4 lightDiffuse,
+ uniform float4 lightSpecular,
+ uniform sampler2D normalMap : register(s0),
+ uniform samplerCUBE normalCubeMap : register(s1),
+ uniform samplerCUBE normalCubeMap2 : register(s2)) // we need this second binding to be compatible with ps_1_1, ps_2_0 could reuse the other
+{
+ // retrieve normalised light vector, expand from range-compressed
+ float3 lightVec = expand(texCUBE(normalCubeMap, TSlightDir).xyz);
+
+ // retrieve half angle and normalise through cube map
+ float3 halfAngle = expand(texCUBE(normalCubeMap2, TShalfAngle).xyz);
+
+ // get bump map vector, again expand from range-compressed
+ float3 bumpVec = expand(tex2D(normalMap, uv).xyz);
+
+ // Pre-raise the specular exponent to the eight power
+ // Note we have no 'pow' function in basic fragment programs, if we were willing to accept compatibility
+ // with ps_2_0 / arbfp1 and above, we could have a variable shininess parameter
+ // This is equivalent to
+ float specFactor = dot(bumpVec, halfAngle);
+ for (int i = 0; i < 3; ++i)
+ specFactor *= specFactor;
+
+
+ // Calculate dot product for diffuse
+ colour = (lightDiffuse * saturate(dot(bumpVec, lightVec))) +
+ (lightSpecular * specFactor);
+
+}
+
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/Example_CelShading.cg b/school/informatik/verkerhssimulation/media/materials/programs/Example_CelShading.cg
new file mode 100644
index 00000000..895944fa
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/Example_CelShading.cg
@@ -0,0 +1,63 @@
+
+/* Cel shading vertex program for single-pass rendering
+ In this program, we want to calculate the diffuse and specular
+ ramp components, and the edge factor (for doing simple outlining)
+ For the outlining to look good, we need a pretty well curved model.
+*/
+void main_vp(float4 position : POSITION,
+ float3 normal : NORMAL,
+ // outputs
+ out float4 oPosition : POSITION,
+ out float diffuse : TEXCOORD0,
+ out float specular : TEXCOORD1,
+ out float edge : TEXCOORD2,
+ // parameters
+ uniform float3 lightPosition, // object space
+ uniform float3 eyePosition, // object space
+ uniform float4 shininess,
+ uniform float4x4 worldViewProj)
+{
+ // calculate output position
+ oPosition = mul(worldViewProj, position);
+
+ // calculate light vector
+ float3 N = normalize(normal);
+ float3 L = normalize(lightPosition - position.xyz);
+
+ // Calculate diffuse component
+ diffuse = max(dot(N, L) , 0);
+
+ // Calculate specular component
+ float3 E = normalize(eyePosition - position.xyz);
+ float3 H = normalize(L + E);
+ specular = pow(max(dot(N, H), 0), shininess);
+ // Mask off specular if diffuse is 0
+ if (diffuse == 0) specular = 0;
+
+ // Edge detection, dot eye and normal vectors
+ edge = max(dot(N, E), 0);
+}
+
+void main_fp(float diffuseIn : TEXCOORD0,
+ float specularIn : TEXCOORD1,
+ float edge : TEXCOORD2,
+
+ out float4 colour : COLOR,
+
+ uniform float4 diffuse,
+ uniform float4 specular,
+
+ uniform sampler1D diffuseRamp,
+ uniform sampler1D specularRamp,
+ uniform sampler1D edgeRamp)
+{
+ // Step functions from textures
+ diffuseIn = tex1D(diffuseRamp, diffuseIn).x;
+ specularIn = tex1D(specularRamp, specularIn).x;
+ edge = tex1D(edgeRamp, edge).x;
+
+ colour = edge * ((diffuse * diffuseIn) +
+ (specular * specularIn));
+}
+
+
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/Example_Fresnel.cg b/school/informatik/verkerhssimulation/media/materials/programs/Example_Fresnel.cg
new file mode 100644
index 00000000..2d8d0dc8
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/Example_Fresnel.cg
@@ -0,0 +1,115 @@
+// Vertex program for fresnel reflections / refractions
+void main_vp(
+ float4 pos : POSITION,
+ float4 normal : NORMAL,
+ float2 tex : TEXCOORD0,
+
+ out float4 oPos : POSITION,
+ out float3 noiseCoord : TEXCOORD0,
+ out float4 projectionCoord : TEXCOORD1,
+ out float3 oEyeDir : TEXCOORD2,
+ out float3 oNormal : TEXCOORD3,
+
+ uniform float4x4 worldViewProjMatrix,
+ uniform float3 eyePosition, // object space
+ uniform float timeVal,
+ uniform float scale, // the amount to scale the noise texture by
+ uniform float scroll, // the amount by which to scroll the noise
+ uniform float noise // the noise perturb as a factor of the time
+ )
+{
+ oPos = mul(worldViewProjMatrix, pos);
+ // Projective texture coordinates, adjust for mapping
+ float4x4 scalemat = float4x4(0.5, 0, 0, 0.5,
+ 0,-0.5, 0, 0.5,
+ 0, 0, 0.5, 0.5,
+ 0, 0, 0, 1);
+ projectionCoord = mul(scalemat, oPos);
+ // Noise map coords
+ noiseCoord.xy = (tex + (timeVal * scroll)) * scale;
+ noiseCoord.z = noise * timeVal;
+
+ oEyeDir = normalize(pos.xyz - eyePosition);
+ oNormal = normal.rgb;
+
+}
+
+// Fragment program for distorting a texture using a 3D noise texture
+void main_fp(
+ float3 noiseCoord : TEXCOORD0,
+ float4 projectionCoord : TEXCOORD1,
+ float3 eyeDir : TEXCOORD2,
+ float3 normal : TEXCOORD3,
+
+ out float4 col : COLOR,
+
+ uniform float4 tintColour,
+ uniform float noiseScale,
+ uniform float fresnelBias,
+ uniform float fresnelScale,
+ uniform float fresnelPower,
+ uniform sampler2D noiseMap : register(s0),
+ uniform sampler2D reflectMap : register(s1),
+ uniform sampler2D refractMap : register(s2)
+ )
+{
+ // Do the tex projection manually so we can distort _after_
+ float2 final = projectionCoord.xy / projectionCoord.w;
+
+ // Noise
+ float3 noiseNormal = (tex2D(noiseMap, (noiseCoord.xy / 5)).rgb - 0.5).rbg * noiseScale;
+ final += noiseNormal.xz;
+
+ // Fresnel
+ //normal = normalize(normal + noiseNormal.xz);
+ float fresnel = fresnelBias + fresnelScale * pow(1 + dot(eyeDir, normal), fresnelPower);
+
+ // Reflection / refraction
+ float4 reflectionColour = tex2D(reflectMap, final);
+ float4 refractionColour = tex2D(refractMap, final) + tintColour;
+
+ // Final colour
+ col = lerp(refractionColour, reflectionColour, fresnel);
+
+
+}
+
+
+// Old version to match ATI PS 1.3 implementation
+void main_vp_old(
+ float4 pos : POSITION,
+ float4 normal : NORMAL,
+ float2 tex : TEXCOORD0,
+
+ out float4 oPos : POSITION,
+ out float fresnel : COLOR,
+ out float3 noiseCoord : TEXCOORD0,
+ out float4 projectionCoord : TEXCOORD1,
+
+ uniform float4x4 worldViewProjMatrix,
+ uniform float3 eyePosition, // object space
+ uniform float fresnelBias,
+ uniform float fresnelScale,
+ uniform float fresnelPower,
+ uniform float timeVal,
+ uniform float scale, // the amount to scale the noise texture by
+ uniform float scroll, // the amount by which to scroll the noise
+ uniform float noise // the noise perturb as a factor of the time
+ )
+{
+ oPos = mul(worldViewProjMatrix, pos);
+ // Projective texture coordinates, adjust for mapping
+ float4x4 scalemat = float4x4(0.5, 0, 0, 0.5,
+ 0,-0.5, 0, 0.5,
+ 0, 0, 0.5, 0.5,
+ 0, 0, 0, 1);
+ projectionCoord = mul(scalemat, oPos);
+ // Noise map coords
+ noiseCoord.xy = (tex + (timeVal * scroll)) * scale;
+ noiseCoord.z = noise * timeVal;
+
+ // calc fresnel factor (reflection coefficient)
+ float3 eyeDir = normalize(pos.xyz - eyePosition);
+ fresnel = fresnelBias + fresnelScale * pow(1 + dot(eyeDir, normal), fresnelPower);
+
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/Example_FresnelPS.asm b/school/informatik/verkerhssimulation/media/materials/programs/Example_FresnelPS.asm
new file mode 100644
index 00000000..2de078ef
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/Example_FresnelPS.asm
@@ -0,0 +1,72 @@
+ps.1.4
+ // conversion from Cg generated ARB_fragment_program to ps.1.4 by NFZ
+ // command line args: -profile arbfp1 -entry main_fp
+ // program main_fp
+ // c0 : distortionRange
+ // c1 : tintColour
+ // testure 0 : noiseMap
+ // texture 1 : reflectMap
+ // texture 2 : refractMap
+ // v0.x : fresnel
+ // t0.xyz : noiseCoord
+ // t1.xyw : projectionCoord
+
+def c2, 2, 1, 0, 0
+
+ // Cg: distort.x = tex3D(noiseMap, noiseCoord).x;
+ // arbfp1: TEX R0.x, fragment.texcoord[0], texture[0], 3D;
+ // sample noise map using noiseCoord in TEX unit 0
+
+texld r0, t0.xyz
+
+ // get projected texture coordinates from TEX coord 1
+ // will be used in phase 2
+
+texcrd r1.xy, t1_dw.xyw
+mov r1.z, c2.y
+
+ // Cg: distort.y = tex3D(noiseMap, noiseCoord + yoffset).x;
+ // arbfp1: ADD R1.xyz, fragment.texcoord[0], c1;
+ // arbfp1: TEX R1.x, R1, texture[0], 3D;
+ // arbfp1: MOV R0.y, R1.x;
+
+ // Cg: distort = (distort * 2 - 1) * distortionRange;
+ // arbfp1: MAD R0.xy, R0, c0.x, -c0.y;
+ // arbfp1: MUL R0.xy, R0, u0.x;
+ // (distort * 2 - 1) same as 2*(distort -.5) so use _bx2
+
+
+ // Cg: final = projectionCoord.xy / projectionCoord.w;
+ // Cg: final += distort;
+ // arbfp1: RCP R0.w, fragment.texcoord[1].w;
+ // arbfp1: MAD R0.xy, fragment.texcoord[1], R0.w, R0;
+ // final = (distort * projectionCoord.w) + projectionCoord.xy
+ // for ps.1.4 have to re-arrange things a bit to perturb projected texture coordinates
+
+mad r0.xyz, r0_bx2, c0.x, r1
+
+phase
+
+ // do dependant texture reads
+ // Cg: reflectionColour = tex2D(reflectMap, final);
+ // arbfp1: TEX R0, R0, texture[1], 2D;
+ // sampe reflectMap using dependant read : texunit 1
+
+texld r1, r0.xyz
+
+ // Cg: refractionColour = tex2D(refractMap, final) + tintColour;
+ // arbfp1: TEX R1, R0, texture[2], 2D;
+ // sample refractMap : texunit 2
+
+texld r2, r0.xyz
+
+ // adding tintColour that is in global c1
+ // arbfp1: ADD R1, R1, u1;
+
+add r2, r2, c1
+
+ // Cg: col = lerp(refractionColour, reflectionColour, fresnel);
+ // arbfp1: ADD R0, R0, -R1;
+ // arbfp1: MAD result.color, fragment.color.primary.x, R0, R1;
+
+lrp r0, v0.x, r1, r2
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/Example_Projection.cg b/school/informatik/verkerhssimulation/media/materials/programs/Example_Projection.cg
new file mode 100644
index 00000000..c43f5904
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/Example_Projection.cg
@@ -0,0 +1,28 @@
+
+void generalPurposeProjection_vp(
+ float4 pos : POSITION,
+
+ out float4 oPos : POSITION,
+ out float4 texCoord : TEXCOORD0,
+
+ uniform float4x4 worldViewProjMatrix,
+ uniform float4x4 worldMatrix,
+ uniform float4x4 texViewProjMatrix)
+{
+ oPos = mul(worldViewProjMatrix, pos);
+ // multiply position by world matrix, then by projective view/proj
+ float4 newpos = mul(worldMatrix, pos);
+ texCoord = mul(texViewProjMatrix, newpos);
+
+}
+
+void generalPurposeProjection_fp(
+ float4 texCoord : TEXCOORD0,
+ out float4 col : COLOR,
+ uniform sampler2D texMap)
+{
+ col = tex2Dproj(texMap, texCoord);
+
+}
+
+
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/GlassFP.cg b/school/informatik/verkerhssimulation/media/materials/programs/GlassFP.cg
new file mode 100644
index 00000000..734c8039
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/GlassFP.cg
@@ -0,0 +1,9 @@
+sampler RT : register(s0);
+sampler NormalMap : register(s1);
+
+float4 main_ps(float2 iTexCoord : TEXCOORD0) : COLOR
+{
+ float4 normal = 2 * (tex2D(NormalMap, iTexCoord * 2.5) - 0.5);
+
+ return tex2D(RT, iTexCoord + normal.xy * 0.05);
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/Grass.cg b/school/informatik/verkerhssimulation/media/materials/programs/Grass.cg
new file mode 100644
index 00000000..4d2517b8
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/Grass.cg
@@ -0,0 +1,30 @@
+// Vertex program to wave some grass about
+// Simplistic, assumes base of the grass at 0
+void grass_vp(float4 position : POSITION,
+ float3 normal : NORMAL,
+ float2 uv : TEXCOORD0,
+ out float4 oPosition : POSITION,
+ out float2 oUv : TEXCOORD0,
+ out float4 colour : COLOR,
+
+ uniform float4x4 worldViewProj,
+ uniform float4 ambient,
+ uniform float4 objSpaceLight,
+ uniform float4 lightColour,
+ uniform float4 offset)
+{
+ float4 mypos = position;
+ //offset = float4(0.5, 0, 0, 0);
+ mypos = mypos + offset * mypos.yyyy;
+ oPosition = mul(worldViewProj, mypos);
+
+ oUv = uv;
+ // get vertex light direction (support directional and point)
+ float3 light = normalize(
+ objSpaceLight.xyz - (position.xyz * objSpaceLight.w));
+ float diffuseFactor = max(dot(normal, light), 0);
+
+
+ colour = ambient + diffuseFactor * lightColour;
+}
+
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/GrayScale.cg b/school/informatik/verkerhssimulation/media/materials/programs/GrayScale.cg
new file mode 100644
index 00000000..cb0c0dfb
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/GrayScale.cg
@@ -0,0 +1,18 @@
+sampler RT : register(s0);
+
+float4 GrayScale_ps(float2 iTexCoord : TEXCOORD0) : COLOR
+{
+ float3 greyscale = dot(tex2D(RT, iTexCoord).rgb, float3(0.3, 0.59, 0.11));
+ return float4(greyscale, 1.0);
+}
+
+float4 Embossed_ps(float2 iTexCoord : TEXCOORD0) : COLOR
+{
+ float4 Color;
+ Color.a = 1.0f;
+ Color.rgb = 0.5f;
+ Color -= tex2D( RT, iTexCoord - 0.001)*2.0f;
+ Color += tex2D( RT, iTexCoord + 0.001)*2.0f;
+ Color.rgb = (Color.r+Color.g+Color.b)/3.0f;
+ return Color;
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/HeatVision.cg b/school/informatik/verkerhssimulation/media/materials/programs/HeatVision.cg
new file mode 100644
index 00000000..86d5b812
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/HeatVision.cg
@@ -0,0 +1,230 @@
+//////////////////////////////////////////////
+// CASTER PASS //
+// HEAT //
+//////////////////////////////////////////////
+
+// vs_1_1
+void HeatCaster_vp(
+ // in
+ float4 vPos: POSITION,
+ float4 vNormal: NORMAL,
+
+ // out
+ out float4 oPos: POSITION,
+ out float2 oNDotV: TEXCOORD0,
+
+ // parameters
+ uniform float4x4 worldViewProj,
+ uniform float3 eyePosition // object space
+ )
+{
+ float4 eyeDir = float4(eyePosition - vPos.xyz, 0);
+ eyeDir = normalize(eyeDir);
+ oPos = mul( worldViewProj, vPos );
+ oNDotV = clamp( dot( vNormal, eyeDir ), 0, 1 );
+}
+
+// ps_2_0
+float4 HeatCaster_fp(
+ // input from vp
+ float2 iNDotV: TEXCOORD0
+ ) : COLOR0
+{
+ return iNDotV.x;
+}
+
+
+//////////////////////////////////////////////
+// CASTER PASS //
+// COLD //
+//////////////////////////////////////////////
+
+// vs_1_1
+void ColdCaster_vp(
+ // in
+ float4 vPos: POSITION,
+ float4 vNormal: NORMAL,
+
+ // out
+ out float4 oPos: POSITION,
+ out float2 oNDotV: TEXCOORD0,
+
+ // parameters
+ uniform float4x4 worldViewProj,
+ uniform float3 eyePosition // object space
+ )
+{
+ float4 eyeDir = float4(eyePosition - vPos.xyz, 0);
+ eyeDir = normalize(eyeDir);
+ oPos = mul( worldViewProj, vPos );
+ oNDotV = clamp( dot( vNormal, eyeDir ), 0, 1 );
+}
+
+// ps_2_0
+float4 ColdCaster_fp(
+ // input from vp
+ float2 iNDotV: TEXCOORD0
+ ) : COLOR0
+{
+ return iNDotV.x / 2;
+}
+
+
+//////////////////////////////////////////////
+// PASS 1 - Light to heat conversion //
+//////////////////////////////////////////////
+
+// vs_1_1
+void LightToHeat_vp(
+ // in
+ float4 inPos: POSITION,
+
+ uniform float flipping,
+
+ // out
+ out float4 Pos: POSITION,
+ out float2 uv0: TEXCOORD0
+ )
+{
+ Pos = float4(inPos.x, flipping * inPos.y, 0.0f, 1.0f);
+ inPos.xy = sign(inPos.xy);
+ uv0 = (float2(inPos.x, -inPos.y) + 1.0f)/2.0f;
+}
+
+
+// ps_2_0
+void LightToHeat_fp(
+ // input from vp
+ float4 inDiffuse: COLOR0,
+ float2 inUV0: TEXCOORD0,
+
+ // out
+ out float4 outColor: COLOR0,
+
+ // params
+ uniform float4 random_fractions,
+ uniform float4 heatBiasScale,
+ uniform float4 depth_modulator,
+
+ uniform sampler2D Input, // output of HeatVisionCaster_fp (NdotV)
+ uniform sampler2D NoiseMap,
+ uniform sampler2D HeatLookup
+ )
+{
+ float depth, heat, interference;
+
+ // Output constant color:
+ depth = tex2D( Input, inUV0 );
+ depth *= (depth * depth_modulator);
+
+ heat = (depth * heatBiasScale.y);
+
+// if (depth > 0)
+ {
+ interference = -0.5 + tex2D( NoiseMap, inUV0 + float2( random_fractions.x, random_fractions.y ) );
+ interference *= interference;
+ interference *= 1 - heat;
+ heat += interference;//+ heatBiasScale.x;
+ }
+
+/*
+ heatBias isn't used for now
+ if (heat > 0)
+ heat += heatBiasScale.x;
+*/
+
+ // Clamp UVs
+ heat = max( 0.005, min( 0.995, heat ) );
+ outColor = tex2D( HeatLookup, float2( heat, 0.f ) );
+}
+
+
+//////////////////////////////////////////////
+// PASS 2 - add simple blur (final pass) //
+//////////////////////////////////////////////
+
+// vs_1_1
+void Blur_vp(
+ // in
+ float4 inPos: POSITION,
+
+ uniform float flipping,
+
+ // out
+ out float4 Pos: POSITION,
+ out float2 uv0: TEXCOORD0
+ )
+{
+ Pos = float4(inPos.x, flipping * inPos.y, 0.0f, 1.0f);
+ inPos.xy = sign(inPos.xy);
+ uv0 = (float2(inPos.x, -inPos.y) + 1.0f)/2.0f;
+}
+
+// ps_2_0
+void Blur_fp(
+ // input from vp
+ float4 inDiffuse: COLOR0,
+ float2 inUV0: TEXCOORD0,
+
+ // out
+ out float4 outColor: COLOR0,
+
+ // parameters
+ uniform sampler2D Input, // output of HeatVision_fp1 (HeatRenderTexture)
+ uniform float4 blurAmount
+ )
+{
+ int i;
+ float4 tmpOutColor;
+ float diffuseGlowFactor;
+ const float2 offsets[4] =
+ {
+/*
+ // hazy blur
+ -1.8, -1.8,
+ -1.8, 1.8,
+ 1.8, -1.8,
+ 1.8, 1.8
+*/
+/*
+ // less-hazy blur
+ -1.0, 2.0,
+ -1.0, -1.0,
+ 1.0, -1.0,
+ 1.0, 1.0
+*/
+/*
+ -0.326212, -0.405805,
+ -0.840144, -0.073580,
+ -0.695914, 0.457137,
+ -0.203345, 0.620716
+*/
+
+ -0.3, 0.4,
+ -0.3, -0.4,
+ 0.3, -0.4,
+ 0.3, 0.4
+
+ };
+
+ tmpOutColor = tex2D( Input, inUV0 ); // UV coords are in image space
+
+ // calculate glow amount
+ diffuseGlowFactor = 0.0113f * (2.0 - max( tmpOutColor.r, tmpOutColor.g ));
+
+ // basic blur filter
+ for (i = 0; i < 4; i++) {
+ tmpOutColor += tex2D( Input, inUV0 + blurAmount.x * diffuseGlowFactor * offsets[i] );
+ }
+
+ tmpOutColor *= 0.25;
+
+ // TIPS (old-skool strikes again!)
+ // Pay attention here! If you use the "out float4 outColor" directly
+ // in your steps while creating the output color (like you remove
+ // the "tmpOutColor" var and just use the "outColor" directly)
+ // your pixel-color output IS CHANGING EACH TIME YOU DO AN ASSIGNMENT TOO!
+ // A temporary variable, instead, acts like a per-pixel double buffer, and
+ // best of all, lead to better performance.
+ outColor = tmpOutColor;
+}
\ No newline at end of file
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/InvertFP.cg b/school/informatik/verkerhssimulation/media/materials/programs/InvertFP.cg
new file mode 100644
index 00000000..2ef442bc
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/InvertFP.cg
@@ -0,0 +1,6 @@
+sampler RT : register(s0);
+
+float4 Invert_ps (float2 iTexCoord : TEXCOORD0) : COLOR
+{
+ return 1 - tex2D(RT, iTexCoord);
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/LaplaceFP.cg b/school/informatik/verkerhssimulation/media/materials/programs/LaplaceFP.cg
new file mode 100644
index 00000000..999e1bf9
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/LaplaceFP.cg
@@ -0,0 +1,36 @@
+sampler Image : register(s0);
+
+// The Laplace filter approximates the second order derivate,
+// that is, the rate of change of slope in the image. It can be
+// used for edge detection. The Laplace filter gives negative
+// response on the higher side of the edge and positive response
+// on the lower side.
+
+// This is the filter kernel:
+// 0 1 0
+// 1 -4 1
+// 0 1 0
+
+
+
+float4 Laplace_ps (float2 texCoord: TEXCOORD0,
+ uniform float scale,
+ uniform float pixelSize) : COLOR
+{
+
+ float2 samples[4] = {
+ 0, -1,
+ -1, 0,
+ 1, 0,
+ 0, 1
+ };
+ float4 laplace = -4 * tex2D(Image, texCoord);
+
+ // Sample the neighbor pixels
+ for (int i = 0; i < 4; i++){
+ laplace += tex2D(Image, texCoord + pixelSize * samples[i]);
+ }
+
+ return (0.5 + scale * laplace);
+}
+
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/Ocean2GLSL.frag b/school/informatik/verkerhssimulation/media/materials/programs/Ocean2GLSL.frag
new file mode 100644
index 00000000..024b68eb
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/Ocean2GLSL.frag
@@ -0,0 +1,71 @@
+/*********************************************************************NVMH3****
+Copyright NVIDIA Corporation 2003
+TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED
+*AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS
+BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES
+WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
+BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS)
+ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+
+Comments:
+ Simple ocean shader with animated bump map and geometric waves
+ Based partly on "Effective Water Simulation From Physical Models", GPU Gems
+
+11 Aug 05: converted from HLSL to GLSL by Jeff Doyle (nfz) to work in Ogre
+
+******************************************************************************/
+
+
+uniform sampler2D NormalMap;
+uniform samplerCube EnvironmentMap;
+uniform vec4 deepColor;
+uniform vec4 shallowColor;
+uniform vec4 reflectionColor;
+uniform float reflectionAmount;
+uniform float reflectionBlur;
+uniform float waterAmount;
+uniform float fresnelPower;
+uniform float fresnelBias;
+uniform float hdrMultiplier;
+
+varying mat3 rotMatrix; // first row of the 3x3 transform from tangent to cube space
+varying vec2 bumpCoord0;
+varying vec2 bumpCoord1;
+varying vec2 bumpCoord2;
+varying vec3 eyeVector;
+
+
+void main(void)
+{
+ // sum normal maps
+ // sample from 3 different points so no texture repetition is noticeable
+ vec4 t0 = texture2D(NormalMap, bumpCoord0) * 2.0 - 1.0;
+ vec4 t1 = texture2D(NormalMap, bumpCoord1) * 2.0 - 1.0;
+ vec4 t2 = texture2D(NormalMap, bumpCoord2) * 2.0 - 1.0;
+ vec3 N = t0.xyz + t1.xyz + t2.xyz;
+
+ N = normalize(rotMatrix * N);
+
+ // reflection
+ vec3 E = normalize(eyeVector);
+ vec3 R = reflect(E, N);
+ // Ogre conversion for cube map lookup
+ R.z = -R.z;
+
+ vec4 reflection = textureCube(EnvironmentMap, R, reflectionBlur);
+ // cheap hdr effect
+ reflection.rgb *= (reflection.r + reflection.g + reflection.b) * hdrMultiplier;
+
+ // fresnel
+ float facing = 1.0 - dot(-E, N);
+ float fresnel = clamp(fresnelBias + pow(facing, fresnelPower), 0.0, 1.0);
+
+ vec4 waterColor = mix(shallowColor, deepColor, facing) * waterAmount;
+
+ reflection = mix(waterColor, reflection * reflectionColor, fresnel) * reflectionAmount;
+ gl_FragColor = waterColor + reflection;
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/Ocean2GLSL.vert b/school/informatik/verkerhssimulation/media/materials/programs/Ocean2GLSL.vert
new file mode 100644
index 00000000..d42db4bd
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/Ocean2GLSL.vert
@@ -0,0 +1,91 @@
+/*********************************************************************NVMH3****
+Copyright NVIDIA Corporation 2003
+TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED
+*AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS
+BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES
+WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
+BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS)
+ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+
+Comments:
+ Simple ocean shader with animated bump map and geometric waves
+ Based partly on "Effective Water Simulation From Physical Models", GPU Gems
+
+11 Aug 05: converted from HLSL to GLSL by Jeff Doyle (nfz) to work in Ogre
+
+******************************************************************************/
+
+uniform vec3 eyePosition;
+uniform float BumpScale;
+uniform vec2 textureScale;
+uniform vec2 bumpSpeed;
+uniform float time;
+uniform float waveFreq;
+uniform float waveAmp;
+
+varying mat3 rotMatrix; // transform from tangent to obj space
+varying vec2 bumpCoord0;
+varying vec2 bumpCoord1;
+varying vec2 bumpCoord2;
+varying vec3 eyeVector;
+
+// wave functions
+struct Wave {
+ float freq; // 2*PI / wavelength
+ float amp; // amplitude
+ float phase; // speed * 2*PI / wavelength
+ vec2 dir;
+};
+
+
+void main(void)
+{
+
+ #define NWAVES 2
+
+ Wave wave[NWAVES];
+
+ wave[0] = Wave( waveFreq, waveAmp, 0.5, vec2(-1, 0) );
+ wave[1] = Wave( 3.0 * waveFreq, 0.33 * waveAmp, 1.7, vec2(-0.7, 0.7) );
+
+
+ vec4 P = gl_Vertex;
+
+ // sum waves
+ float ddx = 0.0, ddy = 0.0;
+ float deriv;
+ float angle;
+
+ // wave synthesis using two sine waves at different frequencies and phase shift
+ for(int i = 0; i st.y) { c1 = invOff; }
+ half threshholdB = 1.0 - Threshhold;
+ if (st.x > threshholdB) { c2 = c1; }
+ if (st.y > threshholdB) { c2 = c1; }
+ half4 cBottom = c2;
+ c1 = (half4)0;
+ c2 = (half4)0;
+ if (st.x > st.y) { c1 = invOff; }
+ if (st.x < Threshhold) { c2 = c1; }
+ if (st.y < Threshhold) { c2 = c1; }
+ half4 cTop = c2;
+ half4 tileColor = tex2D(RT, PCenter);
+ half4 result = tileColor + cTop - cBottom;
+ return result;
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/crowdVp.glsl b/school/informatik/verkerhssimulation/media/materials/programs/crowdVp.glsl
new file mode 100644
index 00000000..cb7a6e04
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/crowdVp.glsl
@@ -0,0 +1,62 @@
+uniform mat4 viewProjectionMatrix;
+uniform float numBones;
+uniform vec4 worldMatrix3x4Array[240];
+uniform vec4 lightDiffuseColour;
+uniform vec4 ambient;
+uniform vec4 lightPos;
+
+attribute vec4 blendIndices;
+attribute vec4 blendWeights;
+
+
+void main()
+{
+ vec3 blendPos = vec3(0,0,0);
+ vec3 blendNorm = vec3(0,0,0);
+
+ vec3 tmpPos = vec3(0,0,0);
+ vec3 tmpNorm = vec3(0,0,0);
+
+
+ int instanceOffset = int(gl_MultiTexCoord1.x) * 3 * int(numBones);
+ for (int bone = 0; bone < 2; ++bone)
+ {
+ // perform matrix multiplication manually since no 3x4 matrices
+ for (int row = 0; row < 3; ++row)
+ {
+ int idx = instanceOffset + int(blendIndices[bone]) * 3 + row;
+ vec4 blendMatrixRow = worldMatrix3x4Array[idx];
+ tmpPos[row] = dot(blendMatrixRow, gl_Vertex);
+#if SHADOW_CASTER
+#else
+ tmpNorm[row] = dot(blendMatrixRow.xyz, gl_Normal);
+#endif
+
+ }
+ // now weight this into final
+ blendPos += tmpPos * blendWeights[bone];
+#if SHADOW_CASTER
+#else
+ blendNorm += tmpNorm * blendWeights[bone];
+#endif
+ }
+
+ // apply view / projection to position
+ gl_Position = viewProjectionMatrix * vec4(blendPos, 1);
+
+
+#if SHADOW_CASTER
+ gl_FrontColor = ambient;
+#else
+ // simple lighting model
+ vec3 lightDir = normalize(
+ lightPos.xyz - (blendPos.xyz * lightPos.w));
+ gl_FrontColor = ambient
+ + clamp(dot(lightDir, blendNorm), 0.0, 1.0) * lightDiffuseColour;
+#endif
+ gl_FrontSecondaryColor = vec4(0);
+ gl_TexCoord[0] = gl_MultiTexCoord0;
+
+
+}
+
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/hdr.cg b/school/informatik/verkerhssimulation/media/materials/programs/hdr.cg
new file mode 100644
index 00000000..a12237c9
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/hdr.cg
@@ -0,0 +1,25 @@
+void morningskybox_fp (
+ float2 uv : TEXCOORD0,
+ out float4 colour : COLOR,
+
+ uniform sampler2D tex : register(s0) )
+{
+ colour = tex2D(tex, uv);
+
+ // blow out the light a bit
+ colour *= 1.7;
+}
+void morningcubemap_fp (
+ float3 uv : TEXCOORD0,
+ out float4 colour : COLOR,
+
+ uniform samplerCUBE tex : register(s0) )
+{
+ colour = texCUBE(tex, uv);
+
+ // blow out the light a bit
+ colour *= 1.7;
+}
+
+
+
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/hdr.hlsl b/school/informatik/verkerhssimulation/media/materials/programs/hdr.hlsl
new file mode 100644
index 00000000..6dfef6b8
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/hdr.hlsl
@@ -0,0 +1,228 @@
+// RGBE mode utilities
+// RGB each carry a mantissa, A carries a shared exponent
+// The exponent is calculated based on the largest colour channel
+
+
+float3 decodeRGBE8(in float4 rgbe)
+{
+ // get exponent (-128 since it can be +ve or -ve)
+ float exp = rgbe.a * 255 - 128;
+
+ // expand out the rgb value
+ return rgbe.rgb * exp2(exp);
+}
+
+float4 encodeRGBE8(in float3 rgb)
+{
+ float4 ret;
+
+ // What is the largest colour channel?
+ float highVal = max(rgb.r, max(rgb.g, rgb.b));
+
+ // Take the logarithm, clamp it to a whole value
+ float exp = ceil(log2(highVal));
+
+ // Divide the components by the shared exponent
+ ret.rgb = rgb / exp2(exp);
+
+ // Store the shared exponent in the alpha channel
+ ret.a = (exp + 128) / 255;
+
+ return ret;
+}
+
+
+static const float4 LUMINENCE_FACTOR = float4(0.27f, 0.67f, 0.06f, 0.0f);
+static const float MIDDLE_GREY = 0.72f;
+static const float FUDGE = 0.001f;
+static const float L_WHITE = 1.5f;
+static const float4 BRIGHT_LIMITER = float4(0.6f, 0.6f, 0.6f, 0.0f);
+
+
+/** Tone mapping function
+@note Only affects rgb, not a
+@param inColour The HDR colour
+@param lum The scene lumninence
+@returns Tone mapped colour
+*/
+float4 toneMap(float4 inColour, float lum)
+{
+ // From Reinhard et al
+ // "Photographic Tone Reproduction for Digital Images"
+
+ // Initial luminence scaling (equation 2)
+ inColour.rgb *= MIDDLE_GREY / (FUDGE + lum);
+
+ // Control white out (equation 4 nom)
+ inColour.rgb *= (1.0f + inColour / L_WHITE);
+
+ // Final mapping (equation 4 denom)
+ inColour.rgb /= (1.0f + inColour);
+
+ return inColour;
+
+}
+
+/* Downsample a 2x2 area and convert to greyscale
+*/
+float4 downscale2x2Luminence(
+ float2 uv : TEXCOORD0,
+ uniform float2 texelSize, // depends on size of source texture
+ uniform sampler2D inRTT : register(s0)
+ ) : COLOR
+{
+
+ float4 accum = float4(0.0f, 0.0f, 0.0f, 0.0f);
+
+ float2 texOffset[4] = {
+ -0.5, -0.5,
+ -0.5, 0.5,
+ 0.5, -0.5,
+ 0.5, 0.5 };
+
+ for( int i = 0; i < 4; i++ )
+ {
+ // Get colour from source
+ accum += tex2D(inRTT, uv + texelSize * texOffset[i]);
+ }
+
+ // Adjust the accumulated amount by lum factor
+ // Cannot use float3's here because it generates dependent texture errors because of swizzle
+ float lum = dot(accum, LUMINENCE_FACTOR);
+ // take average of 4 samples
+ lum *= 0.25;
+ return lum;
+
+}
+
+/* Downsample a 3x3 area
+ * This shader is used multiple times on different source sizes, so texel size has to be configurable
+*/
+float4 downscale3x3(
+ float2 uv : TEXCOORD0,
+ uniform float2 texelSize, // depends on size of source texture
+ uniform sampler2D inRTT : register(s0)
+ ) : COLOR
+{
+
+ float4 accum = float4(0.0f, 0.0f, 0.0f, 0.0f);
+
+ float2 texOffset[9] = {
+ -1.0, -1.0,
+ 0.0, -1.0,
+ 1.0, -1.0,
+ -1.0, 0.0,
+ 0.0, 0.0,
+ 1.0, 0.0,
+ -1.0, 1.0,
+ 0.0, 1.0,
+ 1.0, 1.0
+ };
+
+ for( int i = 0; i < 9; i++ )
+ {
+ // Get colour from source
+ accum += tex2D(inRTT, uv + texelSize * texOffset[i]);
+ }
+
+ // take average of 9 samples
+ accum *= 0.1111111111111111;
+ return accum;
+
+}
+
+/* Downsample a 3x3 area from main RTT and perform a brightness pass
+*/
+float4 downscale3x3brightpass(
+ float2 uv : TEXCOORD0,
+ uniform float2 texelSize, // depends on size of source texture
+ uniform sampler2D inRTT : register(s0),
+ uniform sampler2D inLum : register(s1)
+ ) : COLOR
+{
+
+ float4 accum = float4(0.0f, 0.0f, 0.0f, 0.0f);
+
+ float2 texOffset[9] = {
+ -1.0, -1.0,
+ 0.0, -1.0,
+ 1.0, -1.0,
+ -1.0, 0.0,
+ 0.0, 0.0,
+ 1.0, 0.0,
+ -1.0, 1.0,
+ 0.0, 1.0,
+ 1.0, 1.0
+ };
+
+ for( int i = 0; i < 9; i++ )
+ {
+ // Get colour from source
+ accum += tex2D(inRTT, uv + texelSize * texOffset[i]);
+ }
+
+ // take average of 9 samples
+ accum *= 0.1111111111111111;
+
+ // Reduce bright and clamp
+ accum = max(float4(0.0f, 0.0f, 0.0f, 1.0f), accum - BRIGHT_LIMITER);
+
+ // Sample the luminence texture
+ float4 lum = tex2D(inLum, float2(0.5f, 0.5f));
+
+ // Tone map result
+ return toneMap(accum, lum.r);
+
+}
+
+/* Gaussian bloom, requires offsets and weights to be provided externally
+*/
+float4 bloom(
+ float2 uv : TEXCOORD0,
+ uniform float2 sampleOffsets[15],
+ uniform float4 sampleWeights[15],
+ uniform sampler2D inRTT : register(s0)
+ ) : COLOR
+{
+ float4 accum = float4(0.0f, 0.0f, 0.0f, 1.0f);
+ float2 sampleUV;
+
+ for( int i = 0; i < 15; i++ )
+ {
+ // Sample from adjacent points, 7 each side and central
+ sampleUV = uv + sampleOffsets[i];
+ accum += sampleWeights[i] * tex2D(inRTT, sampleUV);
+ }
+
+ return accum;
+
+}
+
+
+/* Final scene composition, with tone mapping
+*/
+float4 finalToneMapping(
+ float2 uv : TEXCOORD0,
+ uniform sampler2D inRTT : register(s0),
+ uniform sampler2D inBloom : register(s1),
+ uniform sampler2D inLum : register(s2)
+ ) : COLOR
+{
+ // Get main scene colour
+ float4 sceneCol = tex2D(inRTT, uv);
+
+ // Get luminence value
+ float4 lum = tex2D(inLum, float2(0.5f, 0.5f));
+
+ // tone map this
+ float4 toneMappedSceneCol = toneMap(sceneCol, lum.r);
+
+ // Get bloom colour
+ float4 bloom = tex2D(inBloom, uv);
+
+ // Add scene & bloom
+ return float4(toneMappedSceneCol.rgb + bloom.rgb, 1.0f);
+
+}
+
+
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/hdr_bloom.glsl b/school/informatik/verkerhssimulation/media/materials/programs/hdr_bloom.glsl
new file mode 100644
index 00000000..d6992666
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/hdr_bloom.glsl
@@ -0,0 +1,22 @@
+uniform sampler2D inRTT;
+
+uniform vec4 sampleOffsets[15];
+uniform vec4 sampleWeights[15];
+
+varying vec2 uv;
+
+void main(void)
+{
+ vec4 accum = vec4(0.0, 0.0, 0.0, 1.0);
+ vec2 sampleUV;
+
+ for( int i = 0; i < 15; i++ )
+ {
+ // Sample from adjacent points, 7 each side and central
+ sampleUV = uv + sampleOffsets[i].xy;
+ accum += sampleWeights[i] * texture2D(inRTT, sampleUV);
+ }
+
+ gl_FragColor = accum;
+
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/hdr_downscale2x2luminence.glsl b/school/informatik/verkerhssimulation/media/materials/programs/hdr_downscale2x2luminence.glsl
new file mode 100644
index 00000000..976a726b
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/hdr_downscale2x2luminence.glsl
@@ -0,0 +1,24 @@
+uniform sampler2D inRTT;
+uniform vec2 texelSize;
+
+varying vec2 uv;
+
+void main(void)
+{
+
+ vec4 accum = vec4(0.0, 0.0, 0.0, 0.0);
+ vec4 LUMINENCE_FACTOR = vec4(0.27, 0.67, 0.06, 0.0);
+
+ // Get colour from source
+ accum += texture2D(inRTT, uv + texelSize * vec2(-0.5, -0.5));
+ accum += texture2D(inRTT, uv + texelSize * vec2(-0.5, 0.5));
+ accum += texture2D(inRTT, uv + texelSize * vec2(0.5, 0.5));
+ accum += texture2D(inRTT, uv + texelSize * vec2(0.5, -0.5));
+
+ // Adjust the accumulated amount by lum factor
+ float lum = dot(accum, LUMINENCE_FACTOR);
+ // take average of 4 samples
+ lum *= 0.25;
+ gl_FragColor = vec4(lum, lum, lum, 1.0);
+
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/hdr_downscale3x3.glsl b/school/informatik/verkerhssimulation/media/materials/programs/hdr_downscale3x3.glsl
new file mode 100644
index 00000000..2f6a999c
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/hdr_downscale3x3.glsl
@@ -0,0 +1,26 @@
+uniform sampler2D inRTT;
+uniform vec2 texelSize;
+
+varying vec2 uv;
+
+void main(void)
+{
+ vec4 accum = vec4(0.0, 0.0, 0.0, 0.0);
+
+ // Get colour from source
+ accum += texture2D(inRTT, uv + texelSize * vec2(-1.0, -1.0));
+ accum += texture2D(inRTT, uv + texelSize * vec2( 0.0, -1.0));
+ accum += texture2D(inRTT, uv + texelSize * vec2( 1.0, -1.0));
+ accum += texture2D(inRTT, uv + texelSize * vec2(-1.0, 0.0));
+ accum += texture2D(inRTT, uv + texelSize * vec2( 0.0, 0.0));
+ accum += texture2D(inRTT, uv + texelSize * vec2( 1.0, 0.0));
+ accum += texture2D(inRTT, uv + texelSize * vec2(-1.0, 1.0));
+ accum += texture2D(inRTT, uv + texelSize * vec2( 0.0, 1.0));
+ accum += texture2D(inRTT, uv + texelSize * vec2( 1.0, 1.0));
+
+ // take average of 9 samples
+ accum *= 0.1111111111111111;
+
+ gl_FragColor = accum;
+
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/hdr_downscale3x3brightpass.glsl b/school/informatik/verkerhssimulation/media/materials/programs/hdr_downscale3x3brightpass.glsl
new file mode 100644
index 00000000..83d4afba
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/hdr_downscale3x3brightpass.glsl
@@ -0,0 +1,37 @@
+uniform sampler2D inRTT;
+uniform sampler2D inLum;
+uniform vec2 texelSize;
+
+varying vec2 uv;
+const vec4 BRIGHT_LIMITER = vec4(0.6, 0.6, 0.6, 0.0);
+
+// declare external function
+vec4 toneMap(in vec4 inColour, in float lum);
+
+void main(void)
+{
+ vec4 accum = vec4(0.0, 0.0, 0.0, 0.0);
+
+ accum += texture2D(inRTT, uv + texelSize * vec2(-1.0, -1.0));
+ accum += texture2D(inRTT, uv + texelSize * vec2( 0.0, -1.0));
+ accum += texture2D(inRTT, uv + texelSize * vec2( 1.0, -1.0));
+ accum += texture2D(inRTT, uv + texelSize * vec2(-1.0, 0.0));
+ accum += texture2D(inRTT, uv + texelSize * vec2( 0.0, 0.0));
+ accum += texture2D(inRTT, uv + texelSize * vec2( 1.0, 0.0));
+ accum += texture2D(inRTT, uv + texelSize * vec2(-1.0, 1.0));
+ accum += texture2D(inRTT, uv + texelSize * vec2( 0.0, 1.0));
+ accum += texture2D(inRTT, uv + texelSize * vec2( 1.0, 1.0));
+
+ // take average of 9 samples
+ accum *= 0.1111111111111111;
+
+ // Reduce bright and clamp
+ accum = max(vec4(0.0, 0.0, 0.0, 1.0), accum - BRIGHT_LIMITER);
+
+ // Sample the luminence texture
+ vec4 lum = texture2D(inLum, vec2(0.5, 0.5));
+
+ // Tone map result
+ gl_FragColor = toneMap(accum, lum.r);
+
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/hdr_finalToneMapping.glsl b/school/informatik/verkerhssimulation/media/materials/programs/hdr_finalToneMapping.glsl
new file mode 100644
index 00000000..94c1b3e6
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/hdr_finalToneMapping.glsl
@@ -0,0 +1,28 @@
+uniform sampler2D inRTT;
+uniform sampler2D inBloom;
+uniform sampler2D inLum;
+
+varying vec2 uv;
+
+// declare external function
+vec4 toneMap(in vec4 inColour, in float lum);
+
+void main(void)
+{
+ // Get main scene colour
+ vec4 sceneCol = texture2D(inRTT, uv);
+
+ // Get luminence value
+ vec4 lum = texture2D(inLum, vec2(0.5, 0.5));
+
+ // tone map this
+ vec4 toneMappedSceneCol = toneMap(sceneCol, lum.r);
+
+ // Get bloom colour
+ vec4 bloom = texture2D(inBloom, uv);
+
+ // Add scene & bloom
+ gl_FragColor = vec4(toneMappedSceneCol.rgb + bloom.rgb, 1.0);
+
+}
+
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/hdr_tonemap_util.glsl b/school/informatik/verkerhssimulation/media/materials/programs/hdr_tonemap_util.glsl
new file mode 100644
index 00000000..14c58fb1
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/hdr_tonemap_util.glsl
@@ -0,0 +1,29 @@
+const float MIDDLE_GREY = 0.72;
+const float FUDGE = 0.001;
+const float L_WHITE = 1.5;
+
+/** Tone mapping function
+@note Only affects rgb, not a
+@param inColour The HDR colour
+@param lum The scene lumninence
+@returns Tone mapped colour
+*/
+vec4 toneMap(in vec4 inColour, in float lum)
+{
+ // From Reinhard et al
+ // "Photographic Tone Reproduction for Digital Images"
+
+ // Initial luminence scaling (equation 2)
+ inColour.rgb *= MIDDLE_GREY / (FUDGE + lum);
+
+ // Control white out (equation 4 nom)
+ inColour.rgb *= (1.0 + inColour.rgb / L_WHITE);
+
+ // Final mapping (equation 4 denom)
+ inColour.rgb /= (1.0 + inColour.rgb);
+
+ return inColour;
+
+}
+
+
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/instancing.cg b/school/informatik/verkerhssimulation/media/materials/programs/instancing.cg
new file mode 100644
index 00000000..241f41be
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/instancing.cg
@@ -0,0 +1,125 @@
+
+
+void instancing_vp(uniform float3x4 worldMatrix3x4Array[80], float4 position : POSITION,
+ float3 normal : NORMAL,
+ float2 uv : TEXCOORD0,
+ float index : TEXCOORD1,
+ uniform float4x4 viewProjectionMatrix,
+ uniform float4 lightPos,
+ uniform float4 ambient,
+ uniform float4 lightDiffuseColour,
+ out float4 oPosition : POSITION,
+ out float2 oUv : TEXCOORD0,
+ out float4 Color : COLOR )
+{
+ // transform by indexed matrix
+ float4 transformedPos = float4(mul(worldMatrix3x4Array[index], position).xyz, 1.0);
+
+ // view / projection
+ oPosition = mul(viewProjectionMatrix, transformedPos);
+ oUv = uv;
+
+ float3 norm = mul((float3x3)worldMatrix3x4Array[index], normal);
+
+ float3 lightDir = normalize(
+ lightPos.xyz - (transformedPos.xyz * lightPos.w));
+
+ Color = ambient + saturate(dot(lightDir, norm)) * lightDiffuseColour;
+
+
+}
+
+/*
+ Instancing shadow-caster pass
+*/
+void instancingCaster_vp(
+ float4 position : POSITION,
+ float3 normal : NORMAL,
+ float index : TEXCOORD1,
+
+ out float4 oPosition : POSITION,
+ out float4 colour : COLOR,
+ // Support up to 80 bones of float3x4
+ uniform float3x4 worldMatrix3x4Array[80],
+ uniform float4x4 viewProjectionMatrix,
+ uniform float4 ambient)
+{
+ // transform by indexed matrix
+ float4 transformedPos = float4(mul(worldMatrix3x4Array[index], position).xyz, 1.0);
+
+ // view / projection
+ oPosition = mul(viewProjectionMatrix, transformedPos);
+
+ colour = ambient;
+
+}
+void crowd_vp(
+ float4 position : POSITION,
+ float3 normal : NORMAL,
+ float2 uv : TEXCOORD0,
+ float4 blendIdx : BLENDINDICES,
+ float4 blendWgt : BLENDWEIGHT,
+ float index : TEXCOORD1,
+
+ out float4 oPosition : POSITION,
+ out float2 oUv : TEXCOORD0,
+ out float4 colour : COLOR,
+ // Support up to 20 bones of float3x4
+ // vs_2_0 only supports 256 params so more than this is not feasible
+ uniform float4x4 viewProjectionMatrix,
+ uniform float numBones,
+ uniform float3x4 worldMatrix3x4Array[80],
+ uniform float4 lightDiffuseColour,
+ uniform float4 ambient,
+ uniform float4 lightPos)
+{
+ // transform by indexed matrix
+ float4 blendPos = float4(0,0,0,0);
+ int i;
+ for (i = 0; i < 4; ++i)
+ {
+ blendPos += float4(mul(worldMatrix3x4Array[index*numBones+blendIdx[i]], position).xyz, 1.0) * blendWgt[i];
+ }
+ // view / projection
+ oPosition = mul(viewProjectionMatrix, blendPos);
+ oUv = uv;
+ float3 norm = float3(0,0,0);
+ for (i = 0; i < 4; ++i)
+ {
+ norm += mul((float3x3)worldMatrix3x4Array[index*numBones+blendIdx[i]], normal)* blendWgt[i];
+ }
+ float3 lightDir = normalize(
+ lightPos.xyz - (blendPos.xyz * lightPos.w));
+
+ colour = ambient + saturate(dot(lightDir, norm)) * lightDiffuseColour;
+
+
+}
+
+/*
+ Single-weight-per-vertex hardware skinning, shadow-caster pass
+*/
+void crowdCaster_vp(
+ float4 position : POSITION,
+ float3 normal : NORMAL,
+ float blendIdx : BLENDINDICES,
+ float index : TEXCOORD1,
+
+ out float4 oPosition : POSITION,
+ out float4 colour : COLOR,
+ // Support up to 24 bones of float3x4
+ // vs_1_1 only supports 96 params so more than this is not feasible
+ uniform float3x4 worldMatrix3x4Array[80],
+ uniform float4x4 viewProjectionMatrix,
+ uniform float numBones,
+ uniform float4 ambient)
+{
+ // transform by indexed matrix
+ float4 blendPos = float4(mul(worldMatrix3x4Array[index*numBones+blendIdx], position).xyz, 1.0);
+
+ // view / projection
+ oPosition = mul(viewProjectionMatrix, blendPos);
+
+ colour = ambient;
+
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/instancingVp.glsl b/school/informatik/verkerhssimulation/media/materials/programs/instancingVp.glsl
new file mode 100644
index 00000000..06a65665
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/instancingVp.glsl
@@ -0,0 +1,39 @@
+uniform vec4 worldMatrix3x4Array[240];
+uniform mat4 viewProjectionMatrix;
+uniform vec4 lightPos;
+uniform vec4 ambient;
+uniform vec4 lightDiffuseColour;
+
+void main()
+{
+
+ // transform by indexed matrix
+ // perform matrix multiplication manually since no 3x4 matrices
+ vec3 transformedPos;
+ vec3 transformedNorm;
+ int instanceOffset = int(gl_MultiTexCoord1.x) * 3;
+ for (int row = 0; row < 3; ++row)
+ {
+ vec4 matrixRow = worldMatrix3x4Array[instanceOffset + row];
+ transformedPos[row] = dot(matrixRow, gl_Vertex);
+#if SHADOW_CASTER
+#else
+ transformedNorm[row] = dot(matrixRow.xyz, gl_Normal);
+#endif
+
+ }
+
+ // view / projection
+ gl_Position = viewProjectionMatrix * vec4(transformedPos,1);
+ gl_TexCoord[0] = gl_MultiTexCoord0;
+ gl_FrontSecondaryColor = vec4(0);
+
+#if SHADOW_CASTER
+ gl_FrontColor = ambient;
+#else
+ vec3 lightDir = normalize(
+ lightPos.xyz - (transformedPos.xyz * lightPos.w));
+ gl_FrontColor = ambient + clamp(dot(lightDir, transformedNorm),0.0,1.0) * lightDiffuseColour;
+#endif
+
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/oceanGLSL.frag b/school/informatik/verkerhssimulation/media/materials/programs/oceanGLSL.frag
new file mode 100644
index 00000000..dd737482
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/oceanGLSL.frag
@@ -0,0 +1,45 @@
+// oceanGLSL.frag
+// fragment program for Ocean water simulation
+// 05 Aug 2005
+// adapted for Ogre by nfz
+// converted from HLSL to GLSL
+// original shader source from Render Monkey 1.6 Reflections Refractions.rfx
+
+// 06 Aug 2005: moved uvw calculation from fragment program into vertex program
+
+uniform float fadeBias;
+uniform float fadeExp;
+uniform vec4 waterColor;
+uniform sampler3D Noise;
+uniform samplerCube skyBox;
+
+varying vec3 uvw;
+varying vec3 normal;
+varying vec3 vVec;
+
+void main(void)
+{
+ vec3 noisy = texture3D(Noise, uvw).xyz;
+
+ // convert to signed noise
+ vec3 bump = 2.0 * noisy - 1.0;
+ bump.xz *= 0.15;
+ // Make sure the normal always points upwards
+ // note that Ogres y axis is vertical (RM Z axis is vertical)
+ bump.y = 0.8 * abs(bump.y) + 0.2;
+ // Offset the surface normal with the bump
+ bump = normalize(normal + bump);
+
+ // Find the reflection vector
+ vec3 normView = normalize(vVec);
+ vec3 reflVec = reflect(normView, bump);
+ // Ogre has z flipped for cubemaps
+ reflVec.z = -reflVec.z;
+ vec4 refl = textureCube(skyBox, reflVec);
+
+ // set up for fresnel calc
+ float lrp = 1.0 - dot(-normView, bump);
+
+ // Interpolate between the water color and reflection for fresnel effect
+ gl_FragColor = mix(waterColor, refl, clamp(fadeBias + pow(lrp, fadeExp), 0.0, 1.0) );
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/oceanGLSL.vert b/school/informatik/verkerhssimulation/media/materials/programs/oceanGLSL.vert
new file mode 100644
index 00000000..f0f59497
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/oceanGLSL.vert
@@ -0,0 +1,32 @@
+// oceanGLSL.vert
+// vertex program for Ocean water simulation
+// 05 Aug 2005
+// adapted for Ogre by nfz
+// converted from HLSL to GLSL
+// original shader source from Render Monkey 1.6 Reflections Refractions.rfx
+
+// 06 Aug 2005: moved uvw calculation from fragment program into vertex program
+
+uniform vec3 scale;
+uniform vec3 eyePosition;
+uniform vec2 waveSpeed;
+uniform float noiseSpeed;
+uniform float time_0_X;
+
+varying vec3 uvw;
+varying vec3 normal;
+varying vec3 vVec;
+
+void main(void)
+{
+ gl_Position = ftransform();
+
+ // the view vector needs to be in vertex space
+ vVec = gl_Vertex.xyz - eyePosition;
+ normal = gl_Normal;
+ // uvw is the calculated uvw coordinates based on vertex position
+ uvw = gl_Vertex.xyz * scale.xyz;
+ uvw.xz += waveSpeed * time_0_X;
+ uvw.y += uvw.z + noiseSpeed * time_0_X;
+
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/oceanHLSL_Cg.frag b/school/informatik/verkerhssimulation/media/materials/programs/oceanHLSL_Cg.frag
new file mode 100644
index 00000000..4994aec9
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/oceanHLSL_Cg.frag
@@ -0,0 +1,44 @@
+// oceanHLSL_Cg.frag
+// fragment program for Ocean water simulation
+// 04 Aug 2005
+// adapted for Ogre by nfz
+// original shader source from Render Monkey 1.6 Reflections Refractions.rfx
+// can be used in both Cg and HLSL compilers
+
+// 06 Aug 2005: moved uvw calculation from fragment program into vertex program
+
+float4 main(float3 uvw: TEXCOORD0, float3 normal: TEXCOORD1, float3 vVec: TEXCOORD2,
+ uniform float fadeBias,
+ uniform float fadeExp,
+ uniform float4 waterColor,
+ uniform sampler Noise,
+ uniform sampler skyBox
+
+) : COLOR
+{
+
+ float3 noisy = tex3D(Noise, uvw).xyz;
+
+ // convert to Signed noise
+ float3 bump = 2 * noisy - 1;
+ bump.xz *= 0.15;
+ // Make sure the normal always points upwards
+ // note that Ogres y axis is vertical (RM Z axis is vertical)
+ bump.y = 0.8 * abs(bump.y) + 0.2;
+ // Offset the surface normal with the bump
+ bump = normalize(normal + bump);
+
+ // Find the reflection vector
+ float3 normView = normalize(vVec);
+ float3 reflVec = reflect(normView, bump);
+ // Ogre has z flipped for cubemaps
+ reflVec.z = -reflVec.z;
+ float4 refl = texCUBE(skyBox, reflVec);
+
+ // set up for fresnel calc
+ float lrp = 1 - dot(-normView, bump);
+
+ // Interpolate between the water color and reflection for fresnel effect
+ return lerp(waterColor, refl, saturate(fadeBias + pow(lrp, fadeExp)));
+
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/oceanHLSL_Cg.vert b/school/informatik/verkerhssimulation/media/materials/programs/oceanHLSL_Cg.vert
new file mode 100644
index 00000000..a3f517ea
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/oceanHLSL_Cg.vert
@@ -0,0 +1,41 @@
+// oceanHLSL_Cg.vert
+// vertex program for Ocean water simulation
+// 04 Aug 2005
+// adapted for Ogre by nfz
+// original shader source from Render Monkey 1.6 Reflections Refractions.rfx
+// can be used in both Cg and HLSL compilers
+
+// 06 Aug 2005: moved uvw calculation from fragment program into vertex program
+
+struct VS_OUTPUT {
+ float4 Pos: POSITION;
+ float3 uvw: TEXCOORD0;
+ float3 normal: TEXCOORD1;
+ float3 vVec: TEXCOORD2;
+};
+
+VS_OUTPUT main(float4 Pos: POSITION, float3 normal: NORMAL,
+ uniform float4x4 worldViewProj_matrix,
+ uniform float3 scale,
+ uniform float2 waveSpeed,
+ uniform float noiseSpeed,
+ uniform float time_0_X,
+ uniform float3 eyePosition
+
+)
+{
+ VS_OUTPUT Out;
+
+ Out.Pos = mul(worldViewProj_matrix, Pos);
+
+ // uvw is the calculated uvw coordinates based on vertex position
+ Out.uvw = Pos.xyz * scale;
+ Out.uvw.xz += waveSpeed * time_0_X;
+ Out.uvw.y += Out.uvw.z + noiseSpeed * time_0_X;
+
+ // the view vector needs to be in vertex space
+ Out.vVec = Pos.xyz - eyePosition;
+ Out.normal = normal;
+
+ return Out;
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/skinningTwoWeightsShadowCasterVp.glsl b/school/informatik/verkerhssimulation/media/materials/programs/skinningTwoWeightsShadowCasterVp.glsl
new file mode 100644
index 00000000..0ae96e97
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/skinningTwoWeightsShadowCasterVp.glsl
@@ -0,0 +1,40 @@
+// Example GLSL program for skinning with two bone weights per vertex
+
+attribute vec4 blendIndices;
+attribute vec4 blendWeights;
+
+// 3x4 matrix, passed as vec4's for compatibility with GL 2.0
+// GL 2.0 supports 3x4 matrices
+// Support 24 bones ie 24*3, but use 72 since our parser can pick that out for sizing
+uniform vec4 worldMatrix3x4Array[72];
+uniform mat4 viewProjectionMatrix;
+uniform vec4 ambient;
+
+void main()
+{
+ vec3 blendPos = vec3(0,0,0);
+
+ for (int bone = 0; bone < 2; ++bone)
+ {
+ // perform matrix multiplication manually since no 3x4 matrices
+ // ATI GLSL compiler can't handle indexing an array within an array so calculate the inner index first
+ int idx = int(blendIndices[bone]) * 3;
+ // ATI GLSL compiler can't handle unrolling the loop so do it manually
+ // ATI GLSL has better performance when mat4 is used rather than using individual dot product
+ // There is a bug in ATI mat4 constructor (Cat 7.2) when indexed uniform array elements are used as vec4 parameter so manually assign
+ mat4 worldMatrix;
+ worldMatrix[0] = worldMatrix3x4Array[idx];
+ worldMatrix[1] = worldMatrix3x4Array[idx + 1];
+ worldMatrix[2] = worldMatrix3x4Array[idx + 2];
+ worldMatrix[3] = vec4(0);
+ // now weight this into final
+ blendPos += (gl_Vertex * worldMatrix).xyz * blendWeights[bone];
+ }
+
+ // apply view / projection to position
+ gl_Position = viewProjectionMatrix * vec4(blendPos, 1);
+
+ gl_FrontSecondaryColor = vec4(0,0,0,0);
+ gl_FrontColor = ambient;
+ gl_TexCoord[0] = gl_MultiTexCoord0;
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/skinningTwoWeightsVp.glsl b/school/informatik/verkerhssimulation/media/materials/programs/skinningTwoWeightsVp.glsl
new file mode 100644
index 00000000..2c9ce818
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/skinningTwoWeightsVp.glsl
@@ -0,0 +1,57 @@
+// Example GLSL program for skinning with two bone weights per vertex
+
+attribute vec4 blendIndices;
+attribute vec4 blendWeights;
+
+// 3x4 matrix, passed as vec4's for compatibility with GL 2.0
+// GL 2.0 supports 3x4 matrices
+// Support 24 bones ie 24*3, but use 72 since our parser can pick that out for sizing
+uniform vec4 worldMatrix3x4Array[72];
+uniform mat4 viewProjectionMatrix;
+uniform vec4 lightPos[2];
+uniform vec4 lightDiffuseColour[2];
+
+void main()
+{
+ vec3 blendPos = vec3(0,0,0);
+ vec3 blendNorm = vec3(0,0,0);
+
+ for (int bone = 0; bone < 2; ++bone)
+ {
+ // perform matrix multiplication manually since no 3x4 matrices
+ // ATI GLSL compiler can't handle indexing an array within an array so calculate the inner index first
+ int idx = int(blendIndices[bone]) * 3;
+ // ATI GLSL compiler can't handle unrolling the loop so do it manually
+ // ATI GLSL has better performance when mat4 is used rather than using individual dot product
+ // There is a bug in ATI mat4 constructor (Cat 7.2) when indexed uniform array elements are used as vec4 parameter so manually assign
+ mat4 worldMatrix;
+ worldMatrix[0] = worldMatrix3x4Array[idx];
+ worldMatrix[1] = worldMatrix3x4Array[idx + 1];
+ worldMatrix[2] = worldMatrix3x4Array[idx + 2];
+ worldMatrix[3] = vec4(0);
+ // now weight this into final
+ float weight = blendWeights[bone];
+ blendPos += (gl_Vertex * worldMatrix).xyz * weight;
+
+ mat3 worldRotMatrix = mat3(worldMatrix[0].xyz, worldMatrix[1].xyz, worldMatrix[2].xyz);
+ blendNorm += (gl_Normal * worldRotMatrix) * weight;
+
+ }
+
+ // apply view / projection to position
+ gl_Position = viewProjectionMatrix * vec4(blendPos, 1);
+
+ // simple vertex lighting model
+ vec3 lightDir0 = normalize(
+ lightPos[0].xyz - (blendPos.xyz * lightPos[0].w));
+ vec3 lightDir1 = normalize(
+ lightPos[1].xyz - (blendPos.xyz * lightPos[1].w));
+
+ gl_FrontSecondaryColor = vec4(0);
+ gl_FrontColor = vec4(0.5, 0.5, 0.5, 1.0)
+ + clamp(dot(lightDir0, blendNorm), 0.0, 1.0) * lightDiffuseColour[0]
+ + clamp(dot(lightDir1, blendNorm), 0.0, 1.0) * lightDiffuseColour[1];
+
+ gl_TexCoord[0] = gl_MultiTexCoord0;
+
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/varianceshadowcasterfp.cg b/school/informatik/verkerhssimulation/media/materials/programs/varianceshadowcasterfp.cg
new file mode 100644
index 00000000..f39e8a05
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/varianceshadowcasterfp.cg
@@ -0,0 +1,65 @@
+/////////////////////////////////////////////////////////////////////////////////
+//
+// shadowcasterfp.cg
+//
+// Hamilton Chong
+// (c) 2006
+//
+// This is an example fragment shader for shadow caster objects.
+//
+/////////////////////////////////////////////////////////////////////////////////
+
+
+// Define outputs from vertex shader.
+struct VertexOut
+{
+ float4 position : POSITION; // can't rely on access to this
+ float4 pos : TEXCOORD0; // position of fragment (in homogeneous coordinates)
+ float4 normal : TEXCOORD1; // un-normalized normal in object space
+ float4 modelPos : TEXCOORD2; // coordinates of model in object space at this point
+};
+
+struct FragmentOut
+{
+ float4 color : COLOR0;
+};
+
+FragmentOut main( VertexOut In, // fragment to process
+ uniform float uDepthOffset, // offset amount (constant in eye space)
+ uniform float4x4 uProjection // projection matrix
+ )
+{
+ FragmentOut Out;
+
+ // compute the "normalized device coordinates" (no viewport applied yet)
+ float4 postproj = In.pos / In.pos.w;
+
+ // get the normalized normal of the geometry seen at this point
+ float4 normal = normalize(In.normal);
+
+
+ // -- Computing Depth Bias Quantities -----------------------------
+
+ // We now compute the change in z that would signify a push in the z direction
+ // by 1 unit in eye space. Note that eye space z is related in a nonlinear way to
+ // screen space z, so this is not just a constant.
+ // ddepth below is how much screen space z at this point would change for that push.
+ // NOTE: computation of ddepth likely differs from OpenGL's glPolygonOffset "unit"
+ // computation, which is allowed to be vendor specific.
+ float4 dpwdz = mul(uProjection, float4(0.0, 0.0, 1.0, 0.0));
+ float4 dpdz = (dpwdz - (postproj * dpwdz.w)) / In.pos.w;
+ float ddepth = abs(dpdz.z);
+
+ // -- End depth bias helper section --------------------------------
+
+ // We now compute the depth of the fragment. This is the actual depth value plus
+ // our depth bias. The depth bias depends on how uncertain we are about the z value
+ // plus some constant push in the z direction. The exact coefficients to use are
+ // up to you, but at least it should be somewhat intuitive now what the tradeoffs are.
+ float depthval = postproj.z /* + (0.5 * dzlen)*/ + (uDepthOffset * ddepth);
+ depthval = (0.5 * depthval) + 0.5; // put into [0,1] range instead of [-1,1]
+
+
+ Out.color = float4(depthval, depthval * depthval, depthval, 0.0);
+ return Out;
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/varianceshadowcastervp.cg b/school/informatik/verkerhssimulation/media/materials/programs/varianceshadowcastervp.cg
new file mode 100644
index 00000000..60d6de3a
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/varianceshadowcastervp.cg
@@ -0,0 +1,44 @@
+/////////////////////////////////////////////////////////////////////////////////
+//
+// shadowcastervp.cg
+//
+// Hamilton Chong
+// (c) 2006
+//
+// This is an example vertex shader for shadow caster objects.
+//
+/////////////////////////////////////////////////////////////////////////////////
+
+
+// Define inputs from application.
+struct VertexIn
+{
+ float4 position : POSITION; // vertex position in object space
+ float4 normal : NORMAL; // vertex normal in object space
+};
+
+// Define outputs from vertex shader.
+struct VertexOut
+{
+ float4 position : POSITION; // post projection position coordinates
+ float4 pos : TEXCOORD0; // ditto. Not all hardware allows access values bound to POSITION in fp.
+ float4 normal : TEXCOORD1; // normal in object space (to be interpolated)
+ float4 modelPos : TEXCOORD2; // position in object space (to be interpolated)
+};
+
+VertexOut main( VertexIn In, // vertex to process
+ uniform float4x4 uModelViewProjection // model-view-projection matrix
+ )
+{
+ VertexOut Out; // output data
+
+ // Transform vertex position into post projective (homogenous screen) space.
+ Out.position = mul(uModelViewProjection, In.position);
+ Out.pos = mul(uModelViewProjection, In.position);
+
+ // copy over data to interpolate using perspective correct interpolation
+ Out.normal = float4(In.normal.x, In.normal.y, In.normal.z, 0.0);
+ Out.modelPos = In.position;
+
+ return Out;
+}
\ No newline at end of file
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/varianceshadowreceiverfp.cg b/school/informatik/verkerhssimulation/media/materials/programs/varianceshadowreceiverfp.cg
new file mode 100644
index 00000000..28a9aacf
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/varianceshadowreceiverfp.cg
@@ -0,0 +1,107 @@
+/////////////////////////////////////////////////////////////////////////////////
+//
+// shadowreceiverfp.cg
+//
+// Hamilton Chong
+// (c) 2006
+//
+// This is an example fragment shader for shadow receiver objects.
+//
+/////////////////////////////////////////////////////////////////////////////////
+
+
+sampler2D ShadowMap : TEXUNIT0;
+
+// Define outputs from vertex shader.
+struct Vertex
+{
+ float4 position : POSITION; // fragment position in post projective space
+ float4 shadowCoord : TEXCOORD0; // fragment position in shadow map coordinates
+ float diffuse : TEXCOORD1; // diffuse shading value
+};
+
+struct Fragment
+{
+ float4 color : COLOR0;
+};
+
+Fragment main(Vertex In,
+ uniform float uSTexWidth,
+ uniform float uSTexHeight)
+{
+ Fragment Out;
+
+ // compute the shadow coordinates for texture lookup
+ // NOTE: texture_viewproj_matrix maps z into [0,1] range, not [-1,1], so
+ // have to make sure shadow caster stores depth values with same convention.
+ float4 scoord = In.shadowCoord / In.shadowCoord.w;
+
+
+ // -- Bilinear Filtering of Sample --------------------------------------------
+
+ // One could use scoord.xy to look up the shadow map for depth testing, but
+ // we'll be implementing a simple "percentage closest filtering" algorithm instead.
+ // This mimics the behavior of turning on bilinear filtering on NVIDIA hardware
+ // when also performing shadow comparisons. This causes bilinear filtering of
+ // depth tests. Note that this is NOT the same as bilinear filtering the depth
+ // values and then doing the depth comparison. The two operations are not
+ // commutative. PCF is explicitly about filtering the test values since
+ // testing filtered z values is often meaningless.
+
+ // Real percentage closest filtering should sample from the entire footprint
+ // on the shadow map, not just seek the closest four sample points. Such
+ // an improvement is for future work.
+
+
+ // NOTE: Assuming OpenGL convention for texture lookups with integers in centers.
+ // DX convention is to have integers mark sample corners
+ float2 tcoord;
+ tcoord.x = (scoord.x * uSTexWidth) - 0.5;
+ tcoord.y = (scoord.y * uSTexHeight) - 0.5;
+ float x0 = floor(tcoord.x);
+ float x1 = ceil(tcoord.x);
+ float fracx = frac(tcoord.x);
+ float y0 = floor(tcoord.y);
+ float y1 = ceil(tcoord.y);
+ float fracy = frac(tcoord.y);
+
+ // sample coordinates in [0,1]^2 domain
+ float2 t00, t01, t10, t11;
+ float invWidth = 1.0 / uSTexWidth;
+ float invHeight = 1.0 / uSTexHeight;
+ t00 = float2((x0+0.5) * invWidth, (y0+0.5) * invHeight);
+ t10 = float2((x1+0.5) * invWidth, (y0+0.5) * invHeight);
+ t01 = float2((x0+0.5) * invWidth, (y1+0.5) * invHeight);
+ t11 = float2((x1+0.5) * invWidth, (y1+0.5) * invHeight);
+
+ // grab the samples
+ float2 z00 = tex2D(ShadowMap, t00).xy;
+ float2 z01 = tex2D(ShadowMap, t01).xy;
+ float2 z10 = tex2D(ShadowMap, t10).xy;
+ float2 z11 = tex2D(ShadowMap, t11).xy;
+
+ // bilinear filter the sample data
+ float2 d0 = ((1.0 - fracx) * z00) + (fracx * z10);
+ float2 d1 = ((1.0 - fracx) * z01) + (fracx * z11);
+ float2 datum = ((1.0 - fracy) * d0) + (fracy * d1);
+
+ // -- Variance Shadow Mapping ---------------------------------------------------
+
+ float zVariance = datum.y - (datum.x * datum.x);
+ float zDeviation = scoord.z - datum.x;
+ zDeviation = (zDeviation < 0.0) ? 0.0 : zDeviation;
+ float visibility = zVariance / (zVariance + (zDeviation * zDeviation));
+ float ztest = (scoord.z < datum.x) ? 1.0:0.0; // filtering depth ok, because used only for small variance
+ visibility = (zVariance > 0.0) ? visibility : ztest; // if variance too small, we get garbage
+ //0.0000001
+
+ // determine that all geometry within pixel border of shadow map (and outside) is lit
+ float filterBorder = max(invWidth, invHeight);
+ visibility = (all(abs(scoord.xy-0.5)<=0.5-filterBorder)) ? visibility : 1.0;
+
+ // ------------------------------------------------------------------------------
+
+ visibility *= In.diffuse;
+ Out.color = float4(visibility, visibility, visibility, 0.0);
+ return Out;
+}
\ No newline at end of file
diff --git a/school/informatik/verkerhssimulation/media/materials/programs/varianceshadowreceivervp.cg b/school/informatik/verkerhssimulation/media/materials/programs/varianceshadowreceivervp.cg
new file mode 100644
index 00000000..ff950405
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/programs/varianceshadowreceivervp.cg
@@ -0,0 +1,47 @@
+/////////////////////////////////////////////////////////////////////////////////
+//
+// shadowreceivervp.cg
+//
+// Hamilton Chong
+// (c) 2006
+//
+// This is an example vertex shader for shadow receiver objects.
+//
+/////////////////////////////////////////////////////////////////////////////////
+
+// Define inputs from application.
+struct VertexIn
+{
+ float4 position : POSITION; // vertex position in object space
+ float4 normal : NORMAL; // vertex normal in object space
+};
+
+// Define outputs from vertex shader.
+struct Vertex
+{
+ float4 position : POSITION; // vertex position in post projective space
+ float4 shadowCoord : TEXCOORD0; // vertex position in shadow map coordinates
+ float diffuse : TEXCOORD1; // diffuse shading value
+};
+
+Vertex main(VertexIn In,
+ uniform float4x4 uModelViewProjection, // model-view-projection matrix
+ uniform float4 uLightPosition, // light position in object space
+ uniform float4x4 uModel, // model matrix
+ uniform float4x4 uTextureViewProjection // shadow map's view projection matrix
+ )
+{
+ Vertex Out;
+
+ // compute diffuse shading
+ float3 lightDirection = normalize(uLightPosition.xyz - In.position.xyz);
+ Out.diffuse = dot(In.normal.xyz, lightDirection);
+
+ // compute shadow map lookup coordinates
+ Out.shadowCoord = mul(uTextureViewProjection, mul(uModel, In.position));
+
+ // compute vertex's homogenous screen-space coordinates
+ Out.position = mul(uModelViewProjection, In.position);
+
+ return Out;
+}
\ No newline at end of file
diff --git a/school/informatik/verkerhssimulation/media/materials/scripts/BlackAndWhite.material b/school/informatik/verkerhssimulation/media/materials/scripts/BlackAndWhite.material
new file mode 100644
index 00000000..a99670cf
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/scripts/BlackAndWhite.material
@@ -0,0 +1,34 @@
+fragment_program Ogre/Compositor/B&W_FP cg
+{
+ source GrayScale.cg
+ entry_point GrayScale_ps
+ profiles ps_2_0 arbfp1
+}
+
+material Ogre/Compositor/BlackAndWhite
+{
+ technique
+ {
+
+ pass
+ {
+ depth_check off
+
+ vertex_program_ref Ogre/Compositor/StdQuad_Cg_vp
+ {
+ }
+
+ fragment_program_ref Ogre/Compositor/B&W_FP
+ {
+ }
+
+ texture_unit
+ {
+ texture RT
+ tex_coord_set 0
+ tex_address_mode clamp
+ filtering linear linear linear
+ }
+ }
+ }
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/scripts/Bloom.material b/school/informatik/verkerhssimulation/media/materials/scripts/Bloom.material
new file mode 100644
index 00000000..02da77c0
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/scripts/Bloom.material
@@ -0,0 +1,178 @@
+//DirectX 9.0 HLSL Vertex Shader vs_1_1
+vertex_program Blur0_vs11 hlsl
+{
+ source Blur0_vs11.hlsl
+ target vs_1_1
+ entry_point main
+}
+
+//DirectX 9.0 HLSL Pixel Shader ps_2_0
+fragment_program Blur0_ps20 hlsl
+{
+ source Blur0_ps20.hlsl
+ target ps_2_0
+ entry_point main
+}
+
+//DirectX 9.0 HLSL Vertex Shader vs_1_1
+vertex_program Blur1_vs11 hlsl
+{
+ source Blur1_vs11.hlsl
+ target vs_1_1
+ entry_point main
+}
+
+//DirectX 9.0 HLSL Pixel Shader ps_2_0
+fragment_program Blur1_ps20 hlsl
+{
+ source Blur1_ps20.hlsl
+ target ps_2_0
+ entry_point main
+}
+
+vertex_program Blur0_vs_glsl glsl
+{
+ source Blur0_vs.glsl
+}
+vertex_program Blur1_vs_glsl glsl
+{
+ source Blur1_vs.glsl
+}
+fragment_program Blur_ps_glsl glsl
+{
+ source Blur_ps.glsl
+ default_params
+ {
+ param_named tex0 int 0
+ }
+}
+
+//Effect: Bloom
+material Ogre/Compositor/Blur0
+{
+ technique
+ {
+ //Rendering Pass: Blur0 (pass index: #1 )
+ pass
+ {
+ //State: D3DRS_CULLMODE, Value : D3DCULL_NONE
+ cull_hardware none
+ cull_software none
+ depth_check off
+
+ fragment_program_ref Blur0_ps20
+ {
+ }
+ vertex_program_ref Blur0_vs11
+ {
+ }
+ texture_unit RT
+ {
+ tex_coord_set 0
+ tex_address_mode clamp
+ filtering linear linear linear
+ }
+ }
+ }
+ technique
+ {
+ //Rendering Pass: Blur0 (pass index: #1 )
+ pass
+ {
+ cull_hardware none
+ cull_software none
+ depth_check off
+
+ fragment_program_ref Blur_ps_glsl
+ {
+ }
+ vertex_program_ref Blur0_vs_glsl
+ {
+ }
+ texture_unit RT
+ {
+ tex_coord_set 0
+ tex_address_mode clamp
+ filtering linear linear linear
+ }
+ }
+ }
+}
+
+material Ogre/Compositor/Blur1
+{
+ technique
+ {
+
+ //Rendering Pass: Blur1 (pass index: #2 )
+ pass
+ {
+ cull_hardware none
+ cull_software none
+ depth_check off
+
+ fragment_program_ref Blur1_ps20
+ {
+ }
+ vertex_program_ref Blur1_vs11
+ {
+ }
+ texture_unit
+ {
+ tex_coord_set 0
+ tex_address_mode clamp
+ filtering linear linear linear
+ }
+ }
+ }
+ technique
+ {
+
+ //Rendering Pass: Blur1 (pass index: #2 )
+ pass
+ {
+ cull_hardware none
+ cull_software none
+ depth_func always_pass
+
+ fragment_program_ref Blur_ps_glsl
+ {
+ }
+ vertex_program_ref Blur1_vs_glsl
+ {
+ }
+ texture_unit
+ {
+ tex_coord_set 0
+ tex_address_mode clamp
+ filtering linear linear linear
+ }
+ }
+ }
+}
+
+/// Overlay quad
+material Ogre/Compositor/BloomBlend
+{
+ technique
+ {
+ pass
+ {
+ lighting on
+ diffuse 0.0 0.0 0.0 0.6
+ specular 0.0 0.0 0.0 0.0
+ ambient 0.0 0.0 0.0
+ emissive 1.0 1.0 1.0
+ cull_hardware none
+ depth_check off
+ scene_blend alpha_blend
+
+ texture_unit
+ {
+ tex_coord_set 0
+ tex_address_mode clamp
+ filtering linear linear linear
+ }
+ }
+ }
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/scripts/DOF.material b/school/informatik/verkerhssimulation/media/materials/scripts/DOF.material
new file mode 100644
index 00000000..8d62737d
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/scripts/DOF.material
@@ -0,0 +1,94 @@
+fragment_program DOF_Blur_ps cg
+{
+ source DOF_ps.cg
+ entry_point blur
+ profiles ps_2_0 arbfp1
+}
+
+fragment_program DOF_Blend_ps cg
+{
+ source DOF_ps.cg
+ entry_point blend
+ profiles ps_2_0 arbfp1
+}
+
+//Effect: Depth of Field
+material Ogre/Compositor/DOF_Blur0
+{
+ technique
+ {
+ //Rendering Pass: Blur0 (pass index: #1 )
+ pass
+ {
+ //State: D3DRS_CULLMODE, Value : D3DCULL_NONE
+ cull_hardware none
+ cull_software none
+ depth_check off
+
+ fragment_program_ref DOF_Blur_ps
+ {
+ param_named sampleDistance float 0.1
+ }
+ vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp
+ {
+ }
+ texture_unit
+ {
+ // texture will get added at runtime
+ tex_coord_set 0
+ tex_address_mode wrap
+ filtering trilinear
+ }
+ }
+ }
+}
+
+// cheat here by copying from DOF_Blur0
+material Ogre/Compositor/DOF_Blur1 : Ogre/Compositor/DOF_Blur0
+{
+ technique
+ {
+ //Rendering Pass: Blur0 (pass index: #1 )
+ pass
+ {
+ // use the same pixel shader as DOF_Blur0
+ fragment_program_ref
+ {
+ // override value from copied DOF_Blur0 material
+ param_named sampleDistance float 0.1
+ }
+ }
+ }
+}
+
+material Ogre/Compositor/DOF_Blend
+{
+ technique
+ {
+ pass
+ {
+ fragment_program_ref DOF_Blend_ps
+ {
+ param_named focus float 0.66
+ param_named range float 1.0
+ }
+ vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp
+ {
+ }
+ texture_unit Blur0
+ {
+ // texture will get added at runtime
+ tex_coord_set 0
+ tex_address_mode clamp
+ filtering trilinear
+ }
+ texture_unit Blur1
+ {
+ // texture will get added at runtime
+ tex_coord_set 0
+ tex_address_mode clamp
+ filtering trilinear
+ }
+ }
+ }
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/scripts/DepthShadowmap.material b/school/informatik/verkerhssimulation/media/materials/scripts/DepthShadowmap.material
new file mode 100644
index 00000000..024419f6
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/scripts/DepthShadowmap.material
@@ -0,0 +1,595 @@
+
+// ***-- Begin HLSL section --**
+
+vertex_program Ogre/DepthShadowmap/CasterVP_HLSL hlsl
+{
+ source DepthShadowmap.hlsl
+ entry_point casterVP
+ target vs_2_0
+
+ preprocessor_defines LINEAR_RANGE=0
+
+ default_params
+ {
+ param_named_auto worldViewProj worldviewproj_matrix
+ param_named_auto texelOffsets texel_offsets
+ //param_named_auto depthRange scene_depth_range
+ }
+}
+
+
+fragment_program Ogre/DepthShadowmap/CasterFP_HLSL hlsl
+{
+ source DepthShadowmap.hlsl
+ entry_point casterFP
+ target ps_2_0
+
+ preprocessor_defines LINEAR_RANGE=0
+
+ default_params
+ {
+ }
+}
+
+
+vertex_program Ogre/DepthShadowmap/ReceiverVP_HLSL hlsl
+{
+ source DepthShadowmap.hlsl
+ entry_point receiverVP
+ target vs_2_0
+
+ preprocessor_defines LINEAR_RANGE=0
+
+ default_params
+ {
+ param_named_auto world world_matrix
+ param_named_auto worldIT inverse_transpose_world_matrix
+ param_named_auto worldViewProj worldviewproj_matrix
+ param_named_auto texViewProj texture_viewproj_matrix
+ param_named_auto lightPosition light_position 0
+ param_named_auto lightColour light_diffuse_colour 0
+ //param_named_auto shadowDepthRange shadow_scene_depth_range 0
+ }
+}
+
+
+fragment_program Ogre/DepthShadowmap/ReceiverFP_HLSL hlsl
+{
+ source DepthShadowmap.hlsl
+ entry_point receiverFP
+ target ps_2_0
+
+ preprocessor_defines LINEAR_RANGE=0,FUZZY_TEST=0,PCF=0
+
+ default_params
+ {
+ param_named inverseShadowmapSize float 0.0009765625
+ param_named fixedDepthBias float 0.0005
+ param_named gradientClamp float 0.0098
+ param_named gradientScaleBias float 0
+ //param_named shadowFuzzyWidth float 1
+ }
+}
+
+fragment_program Ogre/DepthShadowmap/ReceiverFPPCF_HLSL hlsl
+{
+ source DepthShadowmap.hlsl
+ entry_point receiverFP
+ target ps_2_0
+
+ preprocessor_defines LINEAR_RANGE=0,FUZZY_TEST=0,PCF=1
+
+ default_params
+ {
+ param_named inverseShadowmapSize float 0.0009765625
+ param_named gradientClamp float 0.0098
+ param_named gradientScaleBias float 0
+ //param_named shadowFuzzyWidth float 1
+ }
+}
+vertex_program Ogre/DepthShadowmap/NormalMapReceiverVP_HLSL hlsl
+{
+ source DepthShadowmap.hlsl
+ entry_point normalMapShadowReceiverVp
+ target vs_2_0
+
+ preprocessor_defines LINEAR_RANGE=0
+
+ default_params
+ {
+ param_named_auto world world_matrix
+ param_named_auto worldViewProj worldviewproj_matrix
+ param_named_auto texViewProj texture_viewproj_matrix
+ param_named_auto lightPosition light_position_object_space 0
+ //param_named_auto shadowDepthRange shadow_scene_depth_range 0
+ }
+}
+
+fragment_program Ogre/DepthShadowmap/NormalMapReceiverFP_HLSL hlsl
+{
+ source DepthShadowmap.hlsl
+ entry_point normalMapShadowReceiverFp
+ target ps_2_0
+
+ preprocessor_defines LINEAR_RANGE=0,FUZZY_TEST=0,PCF=0
+
+ default_params
+ {
+ param_named_auto lightColour light_diffuse_colour 0
+ param_named inverseShadowmapSize float 0.0009765625
+ param_named fixedDepthBias float 0.0005
+ param_named gradientClamp float 0.0098
+ param_named gradientScaleBias float 0
+ //param_named shadowFuzzyWidth float 1
+ }
+}
+fragment_program Ogre/DepthShadowmap/NormalMapReceiverFPPCF_HLSL hlsl
+{
+ source DepthShadowmap.hlsl
+ entry_point normalMapShadowReceiverFp
+ target ps_2_0
+
+ preprocessor_defines LINEAR_RANGE=0,FUZZY_TEST=0,PCF=1
+
+ default_params
+ {
+ param_named_auto lightColour light_diffuse_colour 0
+ param_named inverseShadowmapSize float 0.0009765625
+ param_named fixedDepthBias float 0.0005
+ param_named gradientClamp float 0.0098
+ param_named gradientScaleBias float 0
+ //param_named shadowFuzzyWidth float 1
+ }
+}
+
+
+
+// **-- End HLSL Section --**
+
+// **-- Begin GLSL Section --**
+vertex_program Ogre/DepthShadowmap/CasterVP_GLSL glsl
+{
+ source DepthShadowmapCasterVp.glsl
+
+ preprocessor_defines LINEAR_RANGE=0
+
+ default_params
+ {
+ param_named_auto worldViewProj worldviewproj_matrix
+ param_named_auto texelOffsets texel_offsets
+ //param_named_auto depthRange scene_depth_range
+ }
+}
+
+
+fragment_program Ogre/DepthShadowmap/CasterFP_GLSL glsl
+{
+ source DepthShadowmapCasterFp.glsl
+
+ preprocessor_defines LINEAR_RANGE=0
+
+ default_params
+ {
+ }
+}
+
+
+vertex_program Ogre/DepthShadowmap/ReceiverVP_GLSL glsl
+{
+ source DepthShadowmapReceiverVp.glsl
+
+ preprocessor_defines LINEAR_RANGE=0
+
+ default_params
+ {
+ param_named_auto world world_matrix
+ param_named_auto worldIT inverse_transpose_world_matrix
+ param_named_auto worldViewProj worldviewproj_matrix
+ param_named_auto texViewProj texture_viewproj_matrix
+ param_named_auto lightPosition light_position 0
+ param_named_auto lightColour light_diffuse_colour 0
+ //param_named_auto shadowDepthRange shadow_scene_depth_range 0
+ }
+}
+
+
+fragment_program Ogre/DepthShadowmap/ReceiverFP_GLSL glsl
+{
+ source DepthShadowmapReceiverFp.glsl
+
+ preprocessor_defines LINEAR_RANGE=0,FUZZY_TEST=0,PCF=0
+
+ default_params
+ {
+ param_named shadowMap int 0
+ param_named inverseShadowmapSize float 0.0009765625
+ param_named fixedDepthBias float 0.0005
+ param_named gradientClamp float 0.0098
+ param_named gradientScaleBias float 0
+ //param_named shadowFuzzyWidth float 1
+ }
+}
+
+fragment_program Ogre/DepthShadowmap/ReceiverFPPCF_GLSL glsl
+{
+ source DepthShadowmapReceiverFp.glsl
+
+ preprocessor_defines LINEAR_RANGE=0,FUZZY_TEST=0,PCF=1
+
+ default_params
+ {
+ param_named inverseShadowmapSize float 0.0009765625
+ param_named gradientClamp float 0.0098
+ param_named gradientScaleBias float 0
+ //param_named shadowFuzzyWidth float 1
+ }
+}
+vertex_program Ogre/DepthShadowmap/NormalMapReceiverVP_GLSL glsl
+{
+ source DepthShadowmapNormalMapReceiverVp.glsl
+
+ preprocessor_defines LINEAR_RANGE=0
+
+ default_params
+ {
+ param_named_auto world world_matrix
+ param_named_auto worldViewProj worldviewproj_matrix
+ param_named_auto texViewProj texture_viewproj_matrix
+ param_named_auto lightPosition light_position_object_space 0
+ //param_named_auto shadowDepthRange shadow_scene_depth_range 0
+ }
+}
+
+fragment_program Ogre/DepthShadowmap/NormalMapReceiverFP_GLSL glsl
+{
+ source DepthShadowmapNormalMapReceiverFp.glsl
+
+ preprocessor_defines LINEAR_RANGE=0,FUZZY_TEST=0,PCF=0
+
+ default_params
+ {
+ param_named_auto lightColour light_diffuse_colour 0
+ param_named inverseShadowmapSize float 0.0009765625
+ param_named fixedDepthBias float 0.0005
+ param_named gradientClamp float 0.0098
+ param_named gradientScaleBias float 0
+ //param_named shadowFuzzyWidth float 1
+
+ param_named shadowMap int 0
+ param_named normalMap int 1
+ }
+}
+fragment_program Ogre/DepthShadowmap/NormalMapReceiverFPPCF_GLSL glsl
+{
+ source DepthShadowmapNormalMapReceiverFp.glsl
+
+ preprocessor_defines LINEAR_RANGE=0,FUZZY_TEST=0,PCF=1
+
+ default_params
+ {
+ param_named_auto lightColour light_diffuse_colour 0
+ param_named inverseShadowmapSize float 0.0009765625
+ param_named fixedDepthBias float 0.0005
+ param_named gradientClamp float 0.0098
+ param_named gradientScaleBias float 0
+ //param_named shadowFuzzyWidth float 1
+
+ param_named shadowMap int 0
+ param_named normalMap int 1
+ }
+}
+
+// **-- End GLSL Section --**
+
+// **-- Begin Unified Section --**
+vertex_program Ogre/DepthShadowmap/CasterVP unified
+{
+ delegate Ogre/DepthShadowmap/CasterVP_GLSL
+ delegate Ogre/DepthShadowmap/CasterVP_HLSL
+}
+fragment_program Ogre/DepthShadowmap/CasterFP unified
+{
+ delegate Ogre/DepthShadowmap/CasterFP_GLSL
+ delegate Ogre/DepthShadowmap/CasterFP_HLSL
+}
+vertex_program Ogre/DepthShadowmap/ReceiverVP unified
+{
+ delegate Ogre/DepthShadowmap/ReceiverVP_GLSL
+ delegate Ogre/DepthShadowmap/ReceiverVP_HLSL
+}
+fragment_program Ogre/DepthShadowmap/ReceiverFP unified
+{
+ delegate Ogre/DepthShadowmap/ReceiverFP_GLSL
+ delegate Ogre/DepthShadowmap/ReceiverFP_HLSL
+}
+fragment_program Ogre/DepthShadowmap/ReceiverFPPCF unified
+{
+ delegate Ogre/DepthShadowmap/ReceiverFPPCF_GLSL
+ delegate Ogre/DepthShadowmap/ReceiverFPPCF_HLSL
+}
+vertex_program Ogre/DepthShadowmap/NormalMapReceiverVP unified
+{
+ delegate Ogre/DepthShadowmap/NormalMapReceiverVP_HLSL
+ delegate Ogre/DepthShadowmap/NormalMapReceiverVP_GLSL
+}
+vertex_program Ogre/DepthShadowmap/NormalMapReceiverFP unified
+{
+ delegate Ogre/DepthShadowmap/NormalMapReceiverFP_HLSL
+ delegate Ogre/DepthShadowmap/NormalMapReceiverFP_GLSL
+}
+vertex_program Ogre/DepthShadowmap/NormalMapReceiverFPPCF unified
+{
+ delegate Ogre/DepthShadowmap/NormalMapReceiverFPPCF_HLSL
+ delegate Ogre/DepthShadowmap/NormalMapReceiverFPPCF_GLSL
+}
+
+// **-- End Unified Section --**
+
+
+
+// Generic Shadow caster material (floating point shadowmap)
+material Ogre/DepthShadowmap/Caster/Float
+{
+ technique
+ {
+ pass
+ {
+ vertex_program_ref Ogre/DepthShadowmap/CasterVP
+ {
+ }
+ fragment_program_ref Ogre/DepthShadowmap/CasterFP
+ {
+ }
+ }
+ }
+}
+
+// Generic Shadow receiver material (floating point shadowmap)
+material Ogre/DepthShadowmap/Receiver/Float
+{
+ technique
+ {
+ pass
+ {
+ vertex_program_ref Ogre/DepthShadowmap/ReceiverVP
+ {
+ }
+ fragment_program_ref Ogre/DepthShadowmap/ReceiverFP
+ {
+ }
+ texture_unit ShadowMap
+ {
+ tex_address_mode clamp
+ filtering none
+ }
+ }
+ }
+}
+
+
+// Specific receiver material for rockwall
+material Ogre/DepthShadowmap/Receiver/RockWall
+{
+
+ // This is the preferred technique which uses both vertex and
+ // fragment programs, supports coloured lights
+ technique
+ {
+ // Base ambient pass
+ pass
+ {
+ // base colours, not needed for rendering, but as information
+ // to lighting pass categorisation routine
+ ambient 1 1 1
+ diffuse 0 0 0
+ specular 0 0 0 0
+ // Really basic vertex program
+ vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTextureUnified
+ {
+ }
+
+ }
+ // Now do the lighting pass
+ // NB we don't do decal texture here because this is repeated per light
+ pass lighting
+ {
+ // base colours, not needed for rendering, but as information
+ // to lighting pass categorisation routine
+ ambient 0 0 0
+
+ // do this for each light
+ iteration once_per_light
+
+
+ scene_blend add
+
+ // Vertex program reference
+ vertex_program_ref Ogre/DepthShadowmap/ReceiverVP
+ {
+ }
+ shadow_receiver_vertex_program_ref Ogre/DepthShadowmap/ReceiverVP
+ {
+ }
+
+ // Fragment program
+ fragment_program_ref Ogre/DepthShadowmap/ReceiverFP
+ {
+ }
+ shadow_receiver_fragment_program_ref Ogre/DepthShadowmap/ReceiverFP
+ {
+ }
+
+ // shadowmap texture will be bound by code
+
+ }
+
+ // Decal pass
+ pass
+ {
+ // base colours, not needed for rendering, but as information
+ // to lighting pass categorisation routine
+ lighting off
+ // Really basic vertex program
+ vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTextureUnified
+ {
+ param_named ambient float4 1 1 1 1
+ }
+ scene_blend dest_colour zero
+
+
+ texture_unit
+ {
+ texture rockwall.tga
+ }
+
+ }
+ }
+
+
+}
+
+// Specific receiver material for Athene
+material Ogre/DepthShadowmap/Receiver/Athene
+{
+
+ // This is the preferred technique which uses both vertex and
+ // fragment programs, supports coloured lights
+ technique
+ {
+ // Base ambient pass
+ pass
+ {
+ // base colours, not needed for rendering, but as information
+ // to lighting pass categorisation routine
+ ambient 1 1 1
+ diffuse 0 0 0
+ specular 0 0 0 0
+ // Really basic vertex program
+ vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTextureUnified
+ {
+ }
+
+ }
+ // Now do the lighting pass
+ // NB we don't do decal texture here because this is repeated per light
+ pass lighting
+ {
+ // base colours, not needed for rendering, but as information
+ // to lighting pass categorisation routine
+ ambient 0 0 0
+
+ // do this for each light
+ iteration once_per_light
+
+
+ scene_blend add
+
+ // Vertex program reference
+ vertex_program_ref Ogre/DepthShadowmap/NormalMapReceiverVP
+ {
+ }
+ shadow_receiver_vertex_program_ref Ogre/DepthShadowmap/NormalMapReceiverVP
+ {
+ }
+
+ // Fragment program
+ fragment_program_ref Ogre/DepthShadowmap/NormalMapReceiverFP
+ {
+ }
+ shadow_receiver_fragment_program_ref Ogre/DepthShadowmap/NormalMapReceiverFP
+ {
+ }
+
+ // shadowmap texture will be bound by code
+
+ // Base bump map
+ texture_unit
+ {
+ texture atheneNormalMap.png
+ colour_op replace
+ }
+ // Normalisation cube map
+ texture_unit
+ {
+ cubic_texture nm.png combinedUVW
+ tex_coord_set 1
+ tex_address_mode clamp
+ }
+
+ }
+
+ // Decal pass
+ pass
+ {
+ // base colours, not needed for rendering, but as information
+ // to lighting pass categorisation routine
+ lighting off
+ // Really basic vertex program
+ vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTextureUnified
+ {
+ param_named ambient float4 1 1 1 1
+ }
+ scene_blend dest_colour zero
+
+
+ texture_unit
+ {
+ texture egyptrockyfull.jpg
+ }
+
+ }
+ }
+
+
+}
+
+
+
+// Specialisation to use PCF
+material Ogre/DepthShadowmap/Receiver/Float/PCF : Ogre/DepthShadowmap/Receiver/Float
+{
+ technique
+ {
+ pass
+ {
+ // override just receiver program
+ fragment_program_ref Ogre/DepthShadowmap/ReceiverFPPCF
+ {
+ }
+
+ }
+ }
+}
+
+// Specialisation to use PCF
+material Ogre/DepthShadowmap/Receiver/RockWall/PCF : Ogre/DepthShadowmap/Receiver/RockWall
+{
+ technique
+ {
+ pass lighting
+ {
+ // override just receiver program
+ shadow_receiver_fragment_program_ref Ogre/DepthShadowmap/ReceiverFPPCF
+ {
+ }
+
+ }
+ }
+}
+// Specialisation to use PCF
+material Ogre/DepthShadowmap/Receiver/Athene/PCF : Ogre/DepthShadowmap/Receiver/Athene
+{
+ technique
+ {
+ pass lighting
+ {
+ // override just receiver program
+ shadow_receiver_fragment_program_ref Ogre/DepthShadowmap/NormalMapReceiverFPPCF
+ {
+ }
+
+ }
+ }
+}
+
+
diff --git a/school/informatik/verkerhssimulation/media/materials/scripts/Embossed.material b/school/informatik/verkerhssimulation/media/materials/scripts/Embossed.material
new file mode 100644
index 00000000..0e62fa4f
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/scripts/Embossed.material
@@ -0,0 +1,33 @@
+fragment_program Ogre/Compositor/Embossed_FP cg
+{
+ source GrayScale.cg
+ entry_point Embossed_ps
+ profiles ps_2_0 arbfp1
+}
+
+material Ogre/Compositor/Embossed
+{
+ technique
+ {
+
+ pass
+ {
+ depth_check off
+
+ vertex_program_ref Ogre/Compositor/StdQuad_Cg_vp
+ {
+ }
+
+ fragment_program_ref Ogre/Compositor/Embossed_FP
+ {
+ }
+
+ texture_unit RT
+ {
+ tex_coord_set 0
+ tex_address_mode clamp
+ filtering linear linear linear
+ }
+ }
+ }
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/scripts/Example-DynTex.material b/school/informatik/verkerhssimulation/media/materials/scripts/Example-DynTex.material
new file mode 100644
index 00000000..e1d51c7a
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/scripts/Example-DynTex.material
@@ -0,0 +1,86 @@
+
+material Examples/DynaTest
+{
+ technique
+ {
+ pass
+ {
+ texture_unit
+ {
+ texture DynaTex 2d
+ }
+ depth_write off
+ scene_blend alpha_blend
+ lighting off
+ }
+ }
+}
+
+
+material Examples/DynaTest2
+{
+ technique
+ {
+ pass
+ {
+ texture_unit
+ {
+ texture DynaTex 2d
+ }
+ diffuse 0.8 0.8 0.8
+ specular 0.7 0.7 0.7 40.0
+ ambient 0.5 0.5 0.5
+ }
+ }
+}
+
+material Examples/DynaTest3
+{
+ technique
+ {
+ pass
+ {
+ texture_unit
+ {
+ texture DynaTex 2d
+ }
+ diffuse 0.2 0.8 0.8
+ specular 0.4 0.7 0.7 30.0
+ ambient 0.2 0.5 1.0
+ depth_write off
+ scene_blend alpha_blend
+ }
+ }
+}
+
+material Examples/DynaTest4
+{
+ technique
+ {
+ pass
+ {
+ texture_unit
+ {
+ texture DynaTex 2d
+ }
+ diffuse 0.8 0.8 0.8
+ specular 0.7 0.7 0.4 20.0
+ ambient 1.0 0.5 0.2
+ }
+ }
+}
+
+material Examples/VTDarkStuff
+{
+ technique
+ {
+ pass
+ {
+ diffuse 0.0 0.0 0.0
+ ambient 0.1 0.1 0.15
+ cull_hardware none
+ lighting on
+ }
+
+ }
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/scripts/Example-Water.material b/school/informatik/verkerhssimulation/media/materials/scripts/Example-Water.material
new file mode 100644
index 00000000..431eec5d
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/scripts/Example-Water.material
@@ -0,0 +1,183 @@
+
+material Examples/Water0
+{
+ technique
+ {
+ pass
+ {
+ scene_blend colour_blend
+ depth_write off
+
+ texture_unit
+ {
+ texture Water01.jpg
+ env_map spherical
+ scroll_anim 0.01 0.01
+ }
+ }
+ }
+}
+material Examples/Water1
+{
+ technique
+ {
+ pass
+ {
+ scene_blend colour_blend
+ depth_write off
+
+ texture_unit
+ {
+ texture BeachStones.jpg
+ scale 0.25 0.25
+ }
+
+ texture_unit
+ {
+ texture Water01.jpg
+ env_map spherical
+ scroll_anim 0.01 0.01
+ }
+ }
+ }
+}
+material Examples/Water2
+{
+ technique
+ {
+ pass
+ {
+ scene_blend colour_blend
+ depth_write off
+
+ texture_unit
+ {
+ texture Water01.jpg
+ scroll_anim 0.01 0.01
+ }
+ }
+ }
+}
+material Examples/Water3
+{
+ technique
+ {
+ pass
+ {
+ scene_blend colour_blend
+ depth_write off
+
+ texture_unit
+ {
+ texture Water02.jpg
+ env_map spherical
+ scroll_anim 0.01 0.01
+ rotate_anim 0.03
+ }
+ }
+ }
+}
+material Examples/Water4
+{
+ technique
+ {
+ pass
+ {
+ cull_hardware none
+ cull_software none
+
+ texture_unit
+ {
+ texture Water02.jpg
+ env_map spherical
+ scroll_anim 0.01 0.01
+ }
+ }
+ }
+}
+material Examples/Water5
+{
+ technique
+ {
+ pass
+ {
+ cull_hardware none
+ cull_software none
+
+ texture_unit
+ {
+ texture BeachStones.jpg
+ scale 0.25 0.25
+ }
+
+ texture_unit
+ {
+ texture Water01.jpg
+ env_map spherical
+ scroll_anim 0.01 0.01
+ }
+ }
+ }
+}
+material Examples/Water6
+{
+ technique
+ {
+ pass
+ {
+ lighting off
+
+ texture_unit
+ {
+ cubic_texture cubescene.jpg combinedUVW
+ tex_address_mode clamp
+ env_map cubic_reflection
+ }
+ }
+ }
+}
+material Examples/Water7
+{
+ technique
+ {
+ pass
+ {
+ cull_hardware none
+ cull_software none
+
+ texture_unit
+ {
+ texture BeachStones.jpg
+ scale 0.25 0.25
+ }
+
+ texture_unit
+ {
+ cubic_texture cubescene.jpg combinedUVW
+ tex_address_mode clamp
+ env_map cubic_reflection
+ }
+ }
+ }
+}
+material Examples/Water8
+{
+ technique
+ {
+ pass
+ {
+ lighting off
+ scene_blend add
+ depth_write off
+ cull_hardware none
+ cull_software none
+
+ texture_unit
+ {
+ cubic_texture cubescene.jpg combinedUVW
+ tex_address_mode clamp
+ env_map cubic_reflection
+ }
+ }
+ }
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/scripts/Example.material b/school/informatik/verkerhssimulation/media/materials/scripts/Example.material
new file mode 100644
index 00000000..6faa2d3b
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/scripts/Example.material
@@ -0,0 +1,1044 @@
+
+material Examples/EnvMappedRustySteel
+{
+ technique
+ {
+ pass
+ {
+
+ texture_unit
+ {
+ texture RustySteel.jpg
+ }
+
+ texture_unit
+ {
+ texture spheremap.png
+ colour_op_ex add src_texture src_current
+ colour_op_multipass_fallback one one
+ env_map spherical
+ }
+ }
+ }
+}
+material Examples/OgreLogo
+{
+ technique
+ {
+ pass
+ {
+ ambient 0.8 0.8 0.8
+
+ texture_unit
+ {
+ texture ogrelogo.png
+ }
+ }
+ }
+}
+material Examples/DarkMaterial
+{
+ technique
+ {
+ pass
+ {
+ ambient 0.1 0.1 0.1
+
+ texture_unit
+ {
+ texture BeachStones.jpg
+ }
+ }
+ }
+}
+material Examples/SpaceSkyBox
+{
+ technique
+ {
+ pass
+ {
+ lighting off
+ depth_write off
+
+ texture_unit
+ {
+ cubic_texture stevecube.jpg separateUV
+ tex_address_mode clamp
+ }
+ }
+ }
+}
+material Examples/SceneSkyBox1
+{
+ technique
+ {
+ pass
+ {
+ lighting off
+ depth_write off
+
+ texture_unit
+ {
+ cubic_texture cubemap_fr.jpg cubemap_bk.jpg cubemap_lf.jpg cubemap_rt.jpg cubemap_up.jpg cubemap_dn.jpg separateUV
+ tex_address_mode clamp
+ }
+ }
+ }
+}
+material Examples/SceneCubeMap1
+{
+ technique
+ {
+ pass
+ {
+ lighting off
+
+ texture_unit
+ {
+ cubic_texture cubemap.jpg combinedUVW
+ tex_address_mode clamp
+ env_map cubic_reflection
+ }
+ }
+ }
+}
+material Examples/SceneSkyBox2
+{
+ technique
+ {
+ pass
+ {
+ lighting off
+ depth_write off
+
+ texture_unit
+ {
+ cubic_texture cubescene_fr.jpg cubescene_bk.jpg cubescene_lf.jpg cubescene_rt.jpg cubescene_up.jpg cubescene_dn.jpg separateUV
+ tex_address_mode clamp
+ }
+ }
+ }
+}
+material Examples/SceneCubeMap2
+{
+ technique
+ {
+ pass
+ {
+ lighting off
+
+ texture_unit
+ {
+ cubic_texture cubescene.jpg combinedUVW
+ tex_address_mode clamp
+ env_map cubic_reflection
+ }
+ }
+ }
+}
+
+material Examples/CloudyNoonSkyBox
+{
+ technique
+ {
+ pass
+ {
+ lighting off
+ depth_write off
+
+ texture_unit
+ {
+ cubic_texture cloudy_noon.jpg separateUV
+ tex_address_mode clamp
+ }
+ }
+ }
+}
+
+material Examples/StormySkyBox
+{
+ technique
+ {
+ pass
+ {
+ lighting off
+ depth_write off
+
+ texture_unit
+ {
+ cubic_texture stormy.jpg separateUV
+ tex_address_mode clamp
+ }
+ }
+ }
+}
+
+
+fragment_program Examples/MorningSkyBoxHDRfp cg
+{
+ source hdr.cg
+ entry_point morningskybox_fp
+ profiles ps_2_0 arbfp1
+
+}
+material Examples/MorningSkyBox
+{
+ technique
+ {
+ pass
+ {
+ lighting off
+ depth_write off
+
+ texture_unit
+ {
+ cubic_texture morning.jpg separateUV
+ tex_address_mode clamp
+ }
+ }
+ }
+
+ // HDR technique (fake)
+ technique
+ {
+ scheme HDR
+
+ pass
+ {
+ lighting off
+ depth_write off
+
+ vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+ {
+ param_named_auto worldViewProj worldviewproj_matrix
+ param_named ambient float4 1 1 1 1
+ }
+ fragment_program_ref Examples/MorningSkyBoxHDRfp
+ {
+ }
+
+ texture_unit
+ {
+ cubic_texture morning.jpg separateUV
+ tex_address_mode clamp
+ }
+ }
+ }
+}
+fragment_program Examples/MorningCubeMapHDRfp cg
+{
+ source hdr.cg
+ entry_point morningcubemap_fp
+ profiles ps_2_0 arbfp1
+
+}
+material Examples/MorningCubeMap
+{
+ technique
+ {
+ pass
+ {
+ lighting off
+
+ texture_unit
+ {
+ cubic_texture morning.jpg combinedUVW
+ tex_address_mode clamp
+ env_map cubic_reflection
+ }
+ }
+ }
+ // HDR technique (fake)
+ technique
+ {
+ scheme HDR
+
+ pass
+ {
+ lighting off
+
+ fragment_program_ref Examples/MorningCubeMapHDRfp
+ {
+ }
+ texture_unit
+ {
+ cubic_texture morning.jpg combinedUVW
+ tex_address_mode clamp
+ env_map cubic_reflection
+ }
+ }
+ }
+}
+
+
+material Examples/EveningSkyBox
+{
+ technique
+ {
+ pass
+ {
+ lighting off
+ depth_write off
+
+ texture_unit
+ {
+ cubic_texture evening.jpg separateUV
+ tex_address_mode clamp
+ }
+ }
+ }
+}
+
+material Examples/CloudySky
+{
+ technique
+ {
+ pass
+ {
+ lighting off
+ depth_write off
+
+ texture_unit
+ {
+ texture clouds.jpg
+ scroll_anim 0.05 0
+ }
+ }
+ }
+}
+material Examples/RustySteel
+{
+ technique
+ {
+ pass
+ {
+
+ texture_unit
+ {
+ texture RustySteel.jpg
+ }
+ }
+ }
+}
+material Examples/Chrome
+{
+ technique
+ {
+ pass
+ {
+
+ texture_unit
+ {
+ texture Chrome.jpg
+ env_map spherical
+ }
+ }
+ }
+}
+material Examples/SpaceSkyPlane
+{
+ technique
+ {
+ pass
+ {
+ lighting off
+ depth_write off
+ fog_override true none
+
+ texture_unit
+ {
+ texture spacesky.jpg
+ }
+ }
+ }
+}
+material Examples/TextureEffect1
+{
+ technique
+ {
+ pass
+ {
+ ambient 0.75 0.75 0.75
+ cull_hardware none
+ cull_software none
+
+ texture_unit
+ {
+ texture BumpyMetal.jpg
+ rotate_anim 0.2
+ wave_xform scale_x sine 1 0.1 0 5
+ wave_xform scale_y sine 0.5 0.2 0.5 3
+ }
+ }
+ }
+}
+material Examples/TextureEffect2
+{
+ technique
+ {
+ pass
+ {
+
+ texture_unit
+ {
+ texture Water02.jpg
+ scroll_anim 0.5 0
+ }
+ }
+ }
+}
+material Examples/TextureEffect3
+{
+ technique
+ {
+ pass
+ {
+ ambient 0.7 0.7 0.7
+ cull_hardware none
+ cull_software none
+
+ texture_unit
+ {
+ texture Water01.jpg
+ scroll_anim -0.25 0.1
+ }
+
+ texture_unit
+ {
+ texture Water01.jpg
+ colour_op_ex add src_texture src_current
+ colour_op_multipass_fallback one one
+ scroll_anim -0.1 0.25
+ }
+ }
+ }
+}
+material Examples/TextureEffect4
+{
+ technique
+ {
+ pass
+ {
+ ambient 0.3 0.3 0.3
+ scene_blend colour_blend
+ cull_hardware none
+ cull_software none
+
+ texture_unit
+ {
+ texture Water02.jpg
+ scroll_anim 0.01 0.01
+ }
+ }
+ }
+}
+material Examples/BumpyMetal
+{
+ technique
+ {
+ pass
+ {
+ ambient 0.75 0.75 0.75
+ cull_hardware none
+ cull_software none
+
+ texture_unit
+ {
+ texture BumpyMetal.jpg
+ }
+ }
+ }
+}
+material Examples/TransparentTest
+{
+ technique
+ {
+ pass
+ {
+ ambient 0.2 0.2 0.2
+ scene_blend add
+ depth_write off
+
+ texture_unit
+ {
+ texture Water01.jpg
+ scroll_anim 0.25 0
+ }
+
+ texture_unit
+ {
+ texture Water01.jpg
+ wave_xform scroll_y sine 0 0.1 0 0.5
+ }
+ }
+ }
+}
+material Examples/Flare
+{
+ technique
+ {
+ pass
+ {
+ lighting off
+ scene_blend add
+ depth_write off
+
+ texture_unit
+ {
+ texture flare.png
+ }
+ }
+ }
+}
+material Examples/Flare2
+{
+ technique
+ {
+ pass
+ {
+ lighting off
+ scene_blend add
+ depth_write off
+
+ texture_unit
+ {
+ texture flaretrail.png
+ }
+ }
+ }
+}
+material Examples/FlarePointSprite
+{
+ technique
+ {
+ pass
+ {
+ lighting off
+ scene_blend add
+ depth_write off
+
+ point_sprites on
+ point_size 2
+ point_size_attenuation on
+
+ texture_unit
+ {
+ texture flare.png
+ }
+ }
+ }
+}
+
+material Examples/Droplet
+{
+ technique
+ {
+ pass
+ {
+ scene_blend colour_blend
+ depth_write off
+
+ texture_unit
+ {
+ texture basic_droplet.png
+ }
+ }
+ }
+}
+material Examples/Hilite/Yellow
+{
+ technique
+ {
+ pass
+ {
+
+ texture_unit
+ {
+ texture dkyellow.png
+ }
+ }
+ }
+}
+material Examples/Rocky
+{
+ technique
+ {
+ pass
+ {
+ ambient 0.2 0.2 0.2
+
+ texture_unit
+ {
+ texture egyptrockyfull.jpg
+ }
+ }
+ }
+}
+material Examples/10PointBlock
+{
+ technique
+ {
+ pass
+ {
+
+ texture_unit
+ {
+ texture 10points.png
+ }
+ }
+ }
+}
+material Material__25
+{
+ technique
+ {
+ pass
+ {
+
+ texture_unit
+ {
+ texture texmap2.jpg
+ }
+ }
+ }
+}
+material 2 - Default
+{
+ technique
+ {
+ pass
+ {
+
+ texture_unit
+ {
+ texture MtlPlat2.jpg
+ }
+ }
+ }
+}
+material Material #8
+{
+ technique
+ {
+ pass
+ {
+
+ texture_unit
+ {
+ texture BODY.jpg
+ }
+ }
+ }
+}
+material Material #3
+{
+ technique
+ {
+ pass
+ {
+
+ texture_unit
+ {
+ texture HEAD4.jpg
+ }
+ }
+ }
+}
+material Material #9
+{
+ technique
+ {
+ pass
+ {
+
+ texture_unit
+ {
+ texture LEGS.jpg
+ }
+ }
+ }
+}
+
+material Examples/Fish
+{
+ technique
+ {
+ pass
+ {
+ texture_unit
+ {
+ texture steelhead.png
+ }
+ }
+ }
+}
+material Examples/Ninja
+{
+ technique
+ {
+ pass
+ {
+
+ texture_unit
+ {
+ texture nskingr.jpg
+ }
+ }
+ }
+}
+
+material Examples/Robot
+{
+ // Hardware skinning techniique
+ technique
+ {
+ pass
+ {
+ vertex_program_ref Ogre/HardwareSkinningOneWeight
+ {
+ param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+ param_named_auto viewProjectionMatrix viewproj_matrix
+ param_named_auto lightPos[0] light_position 0
+ param_named_auto lightPos[1] light_position 1
+ param_named_auto lightDiffuseColour[0] light_diffuse_colour 0
+ param_named_auto lightDiffuseColour[1] light_diffuse_colour 1
+ param_named_auto ambient ambient_light_colour
+
+ }
+ // alternate shadow caster program
+ shadow_caster_vertex_program_ref Ogre/HardwareSkinningOneWeightShadowCaster
+ {
+ param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+ param_named_auto viewProjectionMatrix viewproj_matrix
+ param_named_auto ambient ambient_light_colour
+
+ }
+
+ texture_unit
+ {
+ texture r2skin.jpg
+ }
+ }
+ }
+
+ // Software blending technique
+ technique
+ {
+ pass
+ {
+
+ texture_unit
+ {
+ texture r2skin.jpg
+ }
+ }
+ }
+}
+
+material Examples/GrassFloor
+{
+ technique
+ {
+ pass
+ {
+ texture_unit
+ {
+ texture grass_1024.jpg
+ }
+ }
+ }
+}
+
+vertex_program Examples/GrassWaverVp cg
+{
+ source Grass.cg
+ entry_point grass_vp
+ profiles vs_1_1 arbvp1
+}
+
+material Examples/GrassBlades
+{
+ // Vertex program waving grass
+ technique
+ {
+ pass
+ {
+ vertex_program_ref Examples/GrassWaverVp
+ {
+ param_named_auto worldViewProj worldviewproj_matrix
+ param_named_auto ambient ambient_light_colour
+ param_named_auto objSpaceLight light_position_object_space 0
+ param_named_auto lightColour light_diffuse_colour 0
+ param_named_auto offset custom 999
+ }
+ alpha_rejection greater 150
+ scene_blend alpha_blend
+ cull_hardware none
+ cull_software none
+ texture_unit
+ {
+ texture gras_02.png
+ }
+ }
+ }
+
+ // Non-vertex program technique (no waving)
+ technique
+ {
+ pass
+ {
+ alpha_rejection greater 150
+ scene_blend alpha_blend
+ cull_hardware none
+ cull_software none
+ texture_unit
+ {
+ texture gras_02.png
+ }
+ }
+ }
+}
+
+material Examples/Rockwall
+{
+ technique
+ {
+ pass
+ {
+ texture_unit
+ {
+ texture rockwall.tga
+ }
+ }
+ }
+}
+
+material Examples/Aureola
+{
+ technique
+ {
+ pass
+ {
+ lighting off
+ scene_blend alpha_blend
+ depth_write off
+ cull_hardware none
+
+ texture_unit
+ {
+ texture aureola.png PF_BYTE_LA
+ tex_address_mode clamp
+ }
+ }
+ }
+}
+
+// Test hardware morph animation
+material Examples/HardwareMorphAnimation
+{
+ technique
+ {
+ pass
+ {
+
+ vertex_program_ref Ogre/HardwareMorphAnimation
+ {
+ // all default
+ }
+
+ texture_unit
+ {
+ tex_coord_set 0
+ colour_op_ex source1 src_current src_current
+ }
+ // need to define these texture units otherwise GL won't use the uv sets
+ texture_unit
+ {
+ tex_coord_set 1
+ // also need to set blending to ignore texture which is GL warning texture
+ colour_op_ex source1 src_current src_current
+ }
+ texture_unit
+ {
+ tex_coord_set 2
+ colour_op_ex source1 src_current src_current
+ }
+
+ }
+ }
+}
+
+// Test hardware pose animation
+material Examples/HardwarePoseAnimation
+{
+ technique
+ {
+ pass
+ {
+
+ vertex_program_ref Ogre/HardwarePoseAnimation
+ {
+ // all default
+ }
+ texture_unit
+ {
+ tex_coord_set 0
+ colour_op_ex source1 src_current src_current
+ }
+ // need to define these texture units otherwise GL won't use the uv sets
+ texture_unit
+ {
+ tex_coord_set 1
+ // also need to set blending to ignore texture which is GL warning texture
+ colour_op_ex source1 src_current src_current
+ }
+ texture_unit
+ {
+ tex_coord_set 2
+ colour_op_ex source1 src_current src_current
+ }
+
+
+ }
+ }
+}
+
+material RustyBarrel
+{
+ technique
+ {
+ pass
+ {
+ ambient 0.5 0.5 0.5 1.0
+ diffuse 1.0 1.0 1.0 1.0
+ specular 0.0 0.0 0.0 1.0 12.5
+ emissive 0.0 0.0 0.0 1.0
+ texture_unit
+ {
+ texture RustyBarrel.png
+ filtering trilinear
+ }
+ }
+ }
+}
+
+material WoodPallet
+{
+ receive_shadows on
+ technique
+ {
+ pass
+ {
+ ambient 0.5 0.5 0.5 1.0
+ diffuse 1.0 1.0 1.0 1.0
+ specular 0.0 0.0 0.0 1.0 12.5
+
+ texture_unit
+ {
+ texture WoodPallet.png
+ filtering trilinear
+ }
+ }
+ }
+}
+
+material Examples/LightRibbonTrail
+{
+ technique
+ {
+ pass
+ {
+ lighting off
+ scene_blend add
+ depth_write off
+
+ texture_unit
+ {
+ texture ribbonband.png 1d
+ tex_address_mode clamp
+ filtering none
+ }
+ }
+ }
+}
+
+material Examples/TudorHouse
+{
+ technique
+ {
+ pass
+ {
+ texture_unit
+ {
+ texture fw12b.jpg
+ tex_address_mode clamp
+ }
+ }
+ }
+}
+
+material jaiqua
+{
+ // Hardware skinning techniique
+ technique
+ {
+ pass
+ {
+ vertex_program_ref Ogre/HardwareSkinningTwoWeights
+ {
+
+ }
+ // alternate shadow caster program
+ shadow_caster_vertex_program_ref Ogre/HardwareSkinningTwoWeightsShadowCaster
+ {
+ param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+ param_named_auto viewProjectionMatrix viewproj_matrix
+ param_named_auto ambient ambient_light_colour
+
+ }
+
+ texture_unit
+ {
+ texture blue_jaiqua.jpg
+ tex_address_mode clamp
+ }
+ }
+ }
+
+ // Software blending technique
+ technique
+ {
+ pass
+ {
+ texture_unit
+ {
+ texture blue_jaiqua.jpg
+ tex_address_mode clamp
+ }
+ }
+ }
+
+}
+
+
+material Examples/Plane/IntegratedShadows
+{
+ technique
+ {
+ pass
+ {
+ // Single-pass shadowing
+ texture_unit
+ {
+ texture MtlPlat2.jpg
+ }
+ texture_unit
+ {
+ // standard modulation blend
+ content_type shadow
+ tex_address_mode clamp
+ }
+ }
+ }
+
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/scripts/Examples-Advanced.material b/school/informatik/verkerhssimulation/media/materials/scripts/Examples-Advanced.material
new file mode 100644
index 00000000..afde7e63
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/scripts/Examples-Advanced.material
@@ -0,0 +1,1167 @@
+// -------------------------------
+// Cel Shading Section
+// -------------------------------
+vertex_program Ogre/CelShadingVP cg
+{
+ source Example_CelShading.cg
+ entry_point main_vp
+ profiles vs_1_1 arbvp1
+
+ default_params
+ {
+ param_named_auto lightPosition light_position_object_space 0
+ param_named_auto eyePosition camera_position_object_space
+ param_named_auto worldViewProj worldviewproj_matrix
+ param_named shininess float 10
+ }
+}
+
+fragment_program Ogre/CelShadingFP cg
+{
+ source Example_CelShading.cg
+ entry_point main_fp
+ profiles ps_1_1 arbfp1 fp20
+}
+
+
+material Examples/CelShading
+{
+ technique
+ {
+ pass
+ {
+ vertex_program_ref Ogre/CelShadingVP
+ {
+ // map shininess from custom renderable param 1
+ param_named_auto shininess custom 1
+ }
+ fragment_program_ref Ogre/CelShadingFP
+ {
+ // map diffuse from custom renderable param 2
+ param_named_auto diffuse custom 2
+ // map specular from custom renderable param 2
+ param_named_auto specular custom 3
+ }
+ texture_unit
+ {
+ texture cel_shading_diffuse.png 1d
+ tex_address_mode clamp
+ filtering none
+ }
+ texture_unit
+ {
+ texture cel_shading_specular.png 1d
+ tex_address_mode clamp
+ filtering none
+ tex_coord_set 1
+ }
+ texture_unit
+ {
+ texture cel_shading_edge.png 1d
+ tex_address_mode clamp
+ filtering none
+ tex_coord_set 2
+ }
+ }
+ }
+
+}
+
+
+
+//------------------------
+// Bump mapping section
+//------------------------
+
+// Bump map vertex program, support for this is required
+vertex_program Examples/BumpMapVP cg
+{
+ source Example_BumpMapping.cg
+ entry_point main_vp
+ profiles vs_1_1 arbvp1
+}
+
+// Bump map fragment program, support for this is optional
+fragment_program Examples/BumpMapFP cg
+{
+ source Example_BumpMapping.cg
+ entry_point main_fp
+ profiles ps_1_1 arbfp1 fp20
+}
+
+// Bump map vertex program shadow receiver
+vertex_program Examples/BumpMapVPShadowRcv cg
+{
+ source Example_BumpMapping.cg
+ entry_point main_shadowreceiver_vp
+ profiles vs_1_1 arbvp1
+}
+// Bump map fragment program shadow receiver, support for this is optional
+fragment_program Examples/BumpMapFPShadowRcv cg
+{
+ source Example_BumpMapping.cg
+ entry_point main_shadowreceiver_fp
+ profiles ps_1_1 arbfp1 fp20
+}
+
+
+// Bump map with specular vertex program, support for this is required
+vertex_program Examples/BumpMapVPSpecular cg
+{
+ source Example_BumpMapping.cg
+ entry_point specular_vp
+ profiles vs_1_1 arbvp1
+}
+
+// Bump map fragment program, support for this is optional
+fragment_program Examples/BumpMapFPSpecular cg
+{
+ source Example_BumpMapping.cg
+ entry_point specular_fp
+ profiles ps_1_1 arbfp1 fp20
+}
+
+// Single light material, less passes (one pass on a 4-unit card)
+material Examples/BumpMapping/SingleLight
+{
+ // Preferred technique, uses vertex and fragment programs
+ // to support a single coloured light
+ technique
+ {
+ pass
+ {
+ // base colours, not needed for rendering, but as information
+ // to lighting pass categorisation routine
+ ambient 0 0 0
+ // Vertex program reference
+ vertex_program_ref Examples/BumpMapVP
+ {
+ param_named_auto lightPosition light_position_object_space 0
+ param_named_auto worldViewProj worldviewproj_matrix
+ }
+
+ // Fragment program
+ fragment_program_ref Examples/BumpMapFP
+ {
+ param_named_auto lightDiffuse light_diffuse_colour 0
+ }
+
+ // Base bump map
+ texture_unit
+ {
+ texture NMBumpsOut.png
+ colour_op replace
+ }
+ // Normalisation cube map
+ texture_unit
+ {
+ cubic_texture nm.png combinedUVW
+ tex_coord_set 1
+ tex_address_mode clamp
+ }
+ // Decal
+ texture_unit
+ {
+ texture RustySteel.jpg
+ }
+ }
+ }
+ // Fallback technique, uses vertex program but only fixed-function
+ // fragment shading, which does not support coloured light
+ technique
+ {
+ pass
+ {
+ // base colours, not needed for rendering, but as information
+ // to lighting pass categorisation routine
+ ambient 0 0 0
+ // Vertex program reference
+ vertex_program_ref Examples/BumpMapVP
+ {
+ param_named_auto lightPosition light_position_object_space 0
+ param_named_auto worldViewProj worldviewproj_matrix
+ }
+
+ // Base bump map
+ texture_unit
+ {
+ texture NMBumpsOut.png
+ colour_op replace
+ }
+ // Normalisation cube map
+ texture_unit
+ {
+ cubic_texture nm.png combinedUVW
+ tex_coord_set 1
+ tex_address_mode clamp
+ colour_op_ex dotproduct src_texture src_current
+ colour_op_multipass_fallback dest_colour zero
+ }
+ // Decal
+ texture_unit
+ {
+ texture RustySteel.jpg
+ }
+ }
+ }
+}
+
+// Any number of lights, diffuse
+material Examples/BumpMapping/MultiLight
+{
+
+ // This is the preferred technique which uses both vertex and
+ // fragment programs, supports coloured lights
+ technique
+ {
+ // Base ambient pass
+ pass
+ {
+ // base colours, not needed for rendering, but as information
+ // to lighting pass categorisation routine
+ ambient 1 1 1
+ diffuse 0 0 0
+ specular 0 0 0 0
+ // Really basic vertex program
+ // NB we don't use fixed function here because GL does not like
+ // mixing fixed function and vertex programs, depth fighting can
+ // be an issue
+ vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+ {
+ param_named_auto worldViewProj worldviewproj_matrix
+ param_named_auto ambient ambient_light_colour
+ }
+
+ }
+ // Now do the lighting pass
+ // NB we don't do decal texture here because this is repeated per light
+ pass
+ {
+ // base colours, not needed for rendering, but as information
+ // to lighting pass categorisation routine
+ ambient 0 0 0
+
+ // do this for each light
+ iteration once_per_light
+
+
+ scene_blend add
+
+ // Vertex program reference
+ vertex_program_ref Examples/BumpMapVP
+ {
+ param_named_auto lightPosition light_position_object_space 0
+ param_named_auto worldViewProj worldviewproj_matrix
+ }
+
+ // Fragment program
+ fragment_program_ref Examples/BumpMapFP
+ {
+ param_named_auto lightDiffuse light_diffuse_colour 0
+ }
+
+ // Base bump map
+ texture_unit
+ {
+ texture NMBumpsOut.png
+ colour_op replace
+ }
+ // Normalisation cube map
+ texture_unit
+ {
+ cubic_texture nm.png combinedUVW
+ tex_coord_set 1
+ tex_address_mode clamp
+ }
+ }
+
+ // Decal pass
+ pass
+ {
+ // base colours, not needed for rendering, but as information
+ // to lighting pass categorisation routine
+ lighting off
+ // Really basic vertex program
+ // NB we don't use fixed function here because GL does not like
+ // mixing fixed function and vertex programs, depth fighting can
+ // be an issue
+ vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+ {
+ param_named_auto worldViewProj worldviewproj_matrix
+ param_named ambient float4 1 1 1 1
+ }
+ scene_blend dest_colour zero
+ texture_unit
+ {
+ texture RustedMetal.jpg
+ }
+
+ }
+ }
+
+ // This is the fallback which cards which don't have fragment program
+ // support will use
+ // Note that it still requires vertex program support
+ technique
+ {
+ // Base ambient pass
+ pass
+ {
+ // base colours, not needed for rendering, but as information
+ // to lighting pass categorisation routine
+ ambient 1 1 1
+ diffuse 0 0 0
+ specular 0 0 0 0
+ // Really basic vertex program
+ // NB we don't use fixed function here because GL does not like
+ // mixing fixed function and vertex programs, depth fighting can
+ // be an issue
+ vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+ {
+ param_named_auto worldViewProj worldviewproj_matrix
+ param_named_auto ambient ambient_light_colour
+ }
+
+ }
+ // Now do the lighting pass
+ // NB we don't do decal texture here because this is repeated per light
+ pass
+ {
+ // base colours, not needed for rendering, but as information
+ // to lighting pass categorisation routine
+ ambient 0 0 0
+ // do this for each light
+ iteration once_per_light
+
+
+ scene_blend add
+
+ // Vertex program reference
+ vertex_program_ref Examples/BumpMapVP
+ {
+ param_named_auto lightPosition light_position_object_space 0
+ param_named_auto worldViewProj worldviewproj_matrix
+ }
+
+ // Base bump map
+ texture_unit
+ {
+ texture NMBumpsOut.png
+ colour_op replace
+ }
+ // Normalisation cube map, with dot product on bump map
+ texture_unit
+ {
+ cubic_texture nm.png combinedUVW
+ tex_coord_set 1
+ tex_address_mode clamp
+ colour_op_ex dotproduct src_texture src_current
+ colour_op_multipass_fallback dest_colour zero
+ }
+ }
+
+ // Decal pass
+ pass
+ {
+ lighting off
+ // Really basic vertex program
+ // NB we don't use fixed function here because GL does not like
+ // mixing fixed function and vertex programs, depth fighting can
+ // be an issue
+ vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+ {
+ param_named_auto worldViewProj worldviewproj_matrix
+ param_named ambient float4 1 1 1 1
+ }
+ scene_blend dest_colour zero
+ texture_unit
+ {
+ texture RustedMetal.jpg
+ }
+
+ }
+
+ }
+}
+
+// Any number of lights, diffuse and specular
+material Examples/BumpMapping/MultiLightSpecular
+{
+
+ // This is the preferred technique which uses both vertex and
+ // fragment programs, supports coloured lights
+ technique
+ {
+ // Base ambient pass
+ pass
+ {
+ // base colours, not needed for rendering, but as information
+ // to lighting pass categorisation routine
+ ambient 1 1 1
+ diffuse 0 0 0
+ specular 0 0 0 0
+ // Really basic vertex program
+ // NB we don't use fixed function here because GL does not like
+ // mixing fixed function and vertex programs, depth fighting can
+ // be an issue
+ vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+ {
+ param_named_auto worldViewProj worldviewproj_matrix
+ param_named_auto ambient ambient_light_colour
+ }
+
+ }
+ // Now do the lighting pass
+ // NB we don't do decal texture here because this is repeated per light
+ pass
+ {
+ // base colours, not needed for rendering, but as information
+ // to lighting pass categorisation routine
+ ambient 0 0 0
+ // do this for each light
+ iteration once_per_light
+
+
+ scene_blend add
+
+ // Vertex program reference
+ vertex_program_ref Examples/BumpMapVPSpecular
+ {
+ param_named_auto lightPosition light_position_object_space 0
+ param_named_auto eyePosition camera_position_object_space
+ param_named_auto worldViewProj worldviewproj_matrix
+ }
+
+ // Fragment program
+ fragment_program_ref Examples/BumpMapFPSpecular
+ {
+ param_named_auto lightDiffuse light_diffuse_colour 0
+ param_named_auto lightSpecular light_specular_colour 0
+ }
+
+ // Base bump map
+ texture_unit
+ {
+ texture NMBumpsOut.png
+ colour_op replace
+ }
+ // Normalisation cube map
+ texture_unit
+ {
+ cubic_texture nm.png combinedUVW
+ tex_coord_set 1
+ tex_address_mode clamp
+ }
+ // Normalisation cube map #2
+ texture_unit
+ {
+ cubic_texture nm.png combinedUVW
+ tex_coord_set 2
+ tex_address_mode clamp
+ }
+ }
+
+ // Decal pass
+ pass
+ {
+ lighting off
+ // Really basic vertex program
+ // NB we don't use fixed function here because GL does not like
+ // mixing fixed function and vertex programs, depth fighting can
+ // be an issue
+ vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+ {
+ param_named_auto worldViewProj worldviewproj_matrix
+ param_named ambient float4 1 1 1 1
+ }
+ scene_blend dest_colour zero
+ texture_unit
+ {
+ texture RustedMetal.jpg
+ }
+
+ }
+ }
+
+ // This is the fallback which cards which don't have fragment program
+ // support will use, NB does not support specular colour
+ // Note that it still requires vertex program support
+ technique
+ {
+ // Base ambient pass
+ pass
+ {
+ // base colours, not needed for rendering, but as information
+ // to lighting pass categorisation routine
+ ambient 1 1 1
+ diffuse 0 0 0
+ specular 0 0 0 0
+ // Really basic vertex program
+ // NB we don't use fixed function here because GL does not like
+ // mixing fixed function and vertex programs, depth fighting can
+ // be an issue
+ vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+ {
+ param_named_auto worldViewProj worldviewproj_matrix
+ param_named_auto ambient ambient_light_colour
+ }
+
+ }
+ // Now do the lighting pass
+ // NB we don't do decal texture here because this is repeated per light
+ pass
+ {
+ // base colours, not needed for rendering, but as information
+ // to lighting pass categorisation routine
+ ambient 0 0 0
+ // do this for each light
+ iteration once_per_light
+
+
+ scene_blend add
+
+ // Vertex program reference
+ vertex_program_ref Examples/BumpMapVP
+ {
+ param_named_auto lightPosition light_position_object_space 0
+ param_named_auto worldViewProj worldviewproj_matrix
+ }
+
+ // Base bump map
+ texture_unit
+ {
+ texture NMBumpsOut.png
+ colour_op replace
+ }
+ // Normalisation cube map, with dot product on bump map
+ texture_unit
+ {
+ cubic_texture nm.png combinedUVW
+ tex_coord_set 1
+ tex_address_mode clamp
+ colour_op_ex dotproduct src_texture src_current
+ colour_op_multipass_fallback dest_colour zero
+ }
+ }
+
+ // Decal pass
+ pass
+ {
+ lighting off
+ // Really basic vertex program
+ // NB we don't use fixed function here because GL does not like
+ // mixing fixed function and vertex programs, depth fighting can
+ // be an issue
+ vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+ {
+ param_named_auto worldViewProj worldviewproj_matrix
+ param_named ambient float4 1 1 1 1
+ }
+ scene_blend dest_colour zero
+ texture_unit
+ {
+ texture RustedMetal.jpg
+ }
+
+ }
+
+ }
+}
+
+//---------------------------
+// Projective texture section
+//---------------------------
+
+
+vertex_program Examples/TexProjectionVP cg
+{
+ source Example_Projection.cg
+ entry_point generalPurposeProjection_vp
+ profiles vs_1_1 arbvp1
+}
+
+fragment_program Examples/TexProjectionFP cg
+{
+ source Example_Projection.cg
+ entry_point generalPurposeProjection_fp
+ // sorry, ps_1_1 can't do this, fp20 can though
+ profiles ps_2_0 arbfp1 fp20
+}
+
+material Examples/GeneralTexProjection
+{
+ technique
+ {
+ pass
+ {
+
+ vertex_program_ref Examples/TexProjectionVP
+ {
+ param_named_auto worldViewProjMatrix worldviewproj_matrix
+ param_named_auto worldMatrix world_matrix
+ // You'll need to update the tex projection, I suggest using
+ // the Frustum class
+ //param_named_auto texWorldViewProj worldviewproj_matrix
+ }
+ fragment_program_ref Examples/TexProjectionFP
+ {
+ // no params
+ }
+ texture_unit
+ {
+ // Project the OGRE logo
+ texture ogrelogo.png
+ tex_address_mode clamp
+ }
+ }
+
+
+ }
+
+}
+
+//----------------------------
+// Distortion effects
+//----------------------------
+
+vertex_program Examples/FresnelRefractReflectVP cg
+{
+ source Example_Fresnel.cg
+ entry_point main_vp
+ profiles vs_1_1 arbvp1
+}
+vertex_program Examples/FresnelRefractReflectVPold cg
+{
+ source Example_Fresnel.cg
+ entry_point main_vp_old
+ profiles vs_1_1 arbvp1
+}
+
+fragment_program Examples/FresnelRefractReflectFP cg
+{
+ source Example_Fresnel.cg
+ entry_point main_fp
+ // sorry, ps_1_1 and fp20 can't do this
+ profiles ps_2_0 arbfp1
+}
+
+fragment_program Examples/FresnelRefractReflectPS asm
+{
+ source Example_FresnelPS.asm
+ // sorry, only for ps_1_4 :)
+ syntax ps_1_4
+
+}
+
+material Examples/FresnelReflectionRefraction
+{
+ // ps_2_0 / arbfp1
+ technique
+ {
+ pass
+ {
+
+ vertex_program_ref Examples/FresnelRefractReflectVP
+ {
+ param_named_auto worldViewProjMatrix worldviewproj_matrix
+ param_named_auto eyePosition camera_position_object_space
+ param_named_auto timeVal time 0.05
+ param_named scroll float 1
+ param_named scale float 1
+ param_named noise float 1
+ // scroll and noisePos will need updating per frame
+ }
+ fragment_program_ref Examples/FresnelRefractReflectFP
+ {
+ param_named fresnelBias float -0.1
+ param_named fresnelScale float 1.8
+ param_named fresnelPower float 8
+ param_named tintColour float4 0 0.0.05 0.05 1
+ param_named noiseScale float 0.05
+ }
+ // Noise
+ texture_unit
+ {
+ // Perlin noise volume
+ texture waves2.dds
+ // min / mag filtering, no mip
+ filtering linear linear none
+ }
+ // Reflection
+ texture_unit
+ {
+ // Will be filled in at runtime
+ texture Reflection
+ tex_address_mode clamp
+ // needed by ps.1.4
+ tex_coord_set 1
+ }
+ // Refraction
+ texture_unit
+ {
+ // Will be filled in at runtime
+ texture Refraction
+ tex_address_mode clamp
+ // needed by ps.1.4
+ tex_coord_set 2
+ }
+ }
+
+
+ }
+
+ // ATI 8500 +
+ technique
+ {
+ pass
+ {
+ vertex_program_ref Examples/FresnelRefractReflectVPold
+ {
+ param_named_auto worldViewProjMatrix worldviewproj_matrix
+ param_named_auto eyePosition camera_position_object_space
+ param_named fresnelBias float -0.3
+ param_named fresnelScale float 1.4
+ param_named fresnelPower float 8
+ param_named_auto timeVal time_0_1 20
+ param_named scroll float 1
+ param_named scale float 4
+ param_named noise float 1
+ // scroll and noisePos will need updating per frame
+ }
+
+ // for ATI RADEON 8500 - 9200
+ fragment_program_ref Examples/FresnelRefractReflectPS
+ {
+ // distortionRange
+ param_indexed 0 float 0.025
+ // tintColour
+ param_indexed 1 float4 0.05 0.12 0.15 1
+ }
+
+ // Noise
+ texture_unit
+ {
+ // Perlin noise volume
+ texture perlinvolume.dds 3d
+ // min / mag filtering, no mip
+ filtering linear linear none
+ }
+ // Reflection
+ texture_unit
+ {
+ // Will be filled in at runtime
+ texture Reflection
+ tex_address_mode clamp
+ // needed by ps.1.4
+ tex_coord_set 1
+ }
+ // Refraction
+ texture_unit
+ {
+ // Will be filled in at runtime
+ texture Refraction
+ tex_address_mode clamp
+ // needed by ps.1.4
+ tex_coord_set 2
+ }
+ }
+ }
+}
+
+// Normal-mapped Athene statue
+material Examples/Athene/NormalMapped
+{
+
+ // This is the preferred technique which uses both vertex and
+ // fragment programs, supports coloured lights
+ technique
+ {
+ // Base ambient pass
+ pass
+ {
+ // base colours, not needed for rendering, but as information
+ // to lighting pass categorisation routine
+ ambient 1 1 1
+ diffuse 0 0 0
+ specular 0 0 0 0
+ // Really basic vertex program
+ // NB we don't use fixed function here because GL does not like
+ // mixing fixed function and vertex programs, depth fighting can
+ // be an issue
+ vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+ {
+ param_named_auto worldViewProj worldviewproj_matrix
+ param_named_auto ambient ambient_light_colour
+ }
+
+ }
+ // Now do the lighting pass
+ // NB we don't do decal texture here because this is repeated per light
+ pass
+ {
+ // base colours, not needed for rendering, but as information
+ // to lighting pass categorisation routine
+ ambient 0 0 0
+
+ // do this for each light
+ iteration once_per_light
+
+
+ scene_blend add
+
+ // Vertex program reference
+ vertex_program_ref Examples/BumpMapVP
+ {
+ param_named_auto lightPosition light_position_object_space 0
+ param_named_auto worldViewProj worldviewproj_matrix
+ }
+
+ // Fragment program
+ fragment_program_ref Examples/BumpMapFP
+ {
+ param_named_auto lightDiffuse light_diffuse_colour 0
+ }
+
+ // texture shadow receiver program
+ shadow_receiver_vertex_program_ref Examples/BumpMapVPShadowRcv
+ {
+ param_named_auto lightPosition light_position_object_space 0
+ param_named_auto worldViewProj worldviewproj_matrix
+ param_named_auto worldMatrix world_matrix
+ param_named_auto texViewProj texture_viewproj_matrix
+ }
+ // Additive texture shadow receiver program
+ shadow_receiver_fragment_program_ref Examples/BumpMapFPShadowRcv
+ {
+ param_named_auto lightDiffuse light_diffuse_colour 0
+ }
+
+ // Base bump map
+ texture_unit
+ {
+ texture atheneNormalMap.png
+ colour_op replace
+ }
+ // Normalisation cube map
+ texture_unit
+ {
+ cubic_texture nm.png combinedUVW
+ tex_coord_set 1
+ tex_address_mode clamp
+ }
+ }
+
+ // Decal pass
+ pass
+ {
+ // base colours, not needed for rendering, but as information
+ // to lighting pass categorisation routine
+ lighting off
+ // Really basic vertex program
+ // NB we don't use fixed function here because GL does not like
+ // mixing fixed function and vertex programs, depth fighting can
+ // be an issue
+ vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+ {
+ param_named_auto worldViewProj worldviewproj_matrix
+ param_named ambient float4 1 1 1 1
+ }
+ scene_blend dest_colour zero
+ texture_unit
+ {
+ texture egyptrockyfull.jpg
+ }
+
+ }
+ }
+
+ // This is the fallback which cards which don't have fragment program
+ // support will use
+ // Note that it still requires vertex program support
+ technique
+ {
+ // Base ambient pass
+ pass
+ {
+ // base colours, not needed for rendering, but as information
+ // to lighting pass categorisation routine
+ ambient 1 1 1
+ diffuse 0 0 0
+ specular 0 0 0 0
+ // Really basic vertex program
+ // NB we don't use fixed function here because GL does not like
+ // mixing fixed function and vertex programs, depth fighting can
+ // be an issue
+ vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+ {
+ param_named_auto worldViewProj worldviewproj_matrix
+ param_named_auto ambient ambient_light_colour
+ }
+
+ }
+ // Now do the lighting pass
+ // NB we don't do decal texture here because this is repeated per light
+ pass
+ {
+ // base colours, not needed for rendering, but as information
+ // to lighting pass categorisation routine
+ ambient 0 0 0
+ // do this for each light
+ iteration once_per_light
+
+
+ scene_blend add
+
+ // Vertex program reference
+ vertex_program_ref Examples/BumpMapVP
+ {
+ param_named_auto lightPosition light_position_object_space 0
+ param_named_auto worldViewProj worldviewproj_matrix
+ }
+
+ // Base bump map
+ texture_unit
+ {
+ texture atheneNormalMap.png
+ colour_op replace
+ }
+ // Normalisation cube map, with dot product on bump map
+ texture_unit
+ {
+ cubic_texture nm.png combinedUVW
+ tex_coord_set 1
+ tex_address_mode clamp
+ colour_op_ex dotproduct src_texture src_current
+ colour_op_multipass_fallback dest_colour zero
+ }
+ }
+
+ // Decal pass
+ pass
+ {
+ lighting off
+ // Really basic vertex program
+ // NB we don't use fixed function here because GL does not like
+ // mixing fixed function and vertex programs, depth fighting can
+ // be an issue
+ vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+ {
+ param_named_auto worldViewProj worldviewproj_matrix
+ param_named ambient float4 1 1 1 1
+ }
+ scene_blend dest_colour zero
+ texture_unit
+ {
+ texture egyptrockyfull.jpg
+ }
+
+ }
+
+ }
+}
+
+// Basic Athene statue
+material Examples/Athene/Basic
+{
+
+ technique
+ {
+ pass
+ {
+ ambient 0.3 0.3 0.3
+ diffuse 1.0 1.0 0.9
+
+ texture_unit
+ {
+ texture egyptrockyfull.jpg
+ }
+
+ }
+ }
+}
+
+
+// Any number of lights, diffuse and specular
+material Examples/Athene/NormalMappedSpecular
+{
+
+ // This is the preferred technique which uses both vertex and
+ // fragment programs, supports coloured lights
+ technique
+ {
+ // Base ambient pass
+ pass
+ {
+ // base colours, not needed for rendering, but as information
+ // to lighting pass categorisation routine
+ ambient 1 1 1
+ diffuse 0 0 0
+ specular 0 0 0 0
+ // Really basic vertex program
+ // NB we don't use fixed function here because GL does not like
+ // mixing fixed function and vertex programs, depth fighting can
+ // be an issue
+ vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+ {
+ param_named_auto worldViewProj worldviewproj_matrix
+ param_named_auto ambient ambient_light_colour
+ }
+
+ }
+ // Now do the lighting pass
+ // NB we don't do decal texture here because this is repeated per light
+ pass
+ {
+ // base colours, not needed for rendering, but as information
+ // to lighting pass categorisation routine
+ ambient 0 0 0
+ // do this for each light
+ iteration once_per_light
+
+
+ scene_blend add
+
+ // Vertex program reference
+ vertex_program_ref Examples/BumpMapVPSpecular
+ {
+ param_named_auto lightPosition light_position_object_space 0
+ param_named_auto eyePosition camera_position_object_space
+ param_named_auto worldViewProj worldviewproj_matrix
+ }
+
+ // Fragment program
+ fragment_program_ref Examples/BumpMapFPSpecular
+ {
+ param_named_auto lightDiffuse light_diffuse_colour 0
+ param_named_auto lightSpecular light_specular_colour 0
+ }
+
+ // Base bump map
+ texture_unit
+ {
+ texture atheneNormalMap.png
+ colour_op replace
+ }
+ // Normalisation cube map
+ texture_unit
+ {
+ cubic_texture nm.png combinedUVW
+ tex_coord_set 1
+ tex_address_mode clamp
+ }
+ // Normalisation cube map #2
+ texture_unit
+ {
+ cubic_texture nm.png combinedUVW
+ tex_coord_set 2
+ tex_address_mode clamp
+ }
+ }
+
+ // Decal pass
+ pass
+ {
+ lighting off
+ // Really basic vertex program
+ // NB we don't use fixed function here because GL does not like
+ // mixing fixed function and vertex programs, depth fighting can
+ // be an issue
+ vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+ {
+ param_named_auto worldViewProj worldviewproj_matrix
+ param_named ambient float4 1 1 1 1
+ }
+ scene_blend dest_colour zero
+ texture_unit
+ {
+ texture egyptrockyfull.jpg
+ }
+
+ }
+ }
+
+ // This is the fallback which cards which don't have fragment program
+ // support will use, NB does not support specular colour
+ // Note that it still requires vertex program support
+ technique
+ {
+ // Base ambient pass
+ pass
+ {
+ // base colours, not needed for rendering, but as information
+ // to lighting pass categorisation routine
+ ambient 1 1 1
+ diffuse 0 0 0
+ specular 0 0 0 0
+ // Really basic vertex program
+ // NB we don't use fixed function here because GL does not like
+ // mixing fixed function and vertex programs, depth fighting can
+ // be an issue
+ vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+ {
+ param_named_auto worldViewProj worldviewproj_matrix
+ param_named_auto ambient ambient_light_colour
+ }
+
+ }
+ // Now do the lighting pass
+ // NB we don't do decal texture here because this is repeated per light
+ pass
+ {
+ // base colours, not needed for rendering, but as information
+ // to lighting pass categorisation routine
+ ambient 0 0 0
+ // do this for each light
+ iteration once_per_light
+
+
+ scene_blend add
+
+ // Vertex program reference
+ vertex_program_ref Examples/BumpMapVP
+ {
+ param_named_auto lightPosition light_position_object_space 0
+ param_named_auto worldViewProj worldviewproj_matrix
+ }
+
+ // Base bump map
+ texture_unit
+ {
+ texture atheneNormalMap.png
+ colour_op replace
+ }
+ // Normalisation cube map, with dot product on bump map
+ texture_unit
+ {
+ cubic_texture nm.png combinedUVW
+ tex_coord_set 1
+ tex_address_mode clamp
+ colour_op_ex dotproduct src_texture src_current
+ colour_op_multipass_fallback dest_colour zero
+ }
+ }
+
+ // Decal pass
+ pass
+ {
+ lighting off
+ // Really basic vertex program
+ // NB we don't use fixed function here because GL does not like
+ // mixing fixed function and vertex programs, depth fighting can
+ // be an issue
+ vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+ {
+ param_named_auto worldViewProj worldviewproj_matrix
+ param_named ambient float4 1 1 1 1
+ }
+ scene_blend dest_colour zero
+ texture_unit
+ {
+ texture egyptrockyfull.jpg
+ }
+
+ }
+
+ }
+}
+
diff --git a/school/informatik/verkerhssimulation/media/materials/scripts/Examples.compositor b/school/informatik/verkerhssimulation/media/materials/scripts/Examples.compositor
new file mode 100644
index 00000000..5e560162
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/scripts/Examples.compositor
@@ -0,0 +1,592 @@
+// Manuel's bloom
+// Needs a scene-sized rtt, but does only one render of the scene
+compositor Bloom
+{
+ technique
+ {
+ // Temporary textures
+ texture rt0 128 128 PF_A8R8G8B8
+ texture rt1 128 128 PF_A8R8G8B8
+
+ target rt1
+ {
+ // Render output from previous compositor (or original scene)
+ input previous
+ }
+
+ target rt0
+ {
+ // Start with clear texture
+ input none
+ // Vertical blur pass
+ pass render_quad
+ {
+ // Renders a fullscreen quad with a material
+ material Ogre/Compositor/Blur0
+ input 0 rt1
+ }
+ }
+
+ target rt1
+ {
+ // Start with clear texture
+ input none
+ // Horizontal blur pass
+ pass render_quad
+ {
+ // Renders a fullscreen quad with a material
+ material Ogre/Compositor/Blur1
+ input 0 rt0
+ }
+ }
+
+ target_output
+ {
+ // Start with clear output
+ input previous
+ // Draw a fullscreen quad
+ pass render_quad
+ {
+ // Renders a fullscreen quad with a material
+ material Ogre/Compositor/BloomBlend
+ input 0 rt1
+ }
+ }
+ }
+}
+
+compositor Glass
+{
+ technique
+ {
+ texture rt0 target_width target_height PF_R8G8B8
+
+ target rt0 { input previous }
+
+ target_output
+ {
+ // Start with clear output
+ input none
+
+ pass render_quad
+ {
+ material Ogre/Compositor/GlassPass
+ input 0 rt0
+ }
+ }
+ }
+}
+
+compositor "Old TV"
+{
+ technique
+ {
+ texture rt0 target_width target_height PF_R8G8B8
+
+ // render scene to a texture
+ target rt0 { input previous }
+
+ target_output
+ {
+ // Start with clear output
+ input none
+
+ pass render_quad
+ {
+ // convert the previous render target to a black and white image, add some noise, distort it,
+ // then render to scene aligned quad
+ material Ogre/Compositor/OldTV
+ input 0 rt0
+ }
+ }
+ }
+}
+
+
+// Black and white effect
+compositor B&W
+{
+ technique
+ {
+ // Temporary textures
+ texture rt0 target_width target_height PF_A8R8G8B8
+
+ target rt0
+ {
+ // Render output from previous compositor (or original scene)
+ input previous
+ }
+
+ target_output
+ {
+ // Start with clear output
+ input none
+ // Draw a fullscreen quad with the black and white image
+ pass render_quad
+ {
+ // Renders a fullscreen quad with a material
+ material Ogre/Compositor/BlackAndWhite
+ input 0 rt0
+ }
+ }
+ }
+}
+
+//compositor DOF // based on Blur but final pass does depth of field
+//{
+// technique
+// {
+// // Temporary textures
+// texture rt0 target_width target_height PF_A8R8G8B8
+// texture rt1 target_width target_height PF_A8R8G8B8
+//
+// target rt1
+// {
+// // Render output from previous compositor (or original scene)
+// input previous
+// }
+//
+// target rt0
+// {
+// // Start with clear texture
+// input none
+// // Vertical blur pass
+// pass render_quad
+// {
+// // Renders a fullscreen quad with a material
+// material Ogre/Compositor/DOF_Blur0
+// input 0 rt1
+// }
+// }
+//
+// target rt1
+// {
+// // Start with clear texture
+// input none
+// // Horizontal blur pass
+// pass render_quad
+// {
+// // Renders a fullscreen quad with a material
+// material Ogre/Compositor/DOF_Blur1
+// input 0 rt0
+// }
+// }
+//
+// target_output
+// {
+// // Start with clear output
+// input none
+// // Draw a fullscreen quad
+// pass render_quad
+// {
+// // Renders a fullscreen quad with a material
+// material Ogre/Compositor/DOF_Blend
+// input 0 rt0
+// input 1 rt1
+// }
+// }
+// }
+//}
+
+// Embossed (fake bump) effect
+compositor Embossed
+{
+ technique
+ {
+ // Temporary textures
+ texture rt0 target_width target_height PF_A8R8G8B8
+
+ target rt0
+ {
+ // Render output from previous compositor (or original scene)
+ input previous
+ }
+
+ target_output
+ {
+ // Start with clear output
+ input none
+ // Draw a fullscreen quad with the black and white image
+ pass render_quad
+ {
+ // Renders a fullscreen quad with a material
+ material Ogre/Compositor/Embossed
+ input 0 rt0
+ }
+ }
+ }
+}
+
+// SharpenEdges
+compositor Sharpen Edges
+{
+ technique
+ {
+ // Temporary textures
+ texture rt0 target_width target_height PF_A8R8G8B8
+
+ target rt0
+ {
+ // Render output from previous compositor (or original scene)
+ input previous
+ }
+
+ target_output
+ {
+ // Start with clear output
+ input none
+ // Draw a fullscreen quad with the black and white image
+ pass render_quad
+ {
+ // Renders a fullscreen quad with a material
+ material Ogre/Compositor/SharpenEdges
+ input 0 rt0
+ }
+ }
+ }
+}
+
+// Invert
+compositor Invert
+{
+ technique
+ {
+ // Temporary textures
+ texture rt0 target_width target_height PF_A8R8G8B8
+
+ target rt0
+ {
+ // Render output from previous compositor (or original scene)
+ input previous
+ }
+
+ target_output
+ {
+ // Start with clear output
+ input none
+ // Draw a fullscreen quad with the black and white image
+ pass render_quad
+ {
+ // Renders a fullscreen quad with a material
+ material Ogre/Compositor/Invert
+ input 0 rt0
+ }
+ }
+ }
+}
+
+// Posterize
+compositor Posterize
+{
+ technique
+ {
+ // Temporary textures
+ texture rt0 target_width target_height PF_A8R8G8B8
+
+ target rt0
+ {
+ // Render output from previous compositor (or original scene)
+ input previous
+ }
+
+ target_output
+ {
+ // Start with clear output
+ input none
+ // Draw a fullscreen quad with the black and white image
+ pass render_quad
+ {
+ // Renders a fullscreen quad with a material
+ material Ogre/Compositor/Posterize
+ input 0 rt0
+ }
+ }
+ }
+}
+
+// Laplace
+compositor Laplace
+{
+ technique
+ {
+ // Temporary textures
+ texture rt0 target_width target_height PF_A8R8G8B8
+
+ target rt0
+ {
+ // Render output from previous compositor (or original scene)
+ input previous
+ }
+
+ target_output
+ {
+ // Start with clear output
+ input none
+ // Draw a fullscreen quad with the black and white image
+ pass render_quad
+ {
+ // Renders a fullscreen quad with a material
+ material Ogre/Compositor/Laplace
+ input 0 rt0
+ }
+ }
+ }
+}
+
+// Tiling
+compositor Tiling
+{
+ technique
+ {
+ // Temporary textures
+ texture rt0 target_width target_height PF_A8R8G8B8
+
+ target rt0
+ {
+ // Render output from previous compositor (or original scene)
+ input previous
+ }
+
+ target_output
+ {
+ // Start with clear output
+ input none
+ // Draw a fullscreen quad with the black and white image
+ pass render_quad
+ {
+ // Renders a fullscreen quad with a material
+ material Ogre/Compositor/Tiling
+ input 0 rt0
+ }
+ }
+ }
+}
+
+// Old Movie
+compositor Old Movie
+{
+ technique
+ {
+ // Temporary textures
+ texture rt0 target_width target_height PF_A8R8G8B8
+
+ target rt0
+ {
+ // Render output from previous compositor (or original scene)
+ input previous
+ }
+
+ target_output
+ {
+ // Start with clear output
+ input none
+ // Draw a fullscreen quad with the black and white image
+ pass render_quad
+ {
+ // Renders a fullscreen quad with a material
+ material Ogre/Compositor/OldMovie
+ input 0 rt0
+ }
+ }
+ }
+}
+
+// HDR
+compositor HDR
+{
+ // floating point only for now
+ technique
+ {
+ // Temporary textures
+ // Fullsize HDR render target, used as tone mapping source
+ texture rt_full target_width target_height PF_FLOAT16_RGB
+ // Targets used for luminance evaluation (3x3 downsample, point filtering)
+ texture rt_lum0 1 1 PF_FLOAT16_RGB
+ texture rt_lum1 4 4 PF_FLOAT16_RGB
+ texture rt_lum2 16 16 PF_FLOAT16_RGB
+ texture rt_lum3 64 64 PF_FLOAT16_RGB
+ texture rt_lum4 128 128 PF_FLOAT16_RGB
+ // Bright-pass filtered target (tone mapped)
+ texture rt_brightpass 128 128 PF_R8G8B8
+ // Bloom filter targets
+ texture rt_bloom0 128 128 PF_R8G8B8
+ texture rt_bloom1 128 128 PF_R8G8B8
+
+
+ target rt_full
+ {
+ // No input, render differently
+ input none
+
+ // Use float target HDR material scheme (unclamped shaders)
+ material_scheme HDR
+
+ pass clear
+ {
+ }
+
+ pass render_scene
+ {
+ }
+
+ }
+
+ // Downsample the original HDR scene to extract luminence value
+ target rt_lum4
+ {
+ input none
+ pass render_quad
+ {
+ // Downsample using a 2x2 filter and convert to greyscale
+ material Ogre/Compositor/HDR/Downsample2x2Luminence
+ input 0 rt_full
+ identifier 994
+ }
+ }
+ target rt_lum3
+ {
+ input none
+ pass render_quad
+ {
+ // Downsample using a 3x3 filter
+ material Ogre/Compositor/HDR/Downsample3x3
+ input 0 rt_lum4
+ identifier 993
+ }
+ }
+ target rt_lum2
+ {
+ input none
+ pass render_quad
+ {
+ // Downsample using a 3x3 filter
+ material Ogre/Compositor/HDR/Downsample3x3
+ input 0 rt_lum3
+ identifier 992
+ }
+ }
+ target rt_lum1
+ {
+ input none
+ pass render_quad
+ {
+ // Downsample using a 3x3 filter
+ material Ogre/Compositor/HDR/Downsample3x3
+ input 0 rt_lum2
+ identifier 991
+ }
+ }
+ target rt_lum0
+ {
+ input none
+ pass render_quad
+ {
+ // Downsample using a 3x3 filter
+ material Ogre/Compositor/HDR/Downsample3x3
+ input 0 rt_lum1
+ identifier 990
+ }
+ }
+
+
+ target rt_brightpass
+ {
+ input none
+ pass render_quad
+ {
+ // Downsample using a 3x3 filter, hi-pass and tone map
+ material Ogre/Compositor/HDR/Downsample3x3Brightpass
+ input 0 rt_full
+ input 1 rt_lum0
+ identifier 800
+ }
+ }
+
+ target rt_bloom1
+ {
+ input none
+ pass render_quad
+ {
+ // Blur horizontally
+ material Ogre/Compositor/HDR/GaussianBloom
+ input 0 rt_brightpass
+ identifier 701
+ }
+ }
+ target rt_bloom0
+ {
+ input none
+ pass render_quad
+ {
+ // Blur horizontally
+ material Ogre/Compositor/HDR/GaussianBloom
+ input 0 rt_bloom1
+ identifier 700
+ }
+ }
+
+
+ // Final output combines tone mapping of the original scene, with an
+ // exposure setting passed in as a GPU parameter, and an additive bloom
+ // effect
+ target_output
+ {
+ input none
+ pass render_quad
+ {
+ material Ogre/Compositor/HDR/ToneMapping
+ input 0 rt_full
+ input 1 rt_bloom0
+ input 2 rt_lum0
+ }
+ }
+
+
+ }
+
+}
+
+
+// Gaussian blur effect
+compositor Gaussian Blur
+{
+ technique
+ {
+ // Temporary textures
+ texture rt0 target_width target_height PF_A8R8G8B8
+ texture rt1 target_width target_height PF_A8R8G8B8
+
+ target rt0
+ {
+ // Render output from previous compositor (or original scene)
+ input previous
+ }
+
+ target rt1
+ {
+ // Blur horizontally
+ input none
+ pass render_quad
+ {
+ material Ogre/Compositor/HDR/GaussianBloom
+ input 0 rt0
+ identifier 700
+ }
+ }
+
+ target_output
+ {
+ // Start with clear output
+ input none
+ // Blur vertically
+ pass render_quad
+ {
+ // Renders a fullscreen quad with a material
+ material Ogre/Compositor/HDR/GaussianBloom
+ input 0 rt1
+ identifier 701
+ }
+ }
+ }
+}
+
diff --git a/school/informatik/verkerhssimulation/media/materials/scripts/Examples.program b/school/informatik/verkerhssimulation/media/materials/scripts/Examples.program
new file mode 100644
index 00000000..a817d833
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/scripts/Examples.program
@@ -0,0 +1,158 @@
+//---------------------------------------------------
+// This file includes a number of basic GPU programs
+// for use in many materials.
+//---------------------------------------------------
+
+
+// A really basic ambient pass program, support for one texture coodinate set
+vertex_program Ogre/BasicVertexPrograms/AmbientOneTexture cg
+{
+ source Example_Basic.cg
+ entry_point ambientOneTexture_vp
+ profiles vs_1_1 arbvp1
+
+ default_params
+ {
+ param_named_auto worldViewProj worldviewproj_matrix
+ param_named_auto ambient ambient_light_colour
+ }
+
+}
+// A really basic ambient pass program, support for one texture coodinate set
+vertex_program Ogre/BasicVertexPrograms/AmbientOneTextureHLSL hlsl
+{
+ source Example_Basic.hlsl
+ entry_point ambientOneTexture_vp
+ target vs_1_1
+
+ default_params
+ {
+ param_named_auto worldViewProj worldviewproj_matrix
+ param_named_auto ambient ambient_light_colour
+ }
+}
+// A really basic ambient pass program, support for one texture coodinate set
+vertex_program Ogre/BasicVertexPrograms/AmbientOneTextureGLSL glsl
+{
+ source AmbientOneTexture.glsl
+
+ default_params
+ {
+ param_named_auto ambient ambient_light_colour
+ }
+}
+
+vertex_program Ogre/BasicVertexPrograms/AmbientOneTextureUnified unified
+{
+ delegate Ogre/BasicVertexPrograms/AmbientOneTextureGLSL
+ delegate Ogre/BasicVertexPrograms/AmbientOneTextureHLSL
+}
+
+
+// Same as below, but for use when rendering texture shadows
+vertex_program Ogre/HardwareSkinningOneWeightShadowCaster cg
+{
+ source Example_Basic.cg
+ entry_point hardwareSkinningOneWeightCaster_vp
+ profiles vs_1_1 arbvp1
+ includes_skeletal_animation true
+}
+// Basic hardware skinning using one indexed weight per vertex
+vertex_program Ogre/HardwareSkinningOneWeight cg
+{
+ source Example_Basic.cg
+ entry_point hardwareSkinningOneWeight_vp
+ profiles vs_1_1 arbvp1
+ includes_skeletal_animation true
+}
+// Same as below, but for use when rendering texture shadows
+vertex_program Ogre/HardwareSkinningTwoWeightsShadowCasterCg cg
+{
+ source Example_Basic.cg
+ entry_point hardwareSkinningTwoWeightsCaster_vp
+ profiles vs_1_1 arbvp1
+ includes_skeletal_animation true
+}
+
+vertex_program Ogre/HardwareSkinningTwoWeightsShadowCasterGLSL glsl
+{
+ source skinningTwoWeightsShadowCasterVp.glsl
+ includes_skeletal_animation true
+}
+
+vertex_program Ogre/HardwareSkinningTwoWeightsShadowCaster unified
+{
+ delegate Ogre/HardwareSkinningTwoWeightsShadowCasterGLSL
+ delegate Ogre/HardwareSkinningTwoWeightsShadowCasterCg
+}
+
+// Basic hardware skinning using two indexed weights per vertex
+vertex_program Ogre/HardwareSkinningTwoWeightsCg cg
+{
+ source Example_Basic.cg
+ entry_point hardwareSkinningTwoWeights_vp
+ profiles vs_1_1 arbvp1
+ includes_skeletal_animation true
+}
+
+vertex_program Ogre/HardwareSkinningTwoWeightsGLSL glsl
+{
+ source skinningTwoWeightsVp.glsl
+ includes_skeletal_animation true
+}
+
+vertex_program Ogre/HardwareSkinningTwoWeights unified
+{
+ delegate Ogre/HardwareSkinningTwoWeightsGLSL
+ delegate Ogre/HardwareSkinningTwoWeightsCg
+
+ default_params
+ {
+ param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+ param_named_auto viewProjectionMatrix viewproj_matrix
+ param_named_auto lightPos[0] light_position 0
+ param_named_auto lightPos[1] light_position 1
+ param_named_auto lightDiffuseColour[0] light_diffuse_colour 0
+ param_named_auto lightDiffuseColour[1] light_diffuse_colour 1
+ }
+}
+
+// Basic hardware skinning using four indexed weights per vertex
+vertex_program Ogre/HardwareSkinningFourWeights cg
+{
+ source Example_Basic.cg
+ entry_point hardwareSkinningFourWeights_vp
+ profiles vs_1_1 arbvp1
+ includes_skeletal_animation true
+
+}
+// Basic hardware morph animation
+vertex_program Ogre/HardwareMorphAnimation cg
+{
+ source Example_Basic.cg
+ entry_point hardwareMorphAnimation
+ profiles vs_1_1 arbvp1
+
+ includes_morph_animation true
+ default_params
+ {
+ param_named_auto worldViewProj worldviewproj_matrix
+ param_named_auto anim_t animation_parametric
+ }
+}
+// Basic hardware pose animation supporting 2 active poses
+vertex_program Ogre/HardwarePoseAnimation cg
+{
+ source Example_Basic.cg
+ entry_point hardwarePoseAnimation
+ profiles vs_1_1 arbvp1
+
+ includes_pose_animation 2
+ default_params
+ {
+ param_named_auto worldViewProj worldviewproj_matrix
+ param_named_auto anim_t animation_parametric
+ }
+}
+
+
diff --git a/school/informatik/verkerhssimulation/media/materials/scripts/Glass.material b/school/informatik/verkerhssimulation/media/materials/scripts/Glass.material
new file mode 100644
index 00000000..457d5b42
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/scripts/Glass.material
@@ -0,0 +1,40 @@
+fragment_program Ogre/Compositor/GlassFP cg
+{
+ source GlassFP.cg
+ entry_point main_ps
+ profiles ps_2_0 arbfp1
+}
+
+material Ogre/Compositor/GlassPass
+{
+ technique
+ {
+ pass
+ {
+ depth_check off
+
+ vertex_program_ref Ogre/Compositor/StdQuad_Cg_vp
+ {
+ }
+
+ fragment_program_ref Ogre/Compositor/GlassFP
+ {
+ }
+
+ texture_unit RT
+ {
+ tex_coord_set 0
+ tex_address_mode clamp
+ filtering linear linear linear
+ }
+
+ texture_unit
+ {
+ texture WaterNormal1.tga 2d
+ tex_coord_set 1
+ //tex_address_mode clamp
+ filtering linear linear linear
+ }
+ }
+ }
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/scripts/HeatVision.material b/school/informatik/verkerhssimulation/media/materials/scripts/HeatVision.material
new file mode 100644
index 00000000..eb6cdb4f
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/scripts/HeatVision.material
@@ -0,0 +1,209 @@
+///////////////////////////////////
+// PASS 0
+// HEAT CASTERS PASS
+///////////////////////////////////
+
+vertex_program Fury/HeatVision/HeatCaster_vp cg
+{
+ source HeatVision.cg
+ entry_point HeatCaster_vp
+ profiles vs_1_1 arbvp1
+}
+
+fragment_program Fury/HeatVision/HeatCaster_fp cg
+{
+ source HeatVision.cg
+ entry_point HeatCaster_fp
+ profiles ps_2_0 arbfp1
+}
+
+material Fury/HeatVision/HeatCaster
+{
+ technique
+ {
+ pass
+ {
+ vertex_program_ref Fury/HeatVision/HeatCaster_vp
+ {
+ param_named_auto eyePosition camera_position_object_space
+ param_named_auto worldViewProj worldviewproj_matrix
+ }
+
+ fragment_program_ref Fury/HeatVision/HeatCaster_fp
+ {
+ }
+ }
+ }
+}
+
+///////////////////////////////////
+// PASS 0
+// HEAT CASTERS PASS
+///////////////////////////////////
+
+vertex_program Fury/HeatVision/ColdCaster_vp cg
+{
+ source HeatVision.cg
+ entry_point ColdCaster_vp
+ profiles vs_1_1 arbvp1
+}
+
+fragment_program Fury/HeatVision/ColdCaster_fp cg
+{
+ source HeatVision.cg
+ entry_point ColdCaster_fp
+ profiles ps_2_0 arbfp1
+}
+
+material Fury/HeatVision/ColdCaster
+{
+ technique
+ {
+ pass
+ {
+ vertex_program_ref Fury/HeatVision/ColdCaster_vp
+ {
+ param_named_auto eyePosition camera_position_object_space
+ param_named_auto worldViewProj worldviewproj_matrix
+ }
+
+ fragment_program_ref Fury/HeatVision/ColdCaster_fp
+ {
+ }
+ }
+ }
+}
+
+///////////////////////////////////
+// PASS 1
+// LIGHT TO HEAT CONVERSION PASS
+///////////////////////////////////
+
+vertex_program Fury/HeatVision/LightToHeat_vp cg
+{
+ source HeatVision.cg
+ entry_point LightToHeat_vp
+ profiles vs_1_1 arbvp1
+
+ default_params
+ {
+ param_named_auto flipping render_target_flipping
+ }
+}
+
+fragment_program Fury/HeatVision/LightToHeat_fp cg
+{
+ source HeatVision.cg
+ entry_point LightToHeat_fp
+ profiles ps_2_0 arbfp1
+}
+
+material Fury/HeatVision/LightToHeat
+{
+ technique
+ {
+ // pass 1
+ pass
+ {
+ cull_hardware none
+ cull_software none
+ depth_func always_pass
+
+ vertex_program_ref Fury/HeatVision/LightToHeat_vp
+ {
+ }
+
+ fragment_program_ref Fury/HeatVision/LightToHeat_fp
+ {
+ // these should be *really* random!
+ param_named random_fractions float4 0.3 0.7 0 0
+
+ param_named depth_modulator float4 0.6 0 0 0
+
+ // this one can be fixed
+ param_named heatBiasScale float4 0.0 1.0 0 0
+ }
+
+ // INPUT (from scene, where entities has "Fury/HeatVision/Caster" material for heat emanation)
+ texture_unit
+ {
+ tex_coord_set 0
+ filtering linear linear none
+ tex_address_mode clamp
+ }
+
+ // Noise map
+ texture_unit
+ {
+ texture HeatNoise.tga
+ tex_coord_set 0
+ }
+
+ // heat conversion texture
+ texture_unit
+ {
+ texture HeatLookup.tga
+ tex_coord_set 0
+ filtering point point none
+ }
+ }
+ }
+
+}
+
+
+///////////////////////////////////
+// PASS 2
+// BLUR PASS
+///////////////////////////////////
+
+vertex_program Fury/HeatVision/Blur_vp cg
+{
+ source HeatVision.cg
+ entry_point Blur_vp
+ profiles vs_1_1 arbvp1
+
+ default_params
+ {
+ param_named_auto flipping render_target_flipping
+ }
+}
+
+fragment_program Fury/HeatVision/Blur_fp cg
+{
+ source HeatVision.cg
+ entry_point Blur_fp
+ profiles ps_2_0 arbfp1
+}
+
+material Fury/HeatVision/Blur
+{
+ technique
+ {
+ // pass 1
+ pass
+ {
+ cull_hardware none
+ cull_software none
+ depth_func always_pass
+
+ vertex_program_ref Fury/HeatVision/Blur_vp
+ {
+ }
+
+ fragment_program_ref Fury/HeatVision/Blur_fp
+ {
+ param_named blurAmount float4 0.5 0 0 0
+ }
+
+ // INPUT (from previous)
+ texture_unit
+ {
+ texture Input
+ tex_coord_set 0
+ filtering linear linear none
+ tex_address_mode clamp
+ }
+ }
+ }
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/scripts/Hurt.material b/school/informatik/verkerhssimulation/media/materials/scripts/Hurt.material
new file mode 100644
index 00000000..e70ab4de
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/scripts/Hurt.material
@@ -0,0 +1,18 @@
+/// Just a simple red quad blended over the scene
+material RedQuad
+{
+ technique
+ {
+ pass
+ {
+ lighting on
+ diffuse 0.0 0.0 0.0 0.5
+ specular 0.0 0.0 0.0 1.0
+ ambient 0.0 0.0 0.0
+ emissive 1.0 0.0 0.0
+ cull_hardware none
+ depth_check off
+ scene_blend alpha_blend
+ }
+ }
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/scripts/Invert.material b/school/informatik/verkerhssimulation/media/materials/scripts/Invert.material
new file mode 100644
index 00000000..c04abdd3
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/scripts/Invert.material
@@ -0,0 +1,36 @@
+fragment_program Ogre/Compositor/InvertFP cg
+{
+ source InvertFP.cg
+ entry_point Invert_ps
+ profiles ps_2_0 arbfp1
+}
+
+material Ogre/Compositor/Invert
+{
+ technique
+ {
+
+ pass
+ {
+ cull_hardware none
+ cull_software none
+ depth_func always_pass
+
+ vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp
+ {
+ }
+
+ fragment_program_ref Ogre/Compositor/InvertFP
+ {
+ }
+
+ texture_unit RT
+ {
+ tex_coord_set 0
+ tex_address_mode clamp
+ filtering trilinear
+ }
+
+ }
+ }
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/scripts/Laplace.material b/school/informatik/verkerhssimulation/media/materials/scripts/Laplace.material
new file mode 100644
index 00000000..7b4615d7
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/scripts/Laplace.material
@@ -0,0 +1,39 @@
+fragment_program Ogre/Compositor/LaplaceFP cg
+{
+ source LaplaceFP.cg
+ entry_point Laplace_ps
+ profiles ps_2_0 arbfp1
+}
+
+material Ogre/Compositor/Laplace
+{
+ technique
+ {
+
+ pass
+ {
+ cull_hardware none
+ cull_software none
+ depth_func always_pass
+
+ vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp
+ {
+ }
+
+ fragment_program_ref Ogre/Compositor/LaplaceFP
+ {
+ param_named pixelSize float 0.0031
+ param_named scale float 1.0
+ }
+
+
+ texture_unit RT
+ {
+ tex_coord_set 0
+ tex_address_mode clamp
+ filtering trilinear
+ }
+
+ }
+ }
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/scripts/MotionBlur.material b/school/informatik/verkerhssimulation/media/materials/scripts/MotionBlur.material
new file mode 100644
index 00000000..05c6f3e5
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/scripts/MotionBlur.material
@@ -0,0 +1,84 @@
+fragment_program Ogre/Compositor/Combine_fp cg
+{
+ source Combine_fp.cg
+ profiles ps_2_0 arbfp1
+ entry_point Combine_fp
+
+ default_params
+ {
+ param_named blur float 0.8
+ }
+}
+
+material Ogre/Compositor/Combine
+{
+ technique
+ {
+ pass
+ {
+ depth_check off
+
+ fragment_program_ref Ogre/Compositor/Combine_fp
+ {
+ }
+
+ vertex_program_ref Ogre/Compositor/StdQuad_Cg_vp
+ {
+ }
+
+ texture_unit RT
+ {
+ tex_address_mode clamp
+ filtering linear linear none
+ tex_coord_set 0
+ }
+
+ texture_unit SUM
+ {
+ tex_address_mode clamp
+ filtering linear linear none
+ tex_coord_set 0
+ }
+ }
+ }
+}
+
+material Ogre/Compositor/Copyback
+{
+ technique
+ {
+ pass
+ {
+ lighting off
+ depth_check off
+
+ texture_unit Temp
+ {
+ tex_address_mode clamp
+ filtering linear linear none
+ colour_op replace
+ tex_coord_set 0
+ }
+ }
+ }
+}
+
+material Ogre/Compositor/MotionBlur
+{
+ technique
+ {
+ pass
+ {
+ lighting off
+ depth_check off
+
+ texture_unit Sum
+ {
+ tex_address_mode clamp
+ filtering linear linear none
+ colour_op replace
+ tex_coord_set 0
+ }
+ }
+ }
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/scripts/Ocean.controls b/school/informatik/verkerhssimulation/media/materials/scripts/Ocean.controls
new file mode 100644
index 00000000..07f2481a
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/scripts/Ocean.controls
@@ -0,0 +1,90 @@
+[1. Ocean2 Cg]
+material = Ocean2_Cg
+control = Wavelet Scale, BumpScale, GPU_VERTEX, 0, 2, 0
+control = Texture Scale X, textureScale, GPU_VERTEX, 0, 40, 0
+control = Texture Scale Y, textureScale, GPU_VERTEX, 0, 40, 1
+control = Wavelet Speed X, bumpSpeed, GPU_VERTEX, -0.1, 0.1, 0
+control = Wavelet Speed Y, bumpSpeed, GPU_VERTEX, -0.1, 0.1, 1
+control = Wave Frequency, waveFreq, GPU_VERTEX, 0, 0.05, 0
+control = Wave Amplitude, waveAmp, GPU_VERTEX, 0, 25, 0
+
+control = Deep Color [Red], deepColor, GPU_FRAGMENT, 0, 1, 0
+control = Deep Color [Green], deepColor, GPU_FRAGMENT, 0, 1, 1
+control = Deep Color [Blue], deepColor, GPU_FRAGMENT, 0, 1, 2
+
+control = Shallow Color [Red], shallowColor, GPU_FRAGMENT, 0, 1, 0
+control = Shallow Color [Green], shallowColor, GPU_FRAGMENT, 0, 1, 1
+control = Shallow Color [Blue], shallowColor, GPU_FRAGMENT, 0, 1, 2
+
+control = Reflection Color [Red], reflectionColor, GPU_FRAGMENT, 0, 1, 0
+control = Reflection Color [Green], reflectionColor, GPU_FRAGMENT, 0, 1, 1
+control = Reflection Color [Blue], reflectionColor, GPU_FRAGMENT, 0, 1, 2
+
+control = Reflection Amount, reflectionAmount, GPU_FRAGMENT, 0, 1, 0
+control = Reflection Blur, reflectionBlur, GPU_FRAGMENT, 0, 8, 0
+control = Water Amount, waterAmount, GPU_FRAGMENT, 0, 1, 0
+control = Fresnel Power, fresnelPower, GPU_FRAGMENT, 0, 10, 0
+control = Fresnel Bias, fresnelBias, GPU_FRAGMENT, 0, 1, 0
+control = HDR Mulitplier, hdrMultiplier, GPU_FRAGMENT, 0, 2, 0
+
+[1a. Ocean2 HLSL/GLSL]
+material = Ocean2_HLSL_GLSL
+control = Wavelet Scale, BumpScale, GPU_VERTEX, 0, 2, 0
+control = Texture Scale X, textureScale, GPU_VERTEX, 0, 40, 0
+control = Texture Scale Y, textureScale, GPU_VERTEX, 0, 40, 1
+control = Wavelet Speed X, bumpSpeed, GPU_VERTEX, -0.1, 0.1, 0
+control = Wavelet Speed Y, bumpSpeed, GPU_VERTEX, -0.1, 0.1, 1
+control = Wave Frequency, waveFreq, GPU_VERTEX, 0, 0.05, 0
+control = Wave Amplitude, waveAmp, GPU_VERTEX, 0, 25, 0
+
+control = Deep Color [Red], deepColor, GPU_FRAGMENT, 0, 1, 0
+control = Deep Color [Green], deepColor, GPU_FRAGMENT, 0, 1, 1
+control = Deep Color [Blue], deepColor, GPU_FRAGMENT, 0, 1, 2
+
+control = Shallow Color [Red], shallowColor, GPU_FRAGMENT, 0, 1, 0
+control = Shallow Color [Green], shallowColor, GPU_FRAGMENT, 0, 1, 1
+control = Shallow Color [Blue], shallowColor, GPU_FRAGMENT, 0, 1, 2
+
+control = Reflection Color [Red], reflectionColor, GPU_FRAGMENT, 0, 1, 0
+control = Reflection Color [Green], reflectionColor, GPU_FRAGMENT, 0, 1, 1
+control = Reflection Color [Blue], reflectionColor, GPU_FRAGMENT, 0, 1, 2
+
+control = Reflection Amount, reflectionAmount, GPU_FRAGMENT, 0, 1, 0
+control = Reflection Blur, reflectionBlur, GPU_FRAGMENT, 0, 8, 0
+control = Water Amount, waterAmount, GPU_FRAGMENT, 0, 1, 0
+control = Fresnel Power, fresnelPower, GPU_FRAGMENT, 0, 10, 0
+control = Fresnel Bias, fresnelBias, GPU_FRAGMENT, 0, 1, 0
+control = HDR Mulitplier, hdrMultiplier, GPU_FRAGMENT, 0, 2, 0
+
+[2. Ocean1 HLSL/GLSL]
+material = OceanHLSL_GLSL
+control = scale x, scale, GPU_VERTEX, 0, 0.1, 0
+control = scale y, scale, GPU_VERTEX, 0, 0.1, 1
+control = scale z, scale, GPU_VERTEX, 0, 0.1, 2
+control = Wave Speed X, waveSpeed, GPU_VERTEX, 0, 1, 0
+control = Wave Speed Y, waveSpeed, GPU_VERTEX, 0, 1, 1
+control = Noise Speed, noiseSpeed, GPU_VERTEX, 0, 1, 0
+
+control = Fade Bias, fadeBias, GPU_FRAGMENT, 0, 1, 0
+control = Fade Exponent, fadeExp, GPU_FRAGMENT, 0, 20, 0
+control = Water Color (r), waterColor, GPU_FRAGMENT, 0, 1, 0
+control = Water Color (g), waterColor, GPU_FRAGMENT, 0, 1, 1
+control = Water Color (b), waterColor, GPU_FRAGMENT, 0, 1, 2
+
+[3. Ocean1 Cg]
+material = OceanCg
+control = scale x, scale, GPU_VERTEX, 0, 0.1, 0
+control = scale y, scale, GPU_VERTEX, 0, 0.1, 1
+control = scale z, scale, GPU_VERTEX, 0, 0.1, 2
+control = Wave Speed X, waveSpeed, GPU_VERTEX, 0, 1, 0
+control = Wave Speed Y, waveSpeed, GPU_VERTEX, 0, 1, 1
+control = Noise Speed, noiseSpeed, GPU_VERTEX, 0, 1, 0
+
+control = Fade Bias, fadeBias, GPU_FRAGMENT, 0, 1, 0
+control = Fade Exponent, fadeExp, GPU_FRAGMENT, 0, 20, 0
+control = Water Color (r), waterColor, GPU_FRAGMENT, 0, 1, 0
+control = Water Color (g), waterColor, GPU_FRAGMENT, 0, 1, 1
+control = Water Color (b), waterColor, GPU_FRAGMENT, 0, 1, 2
+
+
+
diff --git a/school/informatik/verkerhssimulation/media/materials/scripts/Ocean.material b/school/informatik/verkerhssimulation/media/materials/scripts/Ocean.material
new file mode 100644
index 00000000..568aff91
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/scripts/Ocean.material
@@ -0,0 +1,427 @@
+vertex_program HLSL/OceanVS hlsl
+{
+ source oceanHLSL_Cg.vert
+ entry_point main
+ target vs_1_1
+
+
+ default_params
+ {
+ param_named_auto worldViewProj_matrix worldviewproj_matrix
+ param_named_auto eyePosition camera_position_object_space
+ param_named scale float3 0.012 0.005 0.03
+ param_named_auto time_0_X time_0_x 100.0
+ }
+}
+
+fragment_program HLSL/OceanFS hlsl
+{
+ source oceanHLSL_Cg.frag
+ entry_point main
+ target ps_2_0
+
+}
+
+vertex_program GLSL/OceanVS glsl
+{
+ source oceanGLSL.vert
+
+ default_params
+ {
+ param_named_auto eyePosition camera_position_object_space
+ param_named scale float3 0.012 0.005 0.03
+ param_named_auto time_0_X time_0_x 100.0
+ }
+}
+
+fragment_program GLSL/OceanFS glsl
+{
+ source oceanGLSL.frag
+
+ default_params
+ {
+ param_named Noise int 0
+ param_named skyBox int 1
+ }
+}
+
+material OceanHLSL_GLSL
+{
+ technique
+ {
+ pass
+ {
+ vertex_program_ref HLSL/OceanVS
+ {
+ param_named waveSpeed float2 0.0 0.168
+ param_named noiseSpeed float 0.155
+ }
+
+ fragment_program_ref HLSL/OceanFS
+ {
+ param_named fadeBias float 0.336
+ param_named fadeExp float 5.546
+ param_named waterColor float4 0.0 0.244 0.395 1.0
+ }
+
+ texture_unit
+ {
+ texture NoiseVolume.dds 3d
+ tex_coord_set 0
+ filtering linear linear none
+ }
+
+ texture_unit
+ {
+ cubic_texture morning.jpg combinedUVW
+ tex_address_mode clamp
+ tex_coord_set 1
+ }
+
+ }
+
+ }
+
+ technique
+ {
+ pass
+ {
+ vertex_program_ref GLSL/OceanVS
+ {
+ param_named waveSpeed float2 0.0 0.168
+ param_named noiseSpeed float 0.155
+ }
+
+ fragment_program_ref GLSL/OceanFS
+ {
+ param_named fadeBias float 0.336
+ param_named fadeExp float 5.546
+ param_named waterColor float4 0.0 0.244 0.395 1.0
+ }
+
+ texture_unit
+ {
+ texture NoiseVolume.dds 3d
+ tex_coord_set 0
+ filtering linear linear none
+ tex_address_mode wrap
+ }
+
+ texture_unit
+ {
+ cubic_texture morning.jpg combinedUVW
+ tex_address_mode clamp
+ tex_coord_set 1
+ }
+
+ }
+
+ }
+
+}
+
+
+vertex_program Cg/OceanVS cg
+{
+ source oceanHLSL_Cg.vert
+ entry_point main
+ profiles vs_1_1 arbvp1
+
+
+ default_params
+ {
+ param_named_auto worldViewProj_matrix worldviewproj_matrix
+ param_named_auto eyePosition camera_position_object_space
+ param_named scale float3 0.012 0.005 0.03
+ param_named_auto time_0_X time_0_x 100.0
+ }
+}
+
+fragment_program Cg/OceanFS cg
+{
+ source oceanHLSL_Cg.frag
+ entry_point main
+ profiles ps_2_0 arbfp1
+
+}
+
+material OceanCg
+{
+ technique
+ {
+ pass
+ {
+ vertex_program_ref Cg/OceanVS
+ {
+ param_named waveSpeed float2 0.0 0.168
+ param_named noiseSpeed float 0.155
+ }
+
+ fragment_program_ref Cg/OceanFS
+ {
+ param_named fadeBias float 0.336
+ param_named fadeExp float 5.546
+ param_named waterColor float4 0.0 0.244 0.395 1.0
+ }
+
+ texture_unit
+ {
+ texture NoiseVolume.dds 3d
+ tex_coord_set 0
+ filtering linear linear none
+ }
+
+ texture_unit
+ {
+ cubic_texture morning.jpg combinedUVW
+ tex_address_mode clamp
+ tex_coord_set 1
+ }
+
+ }
+
+ }
+}
+
+
+vertex_program Cg/Ocean2VS cg
+{
+ source Ocean2HLSL_Cg.vert
+ entry_point main
+ profiles vs_1_1 arbvp1
+
+
+ default_params
+ {
+ param_named_auto WorldViewProj worldviewproj_matrix
+ param_named_auto eyePosition camera_position_object_space
+ }
+}
+
+fragment_program Cg/Ocean2FS cg
+{
+ source Ocean2HLSL_Cg.frag
+ entry_point main
+ profiles ps_2_0 arbfp1
+
+}
+
+material Ocean2_Cg
+{
+ technique
+ {
+ pass
+ {
+ vertex_program_ref Cg/Ocean2VS
+ {
+ param_named BumpScale float 0.2
+ param_named textureScale float2 25 26
+ param_named bumpSpeed float2 0.015 0.005
+ param_named_auto time time_0_x 100.0
+ param_named waveFreq float 0.028
+ param_named waveAmp float 1.8
+ }
+
+ fragment_program_ref Cg/Ocean2FS
+ {
+ param_named deepColor float4 0 0.3 0.5 1.0
+ param_named shallowColor float4 0 1 1 1.0
+ param_named reflectionColor float4 0.95 1 1 1.0
+ param_named reflectionAmount float 1.0
+ param_named reflectionBlur float 0.0
+ param_named waterAmount float 0.3
+ param_named fresnelPower float 5.0
+ param_named fresnelBias float 0.328
+ param_named hdrMultiplier float 0.471
+ }
+
+ texture_unit
+ {
+ texture waves2.dds
+ tex_coord_set 0
+ filtering linear linear linear
+ }
+
+ texture_unit
+ {
+ cubic_texture morning.jpg combinedUVW
+ tex_address_mode clamp
+ tex_coord_set 1
+ filtering linear linear linear
+ }
+
+ }
+
+ }
+}
+
+
+vertex_program HLSL/Ocean2VS hlsl
+{
+ source Ocean2HLSL_Cg.vert
+ entry_point main
+ target vs_1_1
+
+
+ default_params
+ {
+ param_named_auto WorldViewProj worldviewproj_matrix
+ param_named_auto eyePosition camera_position_object_space
+ }
+}
+
+fragment_program HLSL/Ocean2FS hlsl
+{
+ source Ocean2HLSL_Cg.frag
+ entry_point main
+ target ps_2_0
+
+}
+
+vertex_program GLSL/Ocean2VS glsl
+{
+ source Ocean2GLSL.vert
+
+}
+
+fragment_program GLSL/Ocean2FS glsl
+{
+ source Ocean2GLSL.frag
+}
+
+material Ocean2_HLSL_GLSL
+{
+ technique HLSL
+ {
+ pass
+ {
+ vertex_program_ref HLSL/Ocean2VS
+ {
+ param_named BumpScale float 0.2
+ param_named textureScale float2 25 26
+ param_named bumpSpeed float2 0.015 0.005
+ param_named_auto time time_0_x 100.0
+ param_named waveFreq float 0.028
+ param_named waveAmp float 1.8
+ }
+
+ fragment_program_ref HLSL/Ocean2FS
+ {
+ param_named deepColor float4 0 0.3 0.5 1.0
+ param_named shallowColor float4 0 1 1 1.0
+ param_named reflectionColor float4 0.95 1 1 1.0
+ param_named reflectionAmount float 1.0
+ param_named reflectionBlur float 0.0
+ param_named waterAmount float 0.3
+ param_named fresnelPower float 5.0
+ param_named fresnelBias float 0.328
+ param_named hdrMultiplier float 0.471
+ }
+
+ texture_unit
+ {
+ texture waves2.dds
+ tex_coord_set 0
+ filtering linear linear linear
+ }
+
+ texture_unit
+ {
+ cubic_texture morning.jpg combinedUVW
+ tex_address_mode clamp
+ filtering linear linear linear
+ tex_coord_set 1
+ }
+
+ }
+
+ }
+
+ technique GLSL
+ {
+ pass
+ {
+ vertex_program_ref GLSL/Ocean2VS
+ {
+ param_named_auto eyePosition camera_position_object_space
+ param_named_auto time time_0_x 100.0
+ param_named BumpScale float 0.2
+ param_named textureScale float2 25 26
+ param_named bumpSpeed float2 0.015 0.005
+ param_named waveFreq float 0.028
+ param_named waveAmp float 1.8
+ }
+
+ fragment_program_ref GLSL/Ocean2FS
+ {
+ param_named deepColor float4 0 0.3 0.5 1.0
+ param_named shallowColor float4 0 1 1 1.0
+ param_named reflectionColor float4 0.95 1 1 1.0
+ param_named reflectionAmount float 1.0
+ param_named reflectionBlur float 0.0
+ param_named waterAmount float 0.3
+ param_named fresnelPower float 5.0
+ param_named fresnelBias float 0.328
+ param_named hdrMultiplier float 0.471
+ param_named NormalMap int 0
+ param_named EnvironmentMap int 1
+ }
+
+ texture_unit
+ {
+ texture waves2.dds
+ tex_coord_set 0
+ filtering linear linear linear
+ }
+
+ texture_unit
+ {
+ cubic_texture morning.jpg combinedUVW
+ tex_address_mode clamp
+ tex_coord_set 1
+ filtering linear linear linear
+ }
+
+ }
+
+ }
+}
+
+material SkyBox
+{
+ technique
+ {
+ pass
+ {
+ lighting off
+ depth_write off
+ depth_check off
+
+ texture_unit
+ {
+ cubic_texture morning.jpg separateUV
+ tex_address_mode clamp
+ }
+ }
+ }
+}
+
+material LightFlare
+{
+ technique
+ {
+ pass
+ {
+ lighting off
+ scene_blend add
+ depth_write off
+
+ texture_unit
+ {
+ texture flare.png
+ }
+ }
+ }
+}
+
+
diff --git a/school/informatik/verkerhssimulation/media/materials/scripts/OffsetMapping.material b/school/informatik/verkerhssimulation/media/materials/scripts/OffsetMapping.material
new file mode 100644
index 00000000..95f1c689
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/scripts/OffsetMapping.material
@@ -0,0 +1,242 @@
+// Bump map with Parallax offset vertex program, support for this is required
+vertex_program Examples/OffsetMappingVP cg
+{
+ source OffsetMapping.cg
+ entry_point main_vp
+ profiles vs_1_1 arbvp1
+}
+
+// Bump map with parallax fragment program
+fragment_program Examples/OffsetMappingFP cg
+{
+ source OffsetMapping.cg
+ entry_point main_fp
+ profiles ps_2_0 arbfp1
+}
+
+// Bump map with parallax fragment program
+fragment_program Examples/OffsetMappingPS asm
+{
+ source OffsetMapping_specular.asm
+ // sorry, only for ps_1_4 and above:)
+ syntax ps_1_4
+}
+
+
+material Examples/OffsetMapping/Specular
+{
+
+ // This is the preferred technique which uses both vertex and
+ // fragment programs, supports coloured lights
+ technique
+ {
+ // do the lighting and bump mapping with parallax pass
+ pass
+ {
+
+ // Vertex program reference
+ vertex_program_ref Examples/OffsetMappingVP
+ {
+ param_named_auto lightPosition light_position_object_space 0
+ param_named_auto eyePosition camera_position_object_space
+ param_named_auto worldViewProj worldviewproj_matrix
+ }
+
+ // Fragment program
+ fragment_program_ref Examples/OffsetMappingFP
+ {
+ param_named_auto lightDiffuse light_diffuse_colour 0
+ param_named_auto lightSpecular light_specular_colour 0
+ // Parallax Height scale and bias
+ param_named scaleBias float4 0.04 -0.02 1 0
+ }
+
+ // Normal + height(alpha) map
+ texture_unit
+ {
+ texture rockwall_NH.tga
+ tex_coord_set 0
+ }
+
+ // Base diffuse texture map
+ texture_unit
+ {
+ texture rockwall.tga
+ tex_coord_set 1
+ }
+ }
+ }
+
+
+ // This is the preferred technique which uses both vertex and
+ // fragment programs, supports coloured lights
+ technique
+ {
+ // do the lighting and bump mapping with parallax pass
+ pass
+ {
+
+ // Vertex program reference
+ vertex_program_ref Examples/OffsetMappingVP
+ {
+ param_named_auto lightPosition light_position_object_space 0
+ param_named_auto eyePosition camera_position_object_space
+ param_named_auto worldViewProj worldviewproj_matrix
+ }
+
+ // Fragment program
+ fragment_program_ref Examples/OffsetMappingPS
+ {
+ param_indexed_auto 0 light_diffuse_colour 0
+ param_indexed_auto 1 light_specular_colour 0
+ // Parallax Height scale and bias
+ param_indexed 2 float4 0.04 -0.02 1 0
+ }
+
+ // Normal + height(alpha) map
+ texture_unit
+ {
+ texture rockwall_NH.tga
+ tex_coord_set 0
+ }
+
+ // Base diffuse texture map
+ texture_unit
+ {
+ texture rockwall.tga
+ tex_coord_set 1
+ }
+ }
+ }
+
+ // Simple no-shader fallback
+ technique
+ {
+ pass
+ {
+ // Base diffuse texture map
+ texture_unit
+ {
+ texture rockwall.tga
+ }
+ }
+ }
+
+}
+
+
+
+// Single-pass offset mapping with shadows
+vertex_program Examples/OffsetMappingIntegratedShadowsVPhlsl hlsl
+{
+ source OffsetMapping.hlsl
+ entry_point integratedshadows_vp
+ target vs_2_0
+}
+vertex_program Examples/OffsetMappingIntegratedShadowsVPglsl glsl
+{
+ source OffsetMappingVp.glsl
+}
+
+// Single-pass offset mapping with shadows
+fragment_program Examples/OffsetMappingIntegratedShadowsFPhlsl hlsl
+{
+ source OffsetMapping.hlsl
+ entry_point integratedshadows_fp
+ target ps_2_0
+}
+fragment_program Examples/OffsetMappingIntegratedShadowsFPglsl glsl
+{
+ source OffsetMappingFp.glsl
+ default_params
+ {
+ // assign samplers as required by GLSL
+ param_named normalHeightMap int 0
+ param_named diffuseMap int 1
+ param_named shadowMap1 int 2
+ param_named shadowMap2 int 3
+ }
+}
+// Single-pass offset mapping with shadows
+vertex_program Examples/OffsetMappingIntegratedShadowsVP unified
+{
+ delegate Examples/OffsetMappingIntegratedShadowsVPhlsl
+ delegate Examples/OffsetMappingIntegratedShadowsVPglsl
+}
+// Single-pass offset mapping with shadows
+fragment_program Examples/OffsetMappingIntegratedShadowsFP unified
+{
+ delegate Examples/OffsetMappingIntegratedShadowsFPhlsl
+ delegate Examples/OffsetMappingIntegratedShadowsFPglsl
+}
+
+
+
+material Examples/OffsetMapping/IntegratedShadows
+{
+
+ technique
+ {
+ // do the lighting and bump mapping with parallax pass
+ pass
+ {
+
+ // Vertex program reference
+ vertex_program_ref Examples/OffsetMappingIntegratedShadowsVP
+ {
+ param_named_auto lightPosition light_position_object_space 0
+ param_named_auto eyePosition camera_position_object_space
+ param_named_auto worldViewProj worldviewproj_matrix
+ param_named_auto spotDirection light_direction_object_space 0
+
+ param_named_auto lightPosition1 light_position_object_space 1
+ param_named_auto spotDirection1 light_direction_object_space 1
+ // shadow texture projections
+ param_named_auto worldMatrix world_matrix
+ param_named_auto texViewProj1 texture_viewproj_matrix 0
+ param_named_auto texViewProj2 texture_viewproj_matrix 1
+ }
+
+ // Fragment program
+ fragment_program_ref Examples/OffsetMappingIntegratedShadowsFP
+ {
+ param_named_auto lightDiffuse light_diffuse_colour 0
+ param_named_auto spotParams spotlight_params 0
+
+ param_named_auto lightDiffuse1 light_diffuse_colour 1
+ param_named_auto spotParams1 spotlight_params 1
+ // Parallax Height scale and bias
+ param_named scaleBias float4 0.04 -0.02 1 0
+ }
+
+ // Normal + height(alpha) map
+ texture_unit
+ {
+ texture rockwall_NH.tga
+ tex_coord_set 0
+ }
+
+ // Base diffuse texture map
+ texture_unit
+ {
+ texture rockwall.tga
+ tex_coord_set 1
+ }
+
+ // shadowmap 1
+ texture_unit
+ {
+ content_type shadow
+ }
+ // shadowmap 2
+ texture_unit
+ {
+ content_type shadow
+ }
+ }
+ }
+
+
+
+}
+
diff --git a/school/informatik/verkerhssimulation/media/materials/scripts/Ogre.material b/school/informatik/verkerhssimulation/media/materials/scripts/Ogre.material
new file mode 100644
index 00000000..ccca82ef
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/scripts/Ogre.material
@@ -0,0 +1,119 @@
+
+material Ogre/Earring
+{
+ technique
+ {
+ pass
+ {
+ ambient 0.5 0.5 0
+ diffuse 1 1 0
+
+ texture_unit
+ {
+ texture spheremap.png
+ colour_op_ex add src_texture src_current
+ colour_op_multipass_fallback one one
+ env_map spherical
+ }
+ }
+ }
+}
+material Ogre/Skin
+{
+ technique
+ {
+ pass
+ {
+ ambient 0.7 0.7 0.7
+ cull_hardware none
+
+ texture_unit
+ {
+ texture GreenSkin.jpg
+ tex_address_mode mirror
+ }
+ }
+ }
+}
+material Ogre/Tusks
+{
+ technique
+ {
+ pass
+ {
+ ambient 0.5 0.5 0.4
+ diffuse 1 1 0.8
+
+ texture_unit
+ {
+ texture dirt01.jpg
+ colour_op_ex add src_texture src_current
+ colour_op_multipass_fallback one one
+ }
+ }
+ }
+}
+material Ogre/Eyes
+{
+ technique
+ {
+ pass
+ {
+
+ texture_unit
+ {
+ texture WeirdEye.png
+ }
+ }
+ }
+}
+material Cursor/default
+{
+ technique
+ {
+ pass
+ {
+ scene_blend alpha_blend
+
+ texture_unit
+ {
+ texture cursor.png
+ tex_address_mode clamp
+ }
+ }
+ }
+}
+material Core/StatsBlockBorder/Down
+{
+ technique
+ {
+ pass
+ {
+ lighting off
+ scene_blend alpha_blend
+ depth_check off
+
+ texture_unit
+ {
+ texture ogreborder.png
+ }
+ }
+ }
+}
+material Core/StatsBlockBorder/Up
+{
+ technique
+ {
+ pass
+ {
+ lighting off
+ scene_blend alpha_blend
+ depth_check off
+
+ texture_unit
+ {
+ texture ogreborderUp.png
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/school/informatik/verkerhssimulation/media/materials/scripts/OldMovie.material b/school/informatik/verkerhssimulation/media/materials/scripts/OldMovie.material
new file mode 100644
index 00000000..a8d122e2
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/scripts/OldMovie.material
@@ -0,0 +1,67 @@
+fragment_program Ogre/Compositor/OldMovieFP cg
+{
+ source OldMovieFP.cg
+ entry_point OldMovie_ps
+ profiles ps_2_0 arbfp1
+}
+
+material Ogre/Compositor/OldMovie
+{
+ technique
+ {
+
+ pass
+ {
+ cull_hardware none
+ cull_software none
+ depth_func always_pass
+
+ vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp
+ {
+ }
+
+ fragment_program_ref Ogre/Compositor/OldMovieFP
+ {
+ param_named_auto time_cycle_period time 20
+ param_named flicker float 0.4
+ param_named DirtFrequency float 0.0005
+ param_named luminance float3 0.30 0.59 0.11
+ param_named frameJitter float 0.004
+ param_named lumiShift float 0.03
+ }
+
+ texture_unit RT
+ {
+ tex_coord_set 0
+ tex_address_mode clamp
+ filtering trilinear
+ }
+
+ texture_unit SplotchesTx
+ {
+ texture 8x8PagesSplotches2.png 2d
+ tex_coord_set 1
+ tex_address_mode wrap
+ filtering trilinear
+ }
+
+ texture_unit
+ {
+ texture 1D_Noise.png 1d
+ tex_coord_set 2
+ tex_address_mode wrap
+ filtering point point none
+ }
+
+
+ texture_unit SepiaTx
+ {
+ texture Sepia1D.tga 1d
+ tex_coord_set 3
+ tex_address_mode mirror
+ filtering point point none
+ }
+
+ }
+ }
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/scripts/OldTV.material b/school/informatik/verkerhssimulation/media/materials/scripts/OldTV.material
new file mode 100644
index 00000000..c4ba1911
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/scripts/OldTV.material
@@ -0,0 +1,59 @@
+fragment_program Ogre/Compositor/OldTV_FP cg
+{
+ source OldTV.cg
+ entry_point OldTV_ps
+ profiles ps_2_0 arbfp1
+}
+
+material Ogre/Compositor/OldTV
+{
+ technique
+ {
+
+ pass
+ {
+ depth_check off
+
+ vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp
+ {
+ }
+
+ fragment_program_ref Ogre/Compositor/OldTV_FP
+ {
+ param_named_auto time_0_X time_0_x 120
+ param_named_auto sin_time_0_X sintime_0_x 120
+
+ param_named distortionFreq float 2.7
+ param_named distortionScale float 2.5
+ param_named distortionRoll float 0.93
+ param_named interference float 0.5
+ param_named frameLimit float 0.40
+ param_named frameShape float 0.26
+ param_named frameSharpness float 6.0
+ }
+
+ texture_unit 0
+ {
+ tex_coord_set 0
+ tex_address_mode clamp
+ filtering linear linear linear
+ }
+
+ texture_unit 1
+ {
+ texture Random3D.dds 3d
+ tex_coord_set 1
+ tex_address_mode wrap
+ filtering linear linear linear
+ }
+
+ texture_unit 2
+ {
+ texture NoiseVolume.dds 3d
+ tex_coord_set 2
+ tex_address_mode wrap
+ filtering linear linear linear
+ }
+ }
+ }
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/scripts/Posterize.material b/school/informatik/verkerhssimulation/media/materials/scripts/Posterize.material
new file mode 100644
index 00000000..eab44fc0
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/scripts/Posterize.material
@@ -0,0 +1,36 @@
+fragment_program Ogre/Compositor/PosterizeFP cg
+{
+ source PosterizeFP.cg
+ entry_point Posterize_ps
+ profiles ps_2_0 arbfp1
+}
+
+material Ogre/Compositor/Posterize
+{
+ technique
+ {
+
+ pass
+ {
+ cull_hardware none
+ cull_software none
+ depth_func always_pass
+
+ vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp
+ {
+ }
+
+ fragment_program_ref Ogre/Compositor/PosterizeFP
+ {
+ }
+
+ texture_unit RT
+ {
+ tex_coord_set 0
+ tex_address_mode clamp
+ filtering trilinear
+ }
+
+ }
+ }
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/scripts/RZR-002.material b/school/informatik/verkerhssimulation/media/materials/scripts/RZR-002.material
new file mode 100644
index 00000000..4b2dcc10
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/scripts/RZR-002.material
@@ -0,0 +1,15 @@
+
+material RZR-002
+{
+ technique
+ {
+ pass
+ {
+
+ texture_unit
+ {
+ texture RZR-002.png
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/school/informatik/verkerhssimulation/media/materials/scripts/SharpenEdges.material b/school/informatik/verkerhssimulation/media/materials/scripts/SharpenEdges.material
new file mode 100644
index 00000000..c4ddb699
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/scripts/SharpenEdges.material
@@ -0,0 +1,60 @@
+fragment_program Ogre/Compositor/SharpenEdgesFP_cg cg
+{
+ source SharpenEdgesFP.cg
+ entry_point sharpenEdges_fp
+ profiles ps_2_0 arbfp1
+}
+
+fragment_program Ogre/Compositor/SharpenEdgesFP_ps_2_a hlsl
+{
+ source SharpenEdgesFP.cg
+ entry_point sharpenEdges_fp
+ target ps_2_a
+}
+
+fragment_program Ogre/Compositor/SharpenEdgesFP unified
+{
+ delegate Ogre/Compositor/SharpenEdgesFP_ps_2_a
+ delegate Ogre/Compositor/SharpenEdgesFP_cg
+
+ default_params
+ {
+ param_named_auto vTexelSize inverse_texture_size 0
+ }
+}
+
+material Ogre/Compositor/SharpenEdges
+{
+ technique
+ {
+
+ pass
+ {
+ cull_hardware none
+ cull_software none
+ depth_func always_pass
+
+ //DirectX 9.0 HLSL Vertex Shader vs_1_1
+ //vertex_program_ref PostFilters/SharpenEdgesVP
+ //{
+ //}
+
+ vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp
+ {
+ }
+
+ //DirectX 9.0 HLSL Pixel Shader ps_2_0
+ fragment_program_ref Ogre/Compositor/SharpenEdgesFP
+ {
+ }
+
+ texture_unit
+ {
+ tex_coord_set 0
+ tex_address_mode clamp
+ filtering trilinear
+ }
+
+ }
+ }
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/scripts/StdQuad_vp.program b/school/informatik/verkerhssimulation/media/materials/scripts/StdQuad_vp.program
new file mode 100644
index 00000000..9fbab1cd
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/scripts/StdQuad_vp.program
@@ -0,0 +1,71 @@
+vertex_program Ogre/Compositor/StdQuad_Cg_vp cg
+{
+ source StdQuad_vp.cg
+ entry_point StdQuad_vp
+ profiles vs_1_1 arbvp1
+
+ default_params
+ {
+ param_named_auto worldViewProj worldviewproj_matrix
+ }
+}
+
+vertex_program Ogre/Compositor/StdQuad_Tex2_vp cg
+{
+ source StdQuad_vp.cg
+ entry_point StdQuad_Tex2_vp
+ profiles vs_1_1 arbvp1
+
+ default_params
+ {
+ param_named_auto worldViewProj worldviewproj_matrix
+ }
+}
+
+vertex_program Ogre/Compositor/StdQuad_Tex2a_vp cg
+{
+ source StdQuad_vp.cg
+ entry_point StdQuad_Tex2a_vp
+ profiles vs_1_1 arbvp1
+
+ default_params
+ {
+ param_named_auto worldViewProj worldviewproj_matrix
+ }
+}
+
+vertex_program Ogre/Compositor/StdQuad_Tex3_vp cg
+{
+ source StdQuad_vp.cg
+ entry_point StdQuad_Tex3_vp
+ profiles vs_1_1 arbvp1
+
+ default_params
+ {
+ param_named_auto worldViewProj worldviewproj_matrix
+ }
+}
+
+vertex_program Ogre/Compositor/StdQuad_Tex4_vp cg
+{
+ source StdQuad_vp.cg
+ entry_point StdQuad_Tex4_vp
+ profiles vs_1_1 arbvp1
+
+ default_params
+ {
+ param_named_auto worldViewProj worldviewproj_matrix
+ }
+}
+
+vertex_program Ogre/Compositor/StdQuad_GLSL_vp glsl
+{
+ source StdQuad_vp.glsl
+}
+
+
+vertex_program Ogre/Compositor/StdQuad_vp unified
+{
+ delegate Ogre/Compositor/StdQuad_GLSL_vp
+ delegate Ogre/Compositor/StdQuad_Cg_vp
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/scripts/Tiling.material b/school/informatik/verkerhssimulation/media/materials/scripts/Tiling.material
new file mode 100644
index 00000000..05181381
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/scripts/Tiling.material
@@ -0,0 +1,39 @@
+fragment_program Ogre/Compositor/TilingFP cg
+{
+ source TilingFP.cg
+ entry_point Tiling_ps
+ profiles ps_2_0 arbfp1
+}
+
+material Ogre/Compositor/Tiling
+{
+ technique
+ {
+
+ pass
+ {
+ cull_hardware none
+ cull_software none
+ depth_func always_pass
+
+ vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp
+ {
+ }
+
+ //DirectX 9.0 HLSL Pixel Shader ps_2_0
+ fragment_program_ref Ogre/Compositor/TilingFP
+ {
+ param_named NumTiles float 75.0
+ param_named Threshhold float 0.15
+ }
+
+ texture_unit RT
+ {
+ tex_coord_set 0
+ tex_address_mode clamp
+ filtering trilinear
+ }
+
+ }
+ }
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/scripts/VarianceShadowmap.material b/school/informatik/verkerhssimulation/media/materials/scripts/VarianceShadowmap.material
new file mode 100644
index 00000000..16d9e594
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/scripts/VarianceShadowmap.material
@@ -0,0 +1,103 @@
+
+// Shadow Caster __________________________________________________
+
+
+vertex_program VarianceShadowMapping/ShadowCasterVP cg
+{
+ source varianceshadowcastervp.cg
+ entry_point main
+ profiles arbvp1 vs_2_x
+
+ default_params
+ {
+ param_named_auto uModelViewProjection worldviewproj_matrix
+ }
+}
+
+fragment_program VarianceShadowMapping/ShadowCasterFP cg
+{
+ source varianceshadowcasterfp.cg
+ entry_point main
+ profiles arbfp1 ps_2_x
+
+ default_params
+ {
+ param_named uDepthOffset float 1.0
+ param_named_auto uProjection projection_matrix
+ }
+}
+
+material VarianceShadowMapping/ShadowCaster
+{
+ technique default
+ {
+ // Z-write only pass
+ pass Z-write
+ {
+ //Instead of using depth_bias, we'll be implementing it manually
+
+ vertex_program_ref VarianceShadowMapping/ShadowCasterVP
+ {
+ }
+ fragment_program_ref VarianceShadowMapping/ShadowCasterFP
+ {
+ }
+ }
+ }
+}
+
+
+
+// Shadow Receiver ________________________________________________
+
+vertex_program VarianceShadowMapping/ShadowReceiverVP cg
+{
+ source varianceshadowreceivervp.cg
+ entry_point main
+ profiles arbvp1 vs_2_x
+
+ default_params
+ {
+ param_named_auto uModelViewProjection worldviewproj_matrix
+ param_named_auto uLightPosition light_position_object_space 0
+ param_named_auto uModel world_matrix
+ param_named_auto uTextureViewProjection texture_viewproj_matrix
+ }
+}
+
+fragment_program VarianceShadowMapping/ShadowReceiverFP cg
+{
+ source varianceshadowreceiverfp.cg
+ entry_point main
+ profiles arbfp1 ps_2_x
+
+ default_params
+ {
+ param_named uSTexWidth float 512.0
+ param_named uSTexHeight float 512.0
+ }
+}
+
+material VarianceShadowMapping/ShadowReceiver
+{
+ technique default
+ {
+ pass lighting
+ {
+ vertex_program_ref VarianceShadowMapping/ShadowReceiverVP
+ {
+ }
+
+ fragment_program_ref VarianceShadowMapping/ShadowReceiverFP
+ {
+ }
+
+ // we won't rely on hardware specific filtering of z-tests
+ texture_unit ShadowMap
+ {
+ tex_address_mode clamp
+ filtering none
+ }
+ }
+ }
+}
diff --git a/school/informatik/verkerhssimulation/media/materials/scripts/facial.material b/school/informatik/verkerhssimulation/media/materials/scripts/facial.material
new file mode 100644
index 00000000..c0324742
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/scripts/facial.material
@@ -0,0 +1,85 @@
+
+material drbunsen_head
+{
+ technique
+ {
+ pass
+ {
+ ambient 0.25 0.25 0.25
+ diffuse 1.0 1.0 1.0
+
+ texture_unit
+ {
+ texture Dr_Bunsen_Head.jpg
+ }
+ }
+ }
+}
+
+material drbunsen_teeth
+{
+ technique
+ {
+ pass
+ {
+ ambient 0.25 0.25 0.25
+ diffuse 1.0 1.0 1.0
+
+ }
+ }
+}
+
+material drbunsen_tongue
+{
+ technique
+ {
+ pass
+ {
+ ambient 0.25 0.25 0.25
+ diffuse 1.0 0.1 0.1
+
+ }
+ }
+}
+
+material drbunsen_gums
+{
+ technique
+ {
+ pass
+ {
+ ambient 0.25 0.25 0.25
+ diffuse 1.0 0.1 0.1
+
+ }
+ }
+}
+
+material drbunsen_glasses
+{
+ technique
+ {
+ pass
+ {
+ depth_write off
+ scene_blend modulate
+ ambient 0.25 0.25 0.25
+ diffuse 0.75 0.75 0.75
+
+ }
+ }
+}
+
+material drbunsen_glasses_frame
+{
+ technique
+ {
+ pass
+ {
+ ambient 0.25 0.25 0.25
+ diffuse 0.35 0.18 0 1
+
+ }
+ }
+}
+
diff --git a/school/informatik/verkerhssimulation/media/materials/scripts/hdr.material b/school/informatik/verkerhssimulation/media/materials/scripts/hdr.material
new file mode 100644
index 00000000..97304765
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/scripts/hdr.material
@@ -0,0 +1,286 @@
+// Downsample a 2x2 area & turn into luminence (unclamped)
+fragment_program Ogre/Compositor/HDR/downscale2x2LuminenceHLSL_fp hlsl
+{
+ source hdr.hlsl
+ entry_point downscale2x2Luminence
+ target ps_2_0
+}
+fragment_program Ogre/Compositor/HDR/downscale2x2LuminenceGLSL_fp glsl
+{
+ source hdr_downscale2x2luminence.glsl
+ default_params
+ {
+ param_named inRTT int 0
+ }
+}
+fragment_program Ogre/Compositor/HDR/downscale2x2Luminence_fp unified
+{
+ delegate Ogre/Compositor/HDR/downscale2x2LuminenceGLSL_fp
+ delegate Ogre/Compositor/HDR/downscale2x2LuminenceHLSL_fp
+ default_params
+ {
+ param_named_auto texelSize inverse_texture_size 0
+ }
+}
+
+material Ogre/Compositor/HDR/Downsample2x2Luminence
+{
+ technique
+ {
+ pass
+ {
+ cull_hardware none
+ cull_software none
+ depth_check off
+
+ vertex_program_ref Ogre/Compositor/StdQuad_vp
+ {
+ }
+ fragment_program_ref Ogre/Compositor/HDR/downscale2x2Luminence_fp
+ {
+ }
+
+ texture_unit
+ {
+ tex_coord_set 0
+ tex_address_mode clamp
+ filtering none
+ }
+ }
+ }
+}
+
+// Downsample a 3x3 area
+fragment_program Ogre/Compositor/HDR/downscale3x3HLSL_fp hlsl
+{
+ source hdr.hlsl
+ entry_point downscale3x3
+ target ps_2_0
+}
+fragment_program Ogre/Compositor/HDR/downscale3x3GLSL_fp glsl
+{
+ source hdr_downscale3x3.glsl
+ default_params
+ {
+ param_named inRTT int 0
+ }
+}
+fragment_program Ogre/Compositor/HDR/downscale3x3_fp unified
+{
+ delegate Ogre/Compositor/HDR/downscale3x3GLSL_fp
+ delegate Ogre/Compositor/HDR/downscale3x3HLSL_fp
+ default_params
+ {
+ param_named_auto texelSize inverse_texture_size 0
+ }
+}
+
+
+material Ogre/Compositor/HDR/Downsample3x3
+{
+ technique
+ {
+ pass
+ {
+ cull_hardware none
+ cull_software none
+ depth_check off
+
+ vertex_program_ref Ogre/Compositor/StdQuad_vp
+ {
+ }
+ fragment_program_ref Ogre/Compositor/HDR/downscale3x3_fp
+ {
+ }
+
+ texture_unit
+ {
+ tex_coord_set 0
+ tex_address_mode clamp
+ filtering none
+ }
+ }
+ }
+}
+
+// Downsample a 3x3 area and perform a brightness filter pass
+fragment_program Ogre/Compositor/HDR/downscale3x3brightpassHLSL_fp hlsl
+{
+ source hdr.hlsl
+ entry_point downscale3x3brightpass
+ target ps_2_0
+}
+fragment_program Ogre/Compositor/HDR/utils_fp glsl
+{
+ source hdr_tonemap_util.glsl
+}
+fragment_program Ogre/Compositor/HDR/downscale3x3brightpassGLSL_fp glsl
+{
+ source hdr_downscale3x3brightpass.glsl
+ // re-use common functions
+ attach Ogre/Compositor/HDR/utils_fp
+ default_params
+ {
+ param_named inRTT int 0
+ param_named inLum int 1
+ }
+}
+fragment_program Ogre/Compositor/HDR/downscale3x3brightpass_fp unified
+{
+ delegate Ogre/Compositor/HDR/downscale3x3brightpassGLSL_fp
+ delegate Ogre/Compositor/HDR/downscale3x3brightpassHLSL_fp
+ default_params
+ {
+ param_named_auto texelSize inverse_texture_size 0
+ }
+}
+
+
+material Ogre/Compositor/HDR/Downsample3x3Brightpass
+{
+ technique
+ {
+ pass
+ {
+ cull_hardware none
+ cull_software none
+ depth_check off
+
+ vertex_program_ref Ogre/Compositor/StdQuad_vp
+ {
+ }
+ fragment_program_ref Ogre/Compositor/HDR/downscale3x3brightpass_fp
+ {
+ }
+
+ // Scene
+ texture_unit
+ {
+ tex_coord_set 0
+ tex_address_mode clamp
+ filtering none
+ }
+ // Luminence
+ texture_unit
+ {
+ tex_address_mode clamp
+ filtering none
+ }
+ }
+ }
+}
+
+// Bloom an area using gaussian distribution
+fragment_program Ogre/Compositor/HDR/bloomHLSL_fp hlsl
+{
+ source hdr.hlsl
+ entry_point bloom
+ target ps_2_0
+}
+fragment_program Ogre/Compositor/HDR/bloomGLSL_fp glsl
+{
+ source hdr_bloom.glsl
+ default_params
+ {
+ param_named inRTT int 0
+ }
+}
+fragment_program Ogre/Compositor/HDR/bloom_fp unified
+{
+ delegate Ogre/Compositor/HDR/bloomGLSL_fp
+ delegate Ogre/Compositor/HDR/bloomHLSL_fp
+}
+
+
+material Ogre/Compositor/HDR/GaussianBloom
+{
+ technique
+ {
+ pass
+ {
+ cull_hardware none
+ cull_software none
+ depth_check off
+
+ vertex_program_ref Ogre/Compositor/StdQuad_vp
+ {
+ }
+ fragment_program_ref Ogre/Compositor/HDR/bloom_fp
+ {
+ }
+
+ // Input
+ texture_unit
+ {
+ tex_coord_set 0
+ tex_address_mode clamp
+ filtering none
+ }
+ }
+ }
+}
+
+
+// Perform final tone mapping
+fragment_program Ogre/Compositor/HDR/finaltonemappingHLSL_fp hlsl
+{
+ source hdr.hlsl
+ entry_point finalToneMapping
+ target ps_2_0
+}
+fragment_program Ogre/Compositor/HDR/finaltonemappingGLSL_fp glsl
+{
+ source hdr_finalToneMapping.glsl
+ // re-use common functions
+ attach Ogre/Compositor/HDR/utils_fp
+ default_params
+ {
+ param_named inRTT int 0
+ param_named inBloom int 1
+ param_named inLum int 2
+ }
+}
+fragment_program Ogre/Compositor/HDR/finaltonemapping_fp unified
+{
+ delegate Ogre/Compositor/HDR/finaltonemappingHLSL_fp
+ delegate Ogre/Compositor/HDR/finaltonemappingGLSL_fp
+}
+
+material Ogre/Compositor/HDR/ToneMapping
+{
+ technique
+ {
+ pass
+ {
+ cull_hardware none
+ cull_software none
+ depth_check off
+
+ vertex_program_ref Ogre/Compositor/StdQuad_vp
+ {
+ }
+ fragment_program_ref Ogre/Compositor/HDR/finaltonemapping_fp
+ {
+ }
+
+ // Scene
+ texture_unit
+ {
+ tex_coord_set 0
+ tex_address_mode clamp
+ }
+ // Bloom
+ texture_unit
+ {
+ tex_address_mode clamp
+ }
+ // Luminence
+ texture_unit
+ {
+ tex_address_mode clamp
+ }
+ }
+ }
+}
+
+
diff --git a/school/informatik/verkerhssimulation/media/materials/scripts/instancing.material b/school/informatik/verkerhssimulation/media/materials/scripts/instancing.material
new file mode 100644
index 00000000..80c3a1f3
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/scripts/instancing.material
@@ -0,0 +1,131 @@
+
+vertex_program InstancingCg cg
+{
+ source instancing.cg
+ profiles vs_2_0
+ entry_point instancing_vp
+
+ default_params
+ {
+ param_named_auto ambient ambient_light_colour
+ param_named_auto lightDiffuseColour light_diffuse_colour 0
+ param_named_auto lightPos light_position 0
+ param_named_auto viewProjectionMatrix viewproj_matrix
+ param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+ }
+}
+vertex_program InstancingShadowCasterCg cg
+{
+ source instancing.cg
+ profiles vs_2_0
+ entry_point instancingCaster_vp
+ default_params
+ {
+ param_named_auto ambient ambient_light_colour
+ param_named_auto viewProjectionMatrix viewproj_matrix
+ param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+ }
+}
+vertex_program CrowdCg cg
+{
+ source instancing.cg
+ profiles vs_2_0
+ entry_point crowd_vp
+ default_params
+ {
+ param_named_auto viewProjectionMatrix viewproj_matrix
+ param_named_auto numBones custom 0
+ param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+ param_named_auto lightPos light_position 0
+ param_named_auto lightDiffuseColour light_diffuse_colour 0
+ param_named_auto ambient ambient_light_colour
+ }
+}
+vertex_program CrowdShadowCasterCg cg
+{
+ source instancing.cg
+ profiles vs_2_0
+ entry_point crowdCaster_vp
+ default_params
+ {
+ param_named_auto viewProjectionMatrix viewproj_matrix
+ param_named_auto numBones custom 0
+ param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+ param_named_auto ambient ambient_light_colour
+ }
+}
+
+
+vertex_program InstancingGLSL glsl
+{
+ source instancingVp.glsl
+ preprocessor_defines SHADOW_CASTER=0
+ default_params
+ {
+ param_named_auto ambient ambient_light_colour
+ param_named_auto lightDiffuseColour light_diffuse_colour 0
+ param_named_auto lightPos light_position 0
+ param_named_auto viewProjectionMatrix viewproj_matrix
+ param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+ }
+}
+vertex_program InstancingShadowCasterGLSL glsl
+{
+ source instancingVp.glsl
+ preprocessor_defines SHADOW_CASTER=1
+ default_params
+ {
+ param_named_auto ambient ambient_light_colour
+ param_named_auto viewProjectionMatrix viewproj_matrix
+ param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+ }
+}
+vertex_program CrowdGLSL glsl
+{
+ source crowdVp.glsl
+ preprocessor_defines SHADOW_CASTER=0
+ default_params
+ {
+ param_named_auto viewProjectionMatrix viewproj_matrix
+ param_named_auto numBones custom 0
+ param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+ param_named_auto lightPos light_position 0
+ param_named_auto lightDiffuseColour light_diffuse_colour 0
+ param_named_auto ambient ambient_light_colour
+ }
+}
+vertex_program CrowdShadowCasterGLSL glsl
+{
+ source crowdVp.glsl
+ preprocessor_defines SHADOW_CASTER=1
+ default_params
+ {
+ param_named_auto viewProjectionMatrix viewproj_matrix
+ param_named_auto numBones custom 0
+ param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+ param_named_auto ambient ambient_light_colour
+ }
+}
+
+
+vertex_program Instancing unified
+{
+ delegate InstancingGLSL
+ delegate InstancingCg
+}
+vertex_program InstancingShadowCaster unified
+{
+ delegate InstancingShadowCasterGLSL
+ delegate InstancingShadowCasterCg
+}
+vertex_program Crowd unified
+{
+ delegate CrowdGLSL
+ delegate CrowdCg
+}
+vertex_program CrowdShadowCaster unified
+{
+ delegate CrowdShadowCasterGLSL
+ delegate CrowdShadowCasterCg
+}
+
diff --git a/school/informatik/verkerhssimulation/media/materials/scripts/smoke.material b/school/informatik/verkerhssimulation/media/materials/scripts/smoke.material
new file mode 100644
index 00000000..2eb8eb04
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/materials/scripts/smoke.material
@@ -0,0 +1,19 @@
+
+material Examples/Smoke
+{
+ technique
+ {
+ pass
+ {
+ lighting off
+ scene_blend alpha_blend
+ depth_write off
+
+ texture_unit
+ {
+ texture smoke.png
+ tex_address_mode clamp
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/10points.png b/school/informatik/verkerhssimulation/media/materials/textures/10points.png
new file mode 100644
index 00000000..a932146c
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/10points.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/1D_Noise.png b/school/informatik/verkerhssimulation/media/materials/textures/1D_Noise.png
new file mode 100644
index 00000000..d03ed1ee
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/1D_Noise.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/1D_Noise2.png b/school/informatik/verkerhssimulation/media/materials/textures/1D_Noise2.png
new file mode 100644
index 00000000..9dfd6f84
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/1D_Noise2.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/8x8PagesSplotches2.png b/school/informatik/verkerhssimulation/media/materials/textures/8x8PagesSplotches2.png
new file mode 100644
index 00000000..6a6b1051
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/8x8PagesSplotches2.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/BeachStones.jpg b/school/informatik/verkerhssimulation/media/materials/textures/BeachStones.jpg
new file mode 100644
index 00000000..faaa16fe
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/BeachStones.jpg differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/BumpyMetal.jpg b/school/informatik/verkerhssimulation/media/materials/textures/BumpyMetal.jpg
new file mode 100644
index 00000000..8229c0d8
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/BumpyMetal.jpg differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/Chrome.jpg b/school/informatik/verkerhssimulation/media/materials/textures/Chrome.jpg
new file mode 100644
index 00000000..0ae5c526
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/Chrome.jpg differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/Dirt.jpg b/school/informatik/verkerhssimulation/media/materials/textures/Dirt.jpg
new file mode 100644
index 00000000..8b74a42f
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/Dirt.jpg differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/Dr_Bunsen_Head.jpg b/school/informatik/verkerhssimulation/media/materials/textures/Dr_Bunsen_Head.jpg
new file mode 100644
index 00000000..3ef969d7
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/Dr_Bunsen_Head.jpg differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/GLX_icon.png b/school/informatik/verkerhssimulation/media/materials/textures/GLX_icon.png
new file mode 100644
index 00000000..a13699be
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/GLX_icon.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/GreenSkin.jpg b/school/informatik/verkerhssimulation/media/materials/textures/GreenSkin.jpg
new file mode 100644
index 00000000..435dddb1
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/GreenSkin.jpg differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/HeatLookup.tga b/school/informatik/verkerhssimulation/media/materials/textures/HeatLookup.tga
new file mode 100644
index 00000000..e45ec53e
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/HeatLookup.tga differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/HeatNoise.tga b/school/informatik/verkerhssimulation/media/materials/textures/HeatNoise.tga
new file mode 100644
index 00000000..159e3620
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/HeatNoise.tga differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/MtlPlat2.jpg b/school/informatik/verkerhssimulation/media/materials/textures/MtlPlat2.jpg
new file mode 100644
index 00000000..778aad44
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/MtlPlat2.jpg differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/NMBalls.png b/school/informatik/verkerhssimulation/media/materials/textures/NMBalls.png
new file mode 100644
index 00000000..74f02e37
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/NMBalls.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/NMBumpsOut.png b/school/informatik/verkerhssimulation/media/materials/textures/NMBumpsOut.png
new file mode 100644
index 00000000..b5ef61e5
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/NMBumpsOut.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/NMHollyBumps.png b/school/informatik/verkerhssimulation/media/materials/textures/NMHollyBumps.png
new file mode 100644
index 00000000..ac91b020
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/NMHollyBumps.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/NMStripes.png b/school/informatik/verkerhssimulation/media/materials/textures/NMStripes.png
new file mode 100644
index 00000000..40781621
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/NMStripes.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/NPRMetallic.tga b/school/informatik/verkerhssimulation/media/materials/textures/NPRMetallic.tga
new file mode 100644
index 00000000..6649a6fb
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/NPRMetallic.tga differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/NoiseVolume.dds b/school/informatik/verkerhssimulation/media/materials/textures/NoiseVolume.dds
new file mode 100644
index 00000000..bd8147d4
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/NoiseVolume.dds differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/RZR-002.png b/school/informatik/verkerhssimulation/media/materials/textures/RZR-002.png
new file mode 100644
index 00000000..663eb05d
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/RZR-002.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/Random3D.dds b/school/informatik/verkerhssimulation/media/materials/textures/Random3D.dds
new file mode 100644
index 00000000..08b61959
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/Random3D.dds differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/RustedMetal.jpg b/school/informatik/verkerhssimulation/media/materials/textures/RustedMetal.jpg
new file mode 100644
index 00000000..070346d3
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/RustedMetal.jpg differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/RustyBarrel.png b/school/informatik/verkerhssimulation/media/materials/textures/RustyBarrel.png
new file mode 100644
index 00000000..8448a8e7
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/RustyBarrel.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/RustySteel.jpg b/school/informatik/verkerhssimulation/media/materials/textures/RustySteel.jpg
new file mode 100644
index 00000000..a2d7b9df
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/RustySteel.jpg differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/Sepia1D.tga b/school/informatik/verkerhssimulation/media/materials/textures/Sepia1D.tga
new file mode 100644
index 00000000..dcc42620
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/Sepia1D.tga differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/Water01.jpg b/school/informatik/verkerhssimulation/media/materials/textures/Water01.jpg
new file mode 100644
index 00000000..4ebc501b
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/Water01.jpg differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/Water02.jpg b/school/informatik/verkerhssimulation/media/materials/textures/Water02.jpg
new file mode 100644
index 00000000..3efda7b6
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/Water02.jpg differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/WaterNormal1.tga b/school/informatik/verkerhssimulation/media/materials/textures/WaterNormal1.tga
new file mode 100644
index 00000000..a9ca11b7
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/WaterNormal1.tga differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/WaterNormal2.tga b/school/informatik/verkerhssimulation/media/materials/textures/WaterNormal2.tga
new file mode 100644
index 00000000..771d1504
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/WaterNormal2.tga differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/WeirdEye.png b/school/informatik/verkerhssimulation/media/materials/textures/WeirdEye.png
new file mode 100644
index 00000000..13401729
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/WeirdEye.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/WoodPallet.png b/school/informatik/verkerhssimulation/media/materials/textures/WoodPallet.png
new file mode 100644
index 00000000..7727d71a
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/WoodPallet.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/atheneNormalMap.png b/school/informatik/verkerhssimulation/media/materials/textures/atheneNormalMap.png
new file mode 100644
index 00000000..00dbf15e
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/atheneNormalMap.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/aureola.png b/school/informatik/verkerhssimulation/media/materials/textures/aureola.png
new file mode 100644
index 00000000..deab82cc
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/aureola.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/basic_droplet.png b/school/informatik/verkerhssimulation/media/materials/textures/basic_droplet.png
new file mode 100644
index 00000000..27ca8e8a
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/basic_droplet.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/blue_jaiqua.jpg b/school/informatik/verkerhssimulation/media/materials/textures/blue_jaiqua.jpg
new file mode 100644
index 00000000..6016e140
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/blue_jaiqua.jpg differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/cel_shading_diffuse.png b/school/informatik/verkerhssimulation/media/materials/textures/cel_shading_diffuse.png
new file mode 100644
index 00000000..9cd4efbb
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/cel_shading_diffuse.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/cel_shading_edge.png b/school/informatik/verkerhssimulation/media/materials/textures/cel_shading_edge.png
new file mode 100644
index 00000000..9cc118ab
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/cel_shading_edge.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/cel_shading_specular.png b/school/informatik/verkerhssimulation/media/materials/textures/cel_shading_specular.png
new file mode 100644
index 00000000..9cc118ab
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/cel_shading_specular.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/clouds.jpg b/school/informatik/verkerhssimulation/media/materials/textures/clouds.jpg
new file mode 100644
index 00000000..3d37e8e0
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/clouds.jpg differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/cursor.png b/school/informatik/verkerhssimulation/media/materials/textures/cursor.png
new file mode 100644
index 00000000..3d1c756c
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/cursor.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/dirt01.jpg b/school/informatik/verkerhssimulation/media/materials/textures/dirt01.jpg
new file mode 100644
index 00000000..7c7cc5eb
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/dirt01.jpg differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/dkyellow.png b/school/informatik/verkerhssimulation/media/materials/textures/dkyellow.png
new file mode 100644
index 00000000..88c1d647
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/dkyellow.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/droplet.png b/school/informatik/verkerhssimulation/media/materials/textures/droplet.png
new file mode 100644
index 00000000..f1cfc4a8
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/droplet.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/egyptrockyfull.jpg b/school/informatik/verkerhssimulation/media/materials/textures/egyptrockyfull.jpg
new file mode 100644
index 00000000..044ce9f1
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/egyptrockyfull.jpg differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/flare.png b/school/informatik/verkerhssimulation/media/materials/textures/flare.png
new file mode 100644
index 00000000..9f8a2a84
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/flare.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/flaretrail.png b/school/informatik/verkerhssimulation/media/materials/textures/flaretrail.png
new file mode 100644
index 00000000..34d4bf2b
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/flaretrail.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/fw12b.jpg b/school/informatik/verkerhssimulation/media/materials/textures/fw12b.jpg
new file mode 100644
index 00000000..98006054
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/fw12b.jpg differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/gras_02.png b/school/informatik/verkerhssimulation/media/materials/textures/gras_02.png
new file mode 100644
index 00000000..1110724c
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/gras_02.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/grass_1024.jpg b/school/informatik/verkerhssimulation/media/materials/textures/grass_1024.jpg
new file mode 100644
index 00000000..e65691b3
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/grass_1024.jpg differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/nm_bk.png b/school/informatik/verkerhssimulation/media/materials/textures/nm_bk.png
new file mode 100644
index 00000000..65998a43
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/nm_bk.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/nm_dn.png b/school/informatik/verkerhssimulation/media/materials/textures/nm_dn.png
new file mode 100644
index 00000000..2b50b027
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/nm_dn.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/nm_fr.png b/school/informatik/verkerhssimulation/media/materials/textures/nm_fr.png
new file mode 100644
index 00000000..9df5d04b
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/nm_fr.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/nm_lf.png b/school/informatik/verkerhssimulation/media/materials/textures/nm_lf.png
new file mode 100644
index 00000000..28606136
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/nm_lf.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/nm_rt.png b/school/informatik/verkerhssimulation/media/materials/textures/nm_rt.png
new file mode 100644
index 00000000..9d0d5717
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/nm_rt.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/nm_up.png b/school/informatik/verkerhssimulation/media/materials/textures/nm_up.png
new file mode 100644
index 00000000..670f8fc4
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/nm_up.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/normalNoiseColor.png b/school/informatik/verkerhssimulation/media/materials/textures/normalNoiseColor.png
new file mode 100644
index 00000000..fc5f77bf
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/normalNoiseColor.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/nskingr.jpg b/school/informatik/verkerhssimulation/media/materials/textures/nskingr.jpg
new file mode 100644
index 00000000..9397f5d9
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/nskingr.jpg differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/ogreborder.png b/school/informatik/verkerhssimulation/media/materials/textures/ogreborder.png
new file mode 100644
index 00000000..9cc0d9da
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/ogreborder.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/ogreborderUp.png b/school/informatik/verkerhssimulation/media/materials/textures/ogreborderUp.png
new file mode 100644
index 00000000..d1ee4a6b
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/ogreborderUp.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/ogrebordercenter.png b/school/informatik/verkerhssimulation/media/materials/textures/ogrebordercenter.png
new file mode 100644
index 00000000..c62c02af
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/ogrebordercenter.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/ogregui.tga b/school/informatik/verkerhssimulation/media/materials/textures/ogregui.tga
new file mode 100644
index 00000000..74f5efda
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/ogregui.tga differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/ogrelogo-small.jpg b/school/informatik/verkerhssimulation/media/materials/textures/ogrelogo-small.jpg
new file mode 100644
index 00000000..9cee6474
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/ogrelogo-small.jpg differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/ogrelogo.png b/school/informatik/verkerhssimulation/media/materials/textures/ogrelogo.png
new file mode 100644
index 00000000..1bc19755
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/ogrelogo.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/perlinvolume.dds b/school/informatik/verkerhssimulation/media/materials/textures/perlinvolume.dds
new file mode 100644
index 00000000..bd8147d4
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/perlinvolume.dds differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/r2skin.jpg b/school/informatik/verkerhssimulation/media/materials/textures/r2skin.jpg
new file mode 100644
index 00000000..3e83a124
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/r2skin.jpg differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/ribbonband.png b/school/informatik/verkerhssimulation/media/materials/textures/ribbonband.png
new file mode 100644
index 00000000..e6966640
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/ribbonband.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/rockwall.tga b/school/informatik/verkerhssimulation/media/materials/textures/rockwall.tga
new file mode 100644
index 00000000..5703a03a
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/rockwall.tga differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/rockwall_NH.tga b/school/informatik/verkerhssimulation/media/materials/textures/rockwall_NH.tga
new file mode 100644
index 00000000..12fa50bd
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/rockwall_NH.tga differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/scr-back.png b/school/informatik/verkerhssimulation/media/materials/textures/scr-back.png
new file mode 100644
index 00000000..05cf8012
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/scr-back.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/scr-down-p.png b/school/informatik/verkerhssimulation/media/materials/textures/scr-down-p.png
new file mode 100644
index 00000000..31b575ea
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/scr-down-p.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/scr-down.png b/school/informatik/verkerhssimulation/media/materials/textures/scr-down.png
new file mode 100644
index 00000000..d52b5475
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/scr-down.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/scr-thumb.png b/school/informatik/verkerhssimulation/media/materials/textures/scr-thumb.png
new file mode 100644
index 00000000..8f05cc72
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/scr-thumb.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/scr-up-p.png b/school/informatik/verkerhssimulation/media/materials/textures/scr-up-p.png
new file mode 100644
index 00000000..b9b45dcb
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/scr-up-p.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/scr-up.png b/school/informatik/verkerhssimulation/media/materials/textures/scr-up.png
new file mode 100644
index 00000000..1e0f9b46
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/scr-up.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/smoke.png b/school/informatik/verkerhssimulation/media/materials/textures/smoke.png
new file mode 100644
index 00000000..002a062b
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/smoke.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/smokecolors.png b/school/informatik/verkerhssimulation/media/materials/textures/smokecolors.png
new file mode 100644
index 00000000..d8ab9bd1
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/smokecolors.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/snow_1024.jpg b/school/informatik/verkerhssimulation/media/materials/textures/snow_1024.jpg
new file mode 100644
index 00000000..56590af4
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/snow_1024.jpg differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/spacesky.jpg b/school/informatik/verkerhssimulation/media/materials/textures/spacesky.jpg
new file mode 100644
index 00000000..a7e0c570
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/spacesky.jpg differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/spheremap.png b/school/informatik/verkerhssimulation/media/materials/textures/spheremap.png
new file mode 100644
index 00000000..e6b91475
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/spheremap.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/steelhead.png b/school/informatik/verkerhssimulation/media/materials/textures/steelhead.png
new file mode 100644
index 00000000..4c2ba370
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/steelhead.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/terr_dirt-grass.jpg b/school/informatik/verkerhssimulation/media/materials/textures/terr_dirt-grass.jpg
new file mode 100644
index 00000000..001bd3e7
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/terr_dirt-grass.jpg differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/terr_rock-dirt.jpg b/school/informatik/verkerhssimulation/media/materials/textures/terr_rock-dirt.jpg
new file mode 100644
index 00000000..6fda5c7c
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/terr_rock-dirt.jpg differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/terr_rock6.jpg b/school/informatik/verkerhssimulation/media/materials/textures/terr_rock6.jpg
new file mode 100644
index 00000000..3100ed74
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/terr_rock6.jpg differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/terrain.png b/school/informatik/verkerhssimulation/media/materials/textures/terrain.png
new file mode 100644
index 00000000..16e853fe
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/terrain.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/terrain_detail.jpg b/school/informatik/verkerhssimulation/media/materials/textures/terrain_detail.jpg
new file mode 100644
index 00000000..981e37e6
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/terrain_detail.jpg differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/terrain_texture.jpg b/school/informatik/verkerhssimulation/media/materials/textures/terrain_texture.jpg
new file mode 100644
index 00000000..8d4fda5a
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/terrain_texture.jpg differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/texmap2.jpg b/school/informatik/verkerhssimulation/media/materials/textures/texmap2.jpg
new file mode 100644
index 00000000..792da7fb
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/texmap2.jpg differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/waveNM.png b/school/informatik/verkerhssimulation/media/materials/textures/waveNM.png
new file mode 100644
index 00000000..766e2e73
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/waveNM.png differ
diff --git a/school/informatik/verkerhssimulation/media/materials/textures/waves2.dds b/school/informatik/verkerhssimulation/media/materials/textures/waves2.dds
new file mode 100644
index 00000000..c379886f
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/materials/textures/waves2.dds differ
diff --git a/school/informatik/verkerhssimulation/media/models/Barrel.mesh b/school/informatik/verkerhssimulation/media/models/Barrel.mesh
new file mode 100644
index 00000000..511dbbea
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/models/Barrel.mesh differ
diff --git a/school/informatik/verkerhssimulation/media/models/RZR-002.mesh b/school/informatik/verkerhssimulation/media/models/RZR-002.mesh
new file mode 100644
index 00000000..64fc8548
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/models/RZR-002.mesh differ
diff --git a/school/informatik/verkerhssimulation/media/models/WoodPallet.mesh b/school/informatik/verkerhssimulation/media/models/WoodPallet.mesh
new file mode 100644
index 00000000..88db450a
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/models/WoodPallet.mesh differ
diff --git a/school/informatik/verkerhssimulation/media/models/athene.mesh b/school/informatik/verkerhssimulation/media/models/athene.mesh
new file mode 100644
index 00000000..46e39f19
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/models/athene.mesh differ
diff --git a/school/informatik/verkerhssimulation/media/models/column.mesh b/school/informatik/verkerhssimulation/media/models/column.mesh
new file mode 100644
index 00000000..5e9b44b1
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/models/column.mesh differ
diff --git a/school/informatik/verkerhssimulation/media/models/cube.mesh b/school/informatik/verkerhssimulation/media/models/cube.mesh
new file mode 100644
index 00000000..cf7dc84e
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/models/cube.mesh differ
diff --git a/school/informatik/verkerhssimulation/media/models/facial.mesh b/school/informatik/verkerhssimulation/media/models/facial.mesh
new file mode 100644
index 00000000..c59606d7
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/models/facial.mesh differ
diff --git a/school/informatik/verkerhssimulation/media/models/fish.mesh b/school/informatik/verkerhssimulation/media/models/fish.mesh
new file mode 100644
index 00000000..d82b06e2
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/models/fish.mesh differ
diff --git a/school/informatik/verkerhssimulation/media/models/fish.skeleton b/school/informatik/verkerhssimulation/media/models/fish.skeleton
new file mode 100644
index 00000000..7a970fda
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/models/fish.skeleton differ
diff --git a/school/informatik/verkerhssimulation/media/models/geosphere4500.mesh b/school/informatik/verkerhssimulation/media/models/geosphere4500.mesh
new file mode 100644
index 00000000..92e42e3b
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/models/geosphere4500.mesh differ
diff --git a/school/informatik/verkerhssimulation/media/models/geosphere8000.mesh b/school/informatik/verkerhssimulation/media/models/geosphere8000.mesh
new file mode 100644
index 00000000..5922ccd6
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/models/geosphere8000.mesh differ
diff --git a/school/informatik/verkerhssimulation/media/models/jaiqua.mesh b/school/informatik/verkerhssimulation/media/models/jaiqua.mesh
new file mode 100644
index 00000000..a6e3982d
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/models/jaiqua.mesh differ
diff --git a/school/informatik/verkerhssimulation/media/models/jaiqua.skeleton b/school/informatik/verkerhssimulation/media/models/jaiqua.skeleton
new file mode 100644
index 00000000..3d7622c5
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/models/jaiqua.skeleton differ
diff --git a/school/informatik/verkerhssimulation/media/models/knot.mesh b/school/informatik/verkerhssimulation/media/models/knot.mesh
new file mode 100644
index 00000000..84aa8454
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/models/knot.mesh differ
diff --git a/school/informatik/verkerhssimulation/media/models/ninja.mesh b/school/informatik/verkerhssimulation/media/models/ninja.mesh
new file mode 100644
index 00000000..46df1900
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/models/ninja.mesh differ
diff --git a/school/informatik/verkerhssimulation/media/models/ninja.skeleton b/school/informatik/verkerhssimulation/media/models/ninja.skeleton
new file mode 100644
index 00000000..787f5f75
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/models/ninja.skeleton differ
diff --git a/school/informatik/verkerhssimulation/media/models/ogrehead.mesh b/school/informatik/verkerhssimulation/media/models/ogrehead.mesh
new file mode 100644
index 00000000..936f25a4
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/models/ogrehead.mesh differ
diff --git a/school/informatik/verkerhssimulation/media/models/razor.mesh b/school/informatik/verkerhssimulation/media/models/razor.mesh
new file mode 100644
index 00000000..1177280b
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/models/razor.mesh differ
diff --git a/school/informatik/verkerhssimulation/media/models/robot.mesh b/school/informatik/verkerhssimulation/media/models/robot.mesh
new file mode 100644
index 00000000..b408e317
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/models/robot.mesh differ
diff --git a/school/informatik/verkerhssimulation/media/models/robot.skeleton b/school/informatik/verkerhssimulation/media/models/robot.skeleton
new file mode 100644
index 00000000..0aa8bde5
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/models/robot.skeleton differ
diff --git a/school/informatik/verkerhssimulation/media/models/sphere.mesh b/school/informatik/verkerhssimulation/media/models/sphere.mesh
new file mode 100644
index 00000000..286317e0
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/models/sphere.mesh differ
diff --git a/school/informatik/verkerhssimulation/media/models/tudorhouse.mesh b/school/informatik/verkerhssimulation/media/models/tudorhouse.mesh
new file mode 100644
index 00000000..1dd5ae4a
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/models/tudorhouse.mesh differ
diff --git a/school/informatik/verkerhssimulation/media/ogre pic.bmp b/school/informatik/verkerhssimulation/media/ogre pic.bmp
new file mode 100644
index 00000000..2c7918cf
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/ogre pic.bmp differ
diff --git a/school/informatik/verkerhssimulation/media/ogre pic.xcf b/school/informatik/verkerhssimulation/media/ogre pic.xcf
new file mode 100644
index 00000000..507b6867
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/ogre pic.xcf differ
diff --git a/school/informatik/verkerhssimulation/media/overlays/BasicOgreGuiTemplates.inc b/school/informatik/verkerhssimulation/media/overlays/BasicOgreGuiTemplates.inc
new file mode 100644
index 00000000..94290c40
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/overlays/BasicOgreGuiTemplates.inc
@@ -0,0 +1,47 @@
+// Ogre overlay scripts
+template container BorderPanel(SS/Templates/BasicBorderPanel)
+{
+ left 0
+ top 0
+ width 1
+ height 1
+ material Core/StatsBlockCenter
+ border_size 0.06 0.06 0.06665 0.06665
+ border_material Core/StatsBlockBorder
+ border_topleft_uv 0.0000 0.0000 0.1914 0.2031
+ border_top_uv 0.1914 0.0000 0.8086 0.2031
+ border_topright_uv 0.8086 0.0000 1.0000 0.2031
+ border_left_uv 0.0000 0.2031 0.1914 0.7852
+ border_right_uv 0.8086 0.2031 1.0000 0.7852
+ border_bottomleft_uv 0.0000 0.7852 0.1914 1.0000
+ border_bottom_uv 0.1914 0.7852 0.8086 1.0000
+ border_bottomright_uv 0.8086 0.7852 1.0000 1.0000
+}
+
+template container BorderPanel(SS/Templates/BasicSmallBorderPanel) : SS/Templates/BasicBorderPanel
+{
+ border_size 0.04 0.04 0.04665 0.04665
+}
+
+
+template element TextArea(SS/Templates/BasicText)
+{
+ font_name Ogre
+ char_height 0.08
+ colour_top 1 1 0
+ colour_bottom 1 0.2 0.2
+ left 0.03
+ top 0.02
+ width 0.12
+ height 0.09
+}
+
+template container Panel(SS/Templates/BasicPanel)
+{
+ left 0
+ top 0
+ width 1
+ height 1
+ material Core/StatsBlockCenter
+}
+
diff --git a/school/informatik/verkerhssimulation/media/overlays/Compositor.overlay b/school/informatik/verkerhssimulation/media/overlays/Compositor.overlay
new file mode 100644
index 00000000..956778ed
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/overlays/Compositor.overlay
@@ -0,0 +1,66 @@
+Example/CompositorOverlay
+{
+ zorder 500
+ // Stats block
+ container BorderPanel(Core/CompositorPanel)
+ {
+ metrics_mode pixels
+ vert_align top
+ left 5
+ top 5
+ width 500
+ height 55
+ material Core/StatsBlockCenter
+ border_size 1 1 1 1
+ border_material Core/StatsBlockBorder
+ border_topleft_uv 0.0000 1.0000 0.0039 0.9961
+ border_top_uv 0.0039 1.0000 0.9961 0.9961
+ border_topright_uv 0.9961 1.0000 1.0000 0.9961
+ border_left_uv 0.0000 0.9961 0.0039 0.0039
+ border_right_uv 0.9961 0.9961 1.0000 0.0039
+ border_bottomleft_uv 0.0000 0.0039 0.0039 0.0000
+ border_bottom_uv 0.0039 0.0039 0.9961 0.0000
+ border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+
+
+ element TextArea(Example/Compositor/Desc)
+ {
+ metrics_mode pixels
+ left 5
+ top 5
+ width 180
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption Use keys 1-8 to toggle each compositor
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+ element TextArea(Example/Compositor/ActiveLabel)
+ {
+ metrics_mode pixels
+ left 5
+ top 20
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption Active Compositors:
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+ element TextArea(Example/Compositor/ActiveText)
+ {
+ metrics_mode pixels
+ left 155
+ top 20
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption Current:
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+ }
+}
diff --git a/school/informatik/verkerhssimulation/media/overlays/DP3.overlay b/school/informatik/verkerhssimulation/media/overlays/DP3.overlay
new file mode 100644
index 00000000..b6051f6e
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/overlays/DP3.overlay
@@ -0,0 +1,105 @@
+Example/DP3Overlay
+{
+ zorder 500
+ // Stats block
+ container BorderPanel(Core/DP3Panel)
+ {
+ metrics_mode pixels
+ vert_align top
+ left 5
+ top 5
+ width 500
+ height 70
+ material Core/StatsBlockCenter
+ border_size 1 1 1 1
+ border_material Core/StatsBlockBorder
+ border_topleft_uv 0.0000 1.0000 0.0039 0.9961
+ border_top_uv 0.0039 1.0000 0.9961 0.9961
+ border_topright_uv 0.9961 1.0000 1.0000 0.9961
+ border_left_uv 0.0000 0.9961 0.0039 0.0039
+ border_right_uv 0.9961 0.9961 1.0000 0.0039
+ border_bottomleft_uv 0.0000 0.0039 0.0039 0.0000
+ border_bottom_uv 0.0039 0.0039 0.9961 0.0000
+ border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+
+ element TextArea(Example/DP3/Light)
+ {
+ metrics_mode pixels
+ left 5
+ top 5
+ width 180
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption [1,2,3] toggle lights
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+
+ element TextArea(Example/DP3/Object)
+ {
+ metrics_mode pixels
+ left 5
+ top 20
+ width 180
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption [O] change objects
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+ element TextArea(Example/DP3/ObjectInfo)
+ {
+ metrics_mode pixels
+ left 155
+ top 20
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption Current:
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+
+ element TextArea(Example/DP3/Materials)
+ {
+ metrics_mode pixels
+ left 5
+ top 35
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption [M] Change material
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+ element TextArea(Example/DP3/MaterialInfo)
+ {
+ metrics_mode pixels
+ left 155
+ top 35
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption Current:
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+ element TextArea(Example/DP3/Info)
+ {
+ metrics_mode pixels
+ left 5
+ top 50
+ width 250
+ height 30
+ font_name BlueHighway
+ char_height 16
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+ }
+}
diff --git a/school/informatik/verkerhssimulation/media/overlays/Example-CubeMapping.overlay b/school/informatik/verkerhssimulation/media/overlays/Example-CubeMapping.overlay
new file mode 100644
index 00000000..3bcf9cc6
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/overlays/Example-CubeMapping.overlay
@@ -0,0 +1,139 @@
+Example/CubeMappingOverlay
+{
+ zorder 500
+ // Stats block
+ container BorderPanel(Core/CubeMappingPanel)
+ {
+ metrics_mode pixels
+ vert_align top
+ left 5
+ top 5
+ width 250
+ height 130
+ material Core/StatsBlockCenter
+ border_size 1 1 1 1
+ border_material Core/StatsBlockBorder
+ border_topleft_uv 0.0000 1.0000 0.0039 0.9961
+ border_top_uv 0.0039 1.0000 0.9961 0.9961
+ border_topright_uv 0.9961 1.0000 1.0000 0.9961
+ border_left_uv 0.0000 0.9961 0.0039 0.0039
+ border_right_uv 0.9961 0.9961 1.0000 0.0039
+ border_bottomleft_uv 0.0000 0.0039 0.0039 0.0000
+ border_bottom_uv 0.0039 0.0039 0.9961 0.0000
+ border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+
+ element TextArea(Example/CubeMapping/Displacement)
+ {
+ metrics_mode pixels
+ left 5
+ top 5
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption [1/2] Displacement:
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+
+ element TextArea(Example/CubeMapping/Density)
+ {
+ metrics_mode pixels
+ left 5
+ top 20
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption [3/4] Noise density:
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+
+ element TextArea(Example/CubeMapping/TimeDensity)
+ {
+ metrics_mode pixels
+ left 5
+ top 35
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption [5/6] Time density:
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+
+
+ element TextArea(Example/CubeMapping/Noise)
+ {
+ metrics_mode pixels
+ left 5
+ top 50
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption [N] Noise: _not_set_
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+
+ element TextArea(Example/CubeMapping/Material)
+ {
+ metrics_mode pixels
+ left 5
+ top 65
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption [M] Material: *UNIMPLEMENTED*
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+
+ element TextArea(Example/CubeMapping/Object)
+ {
+ metrics_mode pixels
+ left 5
+ top 80
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption [O] Object:
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+
+ element TextArea(Example/CubeMapping/CubeMap)
+ {
+ metrics_mode pixels
+ left 5
+ top 95
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption [C] CubeMap:
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+
+ element TextArea(Example/CubeMapping/Random)
+ {
+ metrics_mode pixels
+ left 5
+ top 110
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption [SPACE] Go random!
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+
+ }
+}
diff --git a/school/informatik/verkerhssimulation/media/overlays/Example-DynTex.overlay b/school/informatik/verkerhssimulation/media/overlays/Example-DynTex.overlay
new file mode 100644
index 00000000..9741f969
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/overlays/Example-DynTex.overlay
@@ -0,0 +1,194 @@
+Example/DynTexOverlay
+{
+ zorder 500
+ // Stats block
+ container BorderPanel(Core/DynTexPanel)
+ {
+ metrics_mode pixels
+ vert_align top
+ left 5
+ top 5
+ width 200
+ height 100
+ material Core/StatsBlockCenter
+ border_size 1 1 1 1
+ border_material Core/StatsBlockBorder
+ border_topleft_uv 0.0000 1.0000 0.0039 0.9961
+ border_top_uv 0.0039 1.0000 0.9961 0.9961
+ border_topright_uv 0.9961 1.0000 1.0000 0.9961
+ border_left_uv 0.0000 0.9961 0.0039 0.0039
+ border_right_uv 0.9961 0.9961 1.0000 0.0039
+ border_bottomleft_uv 0.0000 0.0039 0.0039 0.0000
+ border_bottom_uv 0.0039 0.0039 0.9961 0.0000
+ border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+
+ element TextArea(Example/DynTex/Note)
+ {
+ metrics_mode pixels
+ left 5
+ top 5
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption Reaction parameters
+ colour_top 0.7 0.9 0.7
+ colour_bottom 0.5 0.7 0.5
+ }
+
+ element TextArea(Example/DynTex/Param_K)
+ {
+ metrics_mode pixels
+ left 5
+ top 20
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption [1/2]K:
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+
+ element TextArea(Example/DynTex/Param_F)
+ {
+ metrics_mode pixels
+ left 5
+ top 35
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption [3/4]F:
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+
+ element TextArea(Example/DynTex/Param_A0)
+ {
+ metrics_mode pixels
+ left 5
+ top 50
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption [5/6]Diffusion 1:
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+
+ element TextArea(Example/DynTex/Param_A1)
+ {
+ metrics_mode pixels
+ left 5
+ top 65
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption [7/8]Diffusion 2:
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+
+ element TextArea(Example/DynTex/Zero)
+ {
+ metrics_mode pixels
+ left 5
+ top 80
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption [0]Reset initial conditions
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+
+
+ }
+}
+Example/VolTexOverlay
+{
+ zorder 500
+ // Stats block
+ container BorderPanel(Example/VolTexPanel)
+ {
+ metrics_mode pixels
+ vert_align top
+ left 5
+ top 5
+ width 200
+ height 70
+ material Core/StatsBlockCenter
+ border_size 1 1 1 1
+ border_material Core/StatsBlockBorder
+ border_topleft_uv 0.0000 1.0000 0.0039 0.9961
+ border_top_uv 0.0039 1.0000 0.9961 0.9961
+ border_topright_uv 0.9961 1.0000 1.0000 0.9961
+ border_left_uv 0.0000 0.9961 0.0039 0.0039
+ border_right_uv 0.9961 0.9961 1.0000 0.0039
+ border_bottomleft_uv 0.0000 0.0039 0.0039 0.0000
+ border_bottom_uv 0.0039 0.0039 0.9961 0.0000
+ border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+
+ element TextArea(Example/VolTex/Note)
+ {
+ metrics_mode pixels
+ left 5
+ top 5
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption Julia parameters
+ colour_top 0.7 0.9 0.7
+ colour_bottom 0.5 0.7 0.5
+ }
+
+ element TextArea(Example/VolTex/Param_real)
+ {
+ metrics_mode pixels
+ left 5
+ top 20
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption [1/2]real:
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+
+ element TextArea(Example/VolTex/Param_imag)
+ {
+ metrics_mode pixels
+ left 5
+ top 35
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption [3/4]imag:
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+
+ element TextArea(Example/VolTex/Param_theta)
+ {
+ metrics_mode pixels
+ left 5
+ top 50
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption [5/6]theta:
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+
+
+ }
+}
diff --git a/school/informatik/verkerhssimulation/media/overlays/Example-Water.overlay b/school/informatik/verkerhssimulation/media/overlays/Example-Water.overlay
new file mode 100644
index 00000000..69f7e6d0
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/overlays/Example-Water.overlay
@@ -0,0 +1,168 @@
+Example/WaterOverlay
+{
+ zorder 500
+ // Stats block
+ container BorderPanel(Core/WaterPanel)
+ {
+ metrics_mode pixels
+ vert_align top
+ left 5
+ top 5
+ width 400
+ height 87
+ material Core/StatsBlockCenter
+ border_size 1 1 1 1
+ border_material Core/StatsBlockBorder
+ border_topleft_uv 0.0000 1.0000 0.0039 0.9961
+ border_top_uv 0.0039 1.0000 0.9961 0.9961
+ border_topright_uv 0.9961 1.0000 1.0000 0.9961
+ border_left_uv 0.0000 0.9961 0.0039 0.0039
+ border_right_uv 0.9961 0.9961 1.0000 0.0039
+ border_bottomleft_uv 0.0000 0.0039 0.0039 0.0000
+ border_bottom_uv 0.0039 0.0039 0.9961 0.0000
+ border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+
+
+ element TextArea(Example/Water/Normals)
+ {
+ metrics_mode pixels
+ left 5
+ top 5
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption [N]Normals:
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+
+ element TextArea(Example/Water/Rain)
+ {
+ metrics_mode pixels
+ left 5
+ top 20
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption [SPACE]Rain
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+
+ element TextArea(Example/Water/SkyBox)
+ {
+ metrics_mode pixels
+ left 5
+ top 35
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption [B]SkyBox:
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+
+ element TextArea(Example/Water/Depth)
+ {
+ metrics_mode pixels
+ left 5
+ top 50
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption [U/J]Head depth:
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+
+ element TextArea(Example/Water/Material)
+ {
+ metrics_mode pixels
+ left 5
+ top 65
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption [M]Material:
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+
+ element TextArea(Example/Water/Note)
+ {
+ metrics_mode pixels
+ left 200
+ top 5
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption Careful with these values!
+ colour_top 0.7 0.9 0.7
+ colour_bottom 0.5 0.7 0.5
+ }
+
+ element TextArea(Example/Water/Param_C)
+ {
+ metrics_mode pixels
+ left 200
+ top 20
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption [1/2]Ripple speed:
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+
+ element TextArea(Example/Water/Param_D)
+ {
+ metrics_mode pixels
+ left 200
+ top 35
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption [3/4]Distance:
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+
+ element TextArea(Example/Water/Param_U)
+ {
+ metrics_mode pixels
+ left 200
+ top 50
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption [5/6]Viscosity:
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+
+ element TextArea(Example/Water/Param_T)
+ {
+ metrics_mode pixels
+ left 200
+ top 65
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption [7/8]Time period:
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+
+
+ }
+}
diff --git a/school/informatik/verkerhssimulation/media/overlays/Shadows.overlay b/school/informatik/verkerhssimulation/media/overlays/Shadows.overlay
new file mode 100644
index 00000000..25f36173
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/overlays/Shadows.overlay
@@ -0,0 +1,92 @@
+Example/ShadowsOverlay
+{
+ zorder 500
+ // Stats block
+ container BorderPanel(Core/ShadowsPanel)
+ {
+ metrics_mode pixels
+ vert_align top
+ left 5
+ top 5
+ width 500
+ height 55
+ material Core/StatsBlockCenter
+ border_size 1 1 1 1
+ border_material Core/StatsBlockBorder
+ border_topleft_uv 0.0000 1.0000 0.0039 0.9961
+ border_top_uv 0.0039 1.0000 0.9961 0.9961
+ border_topright_uv 0.9961 1.0000 1.0000 0.9961
+ border_left_uv 0.0000 0.9961 0.0039 0.0039
+ border_right_uv 0.9961 0.9961 1.0000 0.0039
+ border_bottomleft_uv 0.0000 0.0039 0.0039 0.0000
+ border_bottom_uv 0.0039 0.0039 0.9961 0.0000
+ border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+
+
+ element TextArea(Example/Shadows/ShadowTechnique)
+ {
+ metrics_mode pixels
+ left 5
+ top 5
+ width 180
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption [O] Shadow Technique
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+ element TextArea(Example/Shadows/ShadowTechniqueInfo)
+ {
+ metrics_mode pixels
+ left 155
+ top 5
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption Current:
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+
+ element TextArea(Example/Shadows/Materials)
+ {
+ metrics_mode pixels
+ left 5
+ top 20
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption [M] Athene Material
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+ element TextArea(Example/Shadows/MaterialInfo)
+ {
+ metrics_mode pixels
+ left 155
+ top 20
+ width 90
+ height 30
+ font_name BlueHighway
+ char_height 16
+ caption Current:
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+ element TextArea(Example/Shadows/Info)
+ {
+ metrics_mode pixels
+ left 5
+ top 35
+ width 250
+ height 30
+ font_name BlueHighway
+ char_height 16
+ colour_top 0.5 0.7 0.5
+ colour_bottom 0.3 0.5 0.3
+ }
+ }
+}
diff --git a/school/informatik/verkerhssimulation/media/packs/OgreCore.zip b/school/informatik/verkerhssimulation/media/packs/OgreCore.zip
new file mode 100644
index 00000000..578552c1
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/packs/OgreCore.zip differ
diff --git a/school/informatik/verkerhssimulation/media/packs/chiropteraDM.pk3 b/school/informatik/verkerhssimulation/media/packs/chiropteraDM.pk3
new file mode 100644
index 00000000..ffa2c6d3
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/packs/chiropteraDM.pk3 differ
diff --git a/school/informatik/verkerhssimulation/media/packs/chiropteraDM.txt b/school/informatik/verkerhssimulation/media/packs/chiropteraDM.txt
new file mode 100644
index 00000000..caa7829b
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/packs/chiropteraDM.txt
@@ -0,0 +1,99 @@
+date: September 17th 2001.
+Quake3Arena DM level.
+
+====================================================
+title: ChiropteraDM
+file: ChiropteraDM.pk3
+
+authors: Alcatraz / Nunuk / Sock
+
+Alcatraz alcatraz@planetquake.com
+ http://www.planetquake.com/bighouse
+Nunuk: nunuk@planetquake.com
+ http://www.planetquake.com/nunuk
+Sock: sock@planetquake.com
+ http://www.planetquake.com/simland
+====================================================
+Components
+
+Architecture: Nunuk
+Gameplay: Alcatraz
+Textures: Sock / Arnaud "pikouze" barros / Nunuk
+
+====================================================
+Play information
+
+tourney: yes
+deathmatch: 2-6
+Bot File (aas): yes (Optimized)
+
+how to play place chiropteraDM.pk3 in your
+ /Quake III Arena/baseq3/ folder
+ start quake3 Arena
+ hit ~
+ type /map chiropteraDM
+ type /addbot
+ hit ~ (to clear the console)
+
+Note: If the map does not start automatically after loading then make
+sure you have the SV_PURE variable set to 0. I also included an arena
+file in the pk3 file so that it can be loaded from the menus.
+
+====================================================
+Construction
+
+editor: Q3Radiant 197 by Id Software
+build time: Original Map : 3 months, New version : 1 month
+build version: 6(F)
+
+====================================================
+New Beta testers: Nunuk, Ttimo, NakedApe, Shallow[BAP]
+
+Thanks from Sock:
+
+ Ttimo : for advice and testing.
+ NakedApe : for advice on TA items and testing.
+ alcatraz : for taking time on the level, and for his item placement.
+ Zed the best gf ever :P
+
+Additional thanks from Nunuk:
+
+ my wife lorene. for her patience.
+ my son arthur.(stop slapping dad's keyboard!)
+ for advice and testing : nanospawn, bal, sock, shod, ttimo, spog.
+ auhsan - for inspiration :o)
+ th - too bad for the title, it will be for the next map.
+ just for being there : lunaran, grindspire, friction, and all at TF.
+ cool_ber - for being cool :>
+ ptit benj - always there for cool advices
+ bengal - for his awesome artwork
+ pappy-r, will, ash, and staff, @ planetquake
+ all the guys at qmap and terrafusion
+ ohz, shod and fff - for pimping and for always reminding me that i'll
+ become a real mapper when i'll stop doing these crappy space maps .... :oD
+ www.quakexpert.com
+ darkworks
+ yan "la crampe" - the only "dm17sucks" dude that passes at
+ least one hour a day playing in it.
+ arnaud "pikouse" - for allowing me to modify his own texes.
+ roland "poz_kak"
+
+
+Thanx to all the other people that i could have forgot. ;)
+
+====================================================
+Distribution / Copyright / Permissions
+
+Copyright (c) 2001 sock, sock@planetquake.com
+All rights reserved.
+
+Quake III Arena is a registered trademark of
+id Software, Inc.
+
+This level may be electronically distributed only at
+NO CHARGE to the recipient in its current state, MUST
+include this .txt file, and may NOT be modified IN
+ANY WAY. UNDER NO CIRCUMSTANCES IS THIS LEVEL TO BE
+DISTRIBUTED ON CD-ROM WITHOUT PRIOR WRITTEN PERMISSION.
+
+====================================================
diff --git a/school/informatik/verkerhssimulation/media/packs/cubemap.zip b/school/informatik/verkerhssimulation/media/packs/cubemap.zip
new file mode 100644
index 00000000..89917019
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/packs/cubemap.zip differ
diff --git a/school/informatik/verkerhssimulation/media/packs/cubemapsJS.zip b/school/informatik/verkerhssimulation/media/packs/cubemapsJS.zip
new file mode 100644
index 00000000..304e8f84
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/packs/cubemapsJS.zip differ
diff --git a/school/informatik/verkerhssimulation/media/packs/dragon.zip b/school/informatik/verkerhssimulation/media/packs/dragon.zip
new file mode 100644
index 00000000..8a857917
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/packs/dragon.zip differ
diff --git a/school/informatik/verkerhssimulation/media/packs/fresneldemo.zip b/school/informatik/verkerhssimulation/media/packs/fresneldemo.zip
new file mode 100644
index 00000000..2f54d280
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/packs/fresneldemo.zip differ
diff --git a/school/informatik/verkerhssimulation/media/packs/ogretestmap.zip b/school/informatik/verkerhssimulation/media/packs/ogretestmap.zip
new file mode 100644
index 00000000..63fb7860
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/packs/ogretestmap.zip differ
diff --git a/school/informatik/verkerhssimulation/media/packs/skybox.zip b/school/informatik/verkerhssimulation/media/packs/skybox.zip
new file mode 100644
index 00000000..06f6820d
Binary files /dev/null and b/school/informatik/verkerhssimulation/media/packs/skybox.zip differ
diff --git a/school/informatik/verkerhssimulation/media/particle/Example-Water.particle b/school/informatik/verkerhssimulation/media/particle/Example-Water.particle
new file mode 100644
index 00000000..877d3b8c
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/particle/Example-Water.particle
@@ -0,0 +1,35 @@
+Examples/Water/Rain
+{
+ material Examples/Droplet
+ particle_width 100
+ particle_height 300
+ cull_each true
+ quota 100
+ // Make common direction straight down (faster than self oriented)
+ billboard_type oriented_common
+ common_direction 0 -1 0
+
+ // Area emitter
+ emitter Box
+ {
+ angle 0
+ emission_rate 20
+ time_to_live 5
+ direction 0 -1 0
+ velocity 1000
+ colour_range_start 0.3 1 0.3
+ colour_range_end 0.7 1 0.7
+ width 3000
+ height 3000
+ depth 0
+ }
+
+ // Gravity
+ affector LinearForce
+ {
+ force_vector 0 -1000 0
+ force_application add
+ }
+
+}
+
diff --git a/school/informatik/verkerhssimulation/media/particle/Example.particle b/school/informatik/verkerhssimulation/media/particle/Example.particle
new file mode 100644
index 00000000..ddeae9c0
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/particle/Example.particle
@@ -0,0 +1,395 @@
+// Example particle systems
+
+// Exudes greeny particles which float upwards
+Examples/GreenyNimbus
+{
+ material Examples/FlarePointSprite
+ point_rendering true
+ // point rendering means size is controlled by material
+ // provide fallback sizes for hardware that doesn't support point sprite
+ particle_width 30
+ particle_height 30
+ cull_each false
+ cull_each false
+ quota 10000
+ billboard_type point
+
+ // Area emitter
+ emitter Box
+ {
+ angle 30
+ emission_rate 30
+ time_to_live 5
+ direction 0 1 0
+ velocity 0
+ colour_range_start 1 1 0
+ colour_range_end 0.3 1 0.3
+ width 60
+ height 60
+ depth 60
+ }
+
+ // Make em float upwards
+ affector LinearForce
+ {
+ force_vector 0 100 0
+ force_application add
+ }
+
+ // Fader
+ affector ColourFader
+ {
+ red -0.25
+ green -0.25
+ blue -0.25
+ }
+
+
+}
+
+// A sparkly purple fountain
+Examples/PurpleFountain
+{
+ material Examples/Flare2
+ particle_width 20
+ particle_height 40
+ cull_each false
+ quota 10000
+ billboard_type oriented_self
+
+ // Area emitter
+ emitter Point
+ {
+ angle 15
+ emission_rate 75
+ time_to_live 3
+ direction 0 1 0
+ velocity_min 250
+ velocity_max 300
+ colour_range_start 0 0 0
+ colour_range_end 1 1 1
+ }
+
+ // Gravity
+ affector LinearForce
+ {
+ force_vector 0 -100 0
+ force_application add
+ }
+
+ // Fader
+ affector ColourFader
+ {
+ red -0.25
+ green -0.25
+ blue -0.25
+ }
+}
+
+
+// A downpour
+Examples/Rain
+{
+ material Examples/Droplet
+ particle_width 20
+ particle_height 100
+ cull_each true
+ quota 10000
+ // Make common direction straight down (faster than self oriented)
+ billboard_type oriented_common
+ common_direction 0 -1 0
+
+ // Area emitter
+ emitter Box
+ {
+ angle 0
+ emission_rate 100
+ time_to_live 5
+ direction 0 -1 0
+ velocity 50
+ colour_range_start 0.3 1 0.3
+ colour_range_end 0.7 1 0.7
+ width 1000
+ height 1000
+ depth 0
+ }
+
+ // Gravity
+ affector LinearForce
+ {
+ force_vector 0 -200 0
+ force_application add
+ }
+
+}
+
+// A jet engine (of sorts)
+Examples/JetEngine1
+{
+ material Examples/Flare
+ particle_width 25
+ particle_height 25
+ cull_each false
+ quota 200
+ billboard_type point
+
+ emitter Point
+ {
+ angle 5
+ emission_rate 100
+ time_to_live 1
+ direction 0 -1 0
+ velocity_min 250
+ velocity_max 300
+ colour_range_start 1 1 0.5
+ colour_range_end 1 0.8 0.3
+
+ }
+ affector ColourFader
+ {
+ red -0.25
+ green -1
+ blue -1
+ }
+
+}
+Examples/JetEngine2
+{
+ material Examples/Flare
+ particle_width 15
+ particle_height 15
+ cull_each false
+ quota 200
+ billboard_type point
+
+ emitter Point
+ {
+ angle 3
+ emission_rate 100
+ time_to_live 1
+ direction 0 -1 0
+ velocity_min 350
+ velocity_max 400
+ colour_range_start 0.5 1 1
+ colour_range_end 0.3 0.8 1
+
+ }
+ affector ColourFader
+ {
+ red -1
+ green -1
+ blue -0.5
+ }
+
+}
+
+// Exudes aureola particles which around the model float upwards
+Examples/Aureola
+{
+ material Examples/Aureola
+ particle_width 200
+ particle_height 200
+ cull_each false
+ quota 100
+ billboard_type perpendicular_common
+ common_direction 0 1 0
+ common_up_vector 0 0 1
+
+ // Area emitter
+ emitter Box
+ {
+ angle 30
+ emission_rate 4
+ time_to_live 5
+ position 0 -100 0
+ direction 0 1 0
+ velocity_min 0
+ velocity_max 30
+ colour_range_start 0.3 0.3 0.3 0.0
+ colour_range_end 0.8 0.8 0.8 0.0
+ width 10
+ height 10
+ depth 30
+ }
+
+ // Make em float upwards
+ affector LinearForce
+ {
+ force_vector 0 70 0
+ force_application add
+ }
+
+ // Fader
+ affector ColourFader2
+ {
+ red1 +0.4
+ green1 +0.4
+ blue1 +0.4
+ alpha1 +0.7
+
+ red2 -0.25
+ green2 -0.25
+ blue2 -0.25
+ alpha2 -0.3333
+
+ state_change 3.5
+ }
+
+ // Rotater
+ affector Rotator
+ {
+ rotation_range_start 0
+ rotation_range_end 360
+ rotation_speed_range_start 0
+ rotation_speed_range_end 180
+ }
+}
+
+
+Examples/Swarm
+{
+ quota 3000
+ material Examples/Flare2
+ particle_width 12
+ particle_height 24
+ cull_each true
+ renderer billboard
+ sorted true
+ local_space false
+ billboard_type oriented_self
+
+ emitter Box
+ {
+ angle 180
+ colour 1 1 1 1
+ colour_range_start 1 1 1 1
+ colour_range_end 1 1 1 1
+ direction 0 1 0
+ emission_rate 30
+ position 0 0 0
+ velocity 50
+ velocity_min 50
+ velocity_max 1
+ time_to_live 20
+ time_to_live_min 20
+ time_to_live_max 20
+ duration 0
+ duration_min 0
+ duration_max 0
+ repeat_delay 0
+ repeat_delay_min 0
+ repeat_delay_max 0
+ width 80
+ height 80
+ depth 80
+ }
+
+ affector ColourFader
+ {
+ red -0.05
+ green 0
+ blue 0
+ alpha 0
+ }
+
+ affector DeflectorPlane
+ {
+ plane_point 0 -50 0
+ plane_normal 0 1 0
+ bounce 1
+ }
+
+ affector DeflectorPlane
+ {
+ plane_point 0 50 0
+ plane_normal 0 -1 0
+ bounce 1
+ }
+
+ affector DeflectorPlane
+ {
+ plane_point 50 0 0
+ plane_normal -1 0 0
+ bounce 1
+ }
+
+ affector DeflectorPlane
+ {
+ plane_point -50 0 0
+ plane_normal 1 0 0
+ bounce 1
+ }
+
+ affector DeflectorPlane
+ {
+ plane_point 0 0 50
+ plane_normal 0 0 -1
+ bounce 1
+ }
+
+ affector DeflectorPlane
+ {
+ plane_point 0 0 -50
+ plane_normal 0 0 1
+ bounce 1
+ }
+
+ affector DirectionRandomiser
+ {
+ randomness 60
+ }
+}
+
+
+Examples/Snow
+{
+ quota 2000
+ material Examples/Flare
+ particle_width 4
+ particle_height 4
+ cull_each true
+ renderer billboard
+ sorted true
+ local_space false
+ billboard_type point
+
+ emitter Box
+ {
+ angle 0
+ colour 1 1 1 1
+ colour_range_start 1 1 1 1
+ colour_range_end 1 1 1 1
+ direction 0 -1 0
+ emission_rate 100
+ position 0 200 0
+ velocity 20
+ velocity_min 20
+ velocity_max 20
+ time_to_live 20
+ time_to_live_min 20
+ time_to_live_max 20
+ duration 0
+ duration_min 0
+ duration_max 0
+ repeat_delay 0
+ repeat_delay_min 0
+ repeat_delay_max 0
+ width 200
+ height 200
+ depth 1
+ }
+
+ affector DeflectorPlane
+ {
+ plane_point 0 0 0
+ plane_normal 0 1 0
+ bounce 0
+ }
+
+ affector DirectionRandomiser
+ {
+ randomness 10
+ }
+}
+
+
diff --git a/school/informatik/verkerhssimulation/media/particle/emitted_emitter.particle b/school/informatik/verkerhssimulation/media/particle/emitted_emitter.particle
new file mode 100644
index 00000000..47b7bc48
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/particle/emitted_emitter.particle
@@ -0,0 +1,56 @@
+// Example emitted emitters
+Examples/Fireworks
+{
+ material Examples/Flare
+ point_rendering false
+ particle_width 10
+ particle_height 10
+ cull_each false
+ quota 1000
+ emit_emitter_quota 10
+ billboard_type point
+
+ // Emitter that emits multiple Point emitters with name 'explosion'
+ emitter Box
+ {
+ name mainEmitter
+ emit_emitter explosion
+ angle 30
+ emission_rate 1000
+ time_to_live 3
+ direction 0 1 0
+ velocity 200
+ }
+
+ // This Point emitter is emitted by the Box emitter and emits billboard particles itself
+ emitter Point
+ {
+ name explosion
+ angle 360
+ emission_rate 1000
+ time_to_live 2
+ direction 0 1 0
+ velocity 80
+ duration 0.1
+ repeat_delay_min 2
+ repeat_delay_max 3
+ }
+
+ // Make em float downwards
+ affector LinearForce
+ {
+ force_vector 0 -100 0
+ force_application add
+ }
+
+ // Give em some nice colours
+ affector ColourInterpolator
+ {
+ time0 0
+ colour0 1 1 0
+ time1 0.5
+ colour1 1 0 0
+ time2 0.9
+ colour2 0 0 1
+ }
+}
diff --git a/school/informatik/verkerhssimulation/media/particle/smoke.particle b/school/informatik/verkerhssimulation/media/particle/smoke.particle
new file mode 100644
index 00000000..8861ddad
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/particle/smoke.particle
@@ -0,0 +1,43 @@
+// Example particle systems
+
+// smoke
+Examples/Smoke
+{
+ material Examples/Smoke
+ particle_width 55
+ particle_height 55
+ cull_each true
+ quota 500
+ billboard_type point
+ sorted true
+
+ // Area emitter
+ emitter Point
+ {
+ angle 11
+ emission_rate 15
+ time_to_live 4
+ direction 0 1 0
+ velocity_min 150
+ velocity_max 240
+ }
+
+ affector ColourImage
+ {
+ image smokecolors.png
+ }
+
+ affector Rotator
+ {
+ rotation_range_start 0
+ rotation_range_end 360
+ rotation_speed_range_start -60
+ rotation_speed_range_end 200
+ }
+
+ affector Scaler
+ {
+ rate 100
+ }
+
+}
diff --git a/school/informatik/verkerhssimulation/media/terrain.cfg b/school/informatik/verkerhssimulation/media/terrain.cfg
new file mode 100644
index 00000000..5d69f112
--- /dev/null
+++ b/school/informatik/verkerhssimulation/media/terrain.cfg
@@ -0,0 +1,71 @@
+# The main world texture (if you wish the terrain manager to create a material for you)
+WorldTexture=terrain_texture.jpg
+
+# The detail texture (if you wish the terrain manager to create a material for you)
+DetailTexture=terrain_detail.jpg
+
+#number of times the detail texture will tile in a terrain tile
+DetailTile=3
+
+# Heightmap source
+PageSource=Heightmap
+
+# Heightmap-source specific settings
+Heightmap.image=terrain.png
+
+# If you use RAW, fill in the below too
+# RAW-specific setting - size (horizontal/vertical)
+#Heightmap.raw.size=513
+# RAW-specific setting - bytes per pixel (1 = 8bit, 2=16bit)
+#Heightmap.raw.bpp=2
+
+# How large is a page of tiles (in vertices)? Must be (2^n)+1
+PageSize=513
+
+# How large is each tile? Must be (2^n)+1 and be smaller than PageSize
+TileSize=65
+
+# The maximum error allowed when determining which LOD to use
+MaxPixelError=3
+
+# The size of a terrain page, in world units
+PageWorldX=1500
+PageWorldZ=1500
+# Maximum height of the terrain
+MaxHeight=100
+
+# Upper LOD limit
+MaxMipMapLevel=5
+
+#VertexNormals=yes
+#VertexColors=yes
+#UseTriStrips=yes
+
+# Use vertex program to morph LODs, if available
+VertexProgramMorph=yes
+
+# The proportional distance range at which the LOD morph starts to take effect
+# This is as a proportion of the distance between the current LODs effective range,
+# and the effective range of the next lower LOD
+LODMorphStart=0.2
+
+# This following section is for if you want to provide your own terrain shading routine
+# Note that since you define your textures within the material this makes the
+# WorldTexture and DetailTexture settings redundant
+
+# The name of the vertex program parameter you wish to bind the morph LOD factor to
+# this is 0 when there is no adjustment (highest) to 1 when the morph takes it completely
+# to the same position as the next lower LOD
+# USE THIS IF YOU USE HIGH-LEVEL VERTEX PROGRAMS WITH LOD MORPHING
+#MorphLODFactorParamName=morphFactor
+
+# The index of the vertex program parameter you wish to bind the morph LOD factor to
+# this is 0 when there is no adjustment (highest) to 1 when the morph takes it completely
+# to the same position as the next lower LOD
+# USE THIS IF YOU USE ASSEMBLER VERTEX PROGRAMS WITH LOD MORPHING
+#MorphLODFactorParamIndex=4
+
+# The name of the material you will define to shade the terrain
+#CustomMaterialName=TestTerrainMaterial
+
+
diff --git a/school/informatik/verkerhssimulation/open project.bat b/school/informatik/verkerhssimulation/open project.bat
new file mode 100644
index 00000000..c24a920a
--- /dev/null
+++ b/school/informatik/verkerhssimulation/open project.bat
@@ -0,0 +1 @@
+start src\Verkehrssimulation.sln
\ No newline at end of file
diff --git a/school/informatik/verkerhssimulation/run verkehrssimulation.bat b/school/informatik/verkerhssimulation/run verkehrssimulation.bat
new file mode 100644
index 00000000..9f8d7a63
--- /dev/null
+++ b/school/informatik/verkerhssimulation/run verkehrssimulation.bat
@@ -0,0 +1 @@
+start bin\Verkehrssimulation.exe -ncle -pluginpath plugins\
\ No newline at end of file
diff --git a/school/informatik/verkerhssimulation/src/Verkehrssimulation.ncb b/school/informatik/verkerhssimulation/src/Verkehrssimulation.ncb
new file mode 100644
index 00000000..7ee61746
Binary files /dev/null and b/school/informatik/verkerhssimulation/src/Verkehrssimulation.ncb differ
diff --git a/school/informatik/verkerhssimulation/src/Verkehrssimulation.sln b/school/informatik/verkerhssimulation/src/Verkehrssimulation.sln
new file mode 100644
index 00000000..b3972c24
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/Verkehrssimulation.sln
@@ -0,0 +1,49 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Verkehrssimulation", "Verkehrssimulation.vcproj", "{B720E679-39F9-44EF-BE68-4ACEA83DC0D3}"
+ ProjectSection(WebsiteProperties) = preProject
+ Debug.AspNetCompiler.Debug = "True"
+ Release.AspNetCompiler.Debug = "False"
+ EndProjectSection
+ ProjectSection(ProjectDependencies) = postProject
+ {35AFBABB-DF05-43DE-91A7-BB828A874015} = {35AFBABB-DF05-43DE-91A7-BB828A874015}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OgreMain", "..\..\ogre\OgreMain\scripts\OgreMain_vc8.vcproj", "{35AFBABB-DF05-43DE-91A7-BB828A874015}"
+ ProjectSection(WebsiteProperties) = preProject
+ Debug.AspNetCompiler.Debug = "True"
+ Release.AspNetCompiler.Debug = "False"
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ DebugStaticLib|Win32 = DebugStaticLib|Win32
+ Release|Win32 = Release|Win32
+ ReleaseStaticLib|Win32 = ReleaseStaticLib|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {B720E679-39F9-44EF-BE68-4ACEA83DC0D3}.Debug|Win32.ActiveCfg = Debug|Win32
+ {B720E679-39F9-44EF-BE68-4ACEA83DC0D3}.Debug|Win32.Build.0 = Debug|Win32
+ {B720E679-39F9-44EF-BE68-4ACEA83DC0D3}.DebugStaticLib|Win32.ActiveCfg = Debug|Win32
+ {B720E679-39F9-44EF-BE68-4ACEA83DC0D3}.DebugStaticLib|Win32.Build.0 = Debug|Win32
+ {B720E679-39F9-44EF-BE68-4ACEA83DC0D3}.Release|Win32.ActiveCfg = Release|Win32
+ {B720E679-39F9-44EF-BE68-4ACEA83DC0D3}.Release|Win32.Build.0 = Release|Win32
+ {B720E679-39F9-44EF-BE68-4ACEA83DC0D3}.ReleaseStaticLib|Win32.ActiveCfg = Release|Win32
+ {B720E679-39F9-44EF-BE68-4ACEA83DC0D3}.ReleaseStaticLib|Win32.Build.0 = Release|Win32
+ {35AFBABB-DF05-43DE-91A7-BB828A874015}.Debug|Win32.ActiveCfg = Debug|Win32
+ {35AFBABB-DF05-43DE-91A7-BB828A874015}.Debug|Win32.Build.0 = Debug|Win32
+ {35AFBABB-DF05-43DE-91A7-BB828A874015}.DebugStaticLib|Win32.ActiveCfg = DebugStaticLib|Win32
+ {35AFBABB-DF05-43DE-91A7-BB828A874015}.DebugStaticLib|Win32.Build.0 = DebugStaticLib|Win32
+ {35AFBABB-DF05-43DE-91A7-BB828A874015}.Release|Win32.ActiveCfg = Release|Win32
+ {35AFBABB-DF05-43DE-91A7-BB828A874015}.Release|Win32.Build.0 = Release|Win32
+ {35AFBABB-DF05-43DE-91A7-BB828A874015}.ReleaseStaticLib|Win32.ActiveCfg = ReleaseStaticLib|Win32
+ {35AFBABB-DF05-43DE-91A7-BB828A874015}.ReleaseStaticLib|Win32.Build.0 = ReleaseStaticLib|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ DPBuild = 5
+ EndGlobalSection
+EndGlobal
diff --git a/school/informatik/verkerhssimulation/src/Verkehrssimulation.suo b/school/informatik/verkerhssimulation/src/Verkehrssimulation.suo
new file mode 100644
index 00000000..bbca129e
Binary files /dev/null and b/school/informatik/verkerhssimulation/src/Verkehrssimulation.suo differ
diff --git a/school/informatik/verkerhssimulation/src/Verkehrssimulation.vcproj b/school/informatik/verkerhssimulation/src/Verkehrssimulation.vcproj
new file mode 100644
index 00000000..5ae37d41
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/Verkehrssimulation.vcproj
@@ -0,0 +1,354 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/school/informatik/verkerhssimulation/src/Verkehrssimulation.vcproj.D00M2007.Rylon.user b/school/informatik/verkerhssimulation/src/Verkehrssimulation.vcproj.D00M2007.Rylon.user
new file mode 100644
index 00000000..385fd2fc
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/Verkehrssimulation.vcproj.D00M2007.Rylon.user
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/school/informatik/verkerhssimulation/src/c_ycfg/ycfg 1.x/ycfg.pas b/school/informatik/verkerhssimulation/src/c_ycfg/ycfg 1.x/ycfg.pas
new file mode 100644
index 00000000..d1720aca
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/c_ycfg/ycfg 1.x/ycfg.pas
@@ -0,0 +1,616 @@
+unit ycfg;
+
+//v.1.015
+
+interface
+
+uses sysutils,classes;
+
+//strings
+function guckenobzeichenenthaltenist(infostring,searchstring,divideparam:String):boolean;
+function dividestring(str,platzhalter:string;stellenzeiger:integer):string;
+function getnumberofdivides(str,platzhalter:string):integer;
+
+//Wert
+ //get
+
+function getYcfgStr(Filename,info,platzhalter:string):string; overload;
+function getYcfgStr(Filename,info:string):string; overload;
+function getYcfgStr(StringlistWithFile:Tstringlist;info,platzhalter:string):string; overload;
+function getYcfgStr(StringlistWithFile:Tstringlist;info:string):string; overload;
+
+function getYcfgInt(Filename,info,platzhalter:string;defaultint:integer):integer; overload;
+function getYcfgInt(Filename,info:string;defaultint:integer):integer; overload;
+function getYcfgInt(Filename,info:string):integer; overload;
+function getYcfgInt(Filename:TStringlist;info,platzhalter:string;defaultint:integer):integer;overload;
+function getYcfgInt(Filename:TStringlist;info:string;defaultint:integer):integer;overload;
+function getYcfgInt(Filename:TStringlist;info:string):integer;overload;
+
+function getYcfgBool(Filename,info,platzhalter:string):boolean; overload;
+function getYcfgBool(Filename,info:string):boolean; overload;
+function getYcfgBool(StringlistWithFile:Tstringlist;info,platzhalter:string):boolean; overload;
+function getYcfgBool(StringlistWithFile:Tstringlist;info:string):boolean; overload;
+
+ //set
+procedure setYcfgStr(Filename,info,wert,platzhalter:string);overload;
+procedure setYcfgStr(Filename,info,wert:string);overload;
+function setYcfgStr(StringlistWithFile:TStringlist;info,wert,platzhalter:string):TStringlist;overload;
+function setYcfgStr(StringlistWithFile:TStringlist;info,wert:string):TStringlist;overload;
+
+procedure setYcfgInt(Filename,info,platzhalter:string;wert:integer);overload;
+procedure setYcfgInt(Filename,info:string;wert:integer);overload;
+function setYcfgInt(Filename:TStringlist;info,platzhalter:string;wert:integer):Tstringlist;overload;
+function setYcfgInt(Filename:TStringlist;info:string;wert:integer):Tstringlist;overload;
+
+procedure setYcfgBool(Filename,info,platzhalter:string;wert,writtentrue:boolean);overload;
+procedure setYcfgBool(Filename,info:string;wert,writtentrue:boolean);overload;
+procedure setYcfgBool(Filename,info:string;wert:boolean);overload;
+function setYcfgBool(StringlistWithFile:TStringlist;info,platzhalter:string;wert,writtentrue:boolean):TStringlist;overload;
+function setYcfgBool(StringlistWithFile:TStringlist;info:string;wert,writtentrue:boolean):TStringlist;overload;
+function setYcfgBool(StringlistWithFile:TStringlist;info:string;wert:boolean):TStringlist;overload;
+
+//Liste
+ //get
+function getYcfgListe(filepath,divideparam,ignorelist,platzhalter:string):TStringlist; overload;
+function getYcfgListe(StringlistWithFile:TStringlist;divideparam,ignorelist,platzhalter:string):TStringlist; overload;
+
+implementation
+
+function guckenobzeichenenthaltenist(infostring,searchstring,divideparam:String):boolean;
+var count1:integer;
+begin
+//bsp:
+//
+// Rückgabewert von guckenobzeichenenthaltenist('1,2,3,4,5,6,7,8,9','1',',') ist true
+// Dagegen ist guckenobzeichenenthaltenist('1,2,3,4,5,6,7,8,9','10',',') false
+
+ result:=false;
+ count1:=getnumberofdivides(infostring,divideparam);
+ if count1>0 then
+ begin
+ repeat
+ if dividestring(infostring,divideparam,count1)=searchstring then result:=true;
+ count1:=count1-1;
+ until count1<=0;
+ end;
+
+end;
+
+function getycfgliste(StringlistWithFile:TStringlist;divideparam,ignorelist,platzhalter:string):TStringlist; overload;
+var output:TStringlist;
+ count1,count2:integer;
+ test1,ende:boolean;
+begin
+
+//Bsp:
+//
+// Textfile:
+// ...
+// //Foren
+// ---Forum--- //Achtung neue function
+// //Forumname;Forumkonfigdatei;infofile;guest;icon;
+// Testenisscheiße
+//
+// ---Forum---
+// ...
+//
+// temp:=divideycfgfile(wheredistextfileare,'---Forum---','#;##;(*;//',';');
+//
+// Das Ergebnis der function wäre in diesem Falle: "Testenisscheiße", weil alle
+// leeren Zeilen und alle Zeilen mit #,##,(* und // am Anfang ignoriert werden.
+// Außerdem alle leeren Zeilen. Es wird nur zwischen "---Forum---" gesucht.
+// Der Letzte Parameter (platzhalter) (in diesem Falle ";") steht für den "Trenner"
+// zu ignorierenden Zeilenanfängen!
+
+ output:=TStringlist.create;
+
+ ende:=false;
+
+ if StringlistWithFile.count>0 then
+ begin
+ count1:=0;
+ repeat
+ if copy(StringlistWithFile.strings[count1],1,length(divideparam))=divideparam then
+ begin
+ count1:=count1+1;
+ repeat
+ if copy(StringlistWithFile.strings[count1],1,length(divideparam))=divideparam then ende:=true else
+ begin
+ if ende=false then
+ begin
+ count2:=1;
+ test1:=false;
+
+ if getnumberofdivides(ignorelist,platzhalter)<>0 then
+ begin
+ repeat
+ if copy(StringlistWithFile.strings[count1],1,length(dividestring(ignorelist,platzhalter,count2)))= dividestring(ignorelist,platzhalter,count2) then test1:=true;
+ if StringlistWithFile.Strings[count1]='' then test1:=true;
+ count2:=count2+1;
+ until count2>=getnumberofdivides(ignorelist,platzhalter);
+ end;
+
+ if test1=false then output.Add(StringlistWithFile.strings[count1]);
+ end;
+ end;
+ count1:=count1+1;
+ until count1>=StringlistWithFile.count;
+ end;
+ count1:=count1+1;
+ until count1>=StringlistWithFile.count-1;
+ end;
+
+ result:=output;
+
+
+end;
+
+function getycfgliste(filepath,divideparam,ignorelist,platzhalter:string):TStringlist; overload;
+var temp,output:TStringlist;
+ count1,count2:integer;
+ test1,ende:boolean;
+begin
+
+//Bsp:
+//
+// Textfile:
+// ...
+// //Foren
+// ---Forum--- //Achtung neue function
+// //Forumname;Forumkonfigdatei;infofile;guest;icon;
+// Testenisscheiße
+//
+// ---Forum---
+// ...
+//
+// temp:=divideycfgfile(wheredistextfileare,'---Forum---','#;##;(*;//',';');
+//
+// Das Ergebnis der function wäre in diesem Falle: "Testenisscheiße", weil alle
+// leeren Zeilen und alle Zeilen mit #,##,(* und // am Anfang ignoriert werden.
+// Außerdem alle leeren Zeilen. Es wird nur zwischen "---Forum---" gesucht.
+// Der Letzte Parameter (platzhalter) (in diesem Falle ";") steht für den "Trenner"
+// zu ignorierenden Zeilenanfängen!
+
+ if fileexists(filepath) then
+ begin
+ temp:=TStringlist.create;
+ output:=TStringlist.create;
+ temp.loadfromfile(filepath);
+
+ ende:=false;
+
+ if temp.count>0 then
+ begin
+ count1:=0;
+ repeat
+ if copy(temp.strings[count1],1,length(divideparam))=divideparam then
+ begin
+ count1:=count1+1;
+ repeat
+ if copy(temp.strings[count1],1,length(divideparam))=divideparam then ende:=true else
+ begin
+ if ende=false then
+ begin
+ count2:=1;
+ test1:=false;
+
+ if getnumberofdivides(ignorelist,platzhalter)<>0 then
+ begin
+ repeat
+ if copy(temp.strings[count1],1,length(dividestring(ignorelist,platzhalter,count2)))= dividestring(ignorelist,platzhalter,count2) then test1:=true;
+ if temp.Strings[count1]='' then test1:=true;
+ count2:=count2+1;
+ until count2>=getnumberofdivides(ignorelist,platzhalter);
+ end;
+
+ if test1=false then output.Add(temp.strings[count1]);
+ end;
+ end;
+ count1:=count1+1;
+ until count1>=temp.count;
+ end;
+ count1:=count1+1;
+ until count1>=temp.count-1;
+ end;
+ temp.free;
+ end;
+
+ result:=output;
+
+
+end;
+
+function getnumberofdivides(str,platzhalter:string):integer;
+var count1,divides:integer;
+begin
+
+//Bsp:
+//
+// Diese function stellt fest, wie oft der string unterteilt
+// worden ist mit dem Trenner "platzhalter".
+//
+// getnumberofdivides('test1;test2;test3;',';') gibt den Wert 3 aus.
+// getnumberofdivides('test1;test2;test3',';') gibt auch den Wert 3 aus.
+
+ if str='' then
+ begin
+ result:=0;
+ exit;
+ end;
+
+ divides:=0;
+ count1:=1;
+ repeat
+ if copy(str,count1,1)=platzhalter then divides:=divides+1;
+ count1:=count1+1;
+ until count1>length(str);
+
+ if copy(str,length(str),1)<>platzhalter then divides:=divides+1;
+
+ result:=divides;
+
+end;
+
+function dividestring(str,platzhalter:string;stellenzeiger:integer):string;
+var text1:string;
+ count1:integer;
+begin
+
+//Bsp: text1;text2;text3 ... jetzt hast du diesen String... Die Function
+// kann jetzt den string aufteilen in die drei
+// Teile:
+//
+// dividestring('text1;text2;text3;',';',1)
+// Das Ergebnis ist "text1"
+
+ if length(str)>0 then
+ begin
+
+ count1:=1;
+ text1:='';
+ repeat
+ if copy(str,count1,1)=platzhalter then
+ begin
+ stellenzeiger:=stellenzeiger-1;
+ if stellenzeiger<=0 then
+ begin
+ result:=text1;
+ exit;
+ end;
+ text1:='';
+ end else text1:=text1+copy(str,count1,1);
+ if count1=length(str) then
+ begin
+ result:=text1;
+ exit;
+ end;
+ count1:=count1+1;
+ until count1>length(str);
+
+ end;
+
+end;
+
+function getYcfgStr(Filename,info:string):string; overload;
+begin
+
+ result:=getYcfgStr(Filename,info,'=');
+
+end;
+
+function getycfgStr(Filename,info,platzhalter:string):string; overload;
+var text1:string;
+ count1,count2:integer;
+ test1:boolean;
+ ycfg:TStringlist;
+begin
+//Bsp: in einer textdatei filename steht der string test=123 , dann ist die rückgabe von getycfgwert(Filename,'test','=') = '123'
+
+ if fileexists(filename) then
+ begin
+ ycfg:=TStringlist.create;
+ ycfg.LoadFromFile(filename);
+
+ if ycfg.Count>0 then
+ begin
+ count1:=0;
+ repeat
+ text1:='';
+ test1:=false;
+ count2:=1;
+ repeat
+ if copy(ycfg.Strings[count1],count2,1)<>platzhalter then text1:=text1+copy(ycfg.Strings[count1],count2,1) else test1:=true;
+ if count2>=length(ycfg.Strings[count1]) then test1:=true;
+ count2:=count2+1;
+ until test1=true;
+
+ if lowercase(text1)=lowercase(info) then result:=copy(ycfg.Strings[count1],length(text1)+2,length(ycfg.strings[count1]));
+ count1:=count1+1;
+ until count1>=ycfg.Count;
+ end;
+ end;
+
+end;
+
+function getYcfgStr(StringlistWithFile:Tstringlist;info:string):string; overload;
+begin
+
+ result:=getYcfgStr(StringlistWithFile,info,'=');
+
+end;
+
+function getycfgStr(StringlistWithFile:Tstringlist;info,platzhalter:string):string; overload;
+var text1:string;
+ count1,count2:integer;
+ test1:boolean;
+begin
+
+ if StringlistWithFile.Count>0 then
+ begin
+ count1:=0;
+ repeat
+ text1:='';
+ test1:=false;
+ count2:=1;
+ repeat
+ if copy(StringlistWithFile.Strings[count1],count2,1)<>platzhalter then text1:=text1+copy(StringlistWithFile.Strings[count1],count2,1) else test1:=true;
+ if count2>=length(StringlistWithFile.Strings[count1]) then test1:=true;
+ count2:=count2+1;
+ until test1=true;
+
+ if lowercase(text1)=lowercase(info) then result:=copy(StringlistWithFile.Strings[count1],length(text1)+2,length(StringlistWithFile.strings[count1]));
+
+ count1:=count1+1;
+ until count1>=StringlistWithFile.Count;
+ end;
+
+end;
+
+function getYcfgInt(Filename,info:string):integer; overload;
+begin
+
+ result:=getYcfgInt(filename,info,'=',-1);
+
+end;
+
+function getYcfgInt(Filename,info:string;defaultint:integer):integer; overload;
+begin
+
+ result:=getYcfgInt(filename,info,'=',defaultint);
+
+end;
+
+function getycfgInt(Filename,info,platzhalter:string;defaultint:integer):integer; overload;
+begin
+
+ result:=strtointdef(getycfgStr(Filename,info,platzhalter),defaultint);
+
+end;
+
+function getYcfgInt(Filename:TStringlist;info:string):integer;overload;
+begin
+
+ result:=getYcfgInt(filename,info,'=',-1);
+
+end;
+
+function getYcfgInt(Filename:TStringlist;info:string;defaultint:integer):integer;overload;
+begin
+
+ result:=getYcfgInt(filename,info,'=',defaultint);
+
+end;
+
+function getycfgInt(Filename:TStringlist;info,platzhalter:string;defaultint:integer):integer; overload;
+begin
+
+ result:=strtointdef(getycfgStr(Filename,info,platzhalter),defaultint);
+
+end;
+
+function getYcfgBool(Filename,info:string):boolean; overload;
+begin
+
+ result:=getYcfgBool(filename,info,'=');
+
+end;
+
+function getYcfgBool(Filename,info,platzhalter:string):boolean; overload;
+begin
+
+ if (getycfgStr(filename,info,platzhalter)='1') or (lowercase(getycfgStr(filename,info,platzhalter))='true') then result:=true else result:=false;
+
+end;
+
+function getYcfgBool(StringlistWithFile:Tstringlist;info:string):boolean; overload;
+begin
+
+ result:=getYcfgBool(StringlistWithFile,info,'=');
+
+end;
+
+function getYcfgBool(StringlistWithFile:Tstringlist;info,platzhalter:string):boolean; overload;
+begin
+
+ if (getycfgStr(StringlistWithFile,info,platzhalter)='1') or (lowercase(getycfgStr(StringlistWithFile,info,platzhalter))='true') then result:=true else result:=false;
+
+end;
+
+procedure setYcfgStr(Filename,info,wert:string);overload;
+begin
+
+ setycfgstr(filename,info,wert,'=');
+
+end;
+
+procedure setycfgStr(Filename,info,wert,platzhalter:string);
+var text1:string;
+ count1,count2:integer;
+ test1,test2:boolean;
+ ycfg:TSTringlist;
+begin
+
+ ycfg:=TStringlist.create;
+
+ test2:=false;
+ if fileexists(filename) then
+ begin
+ ycfg.LoadFromFile(filename);
+
+ if ycfg.Count>0 then
+ begin
+ count1:=0;
+ repeat
+ text1:='';
+ test1:=false;
+ count2:=1;
+ repeat
+ if copy(ycfg.Strings[count1],count2,1)<>platzhalter then text1:=text1+copy(ycfg.Strings[count1],count2,1) else test1:=true;
+ if count2>=length(ycfg.Strings[count1]) then test1:=true;
+ count2:=count2+1;
+ until test1=true;
+
+ if lowercase(text1)=lowercase(info) then
+ begin
+ test2:=true;
+ ycfg.Strings[count1]:=info+platzhalter+wert;
+ end;
+
+ count1:=count1+1;
+ until count1>=ycfg.Count;
+ end;
+ end;
+
+ if test2=false then ycfg.Add(info+platzhalter+wert);
+
+ ycfg.SaveToFile(filename);
+
+ ycfg.Free;
+
+end;
+
+function setYcfgStr(StringlistWithFile:TStringlist;info,wert:string):TStringlist;overload;
+begin
+
+ result:=setycfgstr(StringlistWithFile,info,wert,'=');
+
+end;
+
+function setycfgStr(StringlistWithFile:TStringlist;info,wert,platzhalter:string):TStringlist;
+var text1:string;
+ count1,count2:integer;
+ test1,test2:boolean;
+begin
+
+ test2:=false;
+ if StringlistWithFile.Count>0 then
+ begin
+ count1:=0;
+ repeat
+ text1:='';
+ test1:=false;
+ count2:=1;
+ repeat
+ if copy(StringlistWithFile.Strings[count1],count2,1)<>platzhalter then text1:=text1+copy(StringlistWithFile.Strings[count1],count2,1) else test1:=true;
+ if count2>=length(StringlistWithFile.Strings[count1]) then test1:=true;
+ count2:=count2+1;
+ until test1=true;
+
+ if lowercase(text1)=lowercase(info) then
+ begin
+ test2:=true;
+ StringlistWithFile.Strings[count1]:=info+platzhalter+wert;
+ end;
+
+ count1:=count1+1;
+ until count1>=StringlistWithFile.Count;
+ end;
+
+ if test2=false then StringlistWithFile.Add(info+platzhalter+wert);
+
+ result:=StringlistWithFile;
+end;
+
+procedure setYcfgInt(Filename,info:string;wert:integer);overload;
+begin
+
+ setYcfgInt(filename,info,'=',wert);
+
+end;
+
+procedure setycfgInt(Filename,info,platzhalter:string;wert:integer);overload;
+begin
+
+ setycfgStr(Filename,info,inttostr(wert),platzhalter);
+
+end;
+
+function setYcfgInt(Filename:TStringlist;info:string;wert:integer):Tstringlist;overload;
+begin
+
+ result:=setYcfgInt(filename,info,'=',wert);
+
+end;
+
+function setycfgInt(Filename:TStringlist;info,platzhalter:string;wert:integer):TStringlist; overload
+begin
+
+ result:=setycfgStr(Filename,info,inttostr(wert),platzhalter);
+
+end;
+
+procedure setYcfgBool(Filename,info:string;wert:boolean);overload;
+begin
+
+ setYcfgBool(filename,info,'=',wert,false);
+
+end;
+
+procedure setYcfgBool(Filename,info:string;wert,writtentrue:boolean);overload;
+begin
+
+ setYcfgBool(filename,info,'=',wert,writtentrue);
+
+end;
+
+procedure setYcfgBool(Filename,info,platzhalter:string;wert,writtentrue:boolean);overload;
+begin
+
+ if wert then
+ begin
+ if writtentrue then setycfgStr(Filename,info,'true',platzhalter) else setycfgStr(Filename,info,'1',platzhalter);
+ end else
+ begin
+ if writtentrue then setycfgStr(Filename,info,'false',platzhalter) else setycfgStr(Filename,info,'0',platzhalter);
+ end;
+
+end;
+
+function setYcfgBool(StringlistWithFile:TStringlist;info:string;wert:boolean):TStringlist;overload;
+begin
+
+ result:=setYcfgBool(StringlistWithFile,info,'=',wert,false);
+
+end;
+
+function setYcfgBool(StringlistWithFile:TStringlist;info:string;wert,writtentrue:boolean):TStringlist;overload;
+begin
+
+ result:=setYcfgBool(StringlistWithFile,info,'=',wert,writtentrue);
+
+end;
+
+function setYcfgBool(StringlistWithFile:TStringlist;info,platzhalter:string;wert,writtentrue:boolean):TStringlist;overload;
+begin
+
+ if wert then
+ begin
+ if writtentrue then result:=setycfgStr(StringlistWithFile,info,'true',platzhalter) else result:=setycfgStr(StringlistWithFile,info,'1',platzhalter);
+ end else
+ begin
+ if writtentrue then result:=setycfgStr(StringlistWithFile,info,'false',platzhalter) else result:=setycfgStr(StringlistWithFile,info,'0',platzhalter);
+ end;
+
+end;
+
+end.
diff --git a/school/informatik/verkerhssimulation/src/c_ycfg/ycfg 2.x/Demo/YCFGDemo.cfg b/school/informatik/verkerhssimulation/src/c_ycfg/ycfg 2.x/Demo/YCFGDemo.cfg
new file mode 100644
index 00000000..18840108
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/c_ycfg/ycfg 2.x/Demo/YCFGDemo.cfg
@@ -0,0 +1,35 @@
+-$A8
+-$B-
+-$C+
+-$D+
+-$E-
+-$F-
+-$G+
+-$H+
+-$I+
+-$J-
+-$K-
+-$L+
+-$M-
+-$N+
+-$O+
+-$P+
+-$Q-
+-$R-
+-$S-
+-$T-
+-$U-
+-$V+
+-$W-
+-$X+
+-$YD
+-$Z1
+-cg
+-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
+-H+
+-W+
+-M
+-$M16384,1048576
+-K$00400000
+-LE"c:\programme\delphi\delphi 6\Projects\Bpl"
+-LN"c:\programme\delphi\delphi 6\Projects\Bpl"
diff --git a/school/informatik/verkerhssimulation/src/c_ycfg/ycfg 2.x/Demo/YCFGDemo.dof b/school/informatik/verkerhssimulation/src/c_ycfg/ycfg 2.x/Demo/YCFGDemo.dof
new file mode 100644
index 00000000..c6d31c04
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/c_ycfg/ycfg 2.x/Demo/YCFGDemo.dof
@@ -0,0 +1,83 @@
+[FileVersion]
+Version=6.0
+[Compiler]
+A=8
+B=0
+C=1
+D=1
+E=0
+F=0
+G=1
+H=1
+I=1
+J=0
+K=0
+L=1
+M=0
+N=1
+O=1
+P=1
+Q=0
+R=0
+S=0
+T=0
+U=0
+V=1
+W=0
+X=1
+Y=1
+Z=1
+ShowHints=1
+ShowWarnings=1
+UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
+[Linker]
+MapFile=0
+OutputObjs=0
+ConsoleApp=1
+DebugInfo=0
+RemoteSymbols=0
+MinStackSize=16384
+MaxStackSize=1048576
+ImageBase=4194304
+ExeDescription=
+[Directories]
+OutputDir=
+UnitOutputDir=
+PackageDLLOutputDir=
+PackageDCPOutputDir=
+SearchPath=
+Packages=
+Conditionals=
+DebugSourceDirs=
+UsePackages=0
+[Parameters]
+RunParams=
+HostApplication=
+Launcher=
+UseLauncher=0
+DebugCWD=
+[Version Info]
+IncludeVerInfo=0
+AutoIncBuild=0
+MajorVer=1
+MinorVer=0
+Release=0
+Build=0
+Debug=0
+PreRelease=0
+Special=0
+Private=0
+DLL=0
+Locale=1031
+CodePage=1252
+[Version Info Keys]
+CompanyName=
+FileDescription=
+FileVersion=1.0.0.0
+InternalName=
+LegalCopyright=
+LegalTrademarks=
+OriginalFilename=
+ProductName=
+ProductVersion=1.0.0.0
+Comments=
diff --git a/school/informatik/verkerhssimulation/src/c_ycfg/ycfg 2.x/Demo/YCFGDemo.dpr b/school/informatik/verkerhssimulation/src/c_ycfg/ycfg 2.x/Demo/YCFGDemo.dpr
new file mode 100644
index 00000000..d6334cd4
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/c_ycfg/ycfg 2.x/Demo/YCFGDemo.dpr
@@ -0,0 +1,13 @@
+program YCFGDemo;
+
+uses
+ Forms,
+ uycfgdemo in 'uycfgdemo.pas' {fMain};
+
+{$R *.res}
+
+begin
+ Application.Initialize;
+ Application.CreateForm(TfMain, fMain);
+ Application.Run;
+end.
diff --git a/school/informatik/verkerhssimulation/src/c_ycfg/ycfg 2.x/Demo/YCFGDemo.exe b/school/informatik/verkerhssimulation/src/c_ycfg/ycfg 2.x/Demo/YCFGDemo.exe
new file mode 100644
index 00000000..3f0e8250
Binary files /dev/null and b/school/informatik/verkerhssimulation/src/c_ycfg/ycfg 2.x/Demo/YCFGDemo.exe differ
diff --git a/school/informatik/verkerhssimulation/src/c_ycfg/ycfg 2.x/Demo/uycfgdemo.ddp b/school/informatik/verkerhssimulation/src/c_ycfg/ycfg 2.x/Demo/uycfgdemo.ddp
new file mode 100644
index 00000000..cdc0ee8c
Binary files /dev/null and b/school/informatik/verkerhssimulation/src/c_ycfg/ycfg 2.x/Demo/uycfgdemo.ddp differ
diff --git a/school/informatik/verkerhssimulation/src/c_ycfg/ycfg 2.x/Demo/uycfgdemo.dfm b/school/informatik/verkerhssimulation/src/c_ycfg/ycfg 2.x/Demo/uycfgdemo.dfm
new file mode 100644
index 00000000..143cf196
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/c_ycfg/ycfg 2.x/Demo/uycfgdemo.dfm
@@ -0,0 +1,332 @@
+object fMain: TfMain
+ Left = 317
+ Top = 230
+ Width = 870
+ Height = 640
+ Caption = 'YCFG DEMO'
+ Color = clBtnFace
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ OldCreateOrder = False
+ PixelsPerInch = 96
+ TextHeight = 13
+ object PageControl1: TPageControl
+ Left = 0
+ Top = 0
+ Width = 862
+ Height = 613
+ ActivePage = TabSheet1
+ Align = alClient
+ TabIndex = 0
+ TabOrder = 0
+ object TabSheet1: TTabSheet
+ Caption = 'Einleitung'
+ object Memo1: TMemo
+ Left = 0
+ Top = 0
+ Width = 854
+ Height = 585
+ Align = alClient
+ BevelInner = bvNone
+ BevelOuter = bvNone
+ BorderStyle = bsNone
+ Color = cl3DLight
+ Lines.Strings = (
+ ''
+ 'YCFG Demo'
+ 'by Rylon t.H.D. a member of Yeminy'
+ ''
+ 'Diese Demo zeigt die Funktionen der ycfg unit auf.'
+ ''
+
+ 'Die ycfg unit ist zum auslesen von configfiles '#228'hnlich den ini f' +
+ 'iles entwickelt worden.'
+ 'um sie einzubinden muss sie in den uses vermerkt werden:'
+ ''
+ 'Bsp:'
+ 'uses'
+
+ ' Windows, Messages, SysUtils, Variants, Classes, Graphics, Cont' +
+ 'rols, Forms,'
+ ' Dialogs, ComCtrls, {!}ycfg{!}, StdCtrls;'
+ ''
+
+ 'Au'#223'erdem muss sie sich auf dem Suchpfad befinden. Bzw im Program' +
+ 'mordner'
+ ''
+ 'Nun zum Praktischen: Bl'#228'tere eine Seite Weiter!')
+ TabOrder = 0
+ end
+ end
+ object TabSheet2: TTabSheet
+ Caption = 'Strings'
+ ImageIndex = 1
+ object Label1: TLabel
+ Left = 96
+ Top = 275
+ Width = 151
+ Height = 13
+ Caption = 'dividestring(Ausgangsstring.text,'
+ Color = clGray
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clRed
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ ParentColor = False
+ ParentFont = False
+ Transparent = True
+ end
+ object Label2: TLabel
+ Left = 520
+ Top = 275
+ Width = 6
+ Height = 13
+ Caption = ');'
+ Color = clGray
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clRed
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ ParentColor = False
+ ParentFont = False
+ Transparent = True
+ end
+ object Label3: TLabel
+ Left = 387
+ Top = 275
+ Width = 3
+ Height = 13
+ Caption = ','
+ Color = clGray
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clRed
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ ParentColor = False
+ ParentFont = False
+ Transparent = True
+ end
+ object Label4: TLabel
+ Left = 8
+ Top = 232
+ Width = 482
+ Height = 20
+ Caption =
+ 'function dividestring(str,platzhalter:string;stellenzeiger:integ' +
+ 'er):string;'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -16
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ ParentFont = False
+ end
+ object Label5: TLabel
+ Left = 8
+ Top = 328
+ Width = 406
+ Height = 20
+ Caption = 'function getnumberofdivides(str,platzhalter:string):integer;'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -16
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ ParentFont = False
+ end
+ object Label6: TLabel
+ Left = 96
+ Top = 371
+ Width = 190
+ Height = 13
+ Caption = 'getnumberofdivides(Ausgangsstring.text,'
+ Color = clGray
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clRed
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ ParentColor = False
+ ParentFont = False
+ Transparent = True
+ end
+ object Label7: TLabel
+ Left = 424
+ Top = 371
+ Width = 6
+ Height = 13
+ Caption = ');'
+ Color = clGray
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clRed
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ ParentColor = False
+ ParentFont = False
+ Transparent = True
+ end
+ object ausgangsstring: TLabeledEdit
+ Left = 8
+ Top = 192
+ Width = 441
+ Height = 21
+ EditLabel.Width = 92
+ EditLabel.Height = 13
+ EditLabel.Caption = 'Der Ausgangsstring'
+ LabelPosition = lpAbove
+ LabelSpacing = 3
+ TabOrder = 0
+ Text = 'adam;eva;m'#252'ller;hallo;test;nochnezeichenfolge;'
+ end
+ object Memo3: TMemo
+ Left = 0
+ Top = 496
+ Width = 854
+ Height = 89
+ Align = alBottom
+ BevelInner = bvNone
+ BevelOuter = bvNone
+ BorderStyle = bsNone
+ Color = cl3DLight
+ Lines.Strings = (
+ 'In der Praxis sieht das dann so aus:'
+ ''
+ 'temps ist eine string variable'
+ 'eineconfigvariable ist eine config variable'
+ ''
+ 'eineconfigvariable:=dividestring(temps,'#39';'#39',1);')
+ TabOrder = 1
+ end
+ object Button1: TButton
+ Left = 8
+ Top = 272
+ Width = 75
+ Height = 25
+ Caption = 'Mache es'
+ TabOrder = 2
+ OnClick = Button1Click
+ end
+ object Platzhalter: TLabeledEdit
+ Left = 264
+ Top = 272
+ Width = 121
+ Height = 21
+ EditLabel.Width = 49
+ EditLabel.Height = 13
+ EditLabel.Caption = 'Platzhalter'
+ LabelPosition = lpAbove
+ LabelSpacing = 3
+ TabOrder = 3
+ Text = ';'
+ end
+ object Stellenanzeige: TLabeledEdit
+ Left = 392
+ Top = 272
+ Width = 121
+ Height = 21
+ EditLabel.Width = 69
+ EditLabel.Height = 13
+ EditLabel.Caption = 'Stellenanzeige'
+ LabelPosition = lpAbove
+ LabelSpacing = 3
+ TabOrder = 4
+ Text = '3'
+ end
+ object Memo4: TMemo
+ Left = 0
+ Top = 0
+ Width = 854
+ Height = 153
+ Align = alTop
+ BevelInner = bvNone
+ BevelOuter = bvNone
+ BorderStyle = bsNone
+ Color = cl3DLight
+ Lines.Strings = (
+ 'Strings k'#246'nnen mit der ycfg unit geteilt werden'
+ ''
+
+ 'Solte der String nicht lang genug sein, wie die angegebene Stell' +
+ 'enanzeige, dann wird die lezte ausgegeben.'
+ ''
+ 'Bsp:'
+ ''
+ 'showmessage(devidestring(Ausgangsstring.text,'#39';'#39',8234395));'
+ ''
+ 'Die schowmessage w'#252'rde "nochnezeichenfolge" lauten. '
+ ''
+
+ 'Au'#223'erdem ist es nicht n'#246'tig am ende nocheinmal ein ";" zu setzen' +
+ ' - Probiers aus!')
+ TabOrder = 5
+ end
+ object Button2: TButton
+ Left = 8
+ Top = 368
+ Width = 75
+ Height = 25
+ Caption = 'Mach es'
+ TabOrder = 6
+ OnClick = Button2Click
+ end
+ object Platzhalter2: TLabeledEdit
+ Left = 296
+ Top = 368
+ Width = 121
+ Height = 21
+ EditLabel.Width = 49
+ EditLabel.Height = 13
+ EditLabel.Caption = 'Platzhalter'
+ LabelPosition = lpAbove
+ LabelSpacing = 3
+ TabOrder = 7
+ Text = ';'
+ end
+ end
+ object TabSheet3: TTabSheet
+ Caption = 'Config: Werte auslesen'
+ ImageIndex = 2
+ end
+ object TabSheet4: TTabSheet
+ Caption = 'Config: Werte schreiben'
+ ImageIndex = 3
+ end
+ object TabSheet5: TTabSheet
+ Caption = 'Config: Liste auslesen'
+ ImageIndex = 4
+ end
+ object TabSheet6: TTabSheet
+ Caption = 'Config: Liste schreiben'
+ ImageIndex = 5
+ end
+ object TabSheet7: TTabSheet
+ Caption = 'Contact'
+ ImageIndex = 6
+ object Memo2: TMemo
+ Left = 0
+ Top = 0
+ Width = 854
+ Height = 585
+ Align = alClient
+ BevelInner = bvNone
+ BevelOuter = bvNone
+ BorderStyle = bsNone
+ Color = cl3DLight
+ Lines.Strings = (
+ 'Contact:'
+ ''
+
+ 'Du kannst mich '#252'ber rylon@web.de erreichen, soltlen Fragen oder ' +
+ 'Probleme auftreten.')
+ TabOrder = 0
+ end
+ end
+ end
+end
diff --git a/school/informatik/verkerhssimulation/src/c_ycfg/ycfg 2.x/Demo/uycfgdemo.pas b/school/informatik/verkerhssimulation/src/c_ycfg/ycfg 2.x/Demo/uycfgdemo.pas
new file mode 100644
index 00000000..fb3ee94e
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/c_ycfg/ycfg 2.x/Demo/uycfgdemo.pas
@@ -0,0 +1,65 @@
+unit uycfgdemo;
+
+interface
+
+uses
+ Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
+ Dialogs, ComCtrls, ycfg, StdCtrls, ExtCtrls;
+
+type
+ TfMain = class(TForm)
+ PageControl1: TPageControl;
+ TabSheet1: TTabSheet;
+ Memo1: TMemo;
+ TabSheet2: TTabSheet;
+ TabSheet3: TTabSheet;
+ TabSheet4: TTabSheet;
+ TabSheet5: TTabSheet;
+ TabSheet6: TTabSheet;
+ TabSheet7: TTabSheet;
+ Memo2: TMemo;
+ ausgangsstring: TLabeledEdit;
+ Memo3: TMemo;
+ Label1: TLabel;
+ Button1: TButton;
+ Platzhalter: TLabeledEdit;
+ Stellenanzeige: TLabeledEdit;
+ Label2: TLabel;
+ Label3: TLabel;
+ Memo4: TMemo;
+ Label4: TLabel;
+ Label5: TLabel;
+ Button2: TButton;
+ Label6: TLabel;
+ Platzhalter2: TLabeledEdit;
+ Label7: TLabel;
+ procedure Button1Click(Sender: TObject);
+ procedure Button2Click(Sender: TObject);
+ private
+ { Private declarations }
+ public
+ { Public declarations }
+ end;
+
+var
+ fMain: TfMain;
+
+implementation
+
+{$R *.dfm}
+
+procedure TfMain.Button1Click(Sender: TObject);
+begin
+
+ showmessage({aus der ycfg unit ->}divideAstring(ausgangsstring.text,platzhalter.text{Daslabeled edit},strtointdef(stellenanzeige.text,1)));
+
+end;
+
+procedure TfMain.Button2Click(Sender: TObject);
+begin
+
+ showmessage(inttostr(getStringDivides(ausgangsstring.Text,platzhalter2.text)));
+
+end;
+
+end.
diff --git a/school/informatik/verkerhssimulation/src/c_ycfg/ycfg 2.x/ycfg.pas b/school/informatik/verkerhssimulation/src/c_ycfg/ycfg 2.x/ycfg.pas
new file mode 100644
index 00000000..c1765514
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/c_ycfg/ycfg 2.x/ycfg.pas
@@ -0,0 +1,2167 @@
+{
+
+ ****************************************************************************
+ | YCFG Unit Version 2.00 |
+ | |
+ | Copyright (c) 2006 by Yeminy |
+ | Copyright (c) 2006 by Rylon |
+ | |
+ | 165 Function/Procedures |
+ | |
+ | 165 Done : 0 ToDo >>> 100,00% Done : 0,00% ToDO |
+ | |
+ | 0 Tested : 165 ToDo >>> 0,00% Done : 100,00% ToDo |
+ | |
+ ****************************************************************************
+
+ ****************************************************************************
+ | License: |
+ | |
+ ****************************************************************************
+
+ ****************************************************************************
+ | ToDo: Falls es viele Keys gibt, alle in einer Liste ausgeben |
+ | Bsp: test=2135123 |
+ | test=213ds435dsf |
+ | |
+ | Comments automatisch löschen und immer eine Funktion um das zu |
+ | unterbinden |
+ | |
+ | Leerezeile einfügen |
+ | |
+ | get Section/List text (ohne Header) |
+ | |
+ | setYcfgSection -> text hinzufügen |
+ | |
+ ****************************************************************************
+
+ ****************************************************************************
+ | ChangeLog: |
+ | -started project ycfg 2 |
+ ****************************************************************************
+
+}
+
+unit ycfg;
+
+interface
+
+uses SysUtils, Classes, windows, Graphics, ycode, dialogs;
+
+// OTHER***************************************************************************************************************************** //--
+ //--
+//strings //--
+function isStringIncluded(SourceString,SearchString,DivideParam:String):boolean; overload; //w
+function isStringIncluded(SourceString,SearchString:String):boolean; overload; //w
+ //--
+//function delStringPart(Sourcestring,DivideParam:string;Position:integer):string; //
+//function delStringPart(Sourcestring:string;Position:integer):string; //
+//function delStringPart(Sourcestring,Searchstring,DivideParam:string):string; //
+//function delStringPart(Sourcestring,Searchstring:string):string; //
+ //--
+function DivideAString(SourceString,DivideParam:string;Position:integer):string; overload; //wt
+function DivideAString(SourceString:string;Position:integer):string; overload; //wt
+ //--
+function getStringDivides(SourceString,DivideParam:string):integer; overload; //wt
+function getStringDivides(SourceString:string):integer; overload; //wt
+ //--
+//sections //--
+procedure delYcfgSection(YcfgFile,Section:string); overload; //w
+procedure delYcfgSection(var YcfgFile:TStringlist;Section:string); overload; //w
+ //--
+procedure createYcfgSection(YcfgFile,Section:string); overload; //w
+procedure createYcfgSection(var YcfgFile:TStringlist;Section:string); overload; //w
+ //--
+procedure clearYcfgSection(YcfgFile,Section:string); overload; //w
+procedure clearYcfgSection(var YcfgFile:TStringlist;Section:string); overload; //w
+ //--
+function YcfgSectionExists(YcfgFile,Section:string):boolean; overload; //w
+function YcfgSectionExists(var YcfgFile:TStringlist;Section:string):boolean; overload; //w
+ //--
+//Ycfg File //--
+ //--
+//function delComments(YcfgFile:string):boolean; overload; //
+//function delComments(YcfgFile:TStringlist):boolean; overload; //
+ //--
+function checkYcfgHeader(YcfgFile:string):boolean; overload; //w
+function checkYcfgHeader(YcfgFile:TStringlist):boolean; overload; //w
+ //--
+procedure writeYcfgHeader(YcfgFile:string); overload; //w
+procedure writeYcfgHeader(YcfgFile:TStringlist); overload; //w
+ //--
+function readYcfgHeader(YcfgFile:string):string; overload; //w
+function readYcfgHeader(YcfgFile:TStringlist):string; overload; //w
+ //--
+//Ycfg Unit //--
+ //--
+function getYcfgVersion:string; //w
+ //--
+// GET******************************************************************************************************************************* //--
+ //--
+//sections //--
+function getYcfgSections(YcfgFile:string):TStringList; overload; //w
+function getYcfgSections(YcfgFile:TStringlist):TStringList; overload; //w
+ //--
+function getYcfgSection(YcfgFile,Section:string):TStringList; overload; //wt
+function getYcfgSection(YcfgFile:TStringlist;Section:string):TStringList; overload; //wt
+ //--
+function getYcfgSectionKeys(YcfgFile,Section,DivideParam:string):TStringList; overload; //w
+function getYcfgSectionKeys(YcfgFile,Section:string):TStringList; overload; //w
+function getYcfgSectionKeys(YcfgFile:TStringlist;Section,DivideParam:string):TStringList; overload; //w
+function getYcfgSectionKeys(YcfgFile:TStringlist;Section:string):TStringList; overload; //w
+ //--
+function getYcfgSectionNoKeys(YcfgFile,Section,DivideParam:string):TStringList; overload; //w
+function getYcfgSectionNoKeys(YcfgFile,Section:string):TStringList; overload; //w
+function getYcfgSectionNoKeys(YcfgFile:TStringlist;Section,DivideParam:string):TStringList; overload; //w
+function getYcfgSectionNoKeys(YcfgFile:TStringlist;Section:string):TStringList; overload; //w
+ //--
+function getYcfgSectionValues(YcfgFile,Section,DivideParam:string):TStringList; overload; //w
+function getYcfgSectionValues(YcfgFile,Section:string):TStringList; overload; //w
+function getYcfgSectionValues(YcfgFile:TStringlist;Section,DivideParam:string):TStringList; overload; //w
+function getYcfgSectionValues(YcfgFile:TStringlist;Section:string):TStringList; overload; //w
+ //--
+function getYcfgSectionPos(YcfgFile,Section:string):TPoint; overload; //w
+function getYcfgSectionPos(YcfgFile:TStringlist;Section:string):TPoint; overload; //w
+ //--
+//String //--
+ //global //--
+function getYcfgStr(YcfgFile,SearchString,DivideParam:string):string; overload; //w
+function getYcfgStr(YcfgFile,SearchString:string):string; overload; //w
+function getYcfgStr(YcfgFile:TStringlist;SearchString,DivideParam:string):string; overload; //w
+function getYcfgStr(YcfgFile:Tstringlist;SearchString:string):string; overload; //w
+ //section //--
+function getYcfgSecStr(YcfgFile,Section,SearchString,DivideParam:string):string; overload; //wt
+function getYcfgSecStr(YcfgFile,Section,SearchString:string):string; overload; //wt
+function getYcfgSecStr(YcfgFile:TStringlist;Section,SearchString,DivideParam:string):string; overload; //wt
+function getYcfgSecStr(YcfgFile:Tstringlist;Section,SearchString:string):string; overload; //wt
+ //--
+//Integer //--
+ //global //--
+function getYcfgInt(YcfgFile,SearchString,DivideParam:string;DefaultValue:integer):integer; overload; //w
+function getYcfgInt(YcfgFile,SearchString:string;DefaultValue:integer):integer; overload; //w
+function getYcfgInt(YcfgFile:TStringlist;SearchString,DivideParam:string;DefaultValue:integer):integer; overload; //w
+function getYcfgInt(YcfgFile:TStringlist;SearchString:string;DefaultValue:integer):integer; overload; //w
+ //section //--
+function getYcfgSecInt(YcfgFile,Section,SearchString,DivideParam:string;DefaultValue:integer):integer; overload; //w
+function getYcfgSecInt(YcfgFile,Section,SearchString:string;DefaultValue:integer):integer; overload; //w
+function getYcfgSecInt(YcfgFile:TStringlist;Section,SearchString,DivideParam:string;DefaultValue:integer):integer; overload; //w
+function getYcfgSecInt(YcfgFile:TStringlist;Section,SearchString:string;DefaultValue:integer):integer; overload; //w
+ //--
+//Bool //--
+ //global //--
+function getYcfgBool(YcfgFile,SearchString,DivideParam:string;DefaultValue:boolean):boolean; overload; //w
+function getYcfgBool(YcfgFile,SearchString:string;DefaultValue:boolean):boolean; overload; //w
+function getYcfgBool(YcfgFile:TStringlist;SearchString,DivideParam:string;DefaultValue:boolean):boolean; overload; //w
+function getYcfgBool(YcfgFile:TStringlist;SearchString:string;DefaultValue:boolean):boolean; overload; //w
+ //section //--
+function getYcfgSecBool(YcfgFile,Section,SearchString,DivideParam:string;DefaultValue:boolean):boolean; overload; //w
+function getYcfgSecBool(YcfgFile,Section,SearchString:string;DefaultValue:boolean):boolean; overload; //w
+function getYcfgSecBool(YcfgFile:TStringlist;Section,SearchString,DivideParam:string;DefaultValue:boolean):boolean; overload; //w
+function getYcfgSecBool(YcfgFile:TStringlist;Section,SearchString:string;DefaultValue:boolean):boolean; overload; //w
+ //--
+//DateTime //--
+ //global //--
+function getYcfgDateTime(YcfgFile,SearchString,DivideParam:string;DefaultValue:TDateTime):TDateTime; overload; //w
+function getYcfgDateTime(YcfgFile,SearchString:string;DefaultValue:TDateTime):TDateTime; overload; //w
+function getYcfgDateTime(YcfgFile:TStringlist;SearchString,DivideParam:string;DefaultValue:TDateTime):TDateTime; overload; //w
+function getYcfgDateTime(YcfgFile:TStringlist;SearchString:string;DefaultValue:TDateTime):TDateTime; overload; //w
+ //section //--
+function getYcfgSecDateTime(YcfgFile,Section,SearchString,DivideParam:string;DefaultValue:TDateTime):TDateTime; overload; //w
+function getYcfgSecDateTime(YcfgFile,Section,SearchString:string;DefaultValue:TDateTime):TDateTime; overload; //w
+function getYcfgSecDateTime(YcfgFile:TStringlist;Section,SearchString,DivideParam:string;DefaultValue:TDateTime):TDateTime; overload; //w
+function getYcfgSecDateTime(YcfgFile:TStringlist;Section,SearchString:string;DefaultValue:TDateTime):TDateTime; overload; //w
+ //--
+//Font //--
+ //global //--
+function getYcfgFont(YcfgFile,SearchString,DivideParam:string;DefaultValue:TFont):TFont; overload; //w
+function getYcfgFont(YcfgFile,SearchString:string;DefaultValue:TFont):TFont; overload; //w
+function getYcfgFont(YcfgFile:TStringlist;SearchString,DivideParam:string;DefaultValue:TFont):TFont; overload; //w
+function getYcfgFont(YcfgFile:TStringlist;SearchString:string;DefaultValue:TFont):TFont; overload; //w
+ //section //--
+function getYcfgSecFont(YcfgFile,Section,SearchString,DivideParam:string;DefaultValue:TFont):TFont; overload; //w
+function getYcfgSecFont(YcfgFile,Section,SearchString:string;DefaultValue:TFont):TFont; overload; //w
+function getYcfgSecFont(YcfgFile:TStringlist;Section,SearchString,DivideParam:string;DefaultValue:TFont):TFont; overload; //w
+function getYcfgSecFont(YcfgFile:TStringlist;Section,SearchString:string;DefaultValue:TFont):TFont; overload; //w
+ //--
+//DeCrypted String //--
+ //global //--
+function getYcfgStrDeCrypted(YcfgFile,SearchString,DivideParam,Key:string):string; overload; //w
+function getYcfgStrDeCrypted(YcfgFile,SearchString,Key:string):string; overload; //w
+function getYcfgStrDeCrypted(YcfgFile:TStringlist;SearchString,DivideParam,Key:string):string; overload; //w
+function getYcfgStrDeCrypted(YcfgFile:Tstringlist;SearchString,Key:string):string; overload; //w
+ //section //--
+function getYcfgSecStrDeCrypted(YcfgFile,Section,SearchString,DivideParam,Key:string):string; overload; //w
+function getYcfgSecStrDeCrypted(YcfgFile,Section,SearchString,Key:string):string; overload; //w
+function getYcfgSecStrDeCrypted(YcfgFile:TStringlist;Section,SearchString,DivideParam,Key:string):string; overload; //w
+function getYcfgSecStrDeCrypted(YcfgFile:Tstringlist;Section,SearchString,Key:string):string; overload; //w
+ //--
+// SET******************************************************************************************************************************* //--
+ //--
+//sections //--
+function setYcfgSections(YcfgFile,Sections:string;OverrideExisting:boolean):boolean; overload; //w
+function setYcfgSections(var YcfgFile:TStringlist;Sections:string;OverrideExisting:boolean):boolean; overload; //w
+function setYcfgSections(YcfgFile:string;Sections:TStringList;OverrideExisting:boolean):boolean; overload; //w
+function setYcfgSections(var YcfgFile,Sections:TStringlist;OverrideExisting:boolean):boolean; overload; //w
+ //--
+function setYcfgSection(YcfgFile,Section,Value:string;OverrideExisting:boolean):boolean; overload; //w
+function setYcfgSection(var YcfgFile:TStringList;Section,Value:string;OverrideExisting:boolean):boolean; overload; //w
+function setYcfgSection(YcfgFile,Section:string;Value:TStringList;OverrideExisting:Boolean):boolean; overload; //w
+function setYcfgSection(var YcfgFile:TStringlist;Section:string;Value:TStringList;OverrideExisting:Boolean):boolean; overload; //w
+ //--
+//String //--
+ //global //--
+procedure setYcfgStr(YcfgFile,SearchString,DivideParam,Value:string); overload; //w
+procedure setYcfgStr(YcfgFile,SearchString,Value:string); overload; //w
+procedure setYcfgStr(var YcfgFile:Tstringlist;SearchString,DivideParam,Value:string); overload; //w
+procedure setYcfgStr(var YcfgFile:Tstringlist;SearchString,Value:string); overload; //w
+ //section //--
+procedure setYcfgSecStr(YcfgFile,Section,SearchString,DivideParam,Value:string); overload; //wt
+procedure setYcfgSecStr(YcfgFile,Section,SearchString,Value:string); overload; //wt
+procedure setYcfgSecStr(var YcfgFile:Tstringlist;Section,SearchString,DivideParam,Value:string); overload; //wt
+procedure setYcfgSecStr(var YcfgFile:Tstringlist;Section,SearchString,Value:string); overload; //wt
+ //--
+//Integer //--
+ //global //--
+procedure setYcfgInt(YcfgFile,SearchString,DivideParam:string;Value:integer); overload; //w
+procedure setYcfgInt(YcfgFile,SearchString:string;Value:integer); overload; //w
+procedure setYcfgInt(var YcfgFile:Tstringlist;SearchString,DivideParam:string;Value:integer); overload; //w
+procedure setYcfgInt(var YcfgFile:Tstringlist;SearchString:string;Value:integer); overload; //w
+ //section //--
+procedure setYcfgSecInt(YcfgFile,Section,SearchString,DivideParam:string;Value:integer); overload; //w
+procedure setYcfgSecInt(YcfgFile,Section,SearchString:string;Value:integer); overload; //w
+procedure setYcfgSecInt(var YcfgFile:Tstringlist;Section,SearchString,DivideParam:string;Value:integer); overload; //w
+procedure setYcfgSecInt(var YcfgFile:Tstringlist;Section,SearchString:string;Value:integer); overload; //w
+ //--
+//Bool //--
+ //global //--
+procedure setYcfgBool(YcfgFile,SearchString,DivideParam:string;Value:boolean); overload; //w
+procedure setYcfgBool(YcfgFile,SearchString:string;Value:boolean); overload; //w
+procedure setYcfgBool(var YcfgFile:Tstringlist;SearchString,DivideParam:string;Value:boolean); overload; //w
+procedure setYcfgBool(var YcfgFile:Tstringlist;SearchString:string;Value:boolean); overload; //w
+ //section //--
+procedure setYcfgSecBool(YcfgFile,Section,SearchString,DivideParam:string;Value:boolean); overload; //w
+procedure setYcfgSecBool(YcfgFile,Section,SearchString:string;Value:boolean); overload; //w
+procedure setYcfgSecBool(var YcfgFile:Tstringlist;Section,SearchString,DivideParam:string;Value:boolean); overload; //w
+procedure setYcfgSecBool(var YcfgFile:Tstringlist;Section,SearchString:string;Value:boolean); overload; //w
+ //--
+//DateTime //--
+ //global //--
+procedure setYcfgDateTime(YcfgFile,SearchString,DivideParam:string;Value:TDateTime); overload; //w
+procedure setYcfgDateTime(YcfgFile,SearchString:string;Value:TDateTime); overload; //w
+procedure setYcfgDateTime(var YcfgFile:Tstringlist;SearchString,DivideParam:string;Value:TDateTime); overload; //w
+procedure setYcfgDateTime(var YcfgFile:Tstringlist;SearchString:string;Value:TDateTime); overload; //w
+ //section //--
+procedure setYcfgSecDateTime(YcfgFile,Section,SearchString,DivideParam:string;Value:TDateTime); overload; //w
+procedure setYcfgSecDateTime(YcfgFile,Section,SearchString:string;Value:TDateTime); overload; //w
+procedure setYcfgSecDateTime(var YcfgFile:Tstringlist;Section,SearchString,DivideParam:string;Value:TDateTime); overload; //w
+procedure setYcfgSecDateTime(var YcfgFile:Tstringlist;Section,SearchString:string;Value:TDateTime); overload; //w
+ //--
+//Font //--
+ //global //--
+procedure setYcfgFont(YcfgFile,SearchString,DivideParam:string;Value:TFont); overload; //w
+procedure setYcfgFont(YcfgFile,SearchString:string;Value:TFont); overload; //w
+procedure setYcfgFont(var YcfgFile:Tstringlist;SearchString,DivideParam:string;Value:TFont); overload; //w
+procedure setYcfgFont(var YcfgFile:Tstringlist;SearchString:string;Value:TFont); overload; //w
+ //section //--
+procedure setYcfgSecFont(YcfgFile,Section,SearchString,DivideParam:string;Value:TFont); overload; //w
+procedure setYcfgSecFont(YcfgFile,Section,SearchString:string;Value:TFont); overload; //w
+procedure setYcfgSecFont(var YcfgFile:Tstringlist;Section,SearchString,DivideParam:string;Value:TFont); overload; //w
+procedure setYcfgSecFont(var YcfgFile:Tstringlist;Section,SearchString:string;Value:TFont); overload; //w
+ //--
+//EnCrypted String //--
+ //global //--
+procedure setYcfgStrEnCrypted(YcfgFile,SearchString,DivideParam,Key,Value:string); overload; //w
+procedure setYcfgStrEnCrypted(YcfgFile,SearchString,Key,Value:string); overload; //w
+procedure setYcfgStrEnCrypted(var YcfgFile:Tstringlist;SearchString,DivideParam,Key,Value:string); overload; //w
+procedure setYcfgStrEnCrypted(var YcfgFile:Tstringlist;SearchString,Key,Value:string); overload; //w
+ //section //--
+procedure setYcfgSecStrEnCrypted(YcfgFile,Section,SearchString,DivideParam,Key,Value:string); overload; //w
+procedure setYcfgSecStrEnCrypted(YcfgFile,Section,SearchString,Key,Value:string); overload; //w
+procedure setYcfgSecStrEnCrypted(var YcfgFile:Tstringlist;Section,SearchString,DivideParam,Key,Value:string); overload; //w
+procedure setYcfgSecStrEnCrypted(var YcfgFile:Tstringlist;Section,SearchString,Key,Value:string); overload; //w
+ //--
+// Add******************************************************************************************************************************* //--
+ //--
+ //global //--
+//procedure addYcfgStr(YcfgFile,Value:string); overload; //
+//procedure addYcfgStr(var YcfgFile:Tstringlist); overload; //
+//procedure addYcfgStr(YcfgFile:string;Position:integer); overload; //
+//procedure addYcfgStr(var YcfgFile:Tstringlist;Position:integer); overload; //
+ //Section //--
+//procedure addYcfgStr(YcfgFile,Section:string); overload; //
+//procedure addYcfgStr(var YcfgFile:Tstringlist;Section:string;); overload; //
+//procedure addYcfgStr(YcfgFile,Section:string;Position:integer); overload; //
+//procedure addYcfgStr(var YcfgFile:Tstringlist;Section:string;Position:integer); overload; //
+ //--
+ //global //--
+//procedure addYcfgSpaceLine(YcfgFile:string); overload; //
+//procedure addYcfgSpaceLine(var YcfgFile:Tstringlist); overload; //
+//procedure addYcfgSpaceLine(YcfgFile:string;Position:integer); overload; //
+//procedure addYcfgSpaceLine(var YcfgFile:Tstringlist;Position:integer); overload; //
+ //Section //--
+//procedure addYcfgSecSpaceLine(YcfgFile,Section:string); overload; //
+//procedure addYcfgSecSpaceLine(var YcfgFile:Tstringlist;Section:string;); overload; //
+//procedure addYcfgSecSpaceLine(YcfgFile,Section:string;Position:integer); overload; //
+//procedure addYcfgSecSpaceLine(var YcfgFile:Tstringlist;Section:string;Position:integer); overload; //
+ //--
+ //gloabl //--
+//procedure addYcfgComment(YcfgFile,Value:string); overload; //
+//procedure addYcfgComment(var YcfgFile:Tstringlist;Value:string); overload; //
+//procedure addYcfgComment(YcfgFile:string;Position:integer;Value:string); overload; //
+//procedure addYcfgComment(var YcfgFile:Tstringlist;Position:integer;Value:string); overload; //
+ //Section //--
+//procedure addYcfgSecComment(YcfgFile,Section,Value:string); overload; //
+//procedure addYcfgSecComment(var YcfgFile:Tstringlist;Section,Value:string); overload; //
+//procedure addYcfgSecComment(YcfgFile,Section:string;Position:integer;Value:string); overload; //
+//procedure addYcfgSecComment(var YcfgFile:Tstringlist;Section:string;Position:integer;Value:string); overload; //
+ //--
+// Lists***************************************************************************************************************************** //--
+ //--
+//get //--
+function getYcfgList(YcfgFile,ListHeader:string):TStringList; overload; //w
+function getYcfgList(YcfgFile:TStringlist;ListHeader:string):TStringList; overload; //w
+ //--
+//set //--
+function setYcfgList(YcfgFile,ListHeader:string;List:TStringList;OverrideExisting:boolean):Boolean; overload; //w
+function setYcfgList(var YcfgFile:TStringlist;ListHeader:string;List:TStringList;OverrideExisting:boolean):Boolean; overload; //w
+ //--
+//add //--
+{add to an existing List} //--
+procedure addYcfgList(YcfgFile,ListHeader:string;Value:TStringList); overload; //w
+procedure addYcfgList(var YcfgFile:TStringlist;ListHeader:string;Value:TStringList); overload; //w
+ //--
+{Add only one string/int/bool} //--
+procedure addYcfgListStr(YcfgFile,ListHeader,Value:string); overload; //w
+procedure addYcfgListStr(var YcfgFile:TStringlist;ListHeader,Value:string); overload; //w
+ //--
+procedure addYcfgListInt(YcfgFile,ListHeader:string;Value:integer); overload; //w
+procedure addYcfgListInt(var YcfgFile:TStringlist;ListHeader:string;Value:integer); overload; //w
+ //--
+procedure addYcfgListComment(YcfgFile,ListHeader:string;Value:string); overload; //w
+procedure addYcfgListComment(var YcfgFile:TStringlist;ListHeader:string;Value:string); overload; //w
+ //--
+procedure addYcfgListBool(YcfgFile,ListHeader:string;Value:boolean); overload; //w
+procedure addYcfgListBool(var YcfgFile:TStringlist;ListHeader:string;Value:boolean); overload; //w
+ //--
+//misc //--
+function getYcfgListPos(YcfgFile,ListHeader:string):TPoint; overload; //w
+function getYcfgListPos(YcfgFile:TStringlist;ListHeader:string):TPoint; overload; //w
+ //--
+procedure clearYcfgList(YcfgFile,ListHeader:string); overload; //w
+procedure clearYcfgList(var YcfgFile:TStringlist;ListHeader:string); overload; //w
+ //--
+procedure delYcfgList(YcfgFile,ListHeader:string); overload; //w
+procedure delYcfgList(var YcfgFile:TStringlist;ListHeader:string); overload; //w
+ //--
+function YcfgListExists(YcfgFile,ListHeader:string):boolean; overload; //w
+function YcfgListExists(YcfgFile:TStringlist;ListHeader:string):boolean; overload; //w
+ //--
+const //--
+ YcfgHeader = '$$YcfgFile 200 $$'; //--
+ YcfgComments = '// ** (* ## > flip axis
+ 00000000000
+ 00000000000
+ 00000000000
+ 00000000000
+ 00000000000
+ originalimg
+
+ */
+ Image & flipAroundY();
+
+ /** Flips (mirrors) the image around the X-axis.
+ @remarks
+ An example of an original and flipped image:
+
+ flip axis
+ |
+ originalimg|gmilanigiro
+ 00000000000|00000000000
+ 00000000000|00000000000
+ 00000000000|00000000000
+ 00000000000|00000000000
+ 00000000000|00000000000
+
+ */
+ Image & flipAroundX();
+
+ /** Stores a pointer to raw data in memory. The pixel format has to be specified.
+ @remarks
+ This method loads an image into memory held in the object. The
+ pixel format will be either greyscale or RGB with an optional
+ Alpha component.
+ The type can be determined by calling getFormat().
+ @note
+ Whilst typically your image is likely to be a simple 2D image,
+ you can define complex images including cube maps, volume maps,
+ and images including custom mip levels. The layout of the
+ internal memory should be:
+ - face 0, mip 0 (top), width x height (x depth)
+ - face 0, mip 1, width/2 x height/2 (x depth/2)
+ - face 0, mip 2, width/4 x height/4 (x depth/4)
+ - .. remaining mips for face 0 ..
+ - face 1, mip 0 (top), width x height (x depth)
.. and so on.
+
+ Of course, you will never have multiple faces (cube map) and
+ depth too.
+ @param
+ The data pointer
+ @param
+ Width of image
+ @param
+ Height of image
+ @param
+ Image Depth (in 3d images, numbers of layers, otherwhise 1)
+ @param
+ Pixel Format
+ @param
+ if memory associated with this buffer is to be destroyed
+ with the Image object.
+ @param
+ the number of faces the image data has inside (6 for cubemaps, 1 otherwise)
+ @param
+ the number of mipmaps the image data has inside
+ @note
+ The memory associated with this buffer is NOT destroyed with the
+ Image object, unless autoDelete is set to true.
+ @remarks
+ The size of the buffer must be numFaces*PixelUtil::getMemorySize(width, height, depth, format)
+ */
+ Image& loadDynamicImage( uchar* pData, size_t uWidth, size_t uHeight,
+ size_t depth,
+ PixelFormat eFormat, bool autoDelete = false,
+ size_t numFaces = 1, size_t numMipMaps = 0);
+
+ /** Stores a pointer to raw data in memory. The pixel format has to be specified.
+ @remarks
+ This method loads an image into memory held in the object. The
+ pixel format will be either greyscale or RGB with an optional
+ Alpha component.
+ The type can be determined by calling getFormat().
+ @note
+ Whilst typically your image is likely to be a simple 2D image,
+ you can define complex images including cube maps
+ and images including custom mip levels. The layout of the
+ internal memory should be:
+ - face 0, mip 0 (top), width x height
+ - face 0, mip 1, width/2 x height/2
+ - face 0, mip 2, width/4 x height/4
+ - .. remaining mips for face 0 ..
+ - face 1, mip 0 (top), width x height (x depth)
.. and so on.
+
+ Of course, you will never have multiple faces (cube map) and
+ depth too.
+ @param
+ The data pointer
+ @param
+ Width of image
+ @param
+ Height of image
+ @param
+ Pixel Format
+ @note
+ The memory associated with this buffer is NOT destroyed with the
+ Image object.
+ @remarks This function is deprecated; one should really use the
+ Image::loadDynamicImage(pData, width, height, depth, format, ...) to be compatible
+ with future Ogre versions.
+ */
+ Image& loadDynamicImage( uchar* pData, size_t uWidth,
+ size_t uHeight, PixelFormat eFormat)
+ {
+ return loadDynamicImage(pData, uWidth, uHeight, 1, eFormat);
+ }
+ /** Loads raw data from a stream. See the function
+ loadDynamicImage for a description of the parameters.
+ @remarks
+ The size of the buffer must be numFaces*PixelUtil::getMemorySize(width, height, depth, format)
+ @note
+ Whilst typically your image is likely to be a simple 2D image,
+ you can define complex images including cube maps
+ and images including custom mip levels. The layout of the
+ internal memory should be:
+ - face 0, mip 0 (top), width x height (x depth)
+ - face 0, mip 1, width/2 x height/2 (x depth/2)
+ - face 0, mip 2, width/4 x height/4 (x depth/4)
+ - .. remaining mips for face 0 ..
+ - face 1, mip 0 (top), width x height (x depth)
.. and so on.
+
+ Of course, you will never have multiple faces (cube map) and
+ depth too.
+ */
+ Image & loadRawData(
+ DataStreamPtr& stream,
+ size_t uWidth, size_t uHeight, size_t uDepth,
+ PixelFormat eFormat,
+ size_t numFaces = 1, size_t numMipMaps = 0);
+ /** Loads raw data from a stream. The pixel format has to be specified.
+ @remarks This function is deprecated; one should really use the
+ Image::loadRawData(stream, width, height, depth, format, ...) to be compatible
+ with future Ogre versions.
+ @note
+ Whilst typically your image is likely to be a simple 2D image,
+ you can define complex images including cube maps
+ and images including custom mip levels. The layout of the
+ internal memory should be:
+ - face 0, mip 0 (top), width x height
+ - face 0, mip 1, width/2 x height/2
+ - face 0, mip 2, width/4 x height/4
+ - .. remaining mips for face 0 ..
+ - face 1, mip 0 (top), width x height (x depth)
.. and so on.
+
+ Of course, you will never have multiple faces (cube map) and
+ depth too.
+ */
+ Image & loadRawData(
+ DataStreamPtr& stream,
+ size_t uWidth, size_t uHeight,
+ PixelFormat eFormat )
+ {
+ return loadRawData(stream, uWidth, uHeight, 1, eFormat);
+ }
+
+ /** Loads an image file.
+ @remarks
+ This method loads an image into memory. Any format for which
+ and associated ImageCodec is registered can be loaded.
+ This can include complex formats like DDS with embedded custom
+ mipmaps, cube faces and volume textures.
+ The type can be determined by calling getFormat().
+ @param
+ strFileName Name of a file file to load.
+ @param
+ groupName Name of the resource group to search for the image
+ @note
+ The memory associated with this buffer is destroyed with the
+ Image object.
+ */
+ Image & load( const String& strFileName, const String& groupName );
+
+ /** Loads an image file from a stream.
+ @remarks
+ This method works in the same way as the filename-based load
+ method except it loads the image from a DataStream object.
+ This DataStream is expected to contain the
+ encoded data as it would be held in a file.
+ Any format for which and associated ImageCodec is registered
+ can be loaded.
+ This can include complex formats like DDS with embedded custom
+ mipmaps, cube faces and volume textures.
+ The type can be determined by calling getFormat().
+ @param
+ stream The source data.
+ @param
+ type The type of the image. Used to decide what decompression
+ codec to use.
+ @see
+ Image::load( const String& strFileName )
+ */
+ Image & load(DataStreamPtr& stream, const String& type );
+
+ /** Save the image as a file. */
+ void save(const String& filename);
+
+ /** Returns a pointer to the internal image buffer.
+ @remarks
+ Be careful with this method. You will almost certainly
+ prefer to use getPixelBox, especially with complex images
+ which include many faces or custom mipmaps.
+ */
+ uchar* getData(void);
+
+ /** Returns a const pointer to the internal image buffer.
+ @remarks
+ Be careful with this method. You will almost certainly
+ prefer to use getPixelBox, especially with complex images
+ which include many faces or custom mipmaps.
+ */
+ const uchar * getData() const;
+
+ /** Returns the size of the data buffer.
+ */
+ size_t getSize() const;
+
+ /** Returns the number of mipmaps contained in the image.
+ */
+ size_t getNumMipmaps() const;
+
+ /** Returns true if the image has the appropriate flag set.
+ */
+ bool hasFlag(const ImageFlags imgFlag) const;
+
+ /** Gets the width of the image in pixels.
+ */
+ size_t getWidth(void) const;
+
+ /** Gets the height of the image in pixels.
+ */
+ size_t getHeight(void) const;
+
+ /** Gets the depth of the image.
+ */
+ size_t getDepth(void) const;
+
+ /** Get the numer of faces of the image. This is usually 6 for a cubemap, and
+ 1 for a normal image.
+ */
+ size_t getNumFaces(void) const;
+
+ /** Gets the physical width in bytes of each row of pixels.
+ */
+ size_t getRowSpan(void) const;
+
+ /** Returns the image format.
+ */
+ PixelFormat getFormat() const;
+
+ /** Returns the number of bits per pixel.
+ */
+ uchar getBPP() const;
+
+ /** Returns true if the image has an alpha component.
+ */
+ bool getHasAlpha() const;
+
+ /** Does gamma adjustment.
+ @note
+ Basic algo taken from Titan Engine, copyright (c) 2000 Ignacio
+ Castano Iguado
+ */
+ static void applyGamma( uchar *buffer, Real gamma, size_t size, uchar bpp );
+
+ /**
+ * Get colour value from a certain location in the image. The z coordinate
+ * is only valid for cubemaps and volume textures. This uses the first (largest)
+ * mipmap.
+ */
+ ColourValue getColourAt(int x, int y, int z);
+
+ /**
+ * Get a PixelBox encapsulating the image data of a mipmap
+ */
+ PixelBox getPixelBox(size_t face = 0, size_t mipmap = 0) const;
+
+ enum Filter
+ {
+ FILTER_NEAREST,
+ FILTER_LINEAR,
+ FILTER_BILINEAR,
+ FILTER_BOX,
+ FILTER_TRIANGLE,
+ FILTER_BICUBIC
+ };
+ /** Scale a 1D, 2D or 3D image volume.
+ @param src PixelBox containing the source pointer, dimensions and format
+ @param dst PixelBox containing the destination pointer, dimensions and format
+ @param filter Which filter to use
+ @remarks This function can do pixel format conversion in the process.
+ @note dst and src can point to the same PixelBox object without any problem
+ */
+ static void scale(const PixelBox &src, const PixelBox &dst, Filter filter = FILTER_BILINEAR);
+
+ /** Resize a 2D image, applying the appropriate filter. */
+ void resize(ushort width, ushort height, Filter filter = FILTER_BILINEAR);
+
+ // Static function to calculate size in bytes from the number of mipmaps, faces and the dimensions
+ static size_t calculateSize(size_t mipmaps, size_t faces, size_t width, size_t height, size_t depth, PixelFormat format);
+ private:
+ // The width of the image in pixels
+ size_t m_uWidth;
+ // The height of the image in pixels
+ size_t m_uHeight;
+ // The depth of the image
+ size_t m_uDepth;
+ // The size of the image buffer
+ size_t m_uSize;
+ // The number of mipmaps the image contains
+ size_t m_uNumMipmaps;
+ // Image specific flags.
+ int m_uFlags;
+
+ // The pixel format of the image
+ PixelFormat m_eFormat;
+
+ // The number of bytes per pixel
+ uchar m_ucPixelSize;
+ uchar* m_pBuffer;
+
+ // A bool to determine if we delete the buffer or the calling app does
+ bool m_bAutoDelete;
+ };
+
+ typedef std::vector ImagePtrList;
+ typedef std::vector ConstImagePtrList;
+
+
+} // namespace
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreImageCodec.h b/school/informatik/verkerhssimulation/src/ogre/OgreImageCodec.h
new file mode 100644
index 00000000..3b8f16cf
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreImageCodec.h
@@ -0,0 +1,82 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _ImageCodec_H__
+#define _ImageCodec_H__
+
+#include "OgreCodec.h"
+#include "OgrePixelFormat.h"
+
+namespace Ogre {
+
+ /** Codec specialized in images.
+ @remarks
+ The users implementing subclasses of ImageCodec are required to return
+ a valid pointer to a ImageData class from the decode(...) function.
+ */
+ class _OgreExport ImageCodec : public Codec
+ {
+ public:
+ virtual ~ImageCodec();
+ /** Codec return class for images. Has imformation about the size and the
+ pixel format of the image. */
+ class _OgrePrivate ImageData : public Codec::CodecData
+ {
+ public:
+ ImageData():
+ height(0), width(0), depth(1), size(0),
+ num_mipmaps(0), flags(0), format(PF_UNKNOWN)
+ {
+ }
+ size_t height;
+ size_t width;
+ size_t depth;
+ size_t size;
+
+ ushort num_mipmaps;
+ uint flags;
+
+ PixelFormat format;
+
+ public:
+ String dataType() const
+ {
+ return "ImageData";
+ }
+ };
+
+ public:
+ String getDataType() const
+ {
+ return "ImageData";
+ }
+ };
+
+} // namespace
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreInstancedGeometry.h b/school/informatik/verkerhssimulation/src/ogre/OgreInstancedGeometry.h
new file mode 100644
index 00000000..e6af73c8
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreInstancedGeometry.h
@@ -0,0 +1,833 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __InstancedGeometry_H__
+#define __InstancedGeometry_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreMovableObject.h"
+#include "OgreSimpleRenderable.h"
+#include "OgreSkeleton.h"
+#include "OgreSkeletonInstance.h"
+#include "OgreAnimationTrack.h"
+#include "OgreBone.h"
+
+namespace Ogre {
+
+ /** Pre-transforms and batches up meshes for efficient use as instanced geometry
+ in a scene
+ @remarks
+ Shader instancing allows to save both memory and draw calls. While
+ StaticGeometry stores 500 times the same object in a batch to display 500
+ objects, this shader instancing implementation stores only 80 times the object,
+ and then re-uses the vertex data with different shader parameter.
+ Although you save memory, you make more draw call. However, you still
+ make less draw calls than if you were rendering each object independently.
+ Plus, you can move the batched objects independently of one another which
+ you cannot do with StaticGeometry.
+ @par
+ Therefore it is important when you are rendering a lot of geometry to
+ batch things up into as few rendering calls as possible. This
+ class allows you to build a batched object from a series of entities
+ in order to benefit from this behaviour.
+ Batching has implications of it's own though:
+ @li Batched geometry cannot be subdivided; that means that the whole
+ group will be displayed, or none of it will. This obivously has
+ culling issues.
+ @li A single material must apply for each batch. In fact this class
+ allows you to use multiple materials, but you should be aware that
+ internally this means that there is one batch per material.
+ Therefore you won't gain as much benefit from the batching if you
+ use many different materials; try to keep the number down.
+ @par
+ The bounding box information is computed whith object position only.
+ It doesn't take account of the object orientation.
+ @par
+ The LOD settings of both the Mesh and the Materials used in
+ constructing this instanced geometry will be respected. This means that
+ if you use meshes/materials which have LOD, batches in the distance
+ will have a lower polygon count or material detail to those in the
+ foreground. Since each mesh might have different LOD distances, during
+ build the furthest distance at each LOD level from all meshes
+ in that BatchInstance is used. This means all the LOD levels change at the
+ same time, but at the furthest distance of any of them (so quality is
+ not degraded). Be aware that using Mesh LOD in this class will
+ further increase the memory required. Only generated LOD
+ is supported for meshes.
+ @par
+ There are 2 ways you can add geometry to this class; you can add
+ Entity objects directly with predetermined positions, scales and
+ orientations, or you can add an entire SceneNode and it's subtree,
+ including all the objects attached to it. Once you've added everthing
+ you need to, you have to call build() the fix the geometry in place.
+ @par
+ You should not construct instances of this class directly; instead, call
+ SceneManager::createInstancedGeometry, which gives the SceneManager the
+ option of providing you with a specialised version of this class if it
+ wishes, and also handles the memory management for you like other
+ classes.
+ */
+ class _OgreExport InstancedGeometry
+ {
+ public:
+ /** Struct holding geometry optimised per SubMesh / lod level, ready
+ for copying to instances.
+ @remarks
+ Since we're going to be duplicating geometry lots of times, it's
+ far more important that we don't have redundant vertex data. If a
+ SubMesh uses shared geometry, or we're looking at a lower LOD, not
+ all the vertices are being referenced by faces on that submesh.
+ Therefore to duplicate them, potentially hundreds or even thousands
+ of times, would be extremely wasteful. Therefore, if a SubMesh at
+ a given LOD has wastage, we create an optimised version of it's
+ geometry which is ready for copying with no wastage.
+ */
+ class _OgrePrivate OptimisedSubMeshGeometry
+ {
+ public:
+ OptimisedSubMeshGeometry() :vertexData(0), indexData(0) {}
+ ~OptimisedSubMeshGeometry()
+ {
+ delete vertexData;
+ delete indexData;
+ }
+ VertexData *vertexData;
+ IndexData *indexData;
+ };
+ typedef std::list OptimisedSubMeshGeometryList;
+ /// Saved link between SubMesh at a LOD and vertex/index data
+ /// May point to original or optimised geometry
+ struct SubMeshLodGeometryLink
+ {
+ VertexData* vertexData;
+ IndexData* indexData;
+ };
+ typedef std::vector SubMeshLodGeometryLinkList;
+ typedef std::map SubMeshGeometryLookup;
+ /// Structure recording a queued submesh for the build
+ struct QueuedSubMesh
+ {
+ SubMesh* submesh;
+ /// Link to LOD list of geometry, potentially optimised
+ SubMeshLodGeometryLinkList* geometryLodList;
+ String materialName;
+ Vector3 position;
+ Quaternion orientation;
+ Vector3 scale;
+ /// Pre-transformed world AABB
+ AxisAlignedBox worldBounds;
+ unsigned int ID;
+ };
+ typedef std::vector QueuedSubMeshList;
+ typedef std::vector QueuedSubMeshOriginList;
+ /// Structure recording a queued geometry for low level builds
+ struct QueuedGeometry
+ {
+ SubMeshLodGeometryLink* geometry;
+ Vector3 position;
+ Quaternion orientation;
+ Vector3 scale;
+ unsigned int ID;
+ };
+ typedef std::vector QueuedGeometryList;
+
+ // forward declarations
+ class LODBucket;
+ class MaterialBucket;
+ class BatchInstance;
+ class InstancedObject;
+
+ /** A GeometryBucket is a the lowest level bucket where geometry with
+ the same vertex & index format is stored. It also acts as the
+ renderable.
+ */
+ class _OgreExport GeometryBucket : public SimpleRenderable
+ {
+ protected:
+
+ /// Geometry which has been queued up pre-build (not for deallocation)
+ QueuedGeometryList mQueuedGeometry;
+ /// Pointer to the Batch
+ InstancedGeometry*mBatch;
+ /// Pointer to parent bucket
+ MaterialBucket* mParent;
+ /// String identifying the vertex / index format
+ String mFormatString;
+ /// Vertex information, includes current number of vertices
+ /// committed to be a part of this bucket
+ VertexData* mVertexData;
+ /// Index information, includes index type which limits the max
+ /// number of vertices which are allowed in one bucket
+ IndexData* mIndexData;
+ /// Size of indexes
+ HardwareIndexBuffer::IndexType mIndexType;
+ /// Maximum vertex indexable
+ size_t mMaxVertexIndex;
+ /// Index of the Texcoord where the index is stored
+ unsigned short mTexCoordIndex;
+ AxisAlignedBox mAABB;
+
+ template
+ void copyIndexes(const T* src, T* dst, size_t count, size_t indexOffset)
+ {
+ if (indexOffset == 0)
+ {
+ memcpy(dst, src, sizeof(T) * count);
+ }
+ else
+ {
+ while(count--)
+ {
+ *dst++ = static_cast(*src++ + indexOffset);
+ }
+ }
+ }
+ public:
+ GeometryBucket(MaterialBucket* parent, const String& formatString,
+ const VertexData* vData, const IndexData* iData);
+ GeometryBucket(MaterialBucket* parent,const String& formatString,GeometryBucket*bucket);
+ virtual ~GeometryBucket();
+ MaterialBucket* getParent(void) { return mParent; }
+ Real getBoundingRadius(void) const;
+ /// Get the vertex data for this geometry
+ const VertexData* getVertexData(void) const { return mVertexData; }
+ /// Get the index data for this geometry
+ const IndexData* getIndexData(void) const { return mIndexData; }
+ /// @copydoc Renderable::getMaterial
+ const MaterialPtr& getMaterial(void) const;
+ Technique* getTechnique(void) const;
+ void getWorldTransforms(Matrix4* xform) const;
+ virtual unsigned short getNumWorldTransforms(void) const ;
+ const Quaternion& getWorldOrientation(void) const;
+ const Vector3& getWorldPosition(void) const;
+ Real getSquaredViewDepth(const Camera* cam) const;
+ const LightList& getLights(void) const;
+ bool getCastsShadows(void) const;
+ String getFormatString(void) const;
+ /** Try to assign geometry to this bucket.
+ @returns false if there is no room left in this bucket
+ */
+ bool assign(QueuedGeometry* qsm);
+ /// Build
+ void build();
+ /// Dump contents for diagnostics
+ void dump(std::ofstream& of) const;
+ /// retun the BoundingBox information. Usefull when cloning the batch instance.
+ AxisAlignedBox & getAABB(void){return mAABB;};
+ };
+ class _OgreExport InstancedObject
+ {
+ friend class GeometryBucket;
+ public:
+ enum TransformSpace
+ {
+ /// Transform is relative to the local space
+ TS_LOCAL,
+ /// Transform is relative to the space of the parent node
+ TS_PARENT,
+ /// Transform is relative to world space
+ TS_WORLD
+ };
+ /// list of Geometry Buckets that contains the instanced object
+ typedef std::vector GeometryBucketList;
+ protected:
+ GeometryBucketList mGeometryBucketList;
+ unsigned short mIndex;
+ Matrix4 mTransformation;
+ Quaternion mOrientation;
+ Vector3 mScale;
+ Vector3 mPosition;
+ SkeletonInstance* mSkeletonInstance;
+ /// Cached bone matrices, including any world transform
+ Matrix4 *mBoneWorldMatrices;
+ /// Cached bone matrices in skeleton local space
+ Matrix4 *mBoneMatrices;
+ /// State of animation for animable meshes
+ AnimationStateSet* mAnimationState;
+ unsigned short mNumBoneMatrices;
+ /// Records the last frame in which animation was updated
+ unsigned long mFrameAnimationLastUpdated;
+ public:
+ InstancedObject(int index);
+ InstancedObject(int index,SkeletonInstance *skeleton,AnimationStateSet*animations);
+ ~InstancedObject();
+ void setPosition( Vector3 position);
+ Vector3 & getPosition(void);
+ void yaw(const Radian& angle);
+ void pitch(const Radian& angle);
+ void roll(const Radian& angle);
+ void rotate(const Quaternion& q);
+ void setScale(const Vector3& scale);
+ void addBucketToList(GeometryBucket* bucket);
+ void needUpdate();
+ GeometryBucketList&getGeometryBucketList(void){return mGeometryBucketList;}
+ void translate(const Matrix3& axes, const Vector3& move);
+ void translate(const Vector3& d);
+ Matrix3 getLocalAxes(void) const;
+ void updateAnimation(void);
+ AnimationState* getAnimationState(const String& name) const;
+ SkeletonInstance*getSkeletonInstance(void){return mSkeletonInstance;}
+
+ };
+ /** A MaterialBucket is a collection of smaller buckets with the same
+ Material (and implicitly the same LOD). */
+ class _OgreExport MaterialBucket
+ {
+ public:
+ /// list of Geometry Buckets in this BatchInstance
+ typedef std::vector GeometryBucketList;
+ protected:
+ /// Pointer to parent LODBucket
+ LODBucket* mParent;
+ /// Material being used
+ String mMaterialName;
+ /// Pointer to material being used
+ MaterialPtr mMaterial;
+ /// Active technique
+ Technique* mTechnique;
+ int mLastIndex;
+ /// list of Geometry Buckets in this BatchInstance
+ GeometryBucketList mGeometryBucketList;
+ // index to current Geometry Buckets for a given geometry format
+ typedef std::map CurrentGeometryMap;
+ CurrentGeometryMap mCurrentGeometryMap;
+ /// Get a packed string identifying the geometry format
+ String getGeometryFormatString(SubMeshLodGeometryLink* geom);
+
+ public:
+ MaterialBucket(LODBucket* parent, const String& materialName);
+ virtual ~MaterialBucket();
+ LODBucket* getParent(void) { return mParent; }
+ /// Get the material name
+ const String& getMaterialName(void) const { return mMaterialName; }
+ /// Assign geometry to this bucket
+ void assign(QueuedGeometry* qsm);
+ /// Build
+ void build();
+ /// Add children to the render queue
+ void addRenderables(RenderQueue* queue, uint8 group,
+ Real camSquaredDist);
+ /// Get the material for this bucket
+ const MaterialPtr& getMaterial(void) const { return mMaterial; }
+ /// Iterator over geometry
+ typedef VectorIterator GeometryIterator;
+ /// Get an iterator over the contained geometry
+ GeometryIterator getGeometryIterator(void);
+ /// Get the current Technique
+ Technique* getCurrentTechnique(void) const { return mTechnique; }
+ /// Dump contents for diagnostics
+ void dump(std::ofstream& of) const;
+ /// Return the geometry map
+ MaterialBucket::CurrentGeometryMap* getMaterialBucketMap(void) const;
+ /// Return the geometry list
+ MaterialBucket::GeometryBucketList*getGeometryBucketList(void) const;
+ /// fill in the map and the list
+ void updateContainers(GeometryBucket* bucket, const String &format);
+ void setLastIndex(int index){mLastIndex=index;}
+ int getLastIndex(){return mLastIndex;}
+ void setMaterial(const String & name);
+
+ };
+ /** A LODBucket is a collection of smaller buckets with the same LOD.
+ @remarks
+ LOD refers to Mesh LOD here. Material LOD can change separately
+ at the next bucket down from this.
+ */
+ class _OgreExport LODBucket
+ {
+ public:
+ /// Lookup of Material Buckets in this BatchInstance
+ typedef std::map MaterialBucketMap;
+ protected:
+ /// Pointer to parent BatchInstance
+ BatchInstance* mParent;
+ /// LOD level (0 == full LOD)
+ unsigned short mLod;
+ /// distance at which this LOD starts to apply (squared)
+ Real mSquaredDistance;
+ /// Lookup of Material Buckets in this BatchInstance
+ MaterialBucketMap mMaterialBucketMap;
+ /// Geometry queued for a single LOD (deallocated here)
+ QueuedGeometryList mQueuedGeometryList;
+ public:
+ LODBucket(BatchInstance* parent, unsigned short lod, Real lodDist);
+ virtual ~LODBucket();
+ BatchInstance* getParent(void) { return mParent; }
+ /// Get the lod index
+ ushort getLod(void) const { return mLod; }
+ /// Get the lod squared distance
+ Real getSquaredDistance(void) const { return mSquaredDistance; }
+ /// Assign a queued submesh to this bucket, using specified mesh LOD
+ void assign(QueuedSubMesh* qsm, ushort atLod);
+ /// Build
+ void build();
+ /// Add children to the render queue
+ void addRenderables(RenderQueue* queue, uint8 group,
+ Real camSquaredDistance);
+ /// Iterator over the materials in this LOD
+ typedef MapIterator MaterialIterator;
+ /// Get an iterator over the materials in this LOD
+ MaterialIterator getMaterialIterator(void);
+ /// Dump contents for diagnostics
+ void dump(std::ofstream& of) const;
+ /// fill the map
+ void updateContainers(MaterialBucket* bucket, String& name );
+
+ };
+ /** The details of a topological BatchInstance which is the highest level of
+ partitioning for this class.
+ @remarks
+ The size & shape of BatchInstances entirely depends on the SceneManager
+ specific implementation. It is a MovableObject since it will be
+ attached to a node based on the local centre - in practice it
+ won't actually move (although in theory it could).
+ */
+ class _OgreExport BatchInstance : public MovableObject
+ {
+ public:
+
+
+ /// list of LOD Buckets in this BatchInstance
+ typedef std::vector LODBucketList;
+ typedef std::map ObjectsMap;
+ protected:
+
+ /// Parent static geometry
+ InstancedGeometry* mParent;
+ /// Scene manager link
+ SceneManager* mSceneMgr;
+ /// Scene node
+ SceneNode* mNode;
+ /// Local list of queued meshes (not used for deallocation)
+ QueuedSubMeshList mQueuedSubMeshes;
+ /// Unique identifier for the BatchInstance
+ uint32 mBatchInstanceID;
+
+ ObjectsMap mInstancesMap;
+ public:
+ /// LOD distances (squared) as built up - use the max at each level
+ std::vector mLodSquaredDistances;
+ /// Local AABB relative to BatchInstance centre
+ AxisAlignedBox mAABB;
+ /// Local bounding radius
+ Real mBoundingRadius;
+ /// The current lod level, as determined from the last camera
+ ushort mCurrentLod;
+ /// Current camera distance, passed on to do material lod later
+ Real mCamDistanceSquared;
+ protected:
+ /// List of LOD buckets
+ LODBucketList mLodBucketList;
+
+ public:
+ BatchInstance(InstancedGeometry* parent, const String& name, SceneManager* mgr,
+ uint32 BatchInstanceID);
+ virtual ~BatchInstance();
+ // more fields can be added in subclasses
+ InstancedGeometry* getParent(void) const { return mParent;}
+ /// Assign a queued mesh to this BatchInstance, read for final build
+ void assign(QueuedSubMesh* qmesh);
+ /// Build this BatchInstance
+ void build();
+ /// Get the BatchInstance ID of this BatchInstance
+ uint32 getID(void) const { return mBatchInstanceID; }
+ /// Get the centre point of the BatchInstance
+// const Vector3& getCentre(void) const { return mCentre; }
+ const String& getMovableType(void) const;
+ void _notifyCurrentCamera(Camera* cam);
+ const AxisAlignedBox& getBoundingBox(void) const;
+ void setBoundingBox(AxisAlignedBox& box);
+ Real getBoundingRadius(void) const;
+ void _updateRenderQueue(RenderQueue* queue);
+ bool isVisible(void) const;
+ // uint32 getTypeFlags(void) const;
+
+ typedef VectorIterator LODIterator;
+ /// Get an iterator over the LODs in this BatchInstance
+ LODIterator getLODIterator(void);
+ /// Shared set of lights for all GeometryBuckets
+ const LightList& getLights(void) const;
+
+ /// update the bounding box of the BatchInstance according to the positions of the objects
+ void updateBoundingBox();
+
+ /// Dump contents for diagnostics
+ void dump(std::ofstream& of) const;
+ /// fill in the list
+ void updateContainers(LODBucket* bucket );
+ /// attach the BatchInstance to the scene
+ void attachToScene();
+ void addInstancedObject(int index, InstancedObject* object);
+ InstancedObject* isInstancedObjectPresent(int index);
+ InstancedObject** getObjectsAsArray(unsigned short & size);
+ SceneNode*getSceneNode(void){return mNode;}
+ ObjectsMap&getInstancesMap(void){return mInstancesMap;};
+ /// change the shader used to render the batch instance
+
+ };
+ /** Indexed BatchInstance map based on packed x/y/z BatchInstance index, 10 bits for
+ each axis.
+ */
+ typedef std::map BatchInstanceMap;
+ /** Simple vectors where are stored all the renderoperations of the Batch.
+ This vector is used when we want to delete the batch, in order to delete only one time each
+ render operation.
+
+ */
+ typedef std::vector RenderOperationVector;
+ protected:
+ // General state & settings
+ SceneManager* mOwner;
+ String mName;
+ bool mBuilt;
+ Real mUpperDistance;
+ Real mSquaredUpperDistance;
+ bool mCastShadows;
+ Vector3 mBatchInstanceDimensions;
+ Vector3 mHalfBatchInstanceDimensions;
+ Vector3 mOrigin;
+ bool mVisible;
+ /// The render queue to use when rendering this object
+ uint8 mRenderQueueID;
+ /// Flags whether the RenderQueue's default should be used.
+ bool mRenderQueueIDSet;
+ /// number of objects in the batch
+ unsigned int mObjectCount;
+ QueuedSubMeshList mQueuedSubMeshes;
+ BatchInstance*mInstancedGeometryInstance;
+ /**this is just a pointer to the base skeleton that will be used for each animated object in the batches
+ This pointer has a value only during the creation of the InstancedGeometry
+ */
+ SkeletonPtr mBaseSkeleton;
+ SkeletonInstance *mSkeletonInstance;
+ /**This is the main animation state. All "objects" in the batch will use an instance of this animation
+ state
+ */
+ AnimationStateSet* mAnimationState;
+ /// List of geometry which has been optimised for SubMesh use
+ /// This is the primary storage used for cleaning up later
+ OptimisedSubMeshGeometryList mOptimisedSubMeshGeometryList;
+
+ /** Cached links from SubMeshes to (potentially optimised) geometry
+ This is not used for deletion since the lookup may reference
+ original vertex data
+ */
+ SubMeshGeometryLookup mSubMeshGeometryLookup;
+
+ /// Map of BatchInstances
+ BatchInstanceMap mBatchInstanceMap;
+ /** This vector stores all the renderOperation used in the batch.
+ See the type definition for more details.
+ */
+ RenderOperationVector mRenderOps;
+ /** Virtual method for getting a BatchInstance most suitable for the
+ passed in bounds. Can be overridden by subclasses.
+ */
+ virtual BatchInstance* getBatchInstance(const AxisAlignedBox& bounds, bool autoCreate);
+ /** Get the BatchInstance within which a point lies */
+ virtual BatchInstance* getBatchInstance(const Vector3& point, bool autoCreate);
+ /** Get the BatchInstance using indexes */
+ virtual BatchInstance* getBatchInstance(ushort x, ushort y, ushort z, bool autoCreate);
+ /** Get the BatchInstance using a packed index, returns null if it doesn't exist. */
+ virtual BatchInstance* getBatchInstance(uint32 index);
+ /** Get the BatchInstance indexes for a point.
+ */
+ virtual void getBatchInstanceIndexes(const Vector3& point,
+ ushort& x, ushort& y, ushort& z);
+ /** get the first BatchInstance or create on if it does not exists.
+ */
+ virtual BatchInstance* getInstancedGeometryInstance(void);
+ /** Pack 3 indexes into a single index value
+ */
+ virtual uint32 packIndex(ushort x, ushort y, ushort z);
+ /** Get the volume intersection for an indexed BatchInstance with some bounds.
+ */
+ virtual Real getVolumeIntersection(const AxisAlignedBox& box,
+ ushort x, ushort y, ushort z);
+ /** Get the bounds of an indexed BatchInstance.
+ */
+ virtual AxisAlignedBox getBatchInstanceBounds(ushort x, ushort y, ushort z);
+ /** Get the centre of an indexed BatchInstance.
+ */
+ virtual Vector3 getBatchInstanceCentre(ushort x, ushort y, ushort z);
+ /** Calculate world bounds from a set of vertex data. */
+ virtual AxisAlignedBox calculateBounds(VertexData* vertexData,
+ const Vector3& position, const Quaternion& orientation,
+ const Vector3& scale);
+ /** Look up or calculate the geometry data to use for this SubMesh */
+ SubMeshLodGeometryLinkList* determineGeometry(SubMesh* sm);
+ /** Split some shared geometry into dedicated geometry. */
+ void splitGeometry(VertexData* vd, IndexData* id,
+ SubMeshLodGeometryLink* targetGeomLink);
+
+ typedef std::map IndexRemap;
+ /** Method for figuring out which vertices are used by an index buffer
+ and calculating a remap lookup for a vertex buffer just containing
+ those vertices.
+ */
+ template
+ void buildIndexRemap(T* pBuffer, size_t numIndexes, IndexRemap& remap)
+ {
+ remap.clear();
+ for (size_t i = 0; i < numIndexes; ++i)
+ {
+ // use insert since duplicates are silently discarded
+ remap.insert(IndexRemap::value_type(*pBuffer++, remap.size()));
+ // this will have mapped oldindex -> new index IF oldindex
+ // wasn't already there
+ }
+ }
+ /** Method for altering indexes based on a remap. */
+ template
+ void remapIndexes(T* src, T* dst, const IndexRemap& remap,
+ size_t numIndexes)
+ {
+ for (size_t i = 0; i < numIndexes; ++i)
+ {
+ // look up original and map to target
+ IndexRemap::const_iterator ix = remap.find(*src++);
+ assert(ix != remap.end());
+ *dst++ = static_cast(ix->second);
+ }
+ }
+
+ public:
+ /// Constructor; do not use directly (@see SceneManager::createInstancedGeometry)
+ InstancedGeometry(SceneManager* owner, const String& name);
+ /// Destructor
+ virtual ~InstancedGeometry();
+
+ /// Get the name of this object
+ const String& getName(void) const { return mName; }
+ /** Adds an Entity to the static geometry.
+ @remarks
+ This method takes an existing Entity and adds its details to the
+ list of elements to include when building. Note that the Entity
+ itself is not copied or referenced in this method; an Entity is
+ passed simply so that you can change the materials of attached
+ SubEntity objects if you want. You can add the same Entity
+ instance multiple times with different material settings
+ completely safely, and destroy the Entity before destroying
+ this InstancedGeometry if you like. The Entity passed in is simply
+ used as a definition.
+ @note Must be called before 'build'.
+ @param ent The Entity to use as a definition (the Mesh and Materials
+ referenced will be recorded for the build call).
+ @param position The world position at which to add this Entity
+ @param orientation The world orientation at which to add this Entity
+ @param scale The scale at which to add this entity
+ */
+ virtual void addEntity(Entity* ent, const Vector3& position,
+ const Quaternion& orientation = Quaternion::IDENTITY,
+ const Vector3& scale = Vector3::UNIT_SCALE);
+
+ /** Adds all the Entity objects attached to a SceneNode and all it's
+ children to the static geometry.
+ @remarks
+ This method performs just like addEntity, except it adds all the
+ entities attached to an entire sub-tree to the geometry.
+ The position / orientation / scale parameters are taken from the
+ node structure instead of being specified manually.
+ @note
+ The SceneNode you pass in will not be automatically detached from
+ it's parent, so if you have this node already attached to the scene
+ graph, you will need to remove it if you wish to avoid the overhead
+ of rendering both the original objects and their new static
+ versions! We don't do this for you incase you are preparing this
+ in advance and so don't want the originals detached yet.
+ @note Must be called before 'build'.
+ @param node Pointer to the node to use to provide a set of Entity
+ templates
+ */
+ virtual void addSceneNode(const SceneNode* node);
+
+ /** Build the geometry.
+ @remarks
+ Based on all the entities which have been added, and the batching
+ options which have been set, this method constructs the batched
+ geometry structures required. The batches are added to the scene
+ and will be rendered unless you specifically hide them.
+ @note
+ Once you have called this method, you can no longer add any more
+ entities.
+ */
+ virtual void build(void);
+ /** Add a new batch instance
+ @remarks
+ This method add a new instance of the whole batch, by creating a new
+ BatchInstance, containing new lod buckets, material buckets and geometry buckets.
+ The new geometry bukets will use the same buffers as the base bucket.
+ @note
+ no note
+ */
+ void addBatchInstance(void);
+ /** Destroys all the built geometry state (reverse of build).
+ @remarks
+ You can call build() again after this and it will pick up all the
+ same entities / nodes you queued last time.
+ */
+ virtual void destroy(void);
+
+ /** Clears any of the entities / nodes added to this geometry and
+ destroys anything which has already been built.
+ */
+ virtual void reset(void);
+
+ /** Sets the distance at which batches are no longer rendered.
+ @remarks
+ This lets you turn off batches at a given distance. This can be
+ useful for things like detail meshes (grass, foliage etc) and could
+ be combined with a shader which fades the geometry out beforehand
+ to lessen the effect.
+ @param dist Distance beyond which the batches will not be rendered
+ (the default is 0, which means batches are always rendered).
+ */
+ virtual void setRenderingDistance(Real dist) {
+ mUpperDistance = dist;
+ mSquaredUpperDistance = mUpperDistance * mUpperDistance;
+ }
+
+ /** Gets the distance at which batches are no longer rendered. */
+ virtual Real getRenderingDistance(void) const { return mUpperDistance; }
+
+ /** Gets the squared distance at which batches are no longer rendered. */
+ virtual Real getSquaredRenderingDistance(void) const
+ { return mSquaredUpperDistance; }
+
+ /** Hides or shows all the batches. */
+ virtual void setVisible(bool visible);
+
+ /** Are the batches visible? */
+ virtual bool isVisible(void) const { return mVisible; }
+
+ /** Sets whether this geometry should cast shadows.
+ @remarks
+ No matter what the settings on the original entities,
+ the InstancedGeometry class defaults to not casting shadows.
+ This is because, being static, unless you have moving lights
+ you'd be better to use precalculated shadows of some sort.
+ However, if you need them, you can enable them using this
+ method. If the SceneManager is set up to use stencil shadows,
+ edge lists will be copied from the underlying meshes on build.
+ It is essential that all meshes support stencil shadows in this
+ case.
+ @note If you intend to use stencil shadows, you must set this to
+ true before calling 'build' as well as making sure you set the
+ scene's shadow type (that should always be the first thing you do
+ anyway). You can turn shadows off temporarily but they can never
+ be turned on if they were not at the time of the build.
+ */
+ virtual void setCastShadows(bool castShadows);
+ /// Will the geometry from this object cast shadows?
+ virtual bool getCastShadows(void) { return mCastShadows; }
+
+ /** Sets the size of a single BatchInstance of geometry.
+ @remarks
+ This method allows you to configure the physical world size of
+ each BatchInstance, so you can balance culling against batch size. Entities
+ will be fitted within the batch they most closely fit, and the
+ eventual bounds of each batch may well be slightly larger than this
+ if they overlap a little. The default is Vector3(1000, 1000, 1000).
+ @note Must be called before 'build'.
+ @param size Vector3 expressing the 3D size of each BatchInstance.
+ */
+ virtual void setBatchInstanceDimensions(const Vector3& size) {
+ mBatchInstanceDimensions = size;
+ mHalfBatchInstanceDimensions = size * 0.5;
+ }
+ /** Gets the size of a single batch of geometry. */
+ virtual const Vector3& getBatchInstanceDimensions(void) const { return mBatchInstanceDimensions; }
+ /** Sets the origin of the geometry.
+ @remarks
+ This method allows you to configure the world centre of the geometry,
+ thus the place which all BatchInstances surround. You probably don't need
+ to mess with this unless you have a seriously large world, since the
+ default set up can handle an area 1024 * mBatchInstanceDimensions, and
+ the sparseness of population is no issue when it comes to rendering.
+ The default is Vector3(0,0,0).
+ @note Must be called before 'build'.
+ @param size Vector3 expressing the 3D origin of the geometry.
+ */
+ virtual void setOrigin(const Vector3& origin) { mOrigin = origin; }
+ /** Gets the origin of this geometry. */
+ virtual const Vector3& getOrigin(void) const { return mOrigin; }
+
+ /** Sets the render queue group this object will be rendered through.
+ @remarks
+ Render queues are grouped to allow you to more tightly control the ordering
+ of rendered objects. If you do not call this method, all objects default
+ to the default queue (RenderQueue::getDefaultQueueGroup), which is fine for
+ most objects. You may want to alter this if you want to perform more complex
+ rendering.
+ @par
+ See RenderQueue for more details.
+ @param queueID Enumerated value of the queue group to use.
+ */
+ virtual void setRenderQueueGroup(uint8 queueID);
+
+ /** Gets the queue group for this entity, see setRenderQueueGroup for full details. */
+ virtual uint8 getRenderQueueGroup(void) const;
+ /// Iterator for iterating over contained BatchInstances
+ typedef MapIterator BatchInstanceIterator;
+ /// Get an iterator over the BatchInstances in this geometry
+ BatchInstanceIterator getBatchInstanceIterator(void);
+ /// get the mRenderOps vector.
+ RenderOperationVector& getRenderOperationVector(){return mRenderOps;}
+ /** Dump the contents of this InstancedGeometry to a file for diagnostic
+ purposes.
+ */
+ virtual void dump(const String& filename) const;
+ /**
+ @remarks
+ Return the skeletonInstance that will be used
+ */
+ SkeletonInstance *getBaseSkeletonInstance(void){return mSkeletonInstance;}
+ /**
+ @remarks
+ Return the skeleton that is shared by all instanced objects.
+ */
+ SkeletonPtr getBaseSkeleton(void){return mBaseSkeleton;}
+ /**
+ @remarks
+ Return the animation state that will be cloned each time an InstancedObject is made
+ */
+ AnimationStateSet* getBaseAnimationState(void){return mAnimationState;}
+ /**
+ @remarks
+ return the total number of object that are in all the batches
+ */
+ unsigned int getObjectCount(void){return mObjectCount;}
+
+
+
+ };
+
+}
+
+#endif
+
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreIteratorWrappers.h b/school/informatik/verkerhssimulation/src/ogre/OgreIteratorWrappers.h
new file mode 100644
index 00000000..ef732f89
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreIteratorWrappers.h
@@ -0,0 +1,359 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __IteratorWrappers_H__
+#define __IteratorWrappers_H__
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre {
+
+ /** Wraps iteration over a vector.
+ @remarks
+ This class is here just to allow clients to iterate over an internal
+ vector of a class without having to have access to the vector itself
+ (typically to iterate you need both the iterator and the end() iterator
+ to test for the end condition, which is messy).
+ No updates are allowed through this interface, it is purely for
+ iterating and reading.
+ @par
+ Note that like STL iterators, these iterators are only valid whilst no
+ updates are made to the underlying collection. You should not attempt to
+ use this iterator if a change is made to the collection. In fact, treat this
+ iterator as a transient object, do NOT store it and try to use it repeatedly.
+ */
+ template
+ class VectorIterator
+ {
+ private:
+ typename T::iterator mCurrent;
+ typename T::iterator mEnd;
+ /// Private constructor since only the parameterised constructor should be used
+ VectorIterator() {};
+ public:
+ typedef typename T::value_type ValueType;
+
+ /** Constructor.
+ @remarks
+ Provide a start and end iterator to initialise.
+ */
+ VectorIterator(typename T::iterator start, typename T::iterator end)
+ : mCurrent(start), mEnd(end)
+ {
+ }
+
+ /** Constructor.
+ @remarks
+ Provide a container to initialise.
+ */
+ explicit VectorIterator(T& c)
+ : mCurrent(c.begin()), mEnd(c.end())
+ {
+ }
+
+ /** Returns true if there are more items in the collection. */
+ bool hasMoreElements(void) const
+ {
+ return mCurrent != mEnd;
+ }
+
+ /** Returns the next element in the collection, and advances to the next. */
+ typename T::value_type getNext(void)
+ {
+ return *mCurrent++;
+ }
+ /** Returns the next element in the collection, without advancing to the next. */
+ typename T::value_type peekNext(void)
+ {
+ return *mCurrent;
+ }
+ /** Returns a pointer to the next element in the collection, without advancing to the next afterwards. */
+ typename T::pointer peekNextPtr(void)
+ {
+ return &(*mCurrent);
+ }
+ /** Moves the iterator on one element. */
+ void moveNext(void)
+ {
+ ++mCurrent;
+ }
+
+
+
+ };
+
+ /** Wraps iteration over a map.
+ @remarks
+ This class is here just to allow clients to iterate over an internal
+ map of a class without having to have access to the map itself
+ (typically to iterate you need both the iterator and the end() iterator
+ to test for the end condition, which is messy).
+ No updates are allowed through this interface, it is purely for
+ iterating and reading.
+ @par
+ Note that like STL iterators, these iterators are only valid whilst no
+ updates are made to the underlying collection. You should not attempt to
+ use this iterator if a change is made to the collection. In fact, treat this
+ iterator as a transient object, do NOT store it and try to use it repeatedly.
+ */
+ template
+ class MapIterator
+ {
+ private:
+ typename T::iterator mCurrent;
+ typename T::iterator mEnd;
+ /// Private constructor since only the parameterised constructor should be used
+ MapIterator() {};
+ public:
+ typedef typename T::mapped_type MappedType;
+ typedef typename T::key_type KeyType;
+
+ /** Constructor.
+ @remarks
+ Provide a start and end iterator to initialise.
+ */
+ MapIterator(typename T::iterator start, typename T::iterator end)
+ : mCurrent(start), mEnd(end)
+ {
+ }
+
+ /** Constructor.
+ @remarks
+ Provide a container to initialise.
+ */
+ explicit MapIterator(T& c)
+ : mCurrent(c.begin()), mEnd(c.end())
+ {
+ }
+
+ /** Returns true if there are more items in the collection. */
+ bool hasMoreElements(void) const
+ {
+ return mCurrent != mEnd;
+ }
+
+ /** Returns the next value element in the collection, and advances to the next. */
+ typename T::mapped_type getNext(void)
+ {
+ return (mCurrent++)->second;
+ }
+ /** Returns the next value element in the collection, without advancing to the next. */
+ typename T::mapped_type peekNextValue(void)
+ {
+ return mCurrent->second;
+ }
+ /** Returns the next key element in the collection, without advancing to the next. */
+ typename T::key_type peekNextKey(void)
+ {
+ return mCurrent->first;
+ }
+ /** Required to overcome intermittent bug */
+ MapIterator & operator=( MapIterator &rhs )
+ {
+ mCurrent = rhs.mCurrent;
+ mEnd = rhs.mEnd;
+ return *this;
+ }
+ /** Returns a pointer to the next value element in the collection, without
+ advancing to the next afterwards. */
+ typename T::mapped_type* peekNextValuePtr(void)
+ {
+ return &(mCurrent->second);
+ }
+ /** Moves the iterator on one element. */
+ void moveNext(void)
+ {
+ ++mCurrent;
+ }
+
+
+
+ };
+ /** Wraps iteration over a const vector.
+ @remarks
+ This class is here just to allow clients to iterate over an internal
+ vector of a class without having to have access to the vector itself
+ (typically to iterate you need both the iterator and the end() iterator
+ to test for the end condition, which is messy).
+ No updates are allowed through this interface, it is purely for
+ iterating and reading.
+ @par
+ Note that like STL iterators, these iterators are only valid whilst no
+ updates are made to the underlying collection. You should not attempt to
+ use this iterator if a change is made to the collection. In fact, treat this
+ iterator as a transient object, do NOT store it and try to use it repeatedly.
+ */
+ template
+ class ConstVectorIterator
+ {
+ private:
+ mutable typename T::const_iterator mCurrent;
+ typename T::const_iterator mEnd;
+ /// Private constructor since only the parameterised constructor should be used
+ ConstVectorIterator() {};
+ public:
+ typedef typename T::value_type ValueType;
+
+ /** Constructor.
+ @remarks
+ Provide a start and end iterator to initialise.
+ */
+ ConstVectorIterator(typename T::const_iterator start, typename T::const_iterator end)
+ : mCurrent(start), mEnd(end)
+ {
+ }
+
+ /** Constructor.
+ @remarks
+ Provide a container to initialise.
+ */
+ explicit ConstVectorIterator(const T& c)
+ : mCurrent(c.begin()), mEnd(c.end())
+ {
+ }
+
+ /** Returns true if there are more items in the collection. */
+ bool hasMoreElements(void) const
+ {
+ return mCurrent != mEnd;
+ }
+
+ /** Returns the next element in the collection, and advances to the next. */
+ typename T::value_type getNext(void)
+ {
+ return *mCurrent++;
+ }
+ /** Returns the next element in the collection, without advancing to the next. */
+ typename T::value_type peekNext(void) const
+ {
+ return *mCurrent;
+ }
+ /** Returns a pointer to the next element in the collection, without advancing to the next afterwards. */
+ typename T::const_pointer peekNextPtr(void) const
+ {
+ return &(*mCurrent);
+ }
+ /** Moves the iterator on one element. */
+ void moveNext(void) const
+ {
+ ++mCurrent;
+ }
+
+
+
+ };
+
+ /** Wraps iteration over a const map.
+ @remarks
+ This class is here just to allow clients to iterate over an internal
+ map of a class without having to have access to the map itself
+ (typically to iterate you need both the iterator and the end() iterator
+ to test for the end condition, which is messy).
+ No updates are allowed through this interface, it is purely for
+ iterating and reading.
+ @par
+ Note that like STL iterators, these iterators are only valid whilst no
+ updates are made to the underlying collection. You should not attempt to
+ use this iterator if a change is made to the collection. In fact, treat this
+ iterator as a transient object, do NOT store it and try to use it repeatedly.
+ */
+ template
+ class ConstMapIterator
+ {
+ private:
+ mutable typename T::const_iterator mCurrent;
+ typename T::const_iterator mEnd;
+ /// Private constructor since only the parameterised constructor should be used
+ ConstMapIterator() {};
+ public:
+ typedef typename T::mapped_type MappedType;
+ typedef typename T::key_type KeyType;
+
+ /** Constructor.
+ @remarks
+ Provide a start and end iterator to initialise.
+ */
+ ConstMapIterator(typename T::const_iterator start, typename T::const_iterator end)
+ : mCurrent(start), mEnd(end)
+ {
+ }
+
+ /** Constructor.
+ @remarks
+ Provide a container to initialise.
+ */
+ explicit ConstMapIterator(const T& c)
+ : mCurrent(c.begin()), mEnd(c.end())
+ {
+ }
+
+ /** Returns true if there are more items in the collection. */
+ bool hasMoreElements(void) const
+ {
+ return mCurrent != mEnd;
+ }
+
+ /** Returns the next value element in the collection, and advances to the next. */
+ typename T::mapped_type getNext(void)
+ {
+ return (mCurrent++)->second;
+ }
+ /** Returns the next value element in the collection, without advancing to the next. */
+ typename T::mapped_type peekNextValue(void) const
+ {
+ return mCurrent->second;
+ }
+ /** Returns the next key element in the collection, without advancing to the next. */
+ typename T::key_type peekNextKey(void) const
+ {
+ return mCurrent->first;
+ }
+ /** Required to overcome intermittent bug */
+ ConstMapIterator & operator=( ConstMapIterator &rhs )
+ {
+ mCurrent = rhs.mCurrent;
+ mEnd = rhs.mEnd;
+ return *this;
+ }
+ /** Returns a pointer to the next value element in the collection, without
+ advancing to the next afterwards. */
+ const typename T::mapped_type* peekNextValuePtr(void) const
+ {
+ return &(mCurrent->second);
+ }
+ /** Moves the iterator on one element. */
+ void moveNext(void) const
+ {
+ ++mCurrent;
+ }
+
+
+
+ };
+}
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreKeyFrame.h b/school/informatik/verkerhssimulation/src/ogre/OgreKeyFrame.h
new file mode 100644
index 00000000..0b159246
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreKeyFrame.h
@@ -0,0 +1,248 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __KeyFrame_H__
+#define __KeyFrame_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreVector3.h"
+#include "OgreQuaternion.h"
+#include "OgreAny.h"
+#include "OgreHardwareVertexBuffer.h"
+#include "OgreIteratorWrappers.h"
+
+namespace Ogre
+{
+
+ /** A key frame in an animation sequence defined by an AnimationTrack.
+ @remarks
+ This class can be used as a basis for all kinds of key frames.
+ The unifying principle is that multiple KeyFrames define an
+ animation sequence, with the exact state of the animation being an
+ interpolation between these key frames.
+ */
+ class _OgreExport KeyFrame
+ {
+ public:
+
+ /** Default constructor, you should not call this but use AnimationTrack::createKeyFrame instead. */
+ KeyFrame(const AnimationTrack* parent, Real time);
+
+ virtual ~KeyFrame() {}
+
+ /** Gets the time of this keyframe in the animation sequence. */
+ Real getTime(void) const { return mTime; }
+
+ /** Clone a keyframe (internal use only) */
+ virtual KeyFrame* _clone(AnimationTrack* newParent) const;
+
+
+ protected:
+ Real mTime;
+ const AnimationTrack* mParentTrack;
+ };
+
+
+ /** Specialised KeyFrame which stores any numeric value.
+ */
+ class _OgreExport NumericKeyFrame : public KeyFrame
+ {
+ public:
+ /** Default constructor, you should not call this but use AnimationTrack::createKeyFrame instead. */
+ NumericKeyFrame(const AnimationTrack* parent, Real time);
+ ~NumericKeyFrame() {}
+
+ /** Get the value at this keyframe. */
+ virtual const AnyNumeric& getValue(void) const;
+ /** Set the value at this keyframe.
+ @remarks
+ All keyframe values must have a consistent type.
+ */
+ virtual void setValue(const AnyNumeric& val);
+
+ /** Clone a keyframe (internal use only) */
+ KeyFrame* _clone(AnimationTrack* newParent) const;
+ protected:
+ AnyNumeric mValue;
+ };
+
+
+ /** Specialised KeyFrame which stores a full transform. */
+ class _OgreExport TransformKeyFrame : public KeyFrame
+ {
+ public:
+ /** Default constructor, you should not call this but use AnimationTrack::createKeyFrame instead. */
+ TransformKeyFrame(const AnimationTrack* parent, Real time);
+ ~TransformKeyFrame() {}
+ /** Sets the translation associated with this keyframe.
+ @remarks
+ The translation factor affects how much the keyframe translates (moves) it's animable
+ object at it's time index.
+ @param trans The vector to translate by
+ */
+ virtual void setTranslate(const Vector3& trans);
+
+ /** Gets the translation applied by this keyframe. */
+ const Vector3& getTranslate(void) const;
+
+ /** Sets the scaling factor applied by this keyframe to the animable
+ object at it's time index.
+ @param scale The vector to scale by (beware of supplying zero values for any component of this
+ vector, it will scale the object to zero dimensions)
+ */
+ virtual void setScale(const Vector3& scale);
+
+ /** Gets the scaling factor applied by this keyframe. */
+ virtual const Vector3& getScale(void) const;
+
+ /** Sets the rotation applied by this keyframe.
+ @param rot The rotation applied; use Quaternion methods to convert from angle/axis or Matrix3 if
+ you don't like using Quaternions directly.
+ */
+ virtual void setRotation(const Quaternion& rot);
+
+ /** Gets the rotation applied by this keyframe. */
+ virtual const Quaternion& getRotation(void) const;
+
+ /** Clone a keyframe (internal use only) */
+ KeyFrame* _clone(AnimationTrack* newParent) const;
+ protected:
+ Vector3 mTranslate;
+ Vector3 mScale;
+ Quaternion mRotate;
+
+
+ };
+
+
+
+ /** Specialised KeyFrame which stores absolute vertex positions for a complete
+ buffer, designed to be interpolated with other keys in the same track.
+ */
+ class _OgreExport VertexMorphKeyFrame : public KeyFrame
+ {
+ public:
+ /** Default constructor, you should not call this but use AnimationTrack::createKeyFrame instead. */
+ VertexMorphKeyFrame(const AnimationTrack* parent, Real time);
+ ~VertexMorphKeyFrame() {}
+ /** Sets the vertex buffer containing the source positions for this keyframe.
+ @remarks
+ We assume that positions are the first 3 float elements in this buffer,
+ although we don't necessarily assume they're the only ones in there.
+ @param buf Vertex buffer link; will not be modified so can be shared
+ read-only data
+ */
+ void setVertexBuffer(const HardwareVertexBufferSharedPtr& buf);
+
+ /** Gets the vertex buffer containing positions for this keyframe. */
+ const HardwareVertexBufferSharedPtr& getVertexBuffer(void) const;
+
+ /** Clone a keyframe (internal use only) */
+ KeyFrame* _clone(AnimationTrack* newParent) const;
+
+ protected:
+ HardwareVertexBufferSharedPtr mBuffer;
+
+ };
+
+ /** Specialised KeyFrame which references a Mesh::Pose at a certain influence
+ level, which stores offsets for a subset of the vertices
+ in a buffer to provide a blendable pose.
+ */
+ class _OgreExport VertexPoseKeyFrame : public KeyFrame
+ {
+ public:
+ /** Default constructor, you should not call this but use AnimationTrack::createKeyFrame instead. */
+ VertexPoseKeyFrame(const AnimationTrack* parent, Real time);
+ ~VertexPoseKeyFrame() {}
+
+ /** Reference to a pose at a given influence level
+ @remarks
+ Each keyframe can refer to many poses each at a given influence level.
+ **/
+ struct PoseRef
+ {
+ /** The linked pose index.
+ @remarks
+ The Mesh contains all poses for all vertex data in one list, both
+ for the shared vertex data and the dedicated vertex data on submeshes.
+ The 'target' on the parent track must match the 'target' on the
+ linked pose.
+ */
+ ushort poseIndex;
+ /** Influence level of the linked pose.
+ 1.0 for full influence (full offset), 0.0 for no influence.
+ */
+ Real influence;
+
+ PoseRef(ushort p, Real i) : poseIndex(p), influence(i) {}
+ };
+ typedef std::vector PoseRefList;
+
+ /** Add a new pose reference.
+ @see PoseRef
+ */
+ void addPoseReference(ushort poseIndex, Real influence);
+ /** Update the influence of a pose reference.
+ @see PoseRef
+ */
+ void updatePoseReference(ushort poseIndex, Real influence);
+ /** Remove reference to a given pose.
+ @param poseIndex The pose index (not the index of the reference)
+ */
+ void removePoseReference(ushort poseIndex);
+ /** Remove all pose references. */
+ void removeAllPoseReferences(void);
+
+
+ /** Get a const reference to the list of pose references. */
+ const PoseRefList& getPoseReferences(void) const;
+
+ typedef VectorIterator PoseRefIterator;
+ typedef ConstVectorIterator ConstPoseRefIterator;
+
+ /** Get an iterator over the pose references. */
+ PoseRefIterator getPoseReferenceIterator(void);
+
+ /** Get a const iterator over the pose references. */
+ ConstPoseRefIterator getPoseReferenceIterator(void) const;
+
+ /** Clone a keyframe (internal use only) */
+ KeyFrame* _clone(AnimationTrack* newParent) const;
+
+ protected:
+ PoseRefList mPoseRefs;
+
+ };
+
+}
+
+
+#endif
+
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreLight.h b/school/informatik/verkerhssimulation/src/ogre/OgreLight.h
new file mode 100644
index 00000000..1302211e
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreLight.h
@@ -0,0 +1,433 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _LIGHT_H__
+#define _LIGHT_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreColourValue.h"
+#include "OgreVector3.h"
+#include "OgreVector4.h"
+#include "OgreString.h"
+#include "OgreMovableObject.h"
+#include "OgrePlaneBoundedVolume.h"
+#include "OgreShadowCameraSetup.h"
+
+namespace Ogre {
+
+
+ /** Representation of a dynamic light source in the scene.
+ @remarks
+ Lights are added to the scene like any other object. They contain various
+ parameters like type, position, attenuation (how light intensity fades with
+ distance), colour etc.
+ @par
+ The defaults when a light is created is pure white diffues light, with no
+ attenuation (does not decrease with distance) and a range of 1000 world units.
+ @par
+ Lights are created by using the SceneManager::createLight method. They can subsequently be
+ added to a SceneNode if required to allow them to move relative to a node in the scene. A light attached
+ to a SceneNode is assumed to havea base position of (0,0,0) and a direction of (0,0,1) before modification
+ by the SceneNode's own orientation. If not attached to a SceneNode,
+ the light's position and direction is as set using setPosition and setDirection.
+ @par
+ Remember also that dynamic lights rely on modifying the colour of vertices based on the position of
+ the light compared to an object's vertex normals. Dynamic lighting will only look good if the
+ object being lit has a fair level of tesselation and the normals are properly set. This is particularly
+ true for the spotlight which will only look right on highly tesselated models. In the future OGRE may be
+ extended for certain scene types so an alternative to the standard dynamic lighting may be used, such
+ as dynamic lightmaps.
+ */
+ class _OgreExport Light : public MovableObject
+ {
+ public:
+ /// Temp tag used for sorting
+ Real tempSquareDist;
+
+ /// Defines the type of light
+ enum LightTypes
+ {
+ /// Point light sources give off light equally in all directions, so require only position not direction
+ LT_POINT,
+ /// Directional lights simulate parallel light beams from a distant source, hence have direction but no position
+ LT_DIRECTIONAL,
+ /// Spotlights simulate a cone of light from a source so require position and direction, plus extra values for falloff
+ LT_SPOTLIGHT
+ };
+
+ /** Default constructor (for Python mainly).
+ */
+ Light();
+
+ /** Normal constructor. Should not be called directly, but rather the SceneManager::createLight method should be used.
+ */
+ Light(const String& name);
+
+ /** Standard destructor.
+ */
+ ~Light();
+
+ /** Sets the type of light - see LightTypes for more info.
+ */
+ void setType(LightTypes type);
+
+ /** Returns the light type.
+ */
+ LightTypes getType(void) const;
+
+ /** Sets the colour of the diffuse light given off by this source.
+ @remarks
+ Material objects have ambient, diffuse and specular values which indicate how much of each type of
+ light an object reflects. This value denotes the amount and colour of this type of light the light
+ exudes into the scene. The actual appearance of objects is a combination of the two.
+ @par
+ Diffuse light simulates the typical light emenating from light sources and affects the base colour
+ of objects together with ambient light.
+ */
+ void setDiffuseColour(Real red, Real green, Real blue);
+
+ /** Sets the colour of the diffuse light given off by this source.
+ @remarks
+ Material objects have ambient, diffuse and specular values which indicate how much of each type of
+ light an object reflects. This value denotes the amount and colour of this type of light the light
+ exudes into the scene. The actual appearance of objects is a combination of the two.
+ @par
+ Diffuse light simulates the typical light emenating from light sources and affects the base colour
+ of objects together with ambient light.
+ */
+ void setDiffuseColour(const ColourValue& colour);
+
+ /** Returns the colour of the diffuse light given off by this light source (see setDiffuseColour for more info).
+ */
+ const ColourValue& getDiffuseColour(void) const;
+
+ /** Sets the colour of the specular light given off by this source.
+ @remarks
+ Material objects have ambient, diffuse and specular values which indicate how much of each type of
+ light an object reflects. This value denotes the amount and colour of this type of light the light
+ exudes into the scene. The actual appearance of objects is a combination of the two.
+ @par
+ Specular light affects the appearance of shiny highlights on objects, and is also dependent on the
+ 'shininess' Material value.
+ */
+ void setSpecularColour(Real red, Real green, Real blue);
+
+ /** Sets the colour of the specular light given off by this source.
+ @remarks
+ Material objects have ambient, diffuse and specular values which indicate how much of each type of
+ light an object reflects. This value denotes the amount and colour of this type of light the light
+ exudes into the scene. The actual appearance of objects is a combination of the two.
+ @par
+ Specular light affects the appearance of shiny highlights on objects, and is also dependent on the
+ 'shininess' Material value.
+ */
+ void setSpecularColour(const ColourValue& colour);
+
+ /** Returns the colour of specular light given off by this light source.
+ */
+ const ColourValue& getSpecularColour(void) const;
+
+ /** Sets the attenuation parameters of the light source ie how it diminishes with distance.
+ @remarks
+ Lights normally get fainter the further they are away. Also, each light is given a maximum range
+ beyond which it cannot affect any objects.
+ @par
+ Light attentuation is not applicable to directional lights since they have an infinite range and
+ constant intensity.
+ @par
+ This follows a standard attenuation approach - see any good 3D text for the details of what they mean
+ since i don't have room here!
+ @param
+ range The absolute upper range of the light in world units
+ @param
+ constant The constant factor in the attenuation formula: 1.0 means never attenuate, 0.0 is complete attenuation
+ @param
+ linear The linear factor in the attenuation formula: 1 means attenuate evenly over the distance
+ @param
+ quadratic The quadratic factor in the attenuation formula: adds a curvature to the attenuation formula.
+ */
+ void setAttenuation(Real range, Real constant, Real linear, Real quadratic);
+
+ /** Returns the absolute upper range of the light.
+ */
+ Real getAttenuationRange(void) const;
+
+ /** Returns the constant factor in the attenuation formula.
+ */
+ Real getAttenuationConstant(void) const;
+
+ /** Returns the linear factor in the attenuation formula.
+ */
+ Real getAttenuationLinear(void) const;
+
+ /** Returns the quadric factor in the attenuation formula.
+ */
+ Real getAttenuationQuadric(void) const;
+
+ /** Sets the position of the light.
+ @remarks
+ Applicable to point lights and spotlights only.
+ @note
+ This will be overridden if the light is attached to a SceneNode.
+ */
+ void setPosition(Real x, Real y, Real z);
+
+ /** Sets the position of the light.
+ @remarks
+ Applicable to point lights and spotlights only.
+ @note
+ This will be overridden if the light is attached to a SceneNode.
+ */
+ void setPosition(const Vector3& vec);
+
+ /** Returns the position of the light.
+ @note
+ Applicable to point lights and spotlights only.
+ */
+ const Vector3& getPosition(void) const;
+
+ /** Sets the direction in which a light points.
+ @remarks
+ Applicable only to the spotlight and directional light types.
+ @note
+ This will be overridden if the light is attached to a SceneNode.
+ */
+ void setDirection(Real x, Real y, Real z);
+
+ /** Sets the direction in which a light points.
+ @remarks
+ Applicable only to the spotlight and directional light types.
+ @note
+ This will be overridden if the light is attached to a SceneNode.
+ */
+ void setDirection(const Vector3& vec);
+
+ /** Returns the light's direction.
+ @remarks
+ Applicable only to the spotlight and directional light types.
+ */
+ const Vector3& getDirection(void) const;
+
+ /** Sets the range of a spotlight, i.e. the angle of the inner and outer cones and the rate of falloff between them.
+ @param
+ innerAngle Angle covered by the bright inner cone
+ @node
+ The inner cone applicable only to Direct3D, it'll always treat as zero in OpenGL.
+ @param
+ outerAngle Angle covered by the outer cone
+ @param
+ falloff The rate of falloff between the inner and outer cones. 1.0 means a linear falloff, less means slower falloff, higher means faster falloff.
+ */
+ void setSpotlightRange(const Radian& innerAngle, const Radian& outerAngle, Real falloff = 1.0);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+ inline void setSpotlightRange(Real innerAngle, Real outerAngle, Real falloff = 1.0) {
+ setSpotlightRange ( Angle(innerAngle), Angle(outerAngle), falloff );
+ }
+#endif//OGRE_FORCE_ANGLE_TYPES
+
+ /** Returns the angle covered by the spotlights inner cone.
+ */
+ const Radian& getSpotlightInnerAngle(void) const;
+
+ /** Returns the angle covered by the spotlights outer cone.
+ */
+ const Radian& getSpotlightOuterAngle(void) const;
+
+ /** Returns the falloff between the inner and outer cones of the spotlight.
+ */
+ Real getSpotlightFalloff(void) const;
+
+ /** Sets the angle covered by the spotlights inner cone.
+ */
+ void setSpotlightInnerAngle(const Radian& val);
+
+ /** Sets the angle covered by the spotlights outer cone.
+ */
+ void setSpotlightOuterAngle(const Radian& val);
+
+ /** Sets the falloff between the inner and outer cones of the spotlight.
+ */
+ void setSpotlightFalloff(Real val);
+
+ /** Set a scaling factor to indicate the relative power of a light.
+ @remarks
+ This factor is only useful in High Dynamic Range (HDR) rendering.
+ You can bind it to a shader variable to take it into account,
+ @see GpuProgramParameters
+ @param power The power rating of this light, default is 1.0.
+ */
+ void setPowerScale(Real power);
+
+ /** Set the scaling factor which indicates the relative power of a
+ light.
+ */
+ Real getPowerScale(void) const;
+
+ /** Overridden from MovableObject */
+ void _notifyAttached(Node* parent, bool isTagPoint = false);
+
+ /** Overridden from MovableObject */
+ void _notifyMoved(void);
+
+ /** Overridden from MovableObject */
+ const AxisAlignedBox& getBoundingBox(void) const;
+
+ /** Overridden from MovableObject */
+ void _updateRenderQueue(RenderQueue* queue);
+
+ /** Overridden from MovableObject */
+ const String& getMovableType(void) const;
+
+ /** Retrieves the position of the light including any transform from nodes it is attached to. */
+ const Vector3& getDerivedPosition(void) const;
+
+ /** Retrieves the direction of the light including any transform from nodes it is attached to. */
+ const Vector3& getDerivedDirection(void) const;
+
+ /** Overridden from MovableObject.
+ @remarks
+ Although lights themselves are not 'visible', setting a light to invisible
+ means it no longer affects the scene.
+ */
+ void setVisible(bool visible);
+
+ /** Overridden from MovableObject */
+ Real getBoundingRadius(void) const { return 0; /* not visible */ }
+
+ /** Gets the details of this light as a 4D vector.
+ @remarks
+ Getting details of a light as a 4D vector can be useful for
+ doing general calculations between different light types; for
+ example the vector can represent both position lights (w=1.0f)
+ and directional lights (w=0.0f) and be used in the same
+ calculations.
+ */
+ Vector4 getAs4DVector(void) const;
+
+ /** Internal method for calculating the 'near clip volume', which is
+ the volume formed between the near clip rectangle of the
+ camera and the light.
+ @remarks This volume is a pyramid for a point/spot light and
+ a cuboid for a directional light. It can used to detect whether
+ an object could be casting a shadow on the viewport. Note that
+ the reference returned is to a shared volume which will be
+ reused across calls to this method.
+ */
+ virtual const PlaneBoundedVolume& _getNearClipVolume(const Camera* const cam) const;
+
+ /** Internal method for calculating the clip volumes outside of the
+ frustum which can be used to determine which objects are casting
+ shadow on the frustum as a whole.
+ @remarks Each of the volumes is a pyramid for a point/spot light and
+ a cuboid for a directional light.
+ */
+ virtual const PlaneBoundedVolumeList& _getFrustumClipVolumes(const Camera* const cam) const;
+
+ /// Override to return specific type flag
+ uint32 getTypeFlags(void) const;
+
+ /// @copydoc AnimableObject::createAnimableValue
+ AnimableValuePtr createAnimableValue(const String& valueName);
+
+ /** Set this light to use a custom shadow camera when rendering texture shadows.
+ @remarks
+ This changes the shadow camera setup for just this light, you can set
+ the shadow camera setup globally using SceneManager::setShadowCameraSetup
+ @see ShadowCameraSetup
+ */
+ void setCustomShadowCameraSetup(const ShadowCameraSetupPtr& customShadowSetup);
+
+ /** Reset the shadow camera setup to the default.
+ @see ShadowCameraSetup
+ */
+ void resetCustomShadowCameraSetup(void);
+
+ /** return a pointer to the custom shadow camera setup (null means use SceneManager global version). */
+ const ShadowCameraSetupPtr& getCustomShadowCameraSetup(void) const;
+
+ protected:
+ /// internal method for synchronising with parent node (if any)
+ virtual void update(void) const;
+
+ /// @copydoc AnimableObject::getAnimableDictionaryName
+ const String& getAnimableDictionaryName(void) const;
+ /// @copydoc AnimableObject::initialiseAnimableDictionary
+ void initialiseAnimableDictionary(StringVector& vec) const;
+
+ LightTypes mLightType;
+ Vector3 mPosition;
+ ColourValue mDiffuse;
+ ColourValue mSpecular;
+
+ Vector3 mDirection;
+
+ Radian mSpotOuter;
+ Radian mSpotInner;
+ Real mSpotFalloff;
+ Real mRange;
+ Real mAttenuationConst;
+ Real mAttenuationLinear;
+ Real mAttenuationQuad;
+ Real mPowerScale;
+
+
+ mutable Vector3 mDerivedPosition;
+ mutable Vector3 mDerivedDirection;
+
+ /// Shared class-level name for Movable type
+ static String msMovableType;
+
+ mutable PlaneBoundedVolume mNearClipVolume;
+ mutable PlaneBoundedVolumeList mFrustumClipVolumes;
+ /// Is the derived transform dirty?
+ mutable bool mDerivedTransformDirty;
+
+ /// Pointer to a custom shadow camera setup
+ mutable ShadowCameraSetupPtr mCustomShadowCameraSetup;
+
+ };
+
+ /** Factory object for creating Light instances */
+ class _OgreExport LightFactory : public MovableObjectFactory
+ {
+ protected:
+ MovableObject* createInstanceImpl( const String& name, const NameValuePairList* params);
+ public:
+ LightFactory() {}
+ ~LightFactory() {}
+
+ static String FACTORY_TYPE_NAME;
+
+ const String& getType(void) const;
+ void destroyInstance( MovableObject* obj);
+
+ };
+
+} // Namespace
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreLog.h b/school/informatik/verkerhssimulation/src/ogre/OgreLog.h
new file mode 100644
index 00000000..dc488a67
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreLog.h
@@ -0,0 +1,149 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __Log_H__
+#define __Log_H__
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre {
+
+ // LogMessageLevel + LoggingLevel > OGRE_LOG_THRESHOLD = message logged
+ #define OGRE_LOG_THRESHOLD 4
+
+ /** The level of detail to which the log will go into.
+ */
+ enum LoggingLevel
+ {
+ LL_LOW = 1,
+ LL_NORMAL = 2,
+ LL_BOREME = 3
+ };
+
+ /** The importance of a logged message.
+ */
+ enum LogMessageLevel
+ {
+ LML_TRIVIAL = 1,
+ LML_NORMAL = 2,
+ LML_CRITICAL = 3
+ };
+
+ /** @remarks Pure Abstract class, derive this class and register to the Log to listen to log messages */
+ class LogListener
+ {
+ public:
+ virtual ~LogListener() {};
+
+ /**
+ @remarks
+ This is called whenever the log recieves a message and is about to write it out
+ @param message
+ The message to be logged
+ @param lml
+ The message level the log is using
+ @param maskDebug
+ If we are printing to the console or not
+ @param logName
+ the name of this log (so you can have several listeners for different logs, and identify them)
+ */
+ virtual void messageLogged( const String& message, LogMessageLevel lml, bool maskDebug, const String &logName ) = 0;
+ };
+
+ /**
+ @remarks
+ Log class for writing debug/log data to files.
+ @note
+
Should not be used directly, but trough the LogManager class.
+ */
+ class _OgreExport Log
+ {
+ protected:
+ std::ofstream mfpLog;
+ LoggingLevel mLogLevel;
+ bool mDebugOut;
+ bool mSuppressFile;
+ String mLogName;
+
+ typedef std::vector mtLogListener;
+ mtLogListener mListeners;
+
+ public:
+ OGRE_AUTO_MUTEX // public to allow external locking
+ /**
+ @remarks
+ Usual constructor - called by LogManager.
+ */
+ Log( const String& name, bool debugOutput = true, bool suppressFileOutput = false);
+
+ /**
+ @remarks
+ Default destructor.
+ */
+ ~Log();
+
+ /// Return the name of the log
+ const String& getName() const { return mLogName; }
+ /// Get whether debug output is enabled for this log
+ bool isDebugOutputEnabled() const { return mDebugOut; }
+ /// Get whether file output is suppressed for this log
+ bool isFileOutputSuppressed() const { return mSuppressFile; }
+
+ /** Log a message to the debugger and to log file (the default is
+ "OGRE.log"),
+ */
+ void logMessage( const String& message, LogMessageLevel lml = LML_NORMAL, bool maskDebug = false );
+
+ /**
+ @remarks
+ Sets the level of the log detail.
+ */
+ void setLogDetail(LoggingLevel ll);
+ /** Gets the level of the log detail.
+ */
+ LoggingLevel getLogDetail() const { return mLogLevel; }
+ /**
+ @remarks
+ Register a listener to this log
+ @param
+ A valid listener derived class
+ */
+ void addListener(LogListener* listener);
+
+ /**
+ @remarks
+ Unregister a listener from this log
+ @param
+ A valid listener derived class
+ */
+ void removeListener(LogListener* listener);
+ };
+}
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreLogManager.h b/school/informatik/verkerhssimulation/src/ogre/OgreLogManager.h
new file mode 100644
index 00000000..efd385fd
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreLogManager.h
@@ -0,0 +1,163 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __LogManager_H__
+#define __LogManager_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreLog.h"
+#include "OgreSingleton.h"
+#include "OgreString.h"
+
+namespace Ogre
+{
+ /** The log manager handles the creation and retrieval of logs for the
+ application.
+ @remarks
+ This class will create new log files and will retrieve instances
+ of existing ones. Other classes wishing to log output can either
+ create a fresh log or retrieve an existing one to output to.
+ One log is the default log, and is the one written to when the
+ logging methods of this class are called.
+ @par
+ By default, Root will instantiate a LogManager (which becomes the
+ Singleton instance) on construction, and will create a default log
+ based on the Root construction parameters. If you want more control,
+ for example redirecting log output right from the start or suppressing
+ debug output, you need to create a LogManager yourself before creating
+ a Root instance, then create a default log. Root will detect that
+ you've created one yourself and won't create one of its own, thus
+ using all your logging preferences from the first instance.
+ */
+ class _OgreExport LogManager : public Singleton
+ {
+ protected:
+ typedef std::map > LogList;
+
+ /// A list of all the logs the manager can access
+ LogList mLogs;
+
+ /// The default log to which output is done
+ Log* mDefaultLog;
+
+ public:
+ OGRE_AUTO_MUTEX // public to allow external locking
+
+ LogManager();
+ ~LogManager();
+
+ /** Creates a new log with the given name.
+ @param
+ name The name to give the log e.g. 'Ogre.log'
+ @param
+ defaultLog If true, this is the default log output will be
+ sent to if the generic logging methods on this class are
+ used. The first log created is always the default log unless
+ this parameter is set.
+ @param
+ debuggerOutput If true, output to this log will also be
+ routed to the debugger's output window.
+ @param
+ suppressFileOutput If true, this is a logical rather than a physical
+ log and no file output will be written. If you do this you should
+ register a LogListener so log output is not lost.
+ */
+ Log* createLog( const String& name, bool defaultLog = false, bool debuggerOutput = true,
+ bool suppressFileOutput = false);
+
+ /** Retrieves a log managed by this class.
+ */
+ Log* getLog( const String& name);
+
+ /** Returns a pointer to the default log.
+ */
+ Log* getDefaultLog();
+
+ /** Closes and removes a named log. */
+ void destroyLog(const String& name);
+ /** Closes and removes a log. */
+ void destroyLog(Log* log);
+
+ /** Sets the passed in log as the default log.
+ @returns The previous default log.
+ */
+ Log* setDefaultLog(Log* newLog);
+
+ /** Log a message to the default log.
+ */
+ void logMessage( const String& message, LogMessageLevel lml = LML_NORMAL,
+ bool maskDebug = false);
+
+ /** Log a message to the default log (signature for backward compatibility).
+ */
+ void logMessage( LogMessageLevel lml, const String& message,
+ bool maskDebug = false) { logMessage(message, lml, maskDebug); }
+
+ /** Sets the level of detail of the default log.
+ */
+ void setLogDetail(LoggingLevel ll);
+ /** Override standard Singleton retrieval.
+ @remarks
+ Why do we do this? Well, it's because the Singleton
+ implementation is in a .h file, which means it gets compiled
+ into anybody who includes it. This is needed for the
+ Singleton template to work, but we actually only want it
+ compiled into the implementation of the class based on the
+ Singleton, not all of them. If we don't change this, we get
+ link errors when trying to use the Singleton-based class from
+ an outside dll.
+ @par
+ This method just delegates to the template version anyway,
+ but the implementation stays in this single compilation unit,
+ preventing link errors.
+ */
+ static LogManager& getSingleton(void);
+ /** Override standard Singleton retrieval.
+ @remarks
+ Why do we do this? Well, it's because the Singleton
+ implementation is in a .h file, which means it gets compiled
+ into anybody who includes it. This is needed for the
+ Singleton template to work, but we actually only want it
+ compiled into the implementation of the class based on the
+ Singleton, not all of them. If we don't change this, we get
+ link errors when trying to use the Singleton-based class from
+ an outside dll.
+ @par
+ This method just delegates to the template version anyway,
+ but the implementation stays in this single compilation unit,
+ preventing link errors.
+ */
+ static LogManager* getSingletonPtr(void);
+
+ };
+
+}
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreManualObject.h b/school/informatik/verkerhssimulation/src/ogre/OgreManualObject.h
new file mode 100644
index 00000000..d7625501
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreManualObject.h
@@ -0,0 +1,513 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __OgreManualObject_H__
+#define __OgreManualObject_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreMovableObject.h"
+#include "OgreRenderable.h"
+#include "OgreResourceGroupManager.h"
+
+
+namespace Ogre
+{
+ /** Class providing a much simplified interface to generating manual
+ objects with custom geometry.
+ @remarks
+ Building one-off geometry objects manually usually requires getting
+ down and dirty with the vertex buffer and vertex declaration API,
+ which some people find a steep learning curve. This class gives you
+ a simpler interface specifically for the purpose of building a
+ 3D object simply and quickly. Note that if you intend to instance your
+ object you will still need to become familiar with the Mesh class.
+ @par
+ This class draws heavily on the interface for OpenGL
+ immediate-mode (glBegin, glVertex, glNormal etc), since this
+ is generally well-liked by people. There are a couple of differences
+ in the results though - internally this class still builds hardware
+ buffers which can be re-used, so you can render the resulting object
+ multiple times without re-issuing all the same commands again.
+ Secondly, the rendering is not immediate, it is still queued just like
+ all OGRE objects. This makes this object more efficient than the
+ equivalent GL immediate-mode commands, so it's feasible to use it for
+ large objects if you really want to.
+ @par
+ To construct some geometry with this object:
+ -# If you know roughly how many vertices (and indices, if you use them)
+ you're going to submit, call estimateVertexCount and estimateIndexCount.
+ This is not essential but will make the process more efficient by saving
+ memory reallocations.
+ -# Call begin() to begin entering data
+ -# For each vertex, call position(), normal(), textureCoord(), colour()
+ to define your vertex data. Note that each time you call position()
+ you start a new vertex. Note that the first vertex defines the
+ components of the vertex - you can't add more after that. For example
+ if you didn't call normal() in the first vertex, you cannot call it
+ in any others. You ought to call the same combination of methods per
+ vertex.
+ -# If you want to define triangles (or lines/points) by indexing into the vertex list,
+ you can call index() as many times as you need to define them.
+ If you don't do this, the class will assume you want triangles drawn
+ directly as defined by the vertex list, ie non-indexed geometry. Note
+ that stencil shadows are only supported on indexed geometry, and that
+ indexed geometry is a little faster; so you should try to use it.
+ -# Call end() to finish entering data.
+ -# Optionally repeat the begin-end cycle if you want more geometry
+ using different rendering operation types, or different materials
+ After calling end(), the class will organise the data for that section
+ internally and make it ready to render with. Like any other
+ MovableObject you should attach the object to a SceneNode to make it
+ visible. Other aspects like the relative render order can be controlled
+ using standard MovableObject methods like setRenderQueueGroup.
+ @par
+ You can also use beginUpdate() to alter the geometry later on if you wish.
+ If you do this, you should call setDynamic(true) before your first call
+ to begin(), and also consider using estimateVertexCount / estimateIndexCount
+ if your geometry is going to be growing, to avoid buffer recreation during
+ growth.
+ @par
+ Note that like all OGRE geometry, triangles should be specified in
+ anti-clockwise winding order (whether you're doing it with just
+ vertices, or using indexes too). That is to say that the front of the
+ face is the one where the vertices are listed in anti-clockwise order.
+ */
+ class _OgreExport ManualObject : public MovableObject
+ {
+ public:
+ ManualObject(const String& name);
+ virtual ~ManualObject();
+
+ //pre-declare ManualObjectSection
+ class ManualObjectSection;
+
+ /** Completely clear the contents of the object.
+ @remarks
+ Clearing the contents of this object and rebuilding from scratch
+ is not the optimal way to manage dynamic vertex data, since the
+ buffers are recreated. If you want to keep the same structure but
+ update the content within that structure, use beginUpdate() instead
+ of clear() begin(). However if you do want to modify the structure
+ from time to time you can do so by clearing and re-specifying the data.
+ */
+ virtual void clear(void);
+
+ /** Estimate the number of vertices ahead of time.
+ @remarks
+ Calling this helps to avoid memory reallocation when you define
+ vertices. Also very handy when using beginUpdate() to manage dynamic
+ data - you can make the vertex buffers a little larger than their
+ initial needs to allow for growth later with this method.
+ */
+ virtual void estimateVertexCount(size_t vcount);
+
+ /** Estimate the number of indices ahead of time.
+ @remarks
+ Calling this helps to avoid memory reallocation when you define
+ indices. Also very handy when using beginUpdate() to manage dynamic
+ data - you can make the index buffer a little larger than the
+ initial need to allow for growth later with this method.
+ */
+ virtual void estimateIndexCount(size_t icount);
+
+ /** Start defining a part of the object.
+ @remarks
+ Each time you call this method, you start a new section of the
+ object with its own material and potentially its own type of
+ rendering operation (triangles, points or lines for example).
+ @param materialName The name of the material to render this part of the
+ object with.
+ @param opType The type of operation to use to render.
+ */
+ virtual void begin(const String& materialName,
+ RenderOperation::OperationType opType = RenderOperation::OT_TRIANGLE_LIST);
+
+ /** Use before defining gometry to indicate that you intend to update the
+ geometry regularly and want the internal structure to reflect that.
+ */
+ virtual void setDynamic(bool dyn) { mDynamic = dyn; }
+ /** Gets whether this object is marked as dynamic */
+ virtual bool getDynamic() const { return mDynamic; }
+
+ /** Start the definition of an update to a part of the object.
+ @remarks
+ Using this method, you can update an existing section of the object
+ efficiently. You do not have the option of changing the operation type
+ obviously, since it must match the one that was used before.
+ @note If your sections are changing size, particularly growing, use
+ estimateVertexCount and estimateIndexCount to pre-size the buffers a little
+ larger than the initial needs to avoid buffer reconstruction.
+ @param sectionIndex The index of the section you want to update. The first
+ call to begin() would have created section 0, the second section 1, etc.
+ */
+ virtual void beginUpdate(size_t sectionIndex);
+ /** Add a vertex position, starting a new vertex at the same time.
+ @remarks A vertex position is slightly special among the other vertex data
+ methods like normal() and textureCoord(), since calling it indicates
+ the start of a new vertex. All other vertex data methods you call
+ after this are assumed to be adding more information (like normals or
+ texture coordinates) to the last vertex started with position().
+ */
+ virtual void position(const Vector3& pos);
+ /// @copydoc ManualObject::position(const Vector3&)
+ virtual void position(Real x, Real y, Real z);
+
+ /** Add a vertex normal to the current vertex.
+ @remarks
+ Vertex normals are most often used for dynamic lighting, and
+ their components should be normalised.
+ */
+ virtual void normal(const Vector3& norm);
+ /// @copydoc ManualObject::normal(const Vector3&)
+ virtual void normal(Real x, Real y, Real z);
+
+ /** Add a texture coordinate to the current vertex.
+ @remarks
+ You can call this method multiple times between position() calls
+ to add multiple texture coordinates to a vertex. Each one can have
+ between 1 and 3 dimensions, depending on your needs, although 2 is
+ most common. There are several versions of this method for the
+ variations in number of dimensions.
+ */
+ virtual void textureCoord(Real u);
+ /// @copydoc ManualObject::textureCoord(Real)
+ virtual void textureCoord(Real u, Real v);
+ /// @copydoc ManualObject::textureCoord(Real)
+ virtual void textureCoord(Real u, Real v, Real w);
+ /// @copydoc ManualObject::textureCoord(Real)
+ virtual void textureCoord(const Vector2& uv);
+ /// @copydoc ManualObject::textureCoord(Real)
+ virtual void textureCoord(const Vector3& uvw);
+
+ /** Add a vertex colour to a vertex.
+ */
+ virtual void colour(const ColourValue& col);
+ /** Add a vertex colour to a vertex.
+ @param r,g,b,a Colour components expressed as floating point numbers from 0-1
+ */
+ virtual void colour(Real r, Real g, Real b, Real a = 1.0f);
+
+ /** Add a vertex index to construct faces / lines / points via indexing
+ rather than just by a simple list of vertices.
+ @remarks
+ You will have to call this 3 times for each face for a triangle list,
+ or use the alternative 3-parameter version. Other operation types
+ require different numbers of indexes, @see RenderOperation::OperationType.
+ @note
+ 32-bit indexes are not supported on all cards which is why this
+ class only allows 16-bit indexes, for simplicity and ease of use.
+ @param idx A vertex index from 0 to 65535.
+ */
+ virtual void index(uint16 idx);
+ /** Add a set of 3 vertex indices to construct a triangle; this is a
+ shortcut to calling index() 3 times. It is only valid for triangle
+ lists.
+ @note
+ 32-bit indexes are not supported on all cards which is why this
+ class only allows 16-bit indexes, for simplicity and ease of use.
+ @param i1, i2, i3 3 vertex indices from 0 to 65535 defining a face.
+ */
+ virtual void triangle(uint16 i1, uint16 i2, uint16 i3);
+ /** Add a set of 4 vertex indices to construct a quad (out of 2
+ triangles); this is a shortcut to calling index() 6 times,
+ or triangle() twice. It's only valid for triangle list operations.
+ @note
+ 32-bit indexes are not supported on all cards which is why this
+ class only allows 16-bit indexes, for simplicity and ease of use.
+ @param i1, i2, i3 3 vertex indices from 0 to 65535 defining a face.
+ */
+ virtual void quad(uint16 i1, uint16 i2, uint16 i3, uint16 i4);
+
+ /** Finish defining the object and compile the final renderable version.
+ @note
+ Will return a pointer to the finished section or NULL if the section was discarded (i.e. has zero vertices/indices).
+ */
+ virtual ManualObjectSection* end(void);
+
+ /** Alter the material for a subsection of this object after it has been
+ specified.
+ @remarks
+ You specify the material to use on a section of this object during the
+ call to begin(), however if you want to change the material afterwards
+ you can do so by calling this method.
+ @param subIndex The index of the subsection to alter
+ @param name The name of the new material to use
+ */
+ virtual void setMaterialName(size_t subindex, const String& name);
+
+ /** Convert this object to a Mesh.
+ @remarks
+ After you've finished building this object, you may convert it to
+ a Mesh if you want in order to be able to create many instances of
+ it in the world (via Entity). This is optional, since this instance
+ can be directly attached to a SceneNode itself, but of course only
+ one instance of it can exist that way.
+ @note Only objects which use indexed geometry may be converted to a mesh.
+ @param meshName The name to give the mesh
+ @param groupName The resource group to create the mesh in
+ */
+ virtual MeshPtr convertToMesh(const String& meshName,
+ const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+
+ /** Sets whether or not to use an 'identity' projection.
+ @remarks
+ Usually ManualObjects will use a projection matrix as determined
+ by the active camera. However, if they want they can cancel this out
+ and use an identity projection, which effectively projects in 2D using
+ a {-1, 1} view space. Useful for overlay rendering. Normally you don't
+ need to change this. The default is false.
+ @see ManualObject::getUseIdentityProjection
+ */
+ void setUseIdentityProjection(bool useIdentityProjection);
+
+ /** Returns whether or not to use an 'identity' projection.
+ @remarks
+ Usually ManualObjects will use a projection matrix as determined
+ by the active camera. However, if they want they can cancel this out
+ and use an identity projection, which effectively projects in 2D using
+ a {-1, 1} view space. Useful for overlay rendering. Normally you don't
+ need to change this.
+ @see ManualObject::setUseIdentityProjection
+ */
+ bool getUseIdentityProjection(void) const { return mUseIdentityProjection; }
+
+ /** Sets whether or not to use an 'identity' view.
+ @remarks
+ Usually ManualObjects will use a view matrix as determined
+ by the active camera. However, if they want they can cancel this out
+ and use an identity matrix, which means all geometry is assumed
+ to be relative to camera space already. Useful for overlay rendering.
+ Normally you don't need to change this. The default is false.
+ @see ManualObject::getUseIdentityView
+ */
+ void setUseIdentityView(bool useIdentityView);
+
+ /** Returns whether or not to use an 'identity' view.
+ @remarks
+ Usually ManualObjects will use a view matrix as determined
+ by the active camera. However, if they want they can cancel this out
+ and use an identity matrix, which means all geometry is assumed
+ to be relative to camera space already. Useful for overlay rendering.
+ Normally you don't need to change this.
+ @see ManualObject::setUseIdentityView
+ */
+ bool getUseIdentityView(void) const { return mUseIdentityView; }
+
+ /** Sets the bounding box.
+ @remarks Call this after having finished creating sections to modify the
+ bounding box. E.g. if you're using ManualObject to create 2D overlays
+ you can call things function to set an infinite bounding box so that
+ the object always stays visible when attached.
+ @see ManualObject::setUseIdentityProjection, ManualObject::setUseIdentityView,
+ AxisAlignedBox::setInfinite */
+ void setBoundingBox(const AxisAlignedBox& box) { mAABB = box; }
+
+ /** Gets a pointer to a ManualObjectSection, ie a part of a ManualObject.
+ */
+ ManualObjectSection* getSection(unsigned int index) const;
+
+ /** Retrieves the number of ManualObjectSection objects making up this ManualObject.
+ */
+ unsigned int getNumSections(void) const;
+
+ // MovableObject overrides
+
+ /** @copydoc MovableObject::getMovableType. */
+ const String& getMovableType(void) const;
+ /** @copydoc MovableObject::getBoundingBox. */
+ const AxisAlignedBox& getBoundingBox(void) const;
+ /** @copydoc MovableObject::getBoundingRadius. */
+ Real getBoundingRadius(void) const;
+ /** @copydoc MovableObject::_updateRenderQueue. */
+ void _updateRenderQueue(RenderQueue* queue);
+ /** Implement this method to enable stencil shadows. */
+ EdgeData* getEdgeList(void);
+ /** Overridden member from ShadowCaster. */
+ bool hasEdgeList(void);
+ /** Implement this method to enable stencil shadows. */
+ ShadowRenderableListIterator getShadowVolumeRenderableIterator(
+ ShadowTechnique shadowTechnique, const Light* light,
+ HardwareIndexBufferSharedPtr* indexBuffer,
+ bool extrudeVertices, Real extrusionDist, unsigned long flags = 0);
+
+
+ /// Built, renderable section of geometry
+ class _OgreExport ManualObjectSection : public Renderable
+ {
+ protected:
+ ManualObject* mParent;
+ String mMaterialName;
+ mutable MaterialPtr mMaterial;
+ RenderOperation mRenderOperation;
+
+ public:
+ ManualObjectSection(ManualObject* parent, const String& materialName,
+ RenderOperation::OperationType opType);
+ virtual ~ManualObjectSection();
+
+ /// Retrieve render operation for manipulation
+ RenderOperation* getRenderOperation(void);
+ /// Retrieve the material name in use
+ const String& getMaterialName(void) const { return mMaterialName; }
+ /// update the material name in use
+ void setMaterialName(const String& name);
+
+ // Renderable overrides
+ /** @copydoc Renderable::getMaterial. */
+ const MaterialPtr& getMaterial(void) const;
+ /** @copydoc Renderable::getRenderOperation. */
+ void getRenderOperation(RenderOperation& op);
+ /** @copydoc Renderable::getWorldTransforms. */
+ void getWorldTransforms(Matrix4* xform) const;
+ /** @copydoc Renderable::getWorldOrientation. */
+ const Quaternion& getWorldOrientation(void) const;
+ /** @copydoc Renderable::getWorldPosition. */
+ const Vector3& getWorldPosition(void) const;
+ /** @copydoc Renderable::getSquaredViewDepth. */
+ Real getSquaredViewDepth(const Ogre::Camera *) const;
+ /** @copydoc Renderable::getLights. */
+ const LightList &getLights(void) const;
+
+ };
+ /** Nested class to allow shadows. */
+ class _OgreExport ManualObjectSectionShadowRenderable : public ShadowRenderable
+ {
+ protected:
+ ManualObject* mParent;
+ // Shared link to position buffer
+ HardwareVertexBufferSharedPtr mPositionBuffer;
+ // Shared link to w-coord buffer (optional)
+ HardwareVertexBufferSharedPtr mWBuffer;
+
+ public:
+ ManualObjectSectionShadowRenderable(ManualObject* parent,
+ HardwareIndexBufferSharedPtr* indexBuffer, const VertexData* vertexData,
+ bool createSeparateLightCap, bool isLightCap = false);
+ ~ManualObjectSectionShadowRenderable();
+ /// Overridden from ShadowRenderable
+ void getWorldTransforms(Matrix4* xform) const;
+ /// Overridden from ShadowRenderable
+ const Quaternion& getWorldOrientation(void) const;
+ /// Overridden from ShadowRenderable
+ const Vector3& getWorldPosition(void) const;
+ HardwareVertexBufferSharedPtr getPositionBuffer(void) { return mPositionBuffer; }
+ HardwareVertexBufferSharedPtr getWBuffer(void) { return mWBuffer; }
+
+ };
+
+ typedef std::vector SectionList;
+
+ protected:
+ /// Dynamic?
+ bool mDynamic;
+ /// List of subsections
+ SectionList mSectionList;
+ /// Current section
+ ManualObjectSection* mCurrentSection;
+ /// Are we updating?
+ bool mCurrentUpdating;
+ /// Temporary vertex structure
+ struct TempVertex
+ {
+ Vector3 position;
+ Vector3 normal;
+ Vector3 texCoord[OGRE_MAX_TEXTURE_COORD_SETS];
+ ushort texCoordDims[OGRE_MAX_TEXTURE_COORD_SETS];
+ ColourValue colour;
+ };
+ /// Temp storage
+ TempVertex mTempVertex;
+ /// First vertex indicator
+ bool mFirstVertex;
+ /// Temp vertex data to copy?
+ bool mTempVertexPending;
+ /// System-memory buffer whilst we establish the size required
+ char* mTempVertexBuffer;
+ /// System memory allocation size, in bytes
+ size_t mTempVertexSize;
+ /// System-memory buffer whilst we establish the size required
+ uint16* mTempIndexBuffer;
+ /// System memory allocation size, in bytes
+ size_t mTempIndexSize;
+ /// Current declaration vertex size
+ size_t mDeclSize;
+ /// Estimated vertex count
+ size_t mEstVertexCount;
+ /// Estimated index count
+ size_t mEstIndexCount;
+ /// Current texture coordinate
+ ushort mTexCoordIndex;
+ /// Bounding box
+ AxisAlignedBox mAABB;
+ /// Bounding sphere
+ Real mRadius;
+ /// Any indexed geoemtry on any sections?
+ bool mAnyIndexed;
+ /// Edge list, used if stencil shadow casting is enabled
+ EdgeData* mEdgeList;
+ /// List of shadow renderables
+ ShadowRenderableList mShadowRenderables;
+ /// Whether to use identity projection for sections
+ bool mUseIdentityProjection;
+ /// Whether to use identity view for sections
+ bool mUseIdentityView;
+
+
+ /// Delete temp buffers and reset init counts
+ virtual void resetTempAreas(void);
+ /// Resize the temp vertex buffer?
+ virtual void resizeTempVertexBufferIfNeeded(size_t numVerts);
+ /// Resize the temp index buffer?
+ virtual void resizeTempIndexBufferIfNeeded(size_t numInds);
+
+ /// Copy current temp vertex into buffer
+ virtual void copyTempVertexToBuffer(void);
+
+ };
+
+
+ /** Factory object for creating ManualObject instances */
+ class _OgreExport ManualObjectFactory : public MovableObjectFactory
+ {
+ protected:
+ MovableObject* createInstanceImpl( const String& name, const NameValuePairList* params);
+ public:
+ ManualObjectFactory() {}
+ ~ManualObjectFactory() {}
+
+ static String FACTORY_TYPE_NAME;
+
+ const String& getType(void) const;
+ void destroyInstance( MovableObject* obj);
+
+ };
+}
+
+#endif
+
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreMaterial.h b/school/informatik/verkerhssimulation/src/ogre/OgreMaterial.h
new file mode 100644
index 00000000..688c4b53
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreMaterial.h
@@ -0,0 +1,680 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _Material_H__
+#define _Material_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreResource.h"
+#include "OgreIteratorWrappers.h"
+#include "OgreCommon.h"
+#include "OgreColourValue.h"
+#include "OgreBlendMode.h"
+
+
+namespace Ogre {
+
+ // Forward declaration
+ class MaterialPtr;
+
+ /** Class encapsulates rendering properties of an object.
+ @remarks
+ Ogre's material class encapsulates ALL aspects of the visual appearance,
+ of an object. It also includes other flags which
+ might not be traditionally thought of as material properties such as
+ culling modes and depth buffer settings, but these affect the
+ appearance of the rendered object and are convenient to attach to the
+ material since it keeps all the settings in one place. This is
+ different to Direct3D which treats a material as just the colour
+ components (diffuse, specular) and not texture maps etc. An Ogre
+ Material can be thought of as equivalent to a 'Shader'.
+ @par
+ A Material can be rendered in multiple different ways depending on the
+ hardware available. You may configure a Material to use high-complexity
+ fragment shaders, but these won't work on every card; therefore a Technique
+ is an approach to creating the visual effect you are looking for. You are advised
+ to create fallback techniques with lower hardware requirements if you decide to
+ use advanced features. In addition, you also might want lower-detail techniques
+ for distant geometry.
+ @par
+ Each technique can be made up of multiple passes. A fixed-function pass
+ may combine multiple texture layers using multitexrtuing, but Ogre can
+ break that into multiple passes automatically if the active card cannot
+ handle that many simultaneous textures. Programmable passes, however, cannot
+ be split down automatically, so if the active graphics card cannot handle the
+ technique which contains these passes, OGRE will try to find another technique
+ which the card can do. If, at the end of the day, the card cannot handle any of the
+ techniques which are listed for the material, the engine will render the
+ geometry plain white, which should alert you to the problem.
+ @par
+ Ogre comes configured with a number of default settings for a newly
+ created material. These can be changed if you wish by retrieving the
+ default material settings through
+ SceneManager::getDefaultMaterialSettings. Any changes you make to the
+ Material returned from this method will apply to any materials created
+ from this point onward.
+ */
+ class _OgreExport Material : public Resource
+ {
+ friend class SceneManager;
+ friend class MaterialManager;
+
+ public:
+ /// distance list used to specify LOD
+ typedef std::vector LodDistanceList;
+ typedef ConstVectorIterator LodDistanceIterator;
+ protected:
+
+
+ /** Internal method which sets the material up from the default settings.
+ */
+ void applyDefaults(void);
+
+ typedef std::vector Techniques;
+ /// All techniques, supported and unsupported
+ Techniques mTechniques;
+ /// Supported techniques of any sort
+ Techniques mSupportedTechniques;
+ typedef std::map LodTechniques;
+ typedef std::map BestTechniquesBySchemeList;
+ /** Map of scheme -> list of LOD techniques.
+ Current scheme is set on MaterialManager,
+ and can be set per Viewport for auto activation.
+ */
+ BestTechniquesBySchemeList mBestTechniquesBySchemeList;
+
+ LodDistanceList mLodDistances;
+ bool mReceiveShadows;
+ bool mTransparencyCastsShadows;
+ /// Does this material require compilation?
+ bool mCompilationRequired;
+ /// Text description of why any techniques are not supported
+ String mUnsupportedReasons;
+
+ /** Insert a supported technique into the local collections. */
+ void insertSupportedTechnique(Technique* t);
+
+ /** Clear the best technique list.
+ */
+ void clearBestTechniqueList(void);
+
+ /** Overridden from Resource.
+ */
+ void loadImpl(void);
+
+ /** Unloads the material, frees resources etc.
+ @see
+ Resource
+ */
+ void unloadImpl(void);
+ /// @copydoc Resource::calculateSize
+ size_t calculateSize(void) const { return 0; } // TODO
+ public:
+
+ /** Constructor - use resource manager's create method rather than this.
+ */
+ Material(ResourceManager* creator, const String& name, ResourceHandle handle,
+ const String& group, bool isManual = false, ManualResourceLoader* loader = 0);
+
+ ~Material();
+ /** Assignment operator to allow easy copying between materials.
+ */
+ Material& operator=( const Material& rhs );
+
+ /** Determines if the material has any transparency with the rest of the scene (derived from
+ whether any Techniques say they involve transparency).
+ */
+ bool isTransparent(void) const;
+
+ /** Sets whether objects using this material will receive shadows.
+ @remarks
+ This method allows a material to opt out of receiving shadows, if
+ it would otherwise do so. Shadows will not be cast on any objects
+ unless the scene is set up to support shadows
+ (@see SceneManager::setShadowTechnique), and not all techniques cast
+ shadows on all objects. In any case, if you have a need to prevent
+ shadows being received by material, this is the method you call to
+ do it.
+ @note
+ Transparent materials never receive shadows despite this setting.
+ The default is to receive shadows.
+ */
+ void setReceiveShadows(bool enabled) { mReceiveShadows = enabled; }
+ /** Returns whether or not objects using this material will receive shadows. */
+ bool getReceiveShadows(void) const { return mReceiveShadows; }
+
+ /** Sets whether objects using this material be classified as opaque to the shadow caster system.
+ @remarks
+ This method allows a material to cast a shadow, even if it is transparent.
+ By default, transparent materials neither cast nor receive shadows. Shadows
+ will not be cast on any objects unless the scene is set up to support shadows
+ (@see SceneManager::setShadowTechnique), and not all techniques cast
+ shadows on all objects.
+ */
+ void setTransparencyCastsShadows(bool enabled) { mTransparencyCastsShadows = enabled; }
+ /** Returns whether or not objects using this material be classified as opaque to the shadow caster system. */
+ bool getTransparencyCastsShadows(void) const { return mTransparencyCastsShadows; }
+
+ /** Creates a new Technique for this Material.
+ @remarks
+ A Technique is a single way of rendering geometry in order to achieve the effect
+ you are intending in a material. There are many reason why you would want more than
+ one - the main one being to handle variable graphics card abilities; you might have
+ one technique which is impressive but only runs on 4th-generation graphics cards,
+ for example. In this case you will want to create at least one fallback Technique.
+ OGRE will work out which Techniques a card can support and pick the best one.
+ @par
+ If multiple Techniques are available, the order in which they are created is
+ important - the engine will consider lower-indexed Techniques to be preferable
+ to higher-indexed Techniques, ie when asked for the 'best' technique it will
+ return the first one in the technique list which is supported by the hardware.
+ */
+ Technique* createTechnique(void);
+ /** Gets the indexed technique. */
+ Technique* getTechnique(unsigned short index);
+ /** searches for the named technique.
+ Return 0 if technique with name is not found
+ */
+ Technique* getTechnique(const String& name);
+ /** Retrieves the number of techniques. */
+ unsigned short getNumTechniques(void) const;
+ /** Removes the technique at the given index. */
+ void removeTechnique(unsigned short index);
+ /** Removes all the techniques in this Material. */
+ void removeAllTechniques(void);
+ typedef VectorIterator TechniqueIterator;
+ /** Get an iterator over the Techniques in this Material. */
+ TechniqueIterator getTechniqueIterator(void);
+ /** Gets an iterator over all the Techniques which are supported by the current card.
+ @remarks
+ The supported technique list is only available after this material has been compiled,
+ which typically happens on loading the material. Therefore, if this method returns
+ an empty list, try calling Material::load.
+ */
+ TechniqueIterator getSupportedTechniqueIterator(void);
+
+ /** Gets the indexed supported technique. */
+ Technique* getSupportedTechnique(unsigned short index);
+ /** Retrieves the number of supported techniques. */
+ unsigned short getNumSupportedTechniques(void) const;
+ /** Gets a string explaining why any techniques are not supported. */
+ const String& getUnsupportedTechniquesExplanation() const { return mUnsupportedReasons; }
+
+ /** Gets the number of levels-of-detail this material has in the
+ given scheme, based on Technique::setLodIndex.
+ @remarks
+ Note that this will not be up to date until the material has been compiled.
+ */
+ unsigned short getNumLodLevels(unsigned short schemeIndex) const;
+ /** Gets the number of levels-of-detail this material has in the
+ given scheme, based on Technique::setLodIndex.
+ @remarks
+ Note that this will not be up to date until the material has been compiled.
+ */
+ unsigned short getNumLodLevels(const String& schemeName) const;
+
+ /** Gets the best supported technique.
+ @remarks
+ This method returns the lowest-index supported Technique in this material
+ (since lower-indexed Techniques are considered to be better than higher-indexed
+ ones).
+ @par
+ The best supported technique is only available after this material has been compiled,
+ which typically happens on loading the material. Therefore, if this method returns
+ NULL, try calling Material::load.
+ @param lodIndex The material lod index to use
+ */
+ Technique* getBestTechnique(unsigned short lodIndex = 0);
+
+
+ /** Creates a new copy of this material with the same settings but a new name.
+ @param newName The name for the cloned material
+ @param changeGroup If true, the resource group of the clone is changed
+ @param newGroup Only required if changeGroup is true; the new group to assign
+ */
+ MaterialPtr clone(const String& newName, bool changeGroup = false,
+ const String& newGroup = StringUtil::BLANK) const;
+
+ /** Copies the details of this material into another, preserving the target's handle and name
+ (unlike operator=) but copying everything else.
+ @param mat Weak reference to material which will receive this material's settings.
+ */
+ void copyDetailsTo(MaterialPtr& mat) const;
+
+ /** 'Compiles' this Material.
+ @remarks
+ Compiling a material involves determining which Techniques are supported on the
+ card on which OGRE is currently running, and for fixed-function Passes within those
+ Techniques, splitting the passes down where they contain more TextureUnitState
+ instances than the current card has texture units.
+ @par
+ This process is automatically done when the Material is loaded, but may be
+ repeated if you make some procedural changes.
+ @param
+ autoManageTextureUnits If true, when a fixed function pass has too many TextureUnitState
+ entries than the card has texture units, the Pass in question will be split into
+ more than one Pass in order to emulate the Pass. If you set this to false and
+ this situation arises, an Exception will be thrown.
+ */
+ void compile(bool autoManageTextureUnits = true);
+
+ // -------------------------------------------------------------------------------
+ // The following methods are to make migration from previous versions simpler
+ // and to make code easier to write when dealing with simple materials
+ // They set the properties which have been moved to Pass for all Techniques and all Passes
+
+ /** Sets the point size properties for every Pass in every Technique.
+ @note
+ This property has been moved to the Pass class, which is accessible via the
+ Technique. For simplicity, this method allows you to set these properties for
+ every current Technique, and for every current Pass within those Techniques. If
+ you need more precision, retrieve the Technique and Pass instances and set the
+ property there.
+ @see Pass::setPointSize
+ */
+ void setPointSize(Real ps);
+
+ /** Sets the ambient colour reflectance properties for every Pass in every Technique.
+ @note
+ This property has been moved to the Pass class, which is accessible via the
+ Technique. For simplicity, this method allows you to set these properties for
+ every current Technique, and for every current Pass within those Techniques. If
+ you need more precision, retrieve the Technique and Pass instances and set the
+ property there.
+ @see Pass::setAmbient
+ */
+ void setAmbient(Real red, Real green, Real blue);
+
+ /** Sets the ambient colour reflectance properties for every Pass in every Technique.
+ @note
+ This property has been moved to the Pass class, which is accessible via the
+ Technique. For simplicity, this method allows you to set these properties for
+ every current Technique, and for every current Pass within those Techniques. If
+ you need more precision, retrieve the Technique and Pass instances and set the
+ property there.
+ @see Pass::setAmbient
+ */
+ void setAmbient(const ColourValue& ambient);
+
+ /** Sets the diffuse colour reflectance properties of every Pass in every Technique.
+ @note
+ This property has been moved to the Pass class, which is accessible via the
+ Technique. For simplicity, this method allows you to set these properties for
+ every current Technique, and for every current Pass within those Techniques. If
+ you need more precision, retrieve the Technique and Pass instances and set the
+ property there.
+ @see Pass::setDiffuse
+ */
+ void setDiffuse(Real red, Real green, Real blue, Real alpha);
+
+ /** Sets the diffuse colour reflectance properties of every Pass in every Technique.
+ @note
+ This property has been moved to the Pass class, which is accessible via the
+ Technique. For simplicity, this method allows you to set these properties for
+ every current Technique, and for every current Pass within those Techniques. If
+ you need more precision, retrieve the Technique and Pass instances and set the
+ property there.
+ @see Pass::setDiffuse
+ */
+ void setDiffuse(const ColourValue& diffuse);
+
+ /** Sets the specular colour reflectance properties of every Pass in every Technique.
+ @note
+ This property has been moved to the Pass class, which is accessible via the
+ Technique. For simplicity, this method allows you to set these properties for
+ every current Technique, and for every current Pass within those Techniques. If
+ you need more precision, retrieve the Technique and Pass instances and set the
+ property there.
+ @see Pass::setSpecular
+ */
+ void setSpecular(Real red, Real green, Real blue, Real alpha);
+
+ /** Sets the specular colour reflectance properties of every Pass in every Technique.
+ @note
+ This property has been moved to the Pass class, which is accessible via the
+ Technique. For simplicity, this method allows you to set these properties for
+ every current Technique, and for every current Pass within those Techniques. If
+ you need more precision, retrieve the Technique and Pass instances and set the
+ property there.
+ @see Pass::setSpecular
+ */
+ void setSpecular(const ColourValue& specular);
+
+ /** Sets the shininess properties of every Pass in every Technique.
+ @note
+ This property has been moved to the Pass class, which is accessible via the
+ Technique. For simplicity, this method allows you to set these properties for
+ every current Technique, and for every current Pass within those Techniques. If
+ you need more precision, retrieve the Technique and Pass instances and set the
+ property there.
+ @see Pass::setShininess
+ */
+ void setShininess(Real val);
+
+ /** Sets the amount of self-illumination of every Pass in every Technique.
+ @note
+ This property has been moved to the Pass class, which is accessible via the
+ Technique. For simplicity, this method allows you to set these properties for
+ every current Technique, and for every current Pass within those Techniques. If
+ you need more precision, retrieve the Technique and Pass instances and set the
+ property there.
+ @see Pass::setSelfIllumination
+ */
+ void setSelfIllumination(Real red, Real green, Real blue);
+
+ /** Sets the amount of self-illumination of every Pass in every Technique.
+ @note
+ This property has been moved to the Pass class, which is accessible via the
+ Technique. For simplicity, this method allows you to set these properties for
+ every current Technique, and for every current Pass within those Techniques. If
+ you need more precision, retrieve the Technique and Pass instances and set the
+ property there.
+ @see Pass::setSelfIllumination
+ */
+ void setSelfIllumination(const ColourValue& selfIllum);
+
+ /** Sets whether or not each Pass renders with depth-buffer checking on or not.
+ @note
+ This property has been moved to the Pass class, which is accessible via the
+ Technique. For simplicity, this method allows you to set these properties for
+ every current Technique, and for every current Pass within those Techniques. If
+ you need more precision, retrieve the Technique and Pass instances and set the
+ property there.
+ @see Pass::setDepthCheckEnabled
+ */
+ void setDepthCheckEnabled(bool enabled);
+
+ /** Sets whether or not each Pass renders with depth-buffer writing on or not.
+ @note
+ This property has been moved to the Pass class, which is accessible via the
+ Technique. For simplicity, this method allows you to set these properties for
+ every current Technique, and for every current Pass within those Techniques. If
+ you need more precision, retrieve the Technique and Pass instances and set the
+ property there.
+ @see Pass::setDepthWriteEnabled
+ */
+ void setDepthWriteEnabled(bool enabled);
+
+ /** Sets the function used to compare depth values when depth checking is on.
+ @note
+ This property has been moved to the Pass class, which is accessible via the
+ Technique. For simplicity, this method allows you to set these properties for
+ every current Technique, and for every current Pass within those Techniques. If
+ you need more precision, retrieve the Technique and Pass instances and set the
+ property there.
+ @see Pass::setDepthFunction
+ */
+ void setDepthFunction( CompareFunction func );
+
+ /** Sets whether or not colour buffer writing is enabled for each Pass.
+ @note
+ This property has been moved to the Pass class, which is accessible via the
+ Technique. For simplicity, this method allows you to set these properties for
+ every current Technique, and for every current Pass within those Techniques. If
+ you need more precision, retrieve the Technique and Pass instances and set the
+ property there.
+ @see Pass::setColourWriteEnabled
+ */
+ void setColourWriteEnabled(bool enabled);
+
+ /** Sets the culling mode for each pass based on the 'vertex winding'.
+ @note
+ This property has been moved to the Pass class, which is accessible via the
+ Technique. For simplicity, this method allows you to set these properties for
+ every current Technique, and for every current Pass within those Techniques. If
+ you need more precision, retrieve the Technique and Pass instances and set the
+ property there.
+ @see Pass::setCullingMode
+ */
+ void setCullingMode( CullingMode mode );
+
+ /** Sets the manual culling mode, performed by CPU rather than hardware.
+ @note
+ This property has been moved to the Pass class, which is accessible via the
+ Technique. For simplicity, this method allows you to set these properties for
+ every current Technique, and for every current Pass within those Techniques. If
+ you need more precision, retrieve the Technique and Pass instances and set the
+ property there.
+ @see Pass::setManualCullingMode
+ */
+ void setManualCullingMode( ManualCullingMode mode );
+
+ /** Sets whether or not dynamic lighting is enabled for every Pass.
+ @note
+ This property has been moved to the Pass class, which is accessible via the
+ Technique. For simplicity, this method allows you to set these properties for
+ every current Technique, and for every current Pass within those Techniques. If
+ you need more precision, retrieve the Technique and Pass instances and set the
+ property there.
+ @see Pass::setLightingEnabled
+ */
+ void setLightingEnabled(bool enabled);
+
+ /** Sets the type of light shading required
+ @note
+ This property has been moved to the Pass class, which is accessible via the
+ Technique. For simplicity, this method allows you to set these properties for
+ every current Technique, and for every current Pass within those Techniques. If
+ you need more precision, retrieve the Technique and Pass instances and set the
+ property there.
+ @see Pass::setShadingMode
+ */
+ void setShadingMode( ShadeOptions mode );
+
+ /** Sets the fogging mode applied to each pass.
+ @note
+ This property has been moved to the Pass class, which is accessible via the
+ Technique. For simplicity, this method allows you to set these properties for
+ every current Technique, and for every current Pass within those Techniques. If
+ you need more precision, retrieve the Technique and Pass instances and set the
+ property there.
+ @see Pass::setFog
+ */
+ void setFog(
+ bool overrideScene,
+ FogMode mode = FOG_NONE,
+ const ColourValue& colour = ColourValue::White,
+ Real expDensity = 0.001, Real linearStart = 0.0, Real linearEnd = 1.0 );
+
+ /** Sets the depth bias to be used for each Pass.
+ @note
+ This property has been moved to the Pass class, which is accessible via the
+ Technique. For simplicity, this method allows you to set these properties for
+ every current Technique, and for every current Pass within those Techniques. If
+ you need more precision, retrieve the Technique and Pass instances and set the
+ property there.
+ @see Pass::setDepthBias
+ */
+ void setDepthBias(float constantBias, float slopeScaleBias);
+
+ /** Set texture filtering for every texture unit in every Technique and Pass
+ @note
+ This property has been moved to the TextureUnitState class, which is accessible via the
+ Technique and Pass. For simplicity, this method allows you to set these properties for
+ every current TeextureUnitState, If you need more precision, retrieve the Technique,
+ Pass and TextureUnitState instances and set the property there.
+ @see TextureUnitState::setTextureFiltering
+ */
+ void setTextureFiltering(TextureFilterOptions filterType);
+ /** Sets the anisotropy level to be used for all textures.
+ @note
+ This property has been moved to the TextureUnitState class, which is accessible via the
+ Technique and Pass. For simplicity, this method allows you to set these properties for
+ every current TeextureUnitState, If you need more precision, retrieve the Technique,
+ Pass and TextureUnitState instances and set the property there.
+ @see TextureUnitState::setTextureAnisotropy
+ */
+ void setTextureAnisotropy(int maxAniso);
+
+ /** Sets the kind of blending every pass has with the existing contents of the scene.
+ @note
+ This property has been moved to the Pass class, which is accessible via the
+ Technique. For simplicity, this method allows you to set these properties for
+ every current Technique, and for every current Pass within those Techniques. If
+ you need more precision, retrieve the Technique and Pass instances and set the
+ property there.
+ @see Pass::setSceneBlending
+ */
+ void setSceneBlending( const SceneBlendType sbt );
+
+ /** Allows very fine control of blending every Pass with the existing contents of the scene.
+ @note
+ This property has been moved to the Pass class, which is accessible via the
+ Technique. For simplicity, this method allows you to set these properties for
+ every current Technique, and for every current Pass within those Techniques. If
+ you need more precision, retrieve the Technique and Pass instances and set the
+ property there.
+ @see Pass::setSceneBlending
+ */
+ void setSceneBlending( const SceneBlendFactor sourceFactor, const SceneBlendFactor destFactor);
+
+
+ /** Tells the material that it needs recompilation. */
+ void _notifyNeedsRecompile(void);
+
+ /** Sets the distance at which level-of-detail (LOD) levels come into effect.
+ @remarks
+ You should only use this if you have assigned LOD indexes to the Technique
+ instances attached to this Material. If you have done so, you should call this
+ method to determine the distance at which the lowe levels of detail kick in.
+ The decision about what distance is actually used is a combination of this
+ and the LOD bias applied to both the current Camera and the current Entity.
+ @param lodDistances A vector of Reals which indicate the distance at which to
+ switch to lower details. They are listed in LOD index order, starting at index
+ 1 (ie the first level down from the highest level 0, which automatically applies
+ from a distance of 0).
+ */
+ void setLodLevels(const LodDistanceList& lodDistances);
+ /** Gets an iterator over the list of distances at which each LOD comes into effect.
+ @remarks
+ Note that the iterator returned from this method is not totally anagolous to
+ the one passed in by calling setLodLevels - the list includes a zero
+ entry at the start (since the highest LOD starts at distance 0), and
+ the other distances are held as their squared value for efficiency.
+ */
+ LodDistanceIterator getLodDistanceIterator(void) const;
+
+ /** Gets the LOD index to use at the given distance. */
+ unsigned short getLodIndex(Real d) const;
+ /** Gets the LOD index to use at the given squared distance. */
+ unsigned short getLodIndexSquaredDepth(Real squaredDepth) const;
+
+ /** @copydoc Resource::touch
+ */
+ void touch(void)
+ {
+ if (mCompilationRequired)
+ compile();
+ // call superclass
+ Resource::touch();
+ }
+
+ /** Applies texture names to Texture Unit State with matching texture name aliases.
+ All techniques, passes, and Texture Unit States within the material are checked.
+ If matching texture aliases are found then true is returned.
+
+ @param
+ aliasList is a map container of texture alias, texture name pairs
+ @param
+ apply set true to apply the texture aliases else just test to see if texture alias matches are found.
+ @return
+ True if matching texture aliases were found in the material.
+ */
+ bool applyTextureAliases(const AliasTextureNamePairList& aliasList, const bool apply = true) const;
+
+ /** Gets the compilation status of the material.
+ @return True if the material needs recompilation.
+ */
+ bool getCompilationRequired() const
+ {
+ return mCompilationRequired;
+ }
+
+
+ };
+
+ /** Specialisation of SharedPtr to allow SharedPtr to be assigned to MaterialPtr
+ @note Has to be a subclass since we need operator=.
+ We could templatise this instead of repeating per Resource subclass,
+ except to do so requires a form VC6 does not support i.e.
+ ResourceSubclassPtr : public SharedPtr
+ */
+ class _OgreExport MaterialPtr : public SharedPtr
+ {
+ public:
+ MaterialPtr() : SharedPtr() {}
+ explicit MaterialPtr(Material* rep) : SharedPtr(rep) {}
+ MaterialPtr(const MaterialPtr& r) : SharedPtr(r) {}
+ MaterialPtr(const ResourcePtr& r) : SharedPtr()
+ {
+ // lock & copy other mutex pointer
+ OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
+ {
+ OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+ OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+ pRep = static_cast(r.getPointer());
+ pUseCount = r.useCountPointer();
+ if (pUseCount)
+ {
+ ++(*pUseCount);
+ }
+ }
+ }
+
+ /// Operator used to convert a ResourcePtr to a MaterialPtr
+ MaterialPtr& operator=(const ResourcePtr& r)
+ {
+ if (pRep == static_cast(r.getPointer()))
+ return *this;
+ release();
+ // lock & copy other mutex pointer
+ OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
+ {
+ OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+ OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+ pRep = static_cast(r.getPointer());
+ pUseCount = r.useCountPointer();
+ if (pUseCount)
+ {
+ ++(*pUseCount);
+ }
+ }
+ else
+ {
+ // RHS must be a null pointer
+ assert(r.isNull() && "RHS must be null if it has no mutex!");
+ setNull();
+ }
+ return *this;
+ }
+ };
+
+} //namespace
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreMaterialManager.h b/school/informatik/verkerhssimulation/src/ogre/OgreMaterialManager.h
new file mode 100644
index 00000000..b183b679
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreMaterialManager.h
@@ -0,0 +1,242 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __MATERIALMANAGER_H__
+#define __MATERIALMANAGER_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreSingleton.h"
+#include "OgreResourceManager.h"
+#include "OgreMaterial.h"
+#include "OgreStringVector.h"
+#include "OgreMaterialSerializer.h"
+
+#if OGRE_THREAD_SUPPORT
+// boost::thread_specific_ptr has 'new' in header but delete in lib
+// so if we use our memory manager it reports leaks incorrectly
+# include "OgreNoMemoryMacros.h"
+# include
+# include "OgreMemoryMacros.h"
+#endif
+
+namespace Ogre {
+
+
+ /** Class for managing Material settings for Ogre.
+ @remarks
+ Materials control the eventual surface rendering properties of geometry. This class
+ manages the library of materials, dealing with programmatic registrations and lookups,
+ as well as loading predefined Material settings from scripts.
+ @par
+ When loaded from a script, a Material is in an 'unloaded' state and only stores the settings
+ required. It does not at that stage load any textures. This is because the material settings may be
+ loaded 'en masse' from bulk material script files, but only a subset will actually be required.
+ @par
+ Because this is a subclass of ResourceManager, any files loaded will be searched for in any path or
+ archive added to the resource paths/archives. See ResourceManager for details.
+ @par
+ For a definition of the material script format, see the Tutorials/MaterialScript.html file.
+ */
+ class _OgreExport MaterialManager : public ResourceManager, public Singleton
+ {
+ protected:
+
+ /// Default Texture filtering - minification
+ FilterOptions mDefaultMinFilter;
+ /// Default Texture filtering - magnification
+ FilterOptions mDefaultMagFilter;
+ /// Default Texture filtering - mipmapping
+ FilterOptions mDefaultMipFilter;
+ /// Default Texture anisotropy
+ unsigned int mDefaultMaxAniso;
+ /// New material compiler. Hold instance per thread if necessary
+ OGRE_THREAD_POINTER(MaterialScriptCompiler, mScriptCompiler);
+ /// Serializer - Hold instance per thread if necessary
+ OGRE_THREAD_POINTER(MaterialSerializer, mSerializer);
+ /// Default settings
+ MaterialPtr mDefaultSettings;
+ /// Overridden from ResourceManager
+ Resource* createImpl(const String& name, ResourceHandle handle,
+ const String& group, bool isManual, ManualResourceLoader* loader,
+ const NameValuePairList* params);
+
+ /// Scheme name -> index. Never shrinks! Should be pretty static anyway
+ typedef std::map SchemeMap;
+ /// List of material schemes
+ SchemeMap mSchemes;
+ /// Current material scheme
+ String mActiveSchemeName;
+ /// Current material scheme
+ unsigned short mActiveSchemeIndex;
+
+ public:
+ /// Default material scheme
+ static String DEFAULT_SCHEME_NAME;
+
+ /** Default constructor.
+ */
+ MaterialManager();
+
+ /** Default destructor.
+ */
+ virtual ~MaterialManager();
+
+ /** Intialises the material manager, which also triggers it to
+ * parse all available .program and .material scripts. */
+ void initialise(void);
+
+ /** @see ScriptLoader::parseScript
+ */
+ void parseScript(DataStreamPtr& stream, const String& groupName);
+
+
+ /** Sets the default texture filtering to be used for loaded textures, for when textures are
+ loaded automatically (e.g. by Material class) or when 'load' is called with the default
+ parameters by the application.
+ @note
+ The default value is TFO_BILINEAR.
+ */
+ virtual void setDefaultTextureFiltering(TextureFilterOptions fo);
+ /** Sets the default texture filtering to be used for loaded textures, for when textures are
+ loaded automatically (e.g. by Material class) or when 'load' is called with the default
+ parameters by the application.
+ */
+ virtual void setDefaultTextureFiltering(FilterType ftype, FilterOptions opts);
+ /** Sets the default texture filtering to be used for loaded textures, for when textures are
+ loaded automatically (e.g. by Material class) or when 'load' is called with the default
+ parameters by the application.
+ */
+ virtual void setDefaultTextureFiltering(FilterOptions minFilter, FilterOptions magFilter, FilterOptions mipFilter);
+
+ /// get the default texture filtering
+ virtual FilterOptions getDefaultTextureFiltering(FilterType ftype) const;
+
+ /** Sets the default anisotropy level to be used for loaded textures, for when textures are
+ loaded automatically (e.g. by Material class) or when 'load' is called with the default
+ parameters by the application.
+ @note
+ The default value is 1 (no anisotropy).
+ */
+ void setDefaultAnisotropy(unsigned int maxAniso);
+ /// get the default maxAnisotropy
+ unsigned int getDefaultAnisotropy() const;
+
+ /** Returns a pointer to the default Material settings.
+ @remarks
+ Ogre comes configured with a set of defaults for newly created
+ materials. If you wish to have a different set of defaults,
+ simply call this method and change the returned Material's
+ settings. All materials created from then on will be configured
+ with the new defaults you have specified.
+ @par
+ The default settings begin as a single Technique with a single, non-programmable Pass:
+
+ - ambient = ColourValue::White
+ - diffuse = ColourValue::White
+ - specular = ColourValue::Black
+ - emmissive = ColourValue::Black
+ - shininess = 0
+ - No texture unit settings (& hence no textures)
+ - SourceBlendFactor = SBF_ONE
+ - DestBlendFactor = SBF_ZERO (no blend, replace with new
+ colour)
+ - Depth buffer checking on
+ - Depth buffer writing on
+ - Depth buffer comparison function = CMPF_LESS_EQUAL
+ - Colour buffer writing on for all channels
+ - Culling mode = CULL_CLOCKWISE
+ - Ambient lighting = ColourValue(0.5, 0.5, 0.5) (mid-grey)
+ - Dynamic lighting enabled
+ - Gourad shading mode
+ - Bilinear texture filtering
+
+ */
+ virtual MaterialPtr getDefaultSettings(void) const { return mDefaultSettings; }
+
+ /** Internal method - returns index for a given material scheme name.
+ @see Technique::setSchemeName
+ */
+ virtual unsigned short _getSchemeIndex(const String& name);
+ /** Internal method - returns name for a given material scheme index.
+ @see Technique::setSchemeName
+ */
+ virtual const String& _getSchemeName(unsigned short index);
+ /** Internal method - returns the active scheme index.
+ @see Technique::setSchemeName
+ */
+ virtual unsigned short _getActiveSchemeIndex(void) const;
+
+ /** Returns the name of the active material scheme.
+ @see Technique::setSchemeName
+ */
+ virtual const String& getActiveScheme(void) const;
+
+ /** Sets the name of the active material scheme.
+ @see Technique::setSchemeName
+ */
+ virtual void setActiveScheme(const String& schemeName);
+
+ /** Override standard Singleton retrieval.
+ @remarks
+ Why do we do this? Well, it's because the Singleton
+ implementation is in a .h file, which means it gets compiled
+ into anybody who includes it. This is needed for the
+ Singleton template to work, but we actually only want it
+ compiled into the implementation of the class based on the
+ Singleton, not all of them. If we don't change this, we get
+ link errors when trying to use the Singleton-based class from
+ an outside dll.
+ @par
+ This method just delegates to the template version anyway,
+ but the implementation stays in this single compilation unit,
+ preventing link errors.
+ */
+ static MaterialManager& getSingleton(void);
+ /** Override standard Singleton retrieval.
+ @remarks
+ Why do we do this? Well, it's because the Singleton
+ implementation is in a .h file, which means it gets compiled
+ into anybody who includes it. This is needed for the
+ Singleton template to work, but we actually only want it
+ compiled into the implementation of the class based on the
+ Singleton, not all of them. If we don't change this, we get
+ link errors when trying to use the Singleton-based class from
+ an outside dll.
+ @par
+ This method just delegates to the template version anyway,
+ but the implementation stays in this single compilation unit,
+ preventing link errors.
+ */
+ static MaterialManager* getSingletonPtr(void);
+
+ };
+
+}
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreMaterialScriptCompiler.h b/school/informatik/verkerhssimulation/src/ogre/OgreMaterialScriptCompiler.h
new file mode 100644
index 00000000..d52a0199
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreMaterialScriptCompiler.h
@@ -0,0 +1,330 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __MaterialScriptScompiler_H__
+#define __MaterialScriptScompiler_H__
+
+#include "OgreCompiler2Pass.h"
+#include "OgreTextureUnitState.h"
+#include "OgreMaterial.h"
+#include "OgreGpuProgram.h"
+#include "OgreStringVector.h"
+
+namespace Ogre {
+
+ class _OgreExport MaterialScriptCompiler : public Compiler2Pass
+ {
+
+ public:
+ MaterialScriptCompiler(void);
+ ~MaterialScriptCompiler(void);
+
+ /** gets BNF Grammer for Compositor script.
+ */
+ virtual const String& getClientBNFGrammer(void) const;
+
+ /** get the name of the BNF grammer.
+ */
+ virtual const String& getClientGrammerName(void) const;
+
+ /** Compile a material script from a data stream using a specific resource group name.
+ @param stream Weak reference to a data stream which is the source of the material script
+ @param groupName The name of the resource group that resources which are
+ parsed are to become a member of. If this group is loaded or unloaded,
+ then the resources discovered in this script will be loaded / unloaded
+ with it.
+ @param allowOverride if material or gpu program name already exists then use definition
+ in the material script being parsed to override the existing instance. The default
+ value is false which causes an exception to be thrown if a duplicate is found.
+ */
+ void parseScript(DataStreamPtr& stream, const String& groupName, const bool allowOverride = false);
+
+ protected:
+ // Token ID enumeration
+ enum TokenID {
+ // Terminal Tokens section
+ ID_UNKOWN = 0,
+ // GPU Program
+ ID_VERTEX_PROGRAM, ID_FRAGMENT_PROGRAM,
+
+ // material
+ ID_CLONE,
+
+ // technique
+
+ // pass
+
+ ID_VERTEXCOLOUR,
+ // scene blend
+ ID_COLOUR_BLEND, ID_DEST_COLOUR,
+ ID_SRC_COLOUR, ID_ONE_MINUS_DEST_COLOUR, ID_ONE_MINUS_SRC_COLOUR,
+ ID_DEST_ALPHA, ID_SRC_ALPHA, ID_ONE_MINUS_DEST_ALPHA, ID_ONE_MINUS_SRC_ALPHA,
+ // Depth
+ ID_ALWAYS_FAIL, ID_ALWAYS_PASS,
+ ID_LESS_EQUAL, ID_LESS, ID_EQUAL, ID_NOT_EQUAL, ID_GREATER_EQUAL, ID_GREATER,
+ // culling
+ ID_CLOCKWISE, ID_ANTICLOCKWISE,
+ ID_CULL_BACK, ID_CULL_FRONT,
+ // shading
+ ID_FLAT, ID_GOURAUD, ID_PHONG,
+ // polygon mode
+ ID_SOLID, ID_WIREFRAME, ID_POINTS,
+ // fog overide
+ ID_EXP, ID_EXP2,
+ // iteration
+ ID_ONCE, ID_ONCE_PER_LIGHT, ID_PER_LIGHT, ID_PER_N_LIGHTS, ID_DIRECTIONAL, ID_SPOT,
+
+ // texture unit state
+ // texture
+ ID_1D, ID_2D, ID_3D, ID_CUBIC, ID_UNLIMITED, ID_ALPHA,
+ // cubic texture
+ ID_SEPARATE_UV, ID_COMBINED_UVW,
+ // address mode
+ ID_WRAP, ID_CLAMP, ID_MIRROR, ID_BORDER,
+ // filtering
+ ID_BILINEAR, ID_TRILINEAR, ID_ANISOTROPIC,
+ // color op
+ ID_REPLACE,
+ ID_SOURCE1, ID_SOURCE2, ID_MODULATE_X2, ID_MODULATE_X4, ID_ADD_SIGNED,
+ ID_ADD_SMOOTH, ID_SUBTRACT, ID_BLEND_DIFFUSE_COLOUR, ID_BLEND_DIFFUSE_ALPHA,
+ ID_BLEND_TEXTURE_ALPHA, ID_BLEND_CURRENT_ALPHA, ID_BLEND_MANUAL, ID_DOTPRODUCT,
+ ID_SRC_CURRENT, ID_SRC_TEXTURE, ID_SRC_DIFFUSE, ID_SRC_SPECULAR, ID_SRC_MANUAL,
+
+ // env map
+ ID_SPHERICAL, ID_PLANAR, ID_CUBIC_REFLECTION, ID_CUBIC_NORMAL,
+ // wave transform
+ ID_SCROLL_X, ID_SCROLL_Y, ID_SCALE_X, ID_SCALE_Y, ID_SINE, ID_TRIANGLE,
+ ID_SQUARE, ID_SAWTOOTH, ID_INVERSE_SAWTOOTH, ID_ROTATE,
+ // content type
+ ID_NAMED, ID_SHADOW,
+
+ // GPU program references
+ // GPU Parameters
+
+ // general
+ ID_ON, ID_OFF, ID_TRUE, ID_FALSE, ID_NONE, ID_POINT, ID_LINEAR, ID_ADD, ID_MODULATE, ID_ALPHA_BLEND,
+ ID_ONE, ID_ZERO, ID_VERTEX, ID_FRAGMENT,
+
+ // where auto generated tokens start so donot remove
+ ID_AUTOTOKENSTART
+ };
+
+ /** Enum to identify material sections. */
+ enum MaterialScriptSection
+ {
+ MSS_NONE,
+ MSS_MATERIAL,
+ MSS_TECHNIQUE,
+ MSS_PASS,
+ MSS_TEXTUREUNIT,
+ MSS_PROGRAM_REF,
+ MSS_PROGRAM,
+ MSS_DEFAULT_PARAMETERS,
+ MSS_TEXTURESOURCE
+ };
+ /** Struct for holding a program definition which is in progress. */
+ struct MaterialScriptProgramDefinition
+ {
+ String name;
+ GpuProgramType progType;
+ String language;
+ String source;
+ String syntax;
+ bool supportsSkeletalAnimation;
+ bool supportsMorphAnimation;
+ ushort supportsPoseAnimation; // number of simultaneous poses supported
+ bool usesVertexTextureFetch;
+ std::vector > customParameters;
+ };
+ /** Struct for holding the script context while parsing. */
+ struct MaterialScriptContext
+ {
+ MaterialScriptSection section;
+ String groupName;
+ MaterialPtr material;
+ Technique* technique;
+ Pass* pass;
+ TextureUnitState* textureUnit;
+ GpuProgramPtr program; // used when referencing a program, not when defining it
+ bool isProgramShadowCaster; // when referencing, are we in context of shadow caster
+ bool isVertexProgramShadowReceiver; // when referencing, are we in context of shadow caster
+ bool isFragmentProgramShadowReceiver; // when referencing, are we in context of shadow caster
+ bool allowOverride; // if true then allow existing materials and gpu programs to be overriden
+ GpuProgramParametersSharedPtr programParams;
+ ushort numAnimationParametrics;
+ MaterialScriptProgramDefinition* programDef; // this is used while defining a program
+
+ int techLev, //Keep track of what tech, pass, and state level we are in
+ passLev,
+ stateLev;
+ // container of token que positions for default params that require pass 2 processing
+ std::vector pendingDefaultParams;
+
+ AliasTextureNamePairList textureAliases;
+ };
+
+ MaterialScriptContext mScriptContext;
+
+ typedef void (MaterialScriptCompiler::* MSC_Action)(void);
+ typedef std::map TokenActionMap;
+ typedef TokenActionMap::iterator TokenActionIterator;
+ /** Map of Token value as key to an Action. An Action converts tokens into
+ the final format.
+ All instances use the same Token Action Map.
+ */
+ static TokenActionMap mTokenActionMap;
+
+ /** Execute an Action associated with a token. Gets called when the compiler finishes tokenizing a
+ section of the source that has been parsed.
+ **/
+ virtual void executeTokenAction(const size_t tokenID);
+ /** Get the start position of auto generated token IDs.
+ */
+ virtual size_t getAutoTokenIDStart() const {return ID_AUTOTOKENSTART;}
+
+ /** Associate all the lexemes used in a material script with their corresponding tokens and actions.
+ **/
+ virtual void setupTokenDefinitions(void);
+ void addLexemeTokenAction(const String& lexeme, const size_t token, const MSC_Action action = 0);
+ /** Associate all the lexemes used in a material script with their corresponding actions and have
+ token IDs auto-generated.
+ **/
+ void addLexemeAction(const String& lexeme, const MSC_Action action) {addLexemeTokenAction(lexeme, 0, action);}
+
+ void logParseError(const String& error);
+
+ // support methods that convert tokens
+ ColourValue _parseColourValue(void);
+ CompareFunction convertCompareFunction(void);
+
+ // Token Actions which get called when tokens are created during parsing.
+ void parseOpenBrace(void);
+ void parseCloseBrace(void);
+ // material section Actions
+ void parseMaterial(void);
+ void parseLodDistances(void);
+ void parseReceiveShadows(void);
+ void parseTransparencyCastsShadows(void);
+ void parseSetTextureAlias(void);
+ // Technique related actions
+ void parseTechnique(void);
+ void parseScheme(void);
+ void parseLodIndex(void);
+ // Pass related Actions
+ void parsePass(void);
+ void parseAmbient(void);
+ void parseDiffuse(void);
+ void parseSpecular(void);
+ void parseEmissive(void);
+ void parseSceneBlend(void);
+ SceneBlendFactor convertBlendFactor(void);
+ void parseDepthCheck(void);
+ void parseDepthWrite(void);
+ void parseDepthFunc(void);
+ void parseDepthBias(void);
+ void parseAlphaRejection(void);
+ void parseCullHardware(void);
+ void parseCullSoftware(void);
+ void parseLighting(void);
+ void parseShading(void);
+ void parsePolygonMode(void);
+ void parseFogOverride(void);
+ void parseMaxLights(void);
+ void parseStartLight(void);
+ void parseIteration(void);
+ void parseIterationLightTypes(void);
+ void parseColourWrite(void);
+ void parsePointSize(void);
+ void parsePointSprites(void);
+ void parsePointSizeMin(void);
+ void parsePointSizeMax(void);
+ void parsePointSizeAttenuation(void);
+ // Texture Unit related Actions
+ void parseTextureUnit(void);
+ void parseTextureAlias(void);
+ void parseTexture(void);
+ void parseAnimTexture(void);
+ void parseCubicTexture(void);
+ void parseTexCoord(void);
+ TextureUnitState::TextureAddressingMode convTexAddressMode(void);
+ void parseTexAddressMode(void);
+ void parseTexBorderColour(void);
+ void parseFiltering(void);
+ FilterOptions convertFiltering();
+ void parseMaxAnisotropy(void);
+ void parseMipMapBias(void);
+ void parseColourOp(void);
+ void parseColourOpEx(void);
+ LayerBlendOperationEx convertBlendOpEx(void);
+ LayerBlendSource convertBlendSource(void);
+ void parseColourOpMultipassFallback(void);
+ void parseAlphaOpEx(void);
+ void parseEnvMap(void);
+ void parseScroll(void);
+ void parseScrollAnim(void);
+ void parseRotate(void);
+ void parseRotateAnim(void);
+ void parseScale(void);
+ void parseWaveXform(void);
+ void parseTransform(void);
+ void parseTextureCustomParameter(void);
+ void parseBindingType(void);
+ void parseContentType(void);
+
+ // GPU Program
+ void parseGPUProgram(void);
+ void parseProgramSource(void);
+ void parseProgramSyntax(void);
+ void parseProgramCustomParameter(void);
+ void parseDefaultParams(void);
+ void parseProgramSkeletalAnimation(void);
+ void parseProgramMorphAnimation(void);
+ void parseProgramPoseAnimation(void);
+ void parseProgramVertexTextureFetch(void);
+ void parseVertexProgramRef(void);
+ void parseFragmentProgramRef(void);
+ void parseShadowCasterVertexProgramRef(void);
+ void parseShadowReceiverVertexProgramRef(void);
+ void parseShadowReceiverFragmentProgramRef(void);
+ void parseParamIndexed(void);
+ void parseParamIndexedAuto(void);
+ void parseParamNamed(void);
+ void parseParamNamedAuto(void);
+ void processManualProgramParam(bool isNamed, const String commandName,
+ size_t index = 0, const String& paramName = StringUtil::BLANK);
+ void processAutoProgramParam(bool isNamed, const String commandName,
+ size_t index, const String& paramName = StringUtil::BLANK);
+
+
+ void finishProgramDefinition(void);
+
+ };
+}
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreMaterialSerializer.h b/school/informatik/verkerhssimulation/src/ogre/OgreMaterialSerializer.h
new file mode 100644
index 00000000..9fa963aa
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreMaterialSerializer.h
@@ -0,0 +1,278 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __MaterialSerializer_H__
+#define __MaterialSerializer_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreMaterial.h"
+#include "OgreBlendMode.h"
+#include "OgreTextureUnitState.h"
+#include "OgreGpuProgram.h"
+#include "OgreStringVector.h"
+
+namespace Ogre {
+
+ /** Enum to identify material sections. */
+ enum MaterialScriptSection
+ {
+ MSS_NONE,
+ MSS_MATERIAL,
+ MSS_TECHNIQUE,
+ MSS_PASS,
+ MSS_TEXTUREUNIT,
+ MSS_PROGRAM_REF,
+ MSS_PROGRAM,
+ MSS_DEFAULT_PARAMETERS,
+ MSS_TEXTURESOURCE
+ };
+ /** Struct for holding a program definition which is in progress. */
+ struct MaterialScriptProgramDefinition
+ {
+ String name;
+ GpuProgramType progType;
+ String language;
+ String source;
+ String syntax;
+ bool supportsSkeletalAnimation;
+ bool supportsMorphAnimation;
+ ushort supportsPoseAnimation; // number of simultaneous poses supported
+ bool usesVertexTextureFetch;
+ std::vector > customParameters;
+ };
+ /** Struct for holding the script context while parsing. */
+ struct MaterialScriptContext
+ {
+ MaterialScriptSection section;
+ String groupName;
+ MaterialPtr material;
+ Technique* technique;
+ Pass* pass;
+ TextureUnitState* textureUnit;
+ GpuProgramPtr program; // used when referencing a program, not when defining it
+ bool isProgramShadowCaster; // when referencing, are we in context of shadow caster
+ bool isVertexProgramShadowReceiver; // when referencing, are we in context of shadow caster
+ bool isFragmentProgramShadowReceiver; // when referencing, are we in context of shadow caster
+ GpuProgramParametersSharedPtr programParams;
+ ushort numAnimationParametrics;
+ MaterialScriptProgramDefinition* programDef; // this is used while defining a program
+
+ int techLev, //Keep track of what tech, pass, and state level we are in
+ passLev,
+ stateLev;
+ StringVector defaultParamLines;
+
+ // Error reporting state
+ size_t lineNo;
+ String filename;
+ AliasTextureNamePairList textureAliases;
+ };
+ /// Function def for material attribute parser; return value determines if the next line should be {
+ typedef bool (*ATTRIBUTE_PARSER)(String& params, MaterialScriptContext& context);
+
+ /** Class for serializing Materials to / from a .material script.*/
+ class _OgreExport MaterialSerializer
+ {
+ protected:
+ /// Keyword-mapped attribute parsers.
+ typedef std::map AttribParserList;
+
+ MaterialScriptContext mScriptContext;
+
+ /** internal method for parsing a material
+ @returns true if it expects the next line to be a {
+ */
+ bool parseScriptLine(String& line);
+ /** internal method for finding & invoking an attribute parser. */
+ bool invokeParser(String& line, AttribParserList& parsers);
+ /** Internal method for saving a program definition which has been
+ built up.
+ */
+ void finishProgramDefinition(void);
+ /// Parsers for the root of the material script
+ AttribParserList mRootAttribParsers;
+ /// Parsers for the material section of a script
+ AttribParserList mMaterialAttribParsers;
+ /// Parsers for the technique section of a script
+ AttribParserList mTechniqueAttribParsers;
+ /// Parsers for the pass section of a script
+ AttribParserList mPassAttribParsers;
+ /// Parsers for the texture unit section of a script
+ AttribParserList mTextureUnitAttribParsers;
+ /// Parsers for the program reference section of a script
+ AttribParserList mProgramRefAttribParsers;
+ /// Parsers for the program definition section of a script
+ AttribParserList mProgramAttribParsers;
+ /// Parsers for the program definition section of a script
+ AttribParserList mProgramDefaultParamAttribParsers;
+
+ void writeMaterial(const MaterialPtr& pMat);
+ void writeTechnique(const Technique* pTech);
+ void writePass(const Pass* pPass);
+ void writeVertexProgramRef(const Pass* pPass);
+ void writeShadowCasterVertexProgramRef(const Pass* pPass);
+ void writeShadowReceiverVertexProgramRef(const Pass* pPass);
+ void writeShadowReceiverFragmentProgramRef(const Pass* pPass);
+ void writeFragmentProgramRef(const Pass* pPass);
+ void writeGpuProgramRef(const String& attrib, const GpuProgramPtr& program, const GpuProgramParametersSharedPtr& params);
+ void writeGpuPrograms(void);
+ void writeGPUProgramParameters(const GpuProgramParametersSharedPtr& params, GpuProgramParameters* defaultParams,
+ const int level = 4, const bool useMainBuffer = true);
+ void writeNamedGpuProgramParameters(const GpuProgramParametersSharedPtr& params, GpuProgramParameters* defaultParams,
+ const int level = 4, const bool useMainBuffer = true);
+ void writeLowLevelGpuProgramParameters(const GpuProgramParametersSharedPtr& params, GpuProgramParameters* defaultParams,
+ const int level = 4, const bool useMainBuffer = true);
+ void writeGpuProgramParameter(
+ const String& commandName, const String& identifier,
+ const GpuProgramParameters::AutoConstantEntry* autoEntry,
+ const GpuProgramParameters::AutoConstantEntry* defaultAutoEntry,
+ bool isFloat, size_t physicalIndex, size_t physicalSize,
+ const GpuProgramParametersSharedPtr& params, GpuProgramParameters* defaultParams,
+ const int level, const bool useMainBuffer);
+ void writeTextureUnit(const TextureUnitState *pTex);
+ void writeSceneBlendFactor(const SceneBlendFactor sbf_src, const SceneBlendFactor sbf_dest);
+ void writeSceneBlendFactor(const SceneBlendFactor sbf);
+ void writeCompareFunction(const CompareFunction cf);
+ void writeColourValue(const ColourValue &colour, bool writeAlpha = false);
+ void writeLayerBlendOperationEx(const LayerBlendOperationEx op);
+ void writeLayerBlendSource(const LayerBlendSource lbs);
+
+ typedef std::multimap EffectMap;
+
+ void writeRotationEffect(const TextureUnitState::TextureEffect& effect, const TextureUnitState *pTex);
+ void writeTransformEffect(const TextureUnitState::TextureEffect& effect, const TextureUnitState *pTex);
+ void writeScrollEffect(const TextureUnitState::TextureEffect& effect, const TextureUnitState *pTex);
+ void writeEnvironmentMapEffect(const TextureUnitState::TextureEffect& effect, const TextureUnitState *pTex);
+
+ String convertFiltering(FilterOptions fo);
+ public:
+ /** default constructor*/
+ MaterialSerializer();
+ /** default destructor*/
+ virtual ~MaterialSerializer() {};
+
+ /** Queue an in-memory Material to the internal buffer for export.
+ @param pMat Material pointer
+ @param clearQueued If true, any materials already queued will be removed
+ @param exportDefaults If true, attributes which are defaulted will be
+ included in the script exported, otherwise they will be omitted
+ */
+ void queueForExport(const MaterialPtr& pMat, bool clearQueued = false,
+ bool exportDefaults = false);
+ /** Exports queued material(s) to a named material script file.
+ @param filename the file name of the material script to be exported
+ @param includeProgDef If true, vertex program and fragment program
+ definitions will be written at the top of the material script
+ @param programFilename the file name of the vertex / fragment program
+ script to be exported. This is only used if there are program definitions
+ to be exported and includeProgDef is false
+ when calling queueForExport.
+ */
+ void exportQueued(const String& filename, const bool includeProgDef = false, const String& programFilename = "");
+ /** Exports a single in-memory Material to the named material script file.
+ @param exportDefaults if true then exports all values including defaults
+ @param includeProgDef if true includes Gpu shader program definitions in the
+ export material script otherwise if false then program definitions will
+ be exported to a seperate file with name programFilename if
+ programFilename is not empty
+ @param programFilename the file name of the vertex / fragment program
+ script to be exported. This is only used if includeProgDef is false.
+ */
+ void exportMaterial(const MaterialPtr& pMat, const String& filename, bool exportDefaults = false,
+ const bool includeProgDef = false, const String& programFilename = "");
+ /** Returns a string representing the parsed material(s) */
+ const String &getQueuedAsString() const;
+ /** Clears the internal buffer */
+ void clearQueue();
+
+ /** Parses a Material script file passed as a stream.
+ */
+ void parseScript(DataStreamPtr& stream, const String& groupName);
+
+
+
+ private:
+ String mBuffer;
+ String mGpuProgramBuffer;
+ typedef std::set GpuProgramDefinitionContainer;
+ typedef GpuProgramDefinitionContainer::iterator GpuProgramDefIterator;
+ GpuProgramDefinitionContainer mGpuProgramDefinitionContainer;
+ bool mDefaults;
+
+ void beginSection(unsigned short level, const bool useMainBuffer = true)
+ {
+ String& buffer = (useMainBuffer ? mBuffer : mGpuProgramBuffer);
+ buffer += "\n";
+ for (unsigned short i = 0; i < level; ++i)
+ {
+ buffer += "\t";
+ }
+ buffer += "{";
+ }
+ void endSection(unsigned short level, const bool useMainBuffer = true)
+ {
+ String& buffer = (useMainBuffer ? mBuffer : mGpuProgramBuffer);
+ buffer += "\n";
+ for (unsigned short i = 0; i < level; ++i)
+ {
+ buffer += "\t";
+ }
+ buffer += "}";
+ }
+
+ void writeAttribute(unsigned short level, const String& att, const bool useMainBuffer = true)
+ {
+ String& buffer = (useMainBuffer ? mBuffer : mGpuProgramBuffer);
+ buffer += "\n";
+ for (unsigned short i = 0; i < level; ++i)
+ {
+ buffer += "\t";
+ }
+ buffer += att;
+ }
+
+ void writeValue(const String& val, const bool useMainBuffer = true)
+ {
+ String& buffer = (useMainBuffer ? mBuffer : mGpuProgramBuffer);
+ buffer += (" " + val);
+ }
+
+ void writeComment(unsigned short level, const String& comment, const bool useMainBuffer = true)
+ {
+ String& buffer = (useMainBuffer ? mBuffer : mGpuProgramBuffer);
+ buffer += "\n";
+ for (unsigned short i = 0; i < level; ++i)
+ {
+ buffer += "\t";
+ }
+ buffer += "// " + comment;
+ }
+
+ };
+}
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreMath.h b/school/informatik/verkerhssimulation/src/ogre/OgreMath.h
new file mode 100644
index 00000000..ff9ee34f
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreMath.h
@@ -0,0 +1,606 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Math_H__
+#define __Math_H__
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre
+{
+ /** Wrapper class which indicates a given angle value is in Radians.
+ @remarks
+ Radian values are interchangeable with Degree values, and conversions
+ will be done automatically between them.
+ */
+ class Radian
+ {
+ Real mRad;
+
+ public:
+ explicit Radian ( Real r=0 ) : mRad(r) {}
+ Radian ( const Degree& d );
+ Radian& operator = ( const Real& f ) { mRad = f; return *this; }
+ Radian& operator = ( const Radian& r ) { mRad = r.mRad; return *this; }
+ Radian& operator = ( const Degree& d );
+
+ Real valueDegrees() const; // see bottom of this file
+ Real valueRadians() const { return mRad; }
+ Real valueAngleUnits() const;
+
+ const Radian& operator + () const { return *this; }
+ Radian operator + ( const Radian& r ) const { return Radian ( mRad + r.mRad ); }
+ Radian operator + ( const Degree& d ) const;
+ Radian& operator += ( const Radian& r ) { mRad += r.mRad; return *this; }
+ Radian& operator += ( const Degree& d );
+ Radian operator - () const { return Radian(-mRad); }
+ Radian operator - ( const Radian& r ) const { return Radian ( mRad - r.mRad ); }
+ Radian operator - ( const Degree& d ) const;
+ Radian& operator -= ( const Radian& r ) { mRad -= r.mRad; return *this; }
+ Radian& operator -= ( const Degree& d );
+ Radian operator * ( Real f ) const { return Radian ( mRad * f ); }
+ Radian operator * ( const Radian& f ) const { return Radian ( mRad * f.mRad ); }
+ Radian& operator *= ( Real f ) { mRad *= f; return *this; }
+ Radian operator / ( Real f ) const { return Radian ( mRad / f ); }
+ Radian& operator /= ( Real f ) { mRad /= f; return *this; }
+
+ bool operator < ( const Radian& r ) const { return mRad < r.mRad; }
+ bool operator <= ( const Radian& r ) const { return mRad <= r.mRad; }
+ bool operator == ( const Radian& r ) const { return mRad == r.mRad; }
+ bool operator != ( const Radian& r ) const { return mRad != r.mRad; }
+ bool operator >= ( const Radian& r ) const { return mRad >= r.mRad; }
+ bool operator > ( const Radian& r ) const { return mRad > r.mRad; }
+ };
+
+ /** Wrapper class which indicates a given angle value is in Degrees.
+ @remarks
+ Degree values are interchangeable with Radian values, and conversions
+ will be done automatically between them.
+ */
+ class Degree
+ {
+ Real mDeg; // if you get an error here - make sure to define/typedef 'Real' first
+
+ public:
+ explicit Degree ( Real d=0 ) : mDeg(d) {}
+ Degree ( const Radian& r ) : mDeg(r.valueDegrees()) {}
+ Degree& operator = ( const Real& f ) { mDeg = f; return *this; }
+ Degree& operator = ( const Degree& d ) { mDeg = d.mDeg; return *this; }
+ Degree& operator = ( const Radian& r ) { mDeg = r.valueDegrees(); return *this; }
+
+ Real valueDegrees() const { return mDeg; }
+ Real valueRadians() const; // see bottom of this file
+ Real valueAngleUnits() const;
+
+ const Degree& operator + () const { return *this; }
+ Degree operator + ( const Degree& d ) const { return Degree ( mDeg + d.mDeg ); }
+ Degree operator + ( const Radian& r ) const { return Degree ( mDeg + r.valueDegrees() ); }
+ Degree& operator += ( const Degree& d ) { mDeg += d.mDeg; return *this; }
+ Degree& operator += ( const Radian& r ) { mDeg += r.valueDegrees(); return *this; }
+ Degree operator - () const { return Degree(-mDeg); }
+ Degree operator - ( const Degree& d ) const { return Degree ( mDeg - d.mDeg ); }
+ Degree operator - ( const Radian& r ) const { return Degree ( mDeg - r.valueDegrees() ); }
+ Degree& operator -= ( const Degree& d ) { mDeg -= d.mDeg; return *this; }
+ Degree& operator -= ( const Radian& r ) { mDeg -= r.valueDegrees(); return *this; }
+ Degree operator * ( Real f ) const { return Degree ( mDeg * f ); }
+ Degree operator * ( const Degree& f ) const { return Degree ( mDeg * f.mDeg ); }
+ Degree& operator *= ( Real f ) { mDeg *= f; return *this; }
+ Degree operator / ( Real f ) const { return Degree ( mDeg / f ); }
+ Degree& operator /= ( Real f ) { mDeg /= f; return *this; }
+
+ bool operator < ( const Degree& d ) const { return mDeg < d.mDeg; }
+ bool operator <= ( const Degree& d ) const { return mDeg <= d.mDeg; }
+ bool operator == ( const Degree& d ) const { return mDeg == d.mDeg; }
+ bool operator != ( const Degree& d ) const { return mDeg != d.mDeg; }
+ bool operator >= ( const Degree& d ) const { return mDeg >= d.mDeg; }
+ bool operator > ( const Degree& d ) const { return mDeg > d.mDeg; }
+ };
+
+ /** Wrapper class which identifies a value as the currently default angle
+ type, as defined by Math::setAngleUnit.
+ @remarks
+ Angle values will be automatically converted between radians and degrees,
+ as appropriate.
+ */
+ class Angle
+ {
+ Real mAngle;
+ public:
+ explicit Angle ( Real angle ) : mAngle(angle) {}
+ operator Radian() const;
+ operator Degree() const;
+ };
+
+ // these functions could not be defined within the class definition of class
+ // Radian because they required class Degree to be defined
+ inline Radian::Radian ( const Degree& d ) : mRad(d.valueRadians()) {
+ }
+ inline Radian& Radian::operator = ( const Degree& d ) {
+ mRad = d.valueRadians(); return *this;
+ }
+ inline Radian Radian::operator + ( const Degree& d ) const {
+ return Radian ( mRad + d.valueRadians() );
+ }
+ inline Radian& Radian::operator += ( const Degree& d ) {
+ mRad += d.valueRadians();
+ return *this;
+ }
+ inline Radian Radian::operator - ( const Degree& d ) const {
+ return Radian ( mRad - d.valueRadians() );
+ }
+ inline Radian& Radian::operator -= ( const Degree& d ) {
+ mRad -= d.valueRadians();
+ return *this;
+ }
+
+ /** Class to provide access to common mathematical functions.
+ @remarks
+ Most of the maths functions are aliased versions of the C runtime
+ library functions. They are aliased here to provide future
+ optimisation opportunities, either from faster RTLs or custom
+ math approximations.
+ @note
+
This is based on MgcMath.h from
+ Wild Magic.
+ */
+ class _OgreExport Math
+ {
+ public:
+ /** The angular units used by the API. This functionality is now deprecated in favor
+ of discreet angular unit types ( see Degree and Radian above ). The only place
+ this functionality is actually still used is when parsing files. Search for
+ usage of the Angle class for those instances
+ */
+ enum AngleUnit
+ {
+ AU_DEGREE,
+ AU_RADIAN
+ };
+
+ protected:
+ // angle units used by the api
+ static AngleUnit msAngleUnit;
+
+ /// Size of the trig tables as determined by constructor.
+ static int mTrigTableSize;
+
+ /// Radian -> index factor value ( mTrigTableSize / 2 * PI )
+ static Real mTrigTableFactor;
+ static Real* mSinTable;
+ static Real* mTanTable;
+
+ /** Private function to build trig tables.
+ */
+ void buildTrigTables();
+
+ static Real SinTable (Real fValue);
+ static Real TanTable (Real fValue);
+ public:
+ /** Default constructor.
+ @param
+ trigTableSize Optional parameter to set the size of the
+ tables used to implement Sin, Cos, Tan
+ */
+ Math(unsigned int trigTableSize = 4096);
+
+ /** Default destructor.
+ */
+ ~Math();
+
+ static inline int IAbs (int iValue) { return ( iValue >= 0 ? iValue : -iValue ); }
+ static inline int ICeil (float fValue) { return int(ceil(fValue)); }
+ static inline int IFloor (float fValue) { return int(floor(fValue)); }
+ static int ISign (int iValue);
+
+ static inline Real Abs (Real fValue) { return Real(fabs(fValue)); }
+ static inline Degree Abs (const Degree& dValue) { return Degree(fabs(dValue.valueDegrees())); }
+ static inline Radian Abs (const Radian& rValue) { return Radian(fabs(rValue.valueRadians())); }
+ static Radian ACos (Real fValue);
+ static Radian ASin (Real fValue);
+ static inline Radian ATan (Real fValue) { return Radian(atan(fValue)); }
+ static inline Radian ATan2 (Real fY, Real fX) { return Radian(atan2(fY,fX)); }
+ static inline Real Ceil (Real fValue) { return Real(ceil(fValue)); }
+
+ /** Cosine function.
+ @param
+ fValue Angle in radians
+ @param
+ useTables If true, uses lookup tables rather than
+ calculation - faster but less accurate.
+ */
+ static inline Real Cos (const Radian& fValue, bool useTables = false) {
+ return (!useTables) ? Real(cos(fValue.valueRadians())) : SinTable(fValue.valueRadians() + HALF_PI);
+ }
+ /** Cosine function.
+ @param
+ fValue Angle in radians
+ @param
+ useTables If true, uses lookup tables rather than
+ calculation - faster but less accurate.
+ */
+ static inline Real Cos (Real fValue, bool useTables = false) {
+ return (!useTables) ? Real(cos(fValue)) : SinTable(fValue + HALF_PI);
+ }
+
+ static inline Real Exp (Real fValue) { return Real(exp(fValue)); }
+
+ static inline Real Floor (Real fValue) { return Real(floor(fValue)); }
+
+ static inline Real Log (Real fValue) { return Real(log(fValue)); }
+
+ static inline Real Pow (Real fBase, Real fExponent) { return Real(pow(fBase,fExponent)); }
+
+ static Real Sign (Real fValue);
+ static inline Radian Sign ( const Radian& rValue )
+ {
+ return Radian(Sign(rValue.valueRadians()));
+ }
+ static inline Degree Sign ( const Degree& dValue )
+ {
+ return Degree(Sign(dValue.valueDegrees()));
+ }
+
+ /** Sine function.
+ @param
+ fValue Angle in radians
+ @param
+ useTables If true, uses lookup tables rather than
+ calculation - faster but less accurate.
+ */
+ static inline Real Sin (const Radian& fValue, bool useTables = false) {
+ return (!useTables) ? Real(sin(fValue.valueRadians())) : SinTable(fValue.valueRadians());
+ }
+ /** Sine function.
+ @param
+ fValue Angle in radians
+ @param
+ useTables If true, uses lookup tables rather than
+ calculation - faster but less accurate.
+ */
+ static inline Real Sin (Real fValue, bool useTables = false) {
+ return (!useTables) ? Real(sin(fValue)) : SinTable(fValue);
+ }
+
+ static inline Real Sqr (Real fValue) { return fValue*fValue; }
+
+ static inline Real Sqrt (Real fValue) { return Real(sqrt(fValue)); }
+
+ static inline Radian Sqrt (const Radian& fValue) { return Radian(sqrt(fValue.valueRadians())); }
+
+ static inline Degree Sqrt (const Degree& fValue) { return Degree(sqrt(fValue.valueDegrees())); }
+
+ /** Inverse square root i.e. 1 / Sqrt(x), good for vector
+ normalisation.
+ */
+ static Real InvSqrt(Real fValue);
+
+ static Real UnitRandom (); // in [0,1]
+
+ static Real RangeRandom (Real fLow, Real fHigh); // in [fLow,fHigh]
+
+ static Real SymmetricRandom (); // in [-1,1]
+
+ /** Tangent function.
+ @param
+ fValue Angle in radians
+ @param
+ useTables If true, uses lookup tables rather than
+ calculation - faster but less accurate.
+ */
+ static inline Real Tan (const Radian& fValue, bool useTables = false) {
+ return (!useTables) ? Real(tan(fValue.valueRadians())) : TanTable(fValue.valueRadians());
+ }
+ /** Tangent function.
+ @param
+ fValue Angle in radians
+ @param
+ useTables If true, uses lookup tables rather than
+ calculation - faster but less accurate.
+ */
+ static inline Real Tan (Real fValue, bool useTables = false) {
+ return (!useTables) ? Real(tan(fValue)) : TanTable(fValue);
+ }
+
+ static inline Real DegreesToRadians(Real degrees) { return degrees * fDeg2Rad; }
+ static inline Real RadiansToDegrees(Real radians) { return radians * fRad2Deg; }
+
+ /** These functions used to set the assumed angle units (radians or degrees)
+ expected when using the Angle type.
+ @par
+ You can set this directly after creating a new Root, and also before/after resource creation,
+ depending on whether you want the change to affect resource files.
+ */
+ static void setAngleUnit(AngleUnit unit);
+ /** Get the unit being used for angles. */
+ static AngleUnit getAngleUnit(void);
+
+ /** Convert from the current AngleUnit to radians. */
+ static Real AngleUnitsToRadians(Real units);
+ /** Convert from radians to the current AngleUnit . */
+ static Real RadiansToAngleUnits(Real radians);
+ /** Convert from the current AngleUnit to degrees. */
+ static Real AngleUnitsToDegrees(Real units);
+ /** Convert from degrees to the current AngleUnit. */
+ static Real DegreesToAngleUnits(Real degrees);
+
+ /** Checks whether a given point is inside a triangle, in a
+ 2-dimensional (Cartesian) space.
+ @remarks
+ The vertices of the triangle must be given in either
+ trigonometrical (anticlockwise) or inverse trigonometrical
+ (clockwise) order.
+ @param
+ p The point.
+ @param
+ a The triangle's first vertex.
+ @param
+ b The triangle's second vertex.
+ @param
+ c The triangle's third vertex.
+ @returns
+ If the point resides in the triangle, true is
+ returned.
+ @par
+ If the point is outside the triangle, false is
+ returned.
+ */
+ static bool pointInTri2D(const Vector2& p, const Vector2& a,
+ const Vector2& b, const Vector2& c);
+
+ /** Checks whether a given 3D point is inside a triangle.
+ @remarks
+ The vertices of the triangle must be given in either
+ trigonometrical (anticlockwise) or inverse trigonometrical
+ (clockwise) order, and the point must be guaranteed to be in the
+ same plane as the triangle
+ @param
+ p The point.
+ @param
+ a The triangle's first vertex.
+ @param
+ b The triangle's second vertex.
+ @param
+ c The triangle's third vertex.
+ @param
+ normal The triangle plane's normal (passed in rather than calculated
+ on demand since the callermay already have it)
+ @returns
+ If the point resides in the triangle, true is
+ returned.
+ @par
+ If the point is outside the triangle, false is
+ returned.
+ */
+ static bool pointInTri3D(const Vector3& p, const Vector3& a,
+ const Vector3& b, const Vector3& c, const Vector3& normal);
+ /** Ray / plane intersection, returns boolean result and distance. */
+ static std::pair intersects(const Ray& ray, const Plane& plane);
+
+ /** Ray / sphere intersection, returns boolean result and distance. */
+ static std::pair intersects(const Ray& ray, const Sphere& sphere,
+ bool discardInside = true);
+
+ /** Ray / box intersection, returns boolean result and distance. */
+ static std::pair intersects(const Ray& ray, const AxisAlignedBox& box);
+
+ /** Ray / box intersection, returns boolean result and two intersection distance.
+ @param
+ ray The ray.
+ @param
+ box The box.
+ @param
+ d1 A real pointer to retrieve the near intersection distance
+ from the ray origin, maybe null which means don't care
+ about the near intersection distance.
+ @param
+ d2 A real pointer to retrieve the far intersection distance
+ from the ray origin, maybe null which means don't care
+ about the far intersection distance.
+ @returns
+ If the ray is intersects the box, true is returned, and
+ the near intersection distance is return by d1, the
+ far intersection distance is return by d2. Guarantee
+ 0 <= d1 <= d2.
+ @par
+ If the ray isn't intersects the box, false is returned, and
+ d1 and d2 is unmodified.
+ */
+ static bool intersects(const Ray& ray, const AxisAlignedBox& box,
+ Real* d1, Real* d2);
+
+ /** Ray / triangle intersection, returns boolean result and distance.
+ @param
+ ray The ray.
+ @param
+ a The triangle's first vertex.
+ @param
+ b The triangle's second vertex.
+ @param
+ c The triangle's third vertex.
+ @param
+ normal The triangle plane's normal (passed in rather than calculated
+ on demand since the callermay already have it), doesn't need
+ normalised since we don't care.
+ @param
+ positiveSide Intersect with "positive side" of the triangle
+ @param
+ negativeSide Intersect with "negative side" of the triangle
+ @returns
+ If the ray is intersects the triangle, a pair of true and the
+ distance between intersection point and ray origin returned.
+ @par
+ If the ray isn't intersects the triangle, a pair of false and
+ 0 returned.
+ */
+ static std::pair intersects(const Ray& ray, const Vector3& a,
+ const Vector3& b, const Vector3& c, const Vector3& normal,
+ bool positiveSide = true, bool negativeSide = true);
+
+ /** Ray / triangle intersection, returns boolean result and distance.
+ @param
+ ray The ray.
+ @param
+ a The triangle's first vertex.
+ @param
+ b The triangle's second vertex.
+ @param
+ c The triangle's third vertex.
+ @param
+ positiveSide Intersect with "positive side" of the triangle
+ @param
+ negativeSide Intersect with "negative side" of the triangle
+ @returns
+ If the ray is intersects the triangle, a pair of true and the
+ distance between intersection point and ray origin returned.
+ @par
+ If the ray isn't intersects the triangle, a pair of false and
+ 0 returned.
+ */
+ static std::pair intersects(const Ray& ray, const Vector3& a,
+ const Vector3& b, const Vector3& c,
+ bool positiveSide = true, bool negativeSide = true);
+
+ /** Sphere / box intersection test. */
+ static bool intersects(const Sphere& sphere, const AxisAlignedBox& box);
+
+ /** Plane / box intersection test. */
+ static bool intersects(const Plane& plane, const AxisAlignedBox& box);
+
+ /** Ray / convex plane list intersection test.
+ @param ray The ray to test with
+ @param plaeList List of planes which form a convex volume
+ @param normalIsOutside Does the normal point outside the volume
+ */
+ static std::pair intersects(
+ const Ray& ray, const std::vector& planeList,
+ bool normalIsOutside);
+ /** Ray / convex plane list intersection test.
+ @param ray The ray to test with
+ @param plaeList List of planes which form a convex volume
+ @param normalIsOutside Does the normal point outside the volume
+ */
+ static std::pair intersects(
+ const Ray& ray, const std::list& planeList,
+ bool normalIsOutside);
+
+ /** Sphere / plane intersection test.
+ @remarks NB just do a plane.getDistance(sphere.getCenter()) for more detail!
+ */
+ static bool intersects(const Sphere& sphere, const Plane& plane);
+
+ /** Compare 2 reals, using tolerance for inaccuracies.
+ */
+ static bool RealEqual(Real a, Real b,
+ Real tolerance = std::numeric_limits::epsilon());
+
+ /** Calculates the tangent space vector for a given set of positions / texture coords. */
+ static Vector3 calculateTangentSpaceVector(
+ const Vector3& position1, const Vector3& position2, const Vector3& position3,
+ Real u1, Real v1, Real u2, Real v2, Real u3, Real v3);
+
+ /** Build a reflection matrix for the passed in plane. */
+ static Matrix4 buildReflectionMatrix(const Plane& p);
+ /** Calculate a face normal, including the w component which is the offset from the origin. */
+ static Vector4 calculateFaceNormal(const Vector3& v1, const Vector3& v2, const Vector3& v3);
+ /** Calculate a face normal, no w-information. */
+ static Vector3 calculateBasicFaceNormal(const Vector3& v1, const Vector3& v2, const Vector3& v3);
+ /** Calculate a face normal without normalize, including the w component which is the offset from the origin. */
+ static Vector4 calculateFaceNormalWithoutNormalize(const Vector3& v1, const Vector3& v2, const Vector3& v3);
+ /** Calculate a face normal without normalize, no w-information. */
+ static Vector3 calculateBasicFaceNormalWithoutNormalize(const Vector3& v1, const Vector3& v2, const Vector3& v3);
+
+ /** Generates a value based on the gaussian (normal) distribution function
+ with the given offset and scale parameters.
+ */
+ static Real gaussianDistribution(Real x, Real offset = 0.0f, Real scale = 1.0f);
+
+ static const Real POS_INFINITY;
+ static const Real NEG_INFINITY;
+ static const Real PI;
+ static const Real TWO_PI;
+ static const Real HALF_PI;
+ static const Real fDeg2Rad;
+ static const Real fRad2Deg;
+
+ };
+
+ // these functions must be defined down here, because they rely on the
+ // angle unit conversion functions in class Math:
+
+ inline Real Radian::valueDegrees() const
+ {
+ return Math::RadiansToDegrees ( mRad );
+ }
+
+ inline Real Radian::valueAngleUnits() const
+ {
+ return Math::RadiansToAngleUnits ( mRad );
+ }
+
+ inline Real Degree::valueRadians() const
+ {
+ return Math::DegreesToRadians ( mDeg );
+ }
+
+ inline Real Degree::valueAngleUnits() const
+ {
+ return Math::DegreesToAngleUnits ( mDeg );
+ }
+
+ inline Angle::operator Radian() const
+ {
+ return Radian(Math::AngleUnitsToRadians(mAngle));
+ }
+
+ inline Angle::operator Degree() const
+ {
+ return Degree(Math::AngleUnitsToDegrees(mAngle));
+ }
+
+ inline Radian operator * ( Real a, const Radian& b )
+ {
+ return Radian ( a * b.valueRadians() );
+ }
+
+ inline Radian operator / ( Real a, const Radian& b )
+ {
+ return Radian ( a / b.valueRadians() );
+ }
+
+ inline Degree operator * ( Real a, const Degree& b )
+ {
+ return Degree ( a * b.valueDegrees() );
+ }
+
+ inline Degree operator / ( Real a, const Degree& b )
+ {
+ return Degree ( a / b.valueDegrees() );
+ }
+
+}
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreMatrix3.h b/school/informatik/verkerhssimulation/src/ogre/OgreMatrix3.h
new file mode 100644
index 00000000..5786a644
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreMatrix3.h
@@ -0,0 +1,306 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Matrix3_H__
+#define __Matrix3_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreVector3.h"
+
+// NB All code adapted from Wild Magic 0.2 Matrix math (free source code)
+// http://www.geometrictools.com/
+
+// NOTE. The (x,y,z) coordinate system is assumed to be right-handed.
+// Coordinate axis rotation matrices are of the form
+// RX = 1 0 0
+// 0 cos(t) -sin(t)
+// 0 sin(t) cos(t)
+// where t > 0 indicates a counterclockwise rotation in the yz-plane
+// RY = cos(t) 0 sin(t)
+// 0 1 0
+// -sin(t) 0 cos(t)
+// where t > 0 indicates a counterclockwise rotation in the zx-plane
+// RZ = cos(t) -sin(t) 0
+// sin(t) cos(t) 0
+// 0 0 1
+// where t > 0 indicates a counterclockwise rotation in the xy-plane.
+
+namespace Ogre
+{
+ /** A 3x3 matrix which can represent rotations around axes.
+ @note
+ All the code is adapted from the Wild Magic 0.2 Matrix
+ library (http://www.geometrictools.com/).
+ @par
+ The coordinate system is assumed to be right-handed.
+ */
+ class _OgreExport Matrix3
+ {
+ public:
+ /** Default constructor.
+ @note
+ It does NOT initialize the matrix for efficiency.
+ */
+ inline Matrix3 () {};
+ inline explicit Matrix3 (const Real arr[3][3])
+ {
+ memcpy(m,arr,9*sizeof(Real));
+ }
+ inline Matrix3 (const Matrix3& rkMatrix)
+ {
+ memcpy(m,rkMatrix.m,9*sizeof(Real));
+ }
+ Matrix3 (Real fEntry00, Real fEntry01, Real fEntry02,
+ Real fEntry10, Real fEntry11, Real fEntry12,
+ Real fEntry20, Real fEntry21, Real fEntry22)
+ {
+ m[0][0] = fEntry00;
+ m[0][1] = fEntry01;
+ m[0][2] = fEntry02;
+ m[1][0] = fEntry10;
+ m[1][1] = fEntry11;
+ m[1][2] = fEntry12;
+ m[2][0] = fEntry20;
+ m[2][1] = fEntry21;
+ m[2][2] = fEntry22;
+ }
+
+ // member access, allows use of construct mat[r][c]
+ inline Real* operator[] (size_t iRow) const
+ {
+ return (Real*)m[iRow];
+ }
+ /*inline operator Real* ()
+ {
+ return (Real*)m[0];
+ }*/
+ Vector3 GetColumn (size_t iCol) const;
+ void SetColumn(size_t iCol, const Vector3& vec);
+ void FromAxes(const Vector3& xAxis, const Vector3& yAxis, const Vector3& zAxis);
+
+ // assignment and comparison
+ inline Matrix3& operator= (const Matrix3& rkMatrix)
+ {
+ memcpy(m,rkMatrix.m,9*sizeof(Real));
+ return *this;
+ }
+ bool operator== (const Matrix3& rkMatrix) const;
+ inline bool operator!= (const Matrix3& rkMatrix) const
+ {
+ return !operator==(rkMatrix);
+ }
+
+ // arithmetic operations
+ Matrix3 operator+ (const Matrix3& rkMatrix) const;
+ Matrix3 operator- (const Matrix3& rkMatrix) const;
+ Matrix3 operator* (const Matrix3& rkMatrix) const;
+ Matrix3 operator- () const;
+
+ // matrix * vector [3x3 * 3x1 = 3x1]
+ Vector3 operator* (const Vector3& rkVector) const;
+
+ // vector * matrix [1x3 * 3x3 = 1x3]
+ _OgreExport friend Vector3 operator* (const Vector3& rkVector,
+ const Matrix3& rkMatrix);
+
+ // matrix * scalar
+ Matrix3 operator* (Real fScalar) const;
+
+ // scalar * matrix
+ _OgreExport friend Matrix3 operator* (Real fScalar, const Matrix3& rkMatrix);
+
+ // utilities
+ Matrix3 Transpose () const;
+ bool Inverse (Matrix3& rkInverse, Real fTolerance = 1e-06) const;
+ Matrix3 Inverse (Real fTolerance = 1e-06) const;
+ Real Determinant () const;
+
+ // singular value decomposition
+ void SingularValueDecomposition (Matrix3& rkL, Vector3& rkS,
+ Matrix3& rkR) const;
+ void SingularValueComposition (const Matrix3& rkL,
+ const Vector3& rkS, const Matrix3& rkR);
+
+ // Gram-Schmidt orthonormalization (applied to columns of rotation matrix)
+ void Orthonormalize ();
+
+ // orthogonal Q, diagonal D, upper triangular U stored as (u01,u02,u12)
+ void QDUDecomposition (Matrix3& rkQ, Vector3& rkD,
+ Vector3& rkU) const;
+
+ Real SpectralNorm () const;
+
+ // matrix must be orthonormal
+ void ToAxisAngle (Vector3& rkAxis, Radian& rfAngle) const;
+ inline void ToAxisAngle (Vector3& rkAxis, Degree& rfAngle) const {
+ Radian r;
+ ToAxisAngle ( rkAxis, r );
+ rfAngle = r;
+ }
+ void FromAxisAngle (const Vector3& rkAxis, const Radian& fRadians);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+ inline void ToAxisAngle (Vector3& rkAxis, Real& rfRadians) const {
+ Radian r;
+ ToAxisAngle ( rkAxis, r );
+ rfRadians = r.valueRadians();
+ }
+ inline void FromAxisAngle (const Vector3& rkAxis, Real fRadians) {
+ FromAxisAngle ( rkAxis, Radian(fRadians) );
+ }
+#endif//OGRE_FORCE_ANGLE_TYPES
+
+ // The matrix must be orthonormal. The decomposition is yaw*pitch*roll
+ // where yaw is rotation about the Up vector, pitch is rotation about the
+ // Right axis, and roll is rotation about the Direction axis.
+ bool ToEulerAnglesXYZ (Radian& rfYAngle, Radian& rfPAngle,
+ Radian& rfRAngle) const;
+ bool ToEulerAnglesXZY (Radian& rfYAngle, Radian& rfPAngle,
+ Radian& rfRAngle) const;
+ bool ToEulerAnglesYXZ (Radian& rfYAngle, Radian& rfPAngle,
+ Radian& rfRAngle) const;
+ bool ToEulerAnglesYZX (Radian& rfYAngle, Radian& rfPAngle,
+ Radian& rfRAngle) const;
+ bool ToEulerAnglesZXY (Radian& rfYAngle, Radian& rfPAngle,
+ Radian& rfRAngle) const;
+ bool ToEulerAnglesZYX (Radian& rfYAngle, Radian& rfPAngle,
+ Radian& rfRAngle) const;
+ void FromEulerAnglesXYZ (const Radian& fYAngle, const Radian& fPAngle, const Radian& fRAngle);
+ void FromEulerAnglesXZY (const Radian& fYAngle, const Radian& fPAngle, const Radian& fRAngle);
+ void FromEulerAnglesYXZ (const Radian& fYAngle, const Radian& fPAngle, const Radian& fRAngle);
+ void FromEulerAnglesYZX (const Radian& fYAngle, const Radian& fPAngle, const Radian& fRAngle);
+ void FromEulerAnglesZXY (const Radian& fYAngle, const Radian& fPAngle, const Radian& fRAngle);
+ void FromEulerAnglesZYX (const Radian& fYAngle, const Radian& fPAngle, const Radian& fRAngle);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+ inline bool ToEulerAnglesXYZ (float& rfYAngle, float& rfPAngle,
+ float& rfRAngle) const {
+ Radian y, p, r;
+ bool b = ToEulerAnglesXYZ(y,p,r);
+ rfYAngle = y.valueRadians();
+ rfPAngle = p.valueRadians();
+ rfRAngle = r.valueRadians();
+ return b;
+ }
+ inline bool ToEulerAnglesXZY (float& rfYAngle, float& rfPAngle,
+ float& rfRAngle) const {
+ Radian y, p, r;
+ bool b = ToEulerAnglesXZY(y,p,r);
+ rfYAngle = y.valueRadians();
+ rfPAngle = p.valueRadians();
+ rfRAngle = r.valueRadians();
+ return b;
+ }
+ inline bool ToEulerAnglesYXZ (float& rfYAngle, float& rfPAngle,
+ float& rfRAngle) const {
+ Radian y, p, r;
+ bool b = ToEulerAnglesYXZ(y,p,r);
+ rfYAngle = y.valueRadians();
+ rfPAngle = p.valueRadians();
+ rfRAngle = r.valueRadians();
+ return b;
+ }
+ inline bool ToEulerAnglesYZX (float& rfYAngle, float& rfPAngle,
+ float& rfRAngle) const {
+ Radian y, p, r;
+ bool b = ToEulerAnglesYZX(y,p,r);
+ rfYAngle = y.valueRadians();
+ rfPAngle = p.valueRadians();
+ rfRAngle = r.valueRadians();
+ return b;
+ }
+ inline bool ToEulerAnglesZXY (float& rfYAngle, float& rfPAngle,
+ float& rfRAngle) const {
+ Radian y, p, r;
+ bool b = ToEulerAnglesZXY(y,p,r);
+ rfYAngle = y.valueRadians();
+ rfPAngle = p.valueRadians();
+ rfRAngle = r.valueRadians();
+ return b;
+ }
+ inline bool ToEulerAnglesZYX (float& rfYAngle, float& rfPAngle,
+ float& rfRAngle) const {
+ Radian y, p, r;
+ bool b = ToEulerAnglesZYX(y,p,r);
+ rfYAngle = y.valueRadians();
+ rfPAngle = p.valueRadians();
+ rfRAngle = r.valueRadians();
+ return b;
+ }
+ inline void FromEulerAnglesXYZ (float fYAngle, float fPAngle, float fRAngle) {
+ FromEulerAnglesXYZ ( Radian(fYAngle), Radian(fPAngle), Radian(fRAngle) );
+ }
+ inline void FromEulerAnglesXZY (float fYAngle, float fPAngle, float fRAngle) {
+ FromEulerAnglesXZY ( Radian(fYAngle), Radian(fPAngle), Radian(fRAngle) );
+ }
+ inline void FromEulerAnglesYXZ (float fYAngle, float fPAngle, float fRAngle) {
+ FromEulerAnglesYXZ ( Radian(fYAngle), Radian(fPAngle), Radian(fRAngle) );
+ }
+ inline void FromEulerAnglesYZX (float fYAngle, float fPAngle, float fRAngle) {
+ FromEulerAnglesYZX ( Radian(fYAngle), Radian(fPAngle), Radian(fRAngle) );
+ }
+ inline void FromEulerAnglesZXY (float fYAngle, float fPAngle, float fRAngle) {
+ FromEulerAnglesZXY ( Radian(fYAngle), Radian(fPAngle), Radian(fRAngle) );
+ }
+ inline void FromEulerAnglesZYX (float fYAngle, float fPAngle, float fRAngle) {
+ FromEulerAnglesZYX ( Radian(fYAngle), Radian(fPAngle), Radian(fRAngle) );
+ }
+#endif//OGRE_FORCE_ANGLE_TYPES
+ // eigensolver, matrix must be symmetric
+ void EigenSolveSymmetric (Real afEigenvalue[3],
+ Vector3 akEigenvector[3]) const;
+
+ static void TensorProduct (const Vector3& rkU, const Vector3& rkV,
+ Matrix3& rkProduct);
+
+ static const Real EPSILON;
+ static const Matrix3 ZERO;
+ static const Matrix3 IDENTITY;
+
+ protected:
+ // support for eigensolver
+ void Tridiagonal (Real afDiag[3], Real afSubDiag[3]);
+ bool QLAlgorithm (Real afDiag[3], Real afSubDiag[3]);
+
+ // support for singular value decomposition
+ static const Real ms_fSvdEpsilon;
+ static const unsigned int ms_iSvdMaxIterations;
+ static void Bidiagonalize (Matrix3& kA, Matrix3& kL,
+ Matrix3& kR);
+ static void GolubKahanStep (Matrix3& kA, Matrix3& kL,
+ Matrix3& kR);
+
+ // support for spectral norm
+ static Real MaxCubicRoot (Real afCoeff[3]);
+
+ Real m[3][3];
+
+ // for faster access
+ friend class Matrix4;
+ };
+}
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreMatrix4.h b/school/informatik/verkerhssimulation/src/ogre/OgreMatrix4.h
new file mode 100644
index 00000000..3063bdac
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreMatrix4.h
@@ -0,0 +1,603 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Matrix4__
+#define __Matrix4__
+
+// Precompiler options
+#include "OgrePrerequisites.h"
+
+#include "OgreVector3.h"
+#include "OgreMatrix3.h"
+#include "OgreVector4.h"
+#include "OgrePlane.h"
+namespace Ogre
+{
+ /** Class encapsulating a standard 4x4 homogenous matrix.
+ @remarks
+ OGRE uses column vectors when applying matrix multiplications,
+ This means a vector is represented as a single column, 4-row
+ matrix. This has the effect that the tranformations implemented
+ by the matrices happens right-to-left e.g. if vector V is to be
+ transformed by M1 then M2 then M3, the calculation would be
+ M3 * M2 * M1 * V. The order that matrices are concatenated is
+ vital since matrix multiplication is not cummatative, i.e. you
+ can get a different result if you concatenate in the wrong order.
+ @par
+ The use of column vectors and right-to-left ordering is the
+ standard in most mathematical texts, and id the same as used in
+ OpenGL. It is, however, the opposite of Direct3D, which has
+ inexplicably chosen to differ from the accepted standard and uses
+ row vectors and left-to-right matrix multiplication.
+ @par
+ OGRE deals with the differences between D3D and OpenGL etc.
+ internally when operating through different render systems. OGRE
+ users only need to conform to standard maths conventions, i.e.
+ right-to-left matrix multiplication, (OGRE transposes matrices it
+ passes to D3D to compensate).
+ @par
+ The generic form M * V which shows the layout of the matrix
+ entries is shown below:
+
+ [ m[0][0] m[0][1] m[0][2] m[0][3] ] {x}
+ | m[1][0] m[1][1] m[1][2] m[1][3] | * {y}
+ | m[2][0] m[2][1] m[2][2] m[2][3] | {z}
+ [ m[3][0] m[3][1] m[3][2] m[3][3] ] {1}
+
+ */
+ class _OgreExport Matrix4
+ {
+ protected:
+ /// The matrix entries, indexed by [row][col].
+ union {
+ Real m[4][4];
+ Real _m[16];
+ };
+ public:
+ /** Default constructor.
+ @note
+ It does NOT initialize the matrix for efficiency.
+ */
+ inline Matrix4()
+ {
+ }
+
+ inline Matrix4(
+ Real m00, Real m01, Real m02, Real m03,
+ Real m10, Real m11, Real m12, Real m13,
+ Real m20, Real m21, Real m22, Real m23,
+ Real m30, Real m31, Real m32, Real m33 )
+ {
+ m[0][0] = m00;
+ m[0][1] = m01;
+ m[0][2] = m02;
+ m[0][3] = m03;
+ m[1][0] = m10;
+ m[1][1] = m11;
+ m[1][2] = m12;
+ m[1][3] = m13;
+ m[2][0] = m20;
+ m[2][1] = m21;
+ m[2][2] = m22;
+ m[2][3] = m23;
+ m[3][0] = m30;
+ m[3][1] = m31;
+ m[3][2] = m32;
+ m[3][3] = m33;
+ }
+
+ /** Creates a standard 4x4 transformation matrix with a zero translation part from a rotation/scaling 3x3 matrix.
+ */
+
+ inline Matrix4(const Matrix3& m3x3)
+ {
+ operator=(IDENTITY);
+ operator=(m3x3);
+ }
+
+ /** Creates a standard 4x4 transformation matrix with a zero translation part from a rotation/scaling Quaternion.
+ */
+
+ inline Matrix4(const Quaternion& rot)
+ {
+ Matrix3 m3x3;
+ rot.ToRotationMatrix(m3x3);
+ operator=(IDENTITY);
+ operator=(m3x3);
+ }
+
+
+ inline Real* operator [] ( size_t iRow )
+ {
+ assert( iRow < 4 );
+ return m[iRow];
+ }
+
+ inline const Real *const operator [] ( size_t iRow ) const
+ {
+ assert( iRow < 4 );
+ return m[iRow];
+ }
+
+ inline Matrix4 concatenate(const Matrix4 &m2) const
+ {
+ Matrix4 r;
+ r.m[0][0] = m[0][0] * m2.m[0][0] + m[0][1] * m2.m[1][0] + m[0][2] * m2.m[2][0] + m[0][3] * m2.m[3][0];
+ r.m[0][1] = m[0][0] * m2.m[0][1] + m[0][1] * m2.m[1][1] + m[0][2] * m2.m[2][1] + m[0][3] * m2.m[3][1];
+ r.m[0][2] = m[0][0] * m2.m[0][2] + m[0][1] * m2.m[1][2] + m[0][2] * m2.m[2][2] + m[0][3] * m2.m[3][2];
+ r.m[0][3] = m[0][0] * m2.m[0][3] + m[0][1] * m2.m[1][3] + m[0][2] * m2.m[2][3] + m[0][3] * m2.m[3][3];
+
+ r.m[1][0] = m[1][0] * m2.m[0][0] + m[1][1] * m2.m[1][0] + m[1][2] * m2.m[2][0] + m[1][3] * m2.m[3][0];
+ r.m[1][1] = m[1][0] * m2.m[0][1] + m[1][1] * m2.m[1][1] + m[1][2] * m2.m[2][1] + m[1][3] * m2.m[3][1];
+ r.m[1][2] = m[1][0] * m2.m[0][2] + m[1][1] * m2.m[1][2] + m[1][2] * m2.m[2][2] + m[1][3] * m2.m[3][2];
+ r.m[1][3] = m[1][0] * m2.m[0][3] + m[1][1] * m2.m[1][3] + m[1][2] * m2.m[2][3] + m[1][3] * m2.m[3][3];
+
+ r.m[2][0] = m[2][0] * m2.m[0][0] + m[2][1] * m2.m[1][0] + m[2][2] * m2.m[2][0] + m[2][3] * m2.m[3][0];
+ r.m[2][1] = m[2][0] * m2.m[0][1] + m[2][1] * m2.m[1][1] + m[2][2] * m2.m[2][1] + m[2][3] * m2.m[3][1];
+ r.m[2][2] = m[2][0] * m2.m[0][2] + m[2][1] * m2.m[1][2] + m[2][2] * m2.m[2][2] + m[2][3] * m2.m[3][2];
+ r.m[2][3] = m[2][0] * m2.m[0][3] + m[2][1] * m2.m[1][3] + m[2][2] * m2.m[2][3] + m[2][3] * m2.m[3][3];
+
+ r.m[3][0] = m[3][0] * m2.m[0][0] + m[3][1] * m2.m[1][0] + m[3][2] * m2.m[2][0] + m[3][3] * m2.m[3][0];
+ r.m[3][1] = m[3][0] * m2.m[0][1] + m[3][1] * m2.m[1][1] + m[3][2] * m2.m[2][1] + m[3][3] * m2.m[3][1];
+ r.m[3][2] = m[3][0] * m2.m[0][2] + m[3][1] * m2.m[1][2] + m[3][2] * m2.m[2][2] + m[3][3] * m2.m[3][2];
+ r.m[3][3] = m[3][0] * m2.m[0][3] + m[3][1] * m2.m[1][3] + m[3][2] * m2.m[2][3] + m[3][3] * m2.m[3][3];
+
+ return r;
+ }
+
+ /** Matrix concatenation using '*'.
+ */
+ inline Matrix4 operator * ( const Matrix4 &m2 ) const
+ {
+ return concatenate( m2 );
+ }
+
+ /** Vector transformation using '*'.
+ @remarks
+ Transforms the given 3-D vector by the matrix, projecting the
+ result back into w = 1.
+ @note
+ This means that the initial w is considered to be 1.0,
+ and then all the tree elements of the resulting 3-D vector are
+ divided by the resulting w.
+ */
+ inline Vector3 operator * ( const Vector3 &v ) const
+ {
+ Vector3 r;
+
+ Real fInvW = 1.0 / ( m[3][0] * v.x + m[3][1] * v.y + m[3][2] * v.z + m[3][3] );
+
+ r.x = ( m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z + m[0][3] ) * fInvW;
+ r.y = ( m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z + m[1][3] ) * fInvW;
+ r.z = ( m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z + m[2][3] ) * fInvW;
+
+ return r;
+ }
+ inline Vector4 operator * (const Vector4& v) const
+ {
+ return Vector4(
+ m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z + m[0][3] * v.w,
+ m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z + m[1][3] * v.w,
+ m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z + m[2][3] * v.w,
+ m[3][0] * v.x + m[3][1] * v.y + m[3][2] * v.z + m[3][3] * v.w
+ );
+ }
+ inline Plane operator * (const Plane& p) const
+ {
+ Plane ret;
+ Matrix4 invTrans = inverse().transpose();
+ Vector4 v4( p.normal.x, p.normal.y, p.normal.z, p.d );
+ v4 = invTrans * v4;
+ ret.normal.x = v4.x;
+ ret.normal.y = v4.y;
+ ret.normal.z = v4.z;
+ ret.d = v4.w / ret.normal.normalise();
+
+ return ret;
+ }
+
+
+ /** Matrix addition.
+ */
+ inline Matrix4 operator + ( const Matrix4 &m2 ) const
+ {
+ Matrix4 r;
+
+ r.m[0][0] = m[0][0] + m2.m[0][0];
+ r.m[0][1] = m[0][1] + m2.m[0][1];
+ r.m[0][2] = m[0][2] + m2.m[0][2];
+ r.m[0][3] = m[0][3] + m2.m[0][3];
+
+ r.m[1][0] = m[1][0] + m2.m[1][0];
+ r.m[1][1] = m[1][1] + m2.m[1][1];
+ r.m[1][2] = m[1][2] + m2.m[1][2];
+ r.m[1][3] = m[1][3] + m2.m[1][3];
+
+ r.m[2][0] = m[2][0] + m2.m[2][0];
+ r.m[2][1] = m[2][1] + m2.m[2][1];
+ r.m[2][2] = m[2][2] + m2.m[2][2];
+ r.m[2][3] = m[2][3] + m2.m[2][3];
+
+ r.m[3][0] = m[3][0] + m2.m[3][0];
+ r.m[3][1] = m[3][1] + m2.m[3][1];
+ r.m[3][2] = m[3][2] + m2.m[3][2];
+ r.m[3][3] = m[3][3] + m2.m[3][3];
+
+ return r;
+ }
+
+ /** Matrix subtraction.
+ */
+ inline Matrix4 operator - ( const Matrix4 &m2 ) const
+ {
+ Matrix4 r;
+ r.m[0][0] = m[0][0] - m2.m[0][0];
+ r.m[0][1] = m[0][1] - m2.m[0][1];
+ r.m[0][2] = m[0][2] - m2.m[0][2];
+ r.m[0][3] = m[0][3] - m2.m[0][3];
+
+ r.m[1][0] = m[1][0] - m2.m[1][0];
+ r.m[1][1] = m[1][1] - m2.m[1][1];
+ r.m[1][2] = m[1][2] - m2.m[1][2];
+ r.m[1][3] = m[1][3] - m2.m[1][3];
+
+ r.m[2][0] = m[2][0] - m2.m[2][0];
+ r.m[2][1] = m[2][1] - m2.m[2][1];
+ r.m[2][2] = m[2][2] - m2.m[2][2];
+ r.m[2][3] = m[2][3] - m2.m[2][3];
+
+ r.m[3][0] = m[3][0] - m2.m[3][0];
+ r.m[3][1] = m[3][1] - m2.m[3][1];
+ r.m[3][2] = m[3][2] - m2.m[3][2];
+ r.m[3][3] = m[3][3] - m2.m[3][3];
+
+ return r;
+ }
+
+ /** Tests 2 matrices for equality.
+ */
+ inline bool operator == ( const Matrix4& m2 ) const
+ {
+ if(
+ m[0][0] != m2.m[0][0] || m[0][1] != m2.m[0][1] || m[0][2] != m2.m[0][2] || m[0][3] != m2.m[0][3] ||
+ m[1][0] != m2.m[1][0] || m[1][1] != m2.m[1][1] || m[1][2] != m2.m[1][2] || m[1][3] != m2.m[1][3] ||
+ m[2][0] != m2.m[2][0] || m[2][1] != m2.m[2][1] || m[2][2] != m2.m[2][2] || m[2][3] != m2.m[2][3] ||
+ m[3][0] != m2.m[3][0] || m[3][1] != m2.m[3][1] || m[3][2] != m2.m[3][2] || m[3][3] != m2.m[3][3] )
+ return false;
+ return true;
+ }
+
+ /** Tests 2 matrices for inequality.
+ */
+ inline bool operator != ( const Matrix4& m2 ) const
+ {
+ if(
+ m[0][0] != m2.m[0][0] || m[0][1] != m2.m[0][1] || m[0][2] != m2.m[0][2] || m[0][3] != m2.m[0][3] ||
+ m[1][0] != m2.m[1][0] || m[1][1] != m2.m[1][1] || m[1][2] != m2.m[1][2] || m[1][3] != m2.m[1][3] ||
+ m[2][0] != m2.m[2][0] || m[2][1] != m2.m[2][1] || m[2][2] != m2.m[2][2] || m[2][3] != m2.m[2][3] ||
+ m[3][0] != m2.m[3][0] || m[3][1] != m2.m[3][1] || m[3][2] != m2.m[3][2] || m[3][3] != m2.m[3][3] )
+ return true;
+ return false;
+ }
+
+ /** Assignment from 3x3 matrix.
+ */
+ inline void operator = ( const Matrix3& mat3 )
+ {
+ m[0][0] = mat3.m[0][0]; m[0][1] = mat3.m[0][1]; m[0][2] = mat3.m[0][2];
+ m[1][0] = mat3.m[1][0]; m[1][1] = mat3.m[1][1]; m[1][2] = mat3.m[1][2];
+ m[2][0] = mat3.m[2][0]; m[2][1] = mat3.m[2][1]; m[2][2] = mat3.m[2][2];
+ }
+
+ inline Matrix4 transpose(void) const
+ {
+ return Matrix4(m[0][0], m[1][0], m[2][0], m[3][0],
+ m[0][1], m[1][1], m[2][1], m[3][1],
+ m[0][2], m[1][2], m[2][2], m[3][2],
+ m[0][3], m[1][3], m[2][3], m[3][3]);
+ }
+
+ /*
+ -----------------------------------------------------------------------
+ Translation Transformation
+ -----------------------------------------------------------------------
+ */
+ /** Sets the translation transformation part of the matrix.
+ */
+ inline void setTrans( const Vector3& v )
+ {
+ m[0][3] = v.x;
+ m[1][3] = v.y;
+ m[2][3] = v.z;
+ }
+
+ /** Extracts the translation transformation part of the matrix.
+ */
+ inline Vector3 getTrans() const
+ {
+ return Vector3(m[0][3], m[1][3], m[2][3]);
+ }
+
+
+ /** Builds a translation matrix
+ */
+ inline void makeTrans( const Vector3& v )
+ {
+ m[0][0] = 1.0; m[0][1] = 0.0; m[0][2] = 0.0; m[0][3] = v.x;
+ m[1][0] = 0.0; m[1][1] = 1.0; m[1][2] = 0.0; m[1][3] = v.y;
+ m[2][0] = 0.0; m[2][1] = 0.0; m[2][2] = 1.0; m[2][3] = v.z;
+ m[3][0] = 0.0; m[3][1] = 0.0; m[3][2] = 0.0; m[3][3] = 1.0;
+ }
+
+ inline void makeTrans( Real tx, Real ty, Real tz )
+ {
+ m[0][0] = 1.0; m[0][1] = 0.0; m[0][2] = 0.0; m[0][3] = tx;
+ m[1][0] = 0.0; m[1][1] = 1.0; m[1][2] = 0.0; m[1][3] = ty;
+ m[2][0] = 0.0; m[2][1] = 0.0; m[2][2] = 1.0; m[2][3] = tz;
+ m[3][0] = 0.0; m[3][1] = 0.0; m[3][2] = 0.0; m[3][3] = 1.0;
+ }
+
+ /** Gets a translation matrix.
+ */
+ inline static Matrix4 getTrans( const Vector3& v )
+ {
+ Matrix4 r;
+
+ r.m[0][0] = 1.0; r.m[0][1] = 0.0; r.m[0][2] = 0.0; r.m[0][3] = v.x;
+ r.m[1][0] = 0.0; r.m[1][1] = 1.0; r.m[1][2] = 0.0; r.m[1][3] = v.y;
+ r.m[2][0] = 0.0; r.m[2][1] = 0.0; r.m[2][2] = 1.0; r.m[2][3] = v.z;
+ r.m[3][0] = 0.0; r.m[3][1] = 0.0; r.m[3][2] = 0.0; r.m[3][3] = 1.0;
+
+ return r;
+ }
+
+ /** Gets a translation matrix - variation for not using a vector.
+ */
+ inline static Matrix4 getTrans( Real t_x, Real t_y, Real t_z )
+ {
+ Matrix4 r;
+
+ r.m[0][0] = 1.0; r.m[0][1] = 0.0; r.m[0][2] = 0.0; r.m[0][3] = t_x;
+ r.m[1][0] = 0.0; r.m[1][1] = 1.0; r.m[1][2] = 0.0; r.m[1][3] = t_y;
+ r.m[2][0] = 0.0; r.m[2][1] = 0.0; r.m[2][2] = 1.0; r.m[2][3] = t_z;
+ r.m[3][0] = 0.0; r.m[3][1] = 0.0; r.m[3][2] = 0.0; r.m[3][3] = 1.0;
+
+ return r;
+ }
+
+ /*
+ -----------------------------------------------------------------------
+ Scale Transformation
+ -----------------------------------------------------------------------
+ */
+ /** Sets the scale part of the matrix.
+ */
+ inline void setScale( const Vector3& v )
+ {
+ m[0][0] = v.x;
+ m[1][1] = v.y;
+ m[2][2] = v.z;
+ }
+
+ /** Gets a scale matrix.
+ */
+ inline static Matrix4 getScale( const Vector3& v )
+ {
+ Matrix4 r;
+ r.m[0][0] = v.x; r.m[0][1] = 0.0; r.m[0][2] = 0.0; r.m[0][3] = 0.0;
+ r.m[1][0] = 0.0; r.m[1][1] = v.y; r.m[1][2] = 0.0; r.m[1][3] = 0.0;
+ r.m[2][0] = 0.0; r.m[2][1] = 0.0; r.m[2][2] = v.z; r.m[2][3] = 0.0;
+ r.m[3][0] = 0.0; r.m[3][1] = 0.0; r.m[3][2] = 0.0; r.m[3][3] = 1.0;
+
+ return r;
+ }
+
+ /** Gets a scale matrix - variation for not using a vector.
+ */
+ inline static Matrix4 getScale( Real s_x, Real s_y, Real s_z )
+ {
+ Matrix4 r;
+ r.m[0][0] = s_x; r.m[0][1] = 0.0; r.m[0][2] = 0.0; r.m[0][3] = 0.0;
+ r.m[1][0] = 0.0; r.m[1][1] = s_y; r.m[1][2] = 0.0; r.m[1][3] = 0.0;
+ r.m[2][0] = 0.0; r.m[2][1] = 0.0; r.m[2][2] = s_z; r.m[2][3] = 0.0;
+ r.m[3][0] = 0.0; r.m[3][1] = 0.0; r.m[3][2] = 0.0; r.m[3][3] = 1.0;
+
+ return r;
+ }
+
+ /** Extracts the rotation / scaling part of the Matrix as a 3x3 matrix.
+ @param m3x3 Destination Matrix3
+ */
+ inline void extract3x3Matrix(Matrix3& m3x3) const
+ {
+ m3x3.m[0][0] = m[0][0];
+ m3x3.m[0][1] = m[0][1];
+ m3x3.m[0][2] = m[0][2];
+ m3x3.m[1][0] = m[1][0];
+ m3x3.m[1][1] = m[1][1];
+ m3x3.m[1][2] = m[1][2];
+ m3x3.m[2][0] = m[2][0];
+ m3x3.m[2][1] = m[2][1];
+ m3x3.m[2][2] = m[2][2];
+
+ }
+
+ /** Extracts the rotation / scaling part as a quaternion from the Matrix.
+ */
+ inline Quaternion extractQuaternion() const
+ {
+ Matrix3 m3x3;
+ extract3x3Matrix(m3x3);
+ return Quaternion(m3x3);
+ }
+
+ static const Matrix4 ZERO;
+ static const Matrix4 IDENTITY;
+ /** Useful little matrix which takes 2D clipspace {-1, 1} to {0,1}
+ and inverts the Y. */
+ static const Matrix4 CLIPSPACE2DTOIMAGESPACE;
+
+ inline Matrix4 operator*(Real scalar) const
+ {
+ return Matrix4(
+ scalar*m[0][0], scalar*m[0][1], scalar*m[0][2], scalar*m[0][3],
+ scalar*m[1][0], scalar*m[1][1], scalar*m[1][2], scalar*m[1][3],
+ scalar*m[2][0], scalar*m[2][1], scalar*m[2][2], scalar*m[2][3],
+ scalar*m[3][0], scalar*m[3][1], scalar*m[3][2], scalar*m[3][3]);
+ }
+
+ /** Function for writing to a stream.
+ */
+ inline _OgreExport friend std::ostream& operator <<
+ ( std::ostream& o, const Matrix4& m )
+ {
+ o << "Matrix4(";
+ for (size_t i = 0; i < 4; ++i)
+ {
+ o << " row" << (unsigned)i << "{";
+ for(size_t j = 0; j < 4; ++j)
+ {
+ o << m[i][j] << " ";
+ }
+ o << "}";
+ }
+ o << ")";
+ return o;
+ }
+
+ Matrix4 adjoint() const;
+ Real determinant() const;
+ Matrix4 inverse() const;
+
+ /** Building a Matrix4 from orientation / scale / position.
+ @remarks
+ Transform is performed in the order scale, rotate, translation, i.e. translation is independent
+ of orientation axes, scale does not affect size of translation, rotation and scaling are always
+ centered on the origin.
+ */
+ void makeTransform(const Vector3& position, const Vector3& scale, const Quaternion& orientation);
+
+ /** Building an inverse Matrix4 from orientation / scale / position.
+ @remarks
+ As makeTransform except it build the inverse given the same data as makeTransform, so
+ performing -translation, -rotate, 1/scale in that order.
+ */
+ void makeInverseTransform(const Vector3& position, const Vector3& scale, const Quaternion& orientation);
+
+ /** Check whether or not the matrix is affine matrix.
+ @remarks
+ An affine matrix is a 4x4 matrix with row 3 equal to (0, 0, 0, 1),
+ e.g. no projective coefficients.
+ */
+ inline bool isAffine(void) const
+ {
+ return m[3][0] == 0 && m[3][1] == 0 && m[3][2] == 0 && m[3][3] == 1;
+ }
+
+ /** Returns the inverse of the affine matrix.
+ @note
+ The matrix must be an affine matrix. @see Matrix4::isAffine.
+ */
+ Matrix4 inverseAffine(void) const;
+
+ /** Concatenate two affine matrix.
+ @note
+ The matrices must be affine matrix. @see Matrix4::isAffine.
+ */
+ inline Matrix4 concatenateAffine(const Matrix4 &m2) const
+ {
+ assert(isAffine() && m2.isAffine());
+
+ return Matrix4(
+ m[0][0] * m2.m[0][0] + m[0][1] * m2.m[1][0] + m[0][2] * m2.m[2][0],
+ m[0][0] * m2.m[0][1] + m[0][1] * m2.m[1][1] + m[0][2] * m2.m[2][1],
+ m[0][0] * m2.m[0][2] + m[0][1] * m2.m[1][2] + m[0][2] * m2.m[2][2],
+ m[0][0] * m2.m[0][3] + m[0][1] * m2.m[1][3] + m[0][2] * m2.m[2][3] + m[0][3],
+
+ m[1][0] * m2.m[0][0] + m[1][1] * m2.m[1][0] + m[1][2] * m2.m[2][0],
+ m[1][0] * m2.m[0][1] + m[1][1] * m2.m[1][1] + m[1][2] * m2.m[2][1],
+ m[1][0] * m2.m[0][2] + m[1][1] * m2.m[1][2] + m[1][2] * m2.m[2][2],
+ m[1][0] * m2.m[0][3] + m[1][1] * m2.m[1][3] + m[1][2] * m2.m[2][3] + m[1][3],
+
+ m[2][0] * m2.m[0][0] + m[2][1] * m2.m[1][0] + m[2][2] * m2.m[2][0],
+ m[2][0] * m2.m[0][1] + m[2][1] * m2.m[1][1] + m[2][2] * m2.m[2][1],
+ m[2][0] * m2.m[0][2] + m[2][1] * m2.m[1][2] + m[2][2] * m2.m[2][2],
+ m[2][0] * m2.m[0][3] + m[2][1] * m2.m[1][3] + m[2][2] * m2.m[2][3] + m[2][3],
+
+ 0, 0, 0, 1);
+ }
+
+ /** 3-D Vector transformation specially for affine matrix.
+ @remarks
+ Transforms the given 3-D vector by the matrix, projecting the
+ result back into w = 1.
+ @note
+ The matrix must be an affine matrix. @see Matrix4::isAffine.
+ */
+ inline Vector3 transformAffine(const Vector3& v) const
+ {
+ assert(isAffine());
+
+ return Vector3(
+ m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z + m[0][3],
+ m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z + m[1][3],
+ m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z + m[2][3]);
+ }
+
+ /** 4-D Vector transformation specially for affine matrix.
+ @note
+ The matrix must be an affine matrix. @see Matrix4::isAffine.
+ */
+ inline Vector4 transformAffine(const Vector4& v) const
+ {
+ assert(isAffine());
+
+ return Vector4(
+ m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z + m[0][3] * v.w,
+ m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z + m[1][3] * v.w,
+ m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z + m[2][3] * v.w,
+ v.w);
+ }
+ };
+
+ /* Removed from Vector4 and made a non-member here because otherwise
+ OgreMatrix4.h and OgreVector4.h have to try to include and inline each
+ other, which frankly doesn't work ;)
+ */
+ inline Vector4 operator * (const Vector4& v, const Matrix4& mat)
+ {
+ return Vector4(
+ v.x*mat[0][0] + v.y*mat[1][0] + v.z*mat[2][0] + v.w*mat[3][0],
+ v.x*mat[0][1] + v.y*mat[1][1] + v.z*mat[2][1] + v.w*mat[3][1],
+ v.x*mat[0][2] + v.y*mat[1][2] + v.z*mat[2][2] + v.w*mat[3][2],
+ v.x*mat[0][3] + v.y*mat[1][3] + v.z*mat[2][3] + v.w*mat[3][3]
+ );
+ }
+
+}
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreMemoryMacros.h b/school/informatik/verkerhssimulation/src/ogre/OgreMemoryMacros.h
new file mode 100644
index 00000000..b4908276
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreMemoryMacros.h
@@ -0,0 +1,69 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+//---- ORIGINAL COPYRIGHT FOLLOWS -------------------------------------------
+// ---------------------------------------------------------------------------------------------------------------------------------
+// Copyright 2000, Paul Nettle. All rights reserved.
+//
+// You are free to use this source code in any commercial or non-commercial product.
+//
+// mmgr.cpp - Memory manager & tracking software
+//
+// The most recent version of this software can be found at: ftp://ftp.GraphicsPapers.com/pub/ProgrammingTools/MemoryManagers/
+//
+// [NOTE: Best when viewed with 8-character tabs]
+//
+// ---------------------------------------------------------------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// How does this work?
+// Remember that before the compiler starts to process a source file, it runs
+// a neat tool called a preprocessor on it. What this preprocessor does in
+// this case is replace all the instances of *alloc/free with the expanded
+// macros - this way we cleverly replace all the calls to the standard C
+// memory (de)allocation functions. The same is done for new/delete
+//
+// Of course, we have the drawback that we can't name a member function of
+// a class *alloc or free and we can't overload the new/delete operators without
+// first undefining these macros - ah, a C++ preprocessor with RE replacement,
+// that would be a dream come true :)
+//
+#ifndef OGRE_MEMORY_MACROS
+#define OGRE_MEMORY_MACROS
+
+#if OGRE_DEBUG_MEMORY_MANAGER && OGRE_DEBUG_MODE
+# define new (::Ogre::MemoryManager::instance().setOwner(__FILE__,__LINE__,__FUNCTION__),false) ? NULL : new
+# define delete (::Ogre::MemoryManager::instance().setOwner(__FILE__,__LINE__,__FUNCTION__),false) ? ::Ogre::MemoryManager::instance().setOwner("",0,"") : delete
+# define malloc(sz) ::Ogre::MemoryManager::instance().allocMem(__FILE__,__LINE__,__FUNCTION__, ::Ogre::m_alloc_malloc, sz, gProcessID)
+# define calloc(num,sz) ::Ogre::MemoryManager::instance().allocMem(__FILE__,__LINE__,__FUNCTION__, ::Ogre::m_alloc_calloc, num*sz, gProcessID)
+# define realloc(ptr,sz) ::Ogre::MemoryManager::instance().rllocMem(__FILE__,__LINE__,__FUNCTION__, ::Ogre::m_alloc_realloc,sz, ptr, gProcessID)
+# define free(ptr) ::Ogre::MemoryManager::instance().dllocMem(__FILE__,__LINE__,__FUNCTION__, ::Ogre::m_alloc_free, ptr, gProcessID)
+#endif // OGRE_DEBUG_MEMORY_MANAGER
+
+#endif // OGRE_MEMORY_MACROS
+//-----------------------------------------------------------------------------
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreMemoryManager.h b/school/informatik/verkerhssimulation/src/ogre/OgreMemoryManager.h
new file mode 100644
index 00000000..03931b7d
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreMemoryManager.h
@@ -0,0 +1,422 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+//---- ORIGINAL COPYRIGHT FOLLOWS -------------------------------------------
+// ---------------------------------------------------------------------------------------------------------------------------------
+// Copyright 2000, Paul Nettle. All rights reserved.
+//
+// You are free to use this source code in any commercial or non-commercial product.
+//
+// mmgr.cpp - Memory manager & tracking software
+//
+// The most recent version of this software can be found at: ftp://ftp.GraphicsPapers.com/pub/ProgrammingTools/MemoryManagers/
+//
+// [NOTE: Best when viewed with 8-character tabs]
+//
+// ---------------------------------------------------------------------------------------------------------------------------------
+#ifndef __MemoryManager_H__
+#define __MemoryManager_H__
+
+#include "OgrePlatform.h"
+#include "OgreStdHeaders.h"
+
+namespace Ogre {
+
+ /** @page memory_manager The memory manager information page
+
+ @subsection desc Description
+ The memory manager is a class that handles memory (de)allocation requests.
+ @par
+ This class works like a wrapper between the actual C memory allocation
+ functions (*alloc, free) and the memory (de)allocation requests of the
+ application.
+ @par
+ Why would such a class be needed? First of all, because we had some
+ major issues with memory getting misued (read: deleted) over DLL
+ boundaries. One thing this memory manager does is solve the problem by
+ allocating all the memory in the OgreMain.dll/so process.
+ @par
+ Another use would be leak detection and memory misuse detection. With
+ a custom memory manager, calls to new/delete and *alloc/free could be
+ overseed and logged.
+ @par
+ Yet another use is the optimization of memory allocation for certain
+ object types. One of the most common examples is a small object
+ allocator.
+ @subsection types Manager types
+ There actually are two classes, one is the standard memory manager
+ which only addresses memory allocation problems when deallocating
+ across processes.
+ @par
+ The other is a modified version of the debugging memory manager written
+ by Paul 'MidNight' Nettle (aka. the Fluid Studios Memory Manager).
+ Obviously, the second one should be used only when debugging your
+ application as it adds some visible overhead.
+ @par
+ You can switch between the two memory managers by setting the value of
+ the OGRE_DEBUG_MEMORY_MANAGER macro in OgreConfig.h
+ @subsection notes Implementation Note
+ The class contains a static member of type MemoryManager. That is
+ because we want the memory manager to be created even before we
+ override the new([])/delete([]) operators.
+ @subsection see See also
+ Paul Nettle's Memory Manager page at flipCode - you can get the original source form here.
+ */
+
+#if OGRE_DEBUG_MEMORY_MANAGER && OGRE_DEBUG_MODE
+
+#ifndef __FUNCTION__
+#define __FUNCTION__ "???"
+#endif
+
+}
+
+//-----------------------------------------------------------------------------
+// We have to declare the global new([])/delete([]) operators before declaring
+// the Ogre::MemoryManager class since it lists them as friend functions
+void *operator new(size_t reportedSize);
+void *operator new[](size_t reportedSize);
+void operator delete(void *reportedAddress);
+void operator delete[](void *reportedAddress);
+//-----------------------------------------------------------------------------
+
+namespace Ogre {
+
+ /** For internal use only.
+ \internal.
+ @remarks
+ This structure holds the allocation tracking information. So,
+ for each allocation made, the overhead this memory manager adds
+ is the size of this structure, the lengths of the names of the
+ file and function in which the allocation was made and the
+ padding size (which can be adjusted).
+ */
+ typedef struct tag_au
+ {
+ size_t actualSize;
+ size_t reportedSize;
+
+ void *actualAddress;
+ void *reportedAddress;
+
+ char sourceFile[40];
+ char sourceFunc[40];
+
+ unsigned int sourceLine;
+ unsigned int allocationType;
+
+ bool breakOnDealloc;
+ bool breakOnRealloc;
+
+ unsigned int allocationNumber;
+ unsigned int processID;
+
+ struct tag_au *next;
+ struct tag_au *prev;
+ } sAllocUnit;
+
+ typedef struct
+ {
+ size_t totalReportedMemory;
+ size_t totalActualMemory;
+
+ size_t peakReportedMemory;
+ size_t peakActualMemory;
+
+ size_t accumulatedReportedMemory;
+ size_t accumulatedActualMemory;
+ size_t accumulatedAllocUnitCount;
+
+ size_t totalAllocUnitCount;
+ size_t peakAllocUnitCount;
+ } sMStats;
+
+ enum
+ {
+ m_alloc_unknown = 0,
+ m_alloc_new = 1,
+ m_alloc_new_array = 2,
+ m_alloc_malloc = 3,
+ m_alloc_calloc = 4,
+ m_alloc_realloc = 5,
+ m_alloc_delete = 6,
+ m_alloc_delete_array = 7,
+ m_alloc_free = 8
+ };
+
+ /** See the \ref memory_manager.
+ */
+ class _OgreExport MemoryManager
+ {
+ friend void * ::operator new(size_t);
+ friend void * ::operator new[](size_t);
+ friend void ::operator delete(void*);
+ friend void ::operator delete[](void*);
+
+ public:
+ static MemoryManager& instance(void);
+
+ private:
+ /// This is used in the process tracking part of the memory manager.
+ unsigned m_uProcessIDs;
+ /// This is set to true when deinitialization takes place.
+ bool m_bDeinitTime;
+
+#ifndef __BORLANDC__
+ private:
+#else
+ public:
+#endif
+ //-------------------------------------------------------------------------
+ // Wrappers for the new/delete functions
+ void *op_new_sc( size_t reportedSize, unsigned processID );
+ void *op_new_vc( size_t reportedSize, unsigned processID );
+
+ void *op_new_sc( size_t reportedSize, const char *sourceFile, int sourceLine, unsigned processID );
+ void *op_new_vc( size_t reportedSize, const char *sourceFile, int sourceLine, unsigned processID );
+
+ void op_del_sc( void *reportedAddress, unsigned processID );
+ void op_del_vc( void *reportedAddress, unsigned processID );
+ //-------------------------------------------------------------------------
+
+ /** This function is intended for internal use only.
+ \internal
+ @remarks
+ This function is used to return an unique handle for each process
+ calling it. The returned unsigned int is then passed to the memory
+ manager every time a re/de/allocation request is made, in order
+ to check that deallocations don't occur in processes other than the
+ ones in which allcations were made and so on.
+ @par
+ Actually, the problem of re/de/allocating in other processes was
+ solved with the addition of the new memory manager, but you may
+ want to limit the occurence of such events anyway, and this function
+ helps you do just that.
+ */
+ unsigned _getProcessID();
+
+ public:
+ MemoryManager();
+ ~MemoryManager();
+
+ //-------------------------------------------------------------------------
+ // Used by the macros
+ void setOwner(const char *file, const unsigned int line, const char *func);
+ //-------------------------------------------------------------------------
+
+ //-------------------------------------------------------------------------
+ // Allocation breakpoints
+ bool &breakOnRealloc(void *reportedAddress);
+ bool &breakOnDealloc( void *reportedAddress );
+ void breakOnAlloc( unsigned int count );
+ //-------------------------------------------------------------------------
+
+ //-------------------------------------------------------------------------
+ // The meat & potatoes of the memory tracking software
+
+ /** This function is intended for internal use only.
+ \internal
+ @remarks
+ This function is the actual memory allocator and acts as a bridge
+ between OGRE and the C/C++ alloc/calloc functions.
+ @par
+ While memory allocation requests are made trough this function,
+ the tracking of memory addresses is possible. Therefore, attempting
+ to deallocate a portion of memory that was not allocated using
+ this function will result in a warning given by the deallocator,
+ dllocMem.
+ */
+ void * allocMem(
+ const char *sourceFile,
+ const unsigned int sourceLine,
+ const char *sourceFunc,
+ const unsigned int allocationType,
+ const size_t reportedSize,
+ const unsigned processID );
+
+ /** This function is intended for internal use only.
+ \internal
+ @remarks
+ This function is the actual memory reallocator and acts as a bridge
+ between OGRE and the C/C++ realloc function.
+ @par
+ While memory reallocation requests are made trough this function,
+ the tracking of memory addresses is possible. Therefore, attempting
+ to deallocate a portion of memory that was not reallocated using
+ this function will result in a warning given by the deallocator,
+ dllocMem.
+ @par
+ As well, trying to reallocate memory that was not allocated using
+ mallc/calloc will result in a warning.
+ */
+ void * rllocMem(
+ const char *sourceFile,
+ const unsigned int sourceLine,
+ const char *sourceFunc,
+ const unsigned int reallocationType,
+ const size_t reportedSize,
+ void *reportedAddress,
+ const unsigned processID );
+
+ /** This function is intended for internal use only.
+ \internal
+ @remarks
+ This function is the actual memory deallocator and acts as a
+ bridge between OGRE and the C/C++ free function.
+ @par
+ While memory deallocation requests are made trough this function,
+ the tracking of memory addresses is possible. Therefore, attempting
+ to deallocate a portion of memory that was not allocated using
+ allocMem or rllocMem, trying to deallocate memory that was
+ allocated with malloc using delete (and the corresponding
+ permutations) or trying to deallocate memory allocated from from
+ process will result in a warning.
+ @note
+ Actually, memory can be allocated in one process and deallocated
+ in another, since the actual (de)allocation takes place in the
+ memory space of the OgreMain library.
+ @par
+ Tracking this kind of (possible) errors exists because users may
+ want to write their own memory allocator later on or they'd like
+ to get rid of OGRE's memory allocator.
+ */
+ void dllocMem(
+ const char *sourceFile,
+ const unsigned int sourceLine,
+ const char *sourceFunc,
+ const unsigned int deallocationType,
+ const void *reportedAddress,
+ const unsigned processID );
+ //-------------------------------------------------------------------------
+
+ //-------------------------------------------------------------------------
+ // Utilitarian functions
+ bool validateAddr(const void *reportedAddress);
+ bool validateAlloc(const sAllocUnit *allocUnit);
+ bool validateAllAllocs();
+ //-------------------------------------------------------------------------
+
+ //-------------------------------------------------------------------------
+ // Unused RAM calculations
+ unsigned int calcUnused( const sAllocUnit *allocUnit );
+ unsigned int calcAllUnused();
+ //-------------------------------------------------------------------------
+
+ //-------------------------------------------------------------------------
+ // Logging and reporting
+ void dumpAllocUnit( const sAllocUnit *allocUnit, const char *prefix = "" );
+ void dumpMemReport( const char *filename = "memreport.log", const bool overwrite = true );
+ sMStats getMemStats();
+ //-------------------------------------------------------------------------
+ };
+}
+
+/** This variable exists separately in each module that links to the OGRE library
+ and is used to track the ID of the current process from the perspective
+ of the memory manager.
+ @see
+ unsigned Ogre::MemoryManager::_getProcessID()
+*/
+static unsigned gProcessID = 0;
+
+// When compiling in Visual C++ (occuring in VS2005 Express but not for VC 7.1) with
+// managed C++, should put the new([])/delete([]) overrides inside unmanaged context,
+// otherwise Visual C++ will link with overridden version of new([]) and CRT version
+// of delete([]), thus, mess up both of OGRE memory manager and CRT memory manager.
+#if defined(__cplusplus_cli)
+#pragma managed(push, off)
+#endif
+//-----------------------------------------------------------------------------
+// Overridden global new([])/delete([]) functions
+//
+inline void *operator new(size_t reportedSize)
+{
+ if( !gProcessID )
+ gProcessID = Ogre::MemoryManager::instance()._getProcessID();
+ return Ogre::MemoryManager::instance().op_new_sc( reportedSize, gProcessID );
+}
+inline void *operator new[](size_t reportedSize)
+{
+ if( !gProcessID )
+ gProcessID = Ogre::MemoryManager::instance()._getProcessID();
+ return Ogre::MemoryManager::instance().op_new_vc( reportedSize, gProcessID );
+}
+
+inline void operator delete(void *reportedAddress)
+{
+ Ogre::MemoryManager::instance().op_del_sc( reportedAddress, gProcessID );
+}
+inline void operator delete[](void *reportedAddress)
+{
+ Ogre::MemoryManager::instance().op_del_vc( reportedAddress, gProcessID );
+}
+//-----------------------------------------------------------------------------
+#if defined(__cplusplus_cli)
+#pragma managed(pop)
+#endif
+
+//-----------------------------------------------------------------------------
+// This header adds the *alloc/free macros, wrapping the C functions
+#include "OgreMemoryMacros.h"
+//-----------------------------------------------------------------------------
+
+#else
+
+ /** See the \ref memory_manager.
+ */
+ class _OgreExport MemoryManager
+ {
+ public:
+ static MemoryManager& instance(void);
+
+ MemoryManager();
+ ~MemoryManager();
+
+ /** Memory allocator - uses plain old malloc.
+ */
+ void *allocMem( const char *szFile, size_t uLine, size_t count ) throw ( );
+
+ /** Memory re-allocator - uses plain old realloc.
+ */
+ void *rllocMem( const char *szFile, size_t uLine, void *ptr , size_t count ) throw ( );
+
+ /** Memory allocator - uses plain old calloc.
+ */
+ void *cllocMem( const char *szFile, size_t uLine, size_t num, size_t size ) throw ( );
+
+ /** Memory de-allocator - uses plain old free.
+ */
+ void dllocMem( const char *szFile, size_t uLine, void *ptr ) throw ( );
+ };
+
+}
+
+#endif
+
+#endif
+
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreMesh.h b/school/informatik/verkerhssimulation/src/ogre/OgreMesh.h
new file mode 100644
index 00000000..fd5edaa6
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreMesh.h
@@ -0,0 +1,875 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Mesh_H__
+#define __Mesh_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreResource.h"
+#include "OgreVertexIndexData.h"
+#include "OgreAxisAlignedBox.h"
+#include "OgreVertexBoneAssignment.h"
+#include "OgreIteratorWrappers.h"
+#include "OgreProgressiveMesh.h"
+#include "OgreHardwareVertexBuffer.h"
+#include "OgreSkeleton.h"
+#include "OgreAnimationTrack.h"
+#include "OgrePose.h"
+
+
+namespace Ogre {
+
+
+ /** Resource holding data about 3D mesh.
+ @remarks
+ This class holds the data used to represent a discrete
+ 3-dimensional object. Mesh data usually contains more
+ than just vertices and triangle information; it also
+ includes references to materials (and the faces which use them),
+ level-of-detail reduction information, convex hull definition,
+ skeleton/bones information, keyframe animation etc.
+ However, it is important to note the emphasis on the word
+ 'discrete' here. This class does not cover the large-scale
+ sprawling geometry found in level / landscape data.
+ @par
+ Multiple world objects can (indeed should) be created from a
+ single mesh object - see the Entity class for more info.
+ The mesh object will have it's own default
+ material properties, but potentially each world instance may
+ wish to customise the materials from the original. When the object
+ is instantiated into a scene node, the mesh material properties
+ will be taken by default but may be changed. These properties
+ are actually held at the SubMesh level since a single mesh may
+ have parts with different materials.
+ @par
+ As described above, because the mesh may have sections of differing
+ material properties, a mesh is inherently a compound contruct,
+ consisting of one or more SubMesh objects.
+ However, it strongly 'owns' it's SubMeshes such that they
+ are loaded / unloaded at the same time. This is contrary to
+ the approach taken to hierarchically related (but loosely owned)
+ scene nodes, where data is loaded / unloaded separately. Note
+ also that mesh sub-sections (when used in an instantiated object)
+ share the same scene node as the parent.
+ */
+
+
+ struct MeshLodUsage;
+
+ class _OgreExport Mesh: public Resource
+ {
+ friend class SubMesh;
+ friend class MeshSerializerImpl;
+ friend class MeshSerializerImpl_v1_2;
+ friend class MeshSerializerImpl_v1_1;
+
+ public:
+ typedef std::vector LodDistanceList;
+ /// Multimap of vertex bone assignments (orders by vertex index)
+ typedef std::multimap VertexBoneAssignmentList;
+ typedef MapIterator BoneAssignmentIterator;
+ typedef std::vector SubMeshList;
+ typedef std::vector IndexMap;
+
+ protected:
+ /** A list of submeshes which make up this mesh.
+ Each mesh is made up of 1 or more submeshes, which
+ are each based on a single material and can have their
+ own vertex data (they may not - they can share vertex data
+ from the Mesh, depending on preference).
+ */
+ SubMeshList mSubMeshList;
+
+ /** Internal method for making the space for a vertex element to hold tangents. */
+ void organiseTangentsBuffer(VertexData *vertexData,
+ VertexElementSemantic targetSemantic, unsigned short index,
+ unsigned short sourceTexCoordSet);
+
+ public:
+ /** A hashmap used to store optional SubMesh names.
+ Translates a name into SubMesh index
+ */
+ typedef HashMap SubMeshNameMap ;
+
+
+ protected:
+ SubMeshNameMap mSubMeshNameMap ;
+
+ /// Local bounding box volume
+ AxisAlignedBox mAABB;
+ /// Local bounding sphere radius (centered on object)
+ Real mBoundRadius;
+
+ /// Optional linked skeleton
+ String mSkeletonName;
+ SkeletonPtr mSkeleton;
+
+
+ VertexBoneAssignmentList mBoneAssignments;
+
+ /// Flag indicating that bone assignments need to be recompiled
+ bool mBoneAssignmentsOutOfDate;
+
+ /** Build the index map between bone index and blend index */
+ void buildIndexMap(const VertexBoneAssignmentList& boneAssignments,
+ IndexMap& boneIndexToBlendIndexMap, IndexMap& blendIndexToBoneIndexMap);
+ /** Compile bone assignments into blend index and weight buffers. */
+ void compileBoneAssignments(const VertexBoneAssignmentList& boneAssignments,
+ unsigned short numBlendWeightsPerVertex,
+ IndexMap& blendIndexToBoneIndexMap,
+ VertexData* targetVertexData);
+
+ bool mIsLodManual;
+ ushort mNumLods;
+ typedef std::vector MeshLodUsageList;
+ MeshLodUsageList mMeshLodUsageList;
+
+ HardwareBuffer::Usage mVertexBufferUsage;
+ HardwareBuffer::Usage mIndexBufferUsage;
+ bool mVertexBufferShadowBuffer;
+ bool mIndexBufferShadowBuffer;
+
+
+ bool mPreparedForShadowVolumes;
+ bool mEdgeListsBuilt;
+ bool mAutoBuildEdgeLists;
+
+ /// Storage of morph animations, lookup by name
+ typedef std::map AnimationList;
+ AnimationList mAnimationsList;
+ /// The vertex animation type associated with the shared vertex data
+ mutable VertexAnimationType mSharedVertexDataAnimationType;
+ /// Do we need to scan animations for animation types?
+ mutable bool mAnimationTypesDirty;
+
+ /// List of available poses for shared and dedicated geometryPoseList
+ PoseList mPoseList;
+
+
+ /// @copydoc Resource::loadImpl
+ void loadImpl(void);
+ /// @copydoc Resource::postLoadImpl
+ void postLoadImpl(void);
+ /// @copydoc Resource::unloadImpl
+ void unloadImpl(void);
+ /// @copydoc Resource::calculateSize
+ size_t calculateSize(void) const;
+
+
+
+ public:
+ /** Default constructor - used by MeshManager
+ @warning
+ Do not call this method directly.
+ */
+ Mesh(ResourceManager* creator, const String& name, ResourceHandle handle,
+ const String& group, bool isManual = false, ManualResourceLoader* loader = 0);
+ ~Mesh();
+
+ // NB All methods below are non-virtual since they will be
+ // called in the rendering loop - speed is of the essence.
+
+ /** Creates a new SubMesh.
+ @remarks
+ Method for manually creating geometry for the mesh.
+ Note - use with extreme caution - you must be sure that
+ you have set up the geometry properly.
+ */
+ SubMesh* createSubMesh(void);
+
+ /** Creates a new SubMesh and gives it a name
+ */
+ SubMesh* createSubMesh(const String& name);
+
+ /** Gives a name to a SubMesh
+ */
+ void nameSubMesh(const String& name, ushort index);
+
+ /** Gets the index of a submesh with a given name.
+ @remarks
+ Useful if you identify the SubMeshes by name (using nameSubMesh)
+ but wish to have faster repeat access.
+ */
+ ushort _getSubMeshIndex(const String& name) const;
+
+ /** Gets the number of sub meshes which comprise this mesh.
+ */
+ unsigned short getNumSubMeshes(void) const;
+
+ /** Gets a pointer to the submesh indicated by the index.
+ */
+ SubMesh* getSubMesh(unsigned short index) const;
+
+ /** Gets a SubMesh by name
+ */
+ SubMesh* getSubMesh(const String& name) const ;
+
+ typedef VectorIterator SubMeshIterator;
+ /// Gets an iterator over the available submeshes
+ SubMeshIterator getSubMeshIterator(void)
+ { return SubMeshIterator(mSubMeshList.begin(), mSubMeshList.end()); }
+
+ /** Shared vertex data.
+ @remarks
+ This vertex data can be shared among multiple submeshes. SubMeshes may not have
+ their own VertexData, they may share this one.
+ @par
+ The use of shared or non-shared buffers is determined when
+ model data is converted to the OGRE .mesh format.
+ */
+ VertexData *sharedVertexData;
+
+ /** Shared index map for translating blend index to bone index.
+ @remarks
+ This index map can be shared among multiple submeshes. SubMeshes might not have
+ their own IndexMap, they might share this one.
+ @par
+ We collect actually used bones of all bone assignments, and build the
+ blend index in 'packed' form, then the range of the blend index in vertex
+ data VES_BLEND_INDICES element is continuous, with no gaps. Thus, by
+ minimising the world matrix array constants passing to GPU, we can support
+ more bones for a mesh when hardware skinning is used. The hardware skinning
+ support limit is applied to each set of vertex data in the mesh, in other words, the
+ hardware skinning support limit is applied only to the actually used bones of each
+ SubMeshes, not all bones across the entire Mesh.
+ @par
+ Because the blend index is different to the bone index, therefore, we use
+ the index map to translate the blend index to bone index.
+ @par
+ The use of shared or non-shared index map is determined when
+ model data is converted to the OGRE .mesh format.
+ */
+ IndexMap sharedBlendIndexToBoneIndexMap;
+
+ /** Makes a copy of this mesh object and gives it a new name.
+ @remarks
+ This is useful if you want to tweak an existing mesh without affecting the original one. The
+ newly cloned mesh is registered with the MeshManager under the new name.
+ @param newName The name to give the clone
+ @param newGroup Optional name of the new group to assign the clone to;
+ if you leave this blank, the clone will be assigned to the same
+ group as this Mesh.
+ */
+ MeshPtr clone(const String& newName, const String& newGroup = StringUtil::BLANK);
+
+ /** Get the axis-aligned bounding box for this mesh.
+ */
+ const AxisAlignedBox& getBounds(void) const;
+
+ /** Gets the radius of the bounding sphere surrounding this mesh. */
+ Real getBoundingSphereRadius(void) const;
+
+ /** Manually set the bounding box for this Mesh.
+ @remarks
+ Calling this method is required when building manual meshes now, because OGRE can no longer
+ update the bounds for you, because it cannot necessarily read vertex data back from
+ the vertex buffers which this mesh uses (they very well might be write-only, and even
+ if they are not, reading data from a hardware buffer is a bottleneck).
+ @param pad If true, a certain padding will be added to the bounding box to separate it from the mesh
+ */
+ void _setBounds(const AxisAlignedBox& bounds, bool pad = true);
+
+ /** Manually set the bounding radius.
+ @remarks
+ Calling this method is required when building manual meshes now, because OGRE can no longer
+ update the bounds for you, because it cannot necessarily read vertex data back from
+ the vertex buffers which this mesh uses (they very well might be write-only, and even
+ if they are not, reading data from a hardware buffer is a bottleneck).
+ */
+ void _setBoundingSphereRadius(Real radius);
+
+ /** Sets the name of the skeleton this Mesh uses for animation.
+ @remarks
+ Meshes can optionally be assigned a skeleton which can be used to animate
+ the mesh through bone assignments. The default is for the Mesh to use no
+ skeleton. Calling this method with a valid skeleton filename will cause the
+ skeleton to be loaded if it is not already (a single skeleton can be shared
+ by many Mesh objects).
+ @param skelName The name of the .skeleton file to use, or an empty string to use
+ no skeleton
+ */
+ void setSkeletonName(const String& skelName);
+
+ /** Returns true if this Mesh has a linked Skeleton. */
+ bool hasSkeleton(void) const;
+
+ /** Returns whether or not this mesh has some kind of vertex animation.
+ */
+ bool hasVertexAnimation(void) const;
+
+ /** Gets a pointer to any linked Skeleton.
+ @returns Weak reference to the skeleton - copy this if you want to hold a strong pointer.
+ */
+ const SkeletonPtr& getSkeleton(void) const;
+
+ /** Gets the name of any linked Skeleton */
+ const String& getSkeletonName(void) const;
+ /** Initialise an animation set suitable for use with this mesh.
+ @remarks
+ Only recommended for use inside the engine, not by applications.
+ */
+ void _initAnimationState(AnimationStateSet* animSet);
+
+ /** Refresh an animation set suitable for use with this mesh.
+ @remarks
+ Only recommended for use inside the engine, not by applications.
+ */
+ void _refreshAnimationState(AnimationStateSet* animSet);
+ /** Assigns a vertex to a bone with a given weight, for skeletal animation.
+ @remarks
+ This method is only valid after calling setSkeletonName.
+ Since this is a one-off process there exists only 'addBoneAssignment' and
+ 'clearBoneAssignments' methods, no 'editBoneAssignment'. You should not need
+ to modify bone assignments during rendering (only the positions of bones) and OGRE
+ reserves the right to do some internal data reformatting of this information, depending
+ on render system requirements.
+ @par
+ This method is for assigning weights to the shared geometry of the Mesh. To assign
+ weights to the per-SubMesh geometry, see the equivalent methods on SubMesh.
+ */
+ void addBoneAssignment(const VertexBoneAssignment& vertBoneAssign);
+
+ /** Removes all bone assignments for this mesh.
+ @remarks
+ This method is for modifying weights to the shared geometry of the Mesh. To assign
+ weights to the per-SubMesh geometry, see the equivalent methods on SubMesh.
+ */
+ void clearBoneAssignments(void);
+
+ /** Internal notification, used to tell the Mesh which Skeleton to use without loading it.
+ @remarks
+ This is only here for unusual situation where you want to manually set up a
+ Skeleton. Best to let OGRE deal with this, don't call it yourself unless you
+ really know what you're doing.
+ */
+ void _notifySkeleton(SkeletonPtr& pSkel);
+
+
+ /** Gets an iterator for access all bone assignments.
+ */
+ BoneAssignmentIterator getBoneAssignmentIterator(void);
+
+
+ /** Automatically generates lower level of detail versions of this mesh for use
+ when a simpler version of the model is acceptable for rendering.
+ @remarks
+ There are 2 ways that you can create level-of-detail (LOD) versions of a mesh;
+ the first is to call this method, which does fairly extensive calculations to
+ work out how to simplify the mesh whilst having the minimum affect on the model.
+ The alternative is to actually create simpler versions of the mesh yourself in
+ a modelling tool, and having exported them, tell the 'master' mesh to use these
+ alternative meshes for lower detail versions; this is done by calling the
+ createManualLodLevel method.
+ @par
+ As well as creating the lower detail versions of the mesh, this method will
+ also associate them with depth values. As soon as an object is at least as far
+ away from the camera as the depth value associated with it's LOD, it will drop
+ to that level of detail.
+ @par
+ I recommend calling this method before mesh export, not at runtime.
+ @param lodDistances A list of depth values indicating the distances at which new lods should be
+ generated.
+ @param reductionMethod The way to determine the number of vertices collapsed per LOD
+ @param reductionValue Meaning depends on reductionMethod, typically either the proportion
+ of remaining vertices to collapse or a fixed number of vertices.
+ */
+ void generateLodLevels(const LodDistanceList& lodDistances,
+ ProgressiveMesh::VertexReductionQuota reductionMethod, Real reductionValue);
+
+ /** Returns the number of levels of detail that this mesh supports.
+ @remarks
+ This number includes the original model.
+ */
+ ushort getNumLodLevels(void) const;
+ /** Gets details of the numbered level of detail entry. */
+ const MeshLodUsage& getLodLevel(ushort index) const;
+ /** Adds a new manual level-of-detail entry to this Mesh.
+ @remarks
+ As an alternative to generating lower level of detail versions of a mesh, you can
+ use your own manually modelled meshes as lower level versions. This lets you
+ have complete control over the LOD, and in addition lets you scale down other
+ aspects of the model which cannot be done using the generated method; for example,
+ you could use less detailed materials and / or use less bones in the skeleton if
+ this is an animated mesh. Therefore for complex models you are likely to be better off
+ modelling your LODs yourself and using this method, whilst for models with fairly
+ simple materials and no animation you can just use the generateLodLevels method.
+ @param fromDepth The z value from which this Lod will apply.
+ @param meshName The name of the mesh which will be the lower level detail version.
+ */
+ void createManualLodLevel(Real fromDepth, const String& meshName);
+
+ /** Changes the alternate mesh to use as a manual LOD at the given index.
+ @remarks
+ Note that the index of a LOD may change if you insert other LODs. If in doubt,
+ use getLodIndex().
+ @param index The index of the level to be changed
+ @param meshName The name of the mesh which will be the lower level detail version.
+ */
+ void updateManualLodLevel(ushort index, const String& meshName);
+
+ /** Retrieves the level of detail index for the given depth value.
+ */
+ ushort getLodIndex(Real depth) const;
+
+ /** Retrieves the level of detail index for the given squared depth value.
+ @remarks
+ Internally the lods are stored at squared depths to avoid having to perform
+ square roots when determining the lod. This method allows you to provide a
+ squared length depth value to avoid having to do your own square roots.
+ */
+ ushort getLodIndexSquaredDepth(Real squaredDepth) const;
+
+ /** Returns true if this mesh is using manual LOD.
+ @remarks
+ A mesh can either use automatically generated LOD, or it can use alternative
+ meshes as provided by an artist. A mesh can only use either all manual LODs
+ or all generated LODs, not a mixture of both.
+ */
+ bool isLodManual(void) const { return mIsLodManual; }
+
+ /** Internal methods for loading LOD, do not use. */
+ void _setLodInfo(unsigned short numLevels, bool isManual);
+ /** Internal methods for loading LOD, do not use. */
+ void _setLodUsage(unsigned short level, MeshLodUsage& usage);
+ /** Internal methods for loading LOD, do not use. */
+ void _setSubMeshLodFaceList(unsigned short subIdx, unsigned short level, IndexData* facedata);
+
+ /** Removes all LOD data from this Mesh. */
+ void removeLodLevels(void);
+
+ /** Sets the policy for the vertex buffers to be used when loading
+ this Mesh.
+ @remarks
+ By default, when loading the Mesh, static, write-only vertex and index buffers
+ will be used where possible in order to improve rendering performance.
+ However, such buffers
+ cannot be manipulated on the fly by CPU code (although shader code can). If you
+ wish to use the CPU to modify these buffers, you should call this method. Note,
+ however, that it only takes effect after the Mesh has been reloaded. Note that you
+ still have the option of manually repacing the buffers in this mesh with your
+ own if you see fit too, in which case you don't need to call this method since it
+ only affects buffers created by the mesh itself.
+ @par
+ You can define the approach to a Mesh by changing the default parameters to
+ MeshManager::load if you wish; this means the Mesh is loaded with those options
+ the first time instead of you having to reload the mesh after changing these options.
+ @param usage The usage flags, which by default are
+ HardwareBuffer::HBU_STATIC_WRITE_ONLY
+ @param shadowBuffer If set to true, the vertex buffers will be created with a
+ system memory shadow buffer. You should set this if you want to be able to
+ read from the buffer, because reading from a hardware buffer is a no-no.
+ */
+ void setVertexBufferPolicy(HardwareBuffer::Usage usage, bool shadowBuffer = false);
+ /** Sets the policy for the index buffers to be used when loading
+ this Mesh.
+ @remarks
+ By default, when loading the Mesh, static, write-only vertex and index buffers
+ will be used where possible in order to improve rendering performance.
+ However, such buffers
+ cannot be manipulated on the fly by CPU code (although shader code can). If you
+ wish to use the CPU to modify these buffers, you should call this method. Note,
+ however, that it only takes effect after the Mesh has been reloaded. Note that you
+ still have the option of manually repacing the buffers in this mesh with your
+ own if you see fit too, in which case you don't need to call this method since it
+ only affects buffers created by the mesh itself.
+ @par
+ You can define the approach to a Mesh by changing the default parameters to
+ MeshManager::load if you wish; this means the Mesh is loaded with those options
+ the first time instead of you having to reload the mesh after changing these options.
+ @param usage The usage flags, which by default are
+ HardwareBuffer::HBU_STATIC_WRITE_ONLY
+ @param shadowBuffer If set to true, the index buffers will be created with a
+ system memory shadow buffer. You should set this if you want to be able to
+ read from the buffer, because reading from a hardware buffer is a no-no.
+ */
+ void setIndexBufferPolicy(HardwareBuffer::Usage usage, bool shadowBuffer = false);
+ /** Gets the usage setting for this meshes vertex buffers. */
+ HardwareBuffer::Usage getVertexBufferUsage(void) const { return mVertexBufferUsage; }
+ /** Gets the usage setting for this meshes index buffers. */
+ HardwareBuffer::Usage getIndexBufferUsage(void) const { return mIndexBufferUsage; }
+ /** Gets whether or not this meshes vertex buffers are shadowed. */
+ bool isVertexBufferShadowed(void) const { return mVertexBufferShadowBuffer; }
+ /** Gets whether or not this meshes index buffers are shadowed. */
+ bool isIndexBufferShadowed(void) const { return mIndexBufferShadowBuffer; }
+
+
+ /** Rationalises the passed in bone assignment list.
+ @remarks
+ OGRE supports up to 4 bone assignments per vertex. The reason for this limit
+ is that this is the maximum number of assignments that can be passed into
+ a hardware-assisted blending algorithm. This method identifies where there are
+ more than 4 bone assignments for a given vertex, and eliminates the bone
+ assignments with the lowest weights to reduce to this limit. The remaining
+ weights are then re-balanced to ensure that they sum to 1.0.
+ @param vertexCount The number of vertices.
+ @param assignments The bone assignment list to rationalise. This list will be modified and
+ entries will be removed where the limits are exceeded.
+ @returns The maximum number of bone assignments per vertex found, clamped to [1-4]
+ */
+ unsigned short _rationaliseBoneAssignments(size_t vertexCount, VertexBoneAssignmentList& assignments);
+
+ /** Internal method, be called once to compile bone assignments into geometry buffer.
+ @remarks
+ The OGRE engine calls this method automatically. It compiles the information
+ submitted as bone assignments into a format usable in realtime. It also
+ eliminates excessive bone assignments (max is OGRE_MAX_BLEND_WEIGHTS)
+ and re-normalises the remaining assignments.
+ */
+ void _compileBoneAssignments(void);
+
+ /** Internal method, be called once to update the compiled bone assignments.
+ @remarks
+ The OGRE engine calls this method automatically. It updates the compiled bone
+ assignments if requested.
+ */
+ void _updateCompiledBoneAssignments(void);
+
+ /** This method builds a set of tangent vectors for a given mesh into a 3D texture coordinate buffer.
+ @remarks
+ Tangent vectors are vectors representing the local 'X' axis for a given vertex based
+ on the orientation of the 2D texture on the geometry. They are built from a combination
+ of existing normals, and from the 2D texture coordinates already baked into the model.
+ They can be used for a number of things, but most of all they are useful for
+ vertex and fragment programs, when you wish to arrive at a common space for doing
+ per-pixel calculations.
+ @par
+ The prerequisites for calling this method include that the vertex data used by every
+ SubMesh has both vertex normals and 2D texture coordinates.
+ @param targetSemantic The semantic to store the tangents in. Defaults to
+ the explicit tangent binding, but note that this is only usable on more
+ modern hardware (Shader Model 2), so if you need portability with older
+ cards you should change this to a texture coordinate binding instead.
+ @param sourceTexCoordSet The texture coordinate index which should be used as the source
+ of 2D texture coordinates, with which to calculate the tangents.
+ @param index The element index, ie the texture coordinate set which should be used to store the 3D
+ coordinates representing a tangent vector per vertex, if targetSemantic is
+ VES_TEXTURE_COORDINATES. If this already exists, it will be overwritten.
+ */
+ void buildTangentVectors(VertexElementSemantic targetSemantic = VES_TANGENT,
+ unsigned short sourceTexCoordSet = 0, unsigned short index = 0);
+
+ /** Ask the mesh to suggest parameters to a future buildTangentVectors call,
+ should you wish to use texture coordinates to store the tangents.
+ @remarks
+ This helper method will suggest source and destination texture coordinate sets
+ for a call to buildTangentVectors. It will detect when there are inappropriate
+ conditions (such as multiple geometry sets which don't agree).
+ Moreover, it will return 'true' if it detects that there are aleady 3D
+ coordinates in the mesh, and therefore tangents may have been prepared already.
+ @param targetSemantic The semantic you intend to use to store the tangents
+ if they are not already present;
+ most likely options are VES_TEXTURE_COORDINATES or VES_TANGENT; you should
+ use texture coordinates if you want compatibility with older, pre-SM2
+ graphics cards, and the tangent binding otherwise.
+ @param outSourceCoordSet Reference to a source texture coordinate set which
+ will be populated
+ @param outIndex Reference to a destination element index (e.g. texture coord set)
+ which will be populated
+ */
+ bool suggestTangentVectorBuildParams(VertexElementSemantic targetSemantic,
+ unsigned short& outSourceCoordSet, unsigned short& outIndex);
+
+ /** Builds an edge list for this mesh, which can be used for generating a shadow volume
+ among other things.
+ */
+ void buildEdgeList(void);
+ /** Destroys and frees the edge lists this mesh has built. */
+ void freeEdgeList(void);
+
+ /** This method prepares the mesh for generating a renderable shadow volume.
+ @remarks
+ Preparing a mesh to generate a shadow volume involves firstly ensuring that the
+ vertex buffer containing the positions for the mesh is a standalone vertex buffer,
+ with no other components in it. This method will therefore break apart any existing
+ vertex buffers this mesh holds if position is sharing a vertex buffer.
+ Secondly, it will double the size of this vertex buffer so that there are 2 copies of
+ the position data for the mesh. The first half is used for the original, and the second
+ half is used for the 'extruded' version of the mesh. The vertex count of the main
+ VertexData used to render the mesh will remain the same though, so as not to add any
+ overhead to regular rendering of the object.
+ Both copies of the position are required in one buffer because shadow volumes stretch
+ from the original mesh to the extruded version.
+ @par
+ Because shadow volumes are rendered in turn, no additional
+ index buffer space is allocated by this method, a shared index buffer allocated by the
+ shadow rendering algorithm is used for addressing this extended vertex buffer.
+ */
+ void prepareForShadowVolume(void);
+
+ /** Return the edge list for this mesh, building it if required.
+ @remarks
+ You must ensure that the Mesh as been prepared for shadow volume
+ rendering if you intend to use this information for that purpose.
+ @lodIndex The LOD at which to get the edge list, 0 being the highest.
+ */
+ EdgeData* getEdgeList(unsigned int lodIndex = 0);
+
+ /** Return the edge list for this mesh, building it if required.
+ @remarks
+ You must ensure that the Mesh as been prepared for shadow volume
+ rendering if you intend to use this information for that purpose.
+ @lodIndex The LOD at which to get the edge list, 0 being the highest.
+ */
+ const EdgeData* getEdgeList(unsigned int lodIndex = 0) const;
+
+ /** Returns whether this mesh has already had it's geometry prepared for use in
+ rendering shadow volumes. */
+ bool isPreparedForShadowVolumes(void) const { return mPreparedForShadowVolumes; }
+
+ /** Returns whether this mesh has an attached edge list. */
+ bool isEdgeListBuilt(void) const { return mEdgeListsBuilt; }
+
+ /** Prepare matrices for software indexed vertex blend.
+ @remarks
+ This function organise bone indexed matrices to blend indexed matrices,
+ so software vertex blending can access to the matrix via blend index
+ directly.
+ @param blendMatrices Pointer to an array of matrix pointers to store
+ prepared results, which indexed by blend index
+ @param boneMatrices Pointer to an array of matrices to be used to blend,
+ which indexed by bone index
+ @param indexMap The index map used to translate blend index to bone index
+ */
+ static void prepareMatricesForVertexBlend(const Matrix4** blendMatrices,
+ const Matrix4* boneMatrices, const IndexMap& indexMap);
+
+ /** Performs a software indexed vertex blend, of the kind used for
+ skeletal animation although it can be used for other purposes.
+ @remarks
+ This function is supplied to update vertex data with blends
+ done in software, either because no hardware support is available,
+ or that you need the results of the blend for some other CPU operations.
+ @param sourceVertexData VertexData class containing positions, normals,
+ blend indices and blend weights.
+ @param targetVertexData VertexData class containing target position
+ and normal buffers which will be updated with the blended versions.
+ Note that the layout of the source and target position / normal
+ buffers must be identical, ie they must use the same buffer indexes
+ @param blendMatrices Pointer to an array of matrix pointers to be used to blend,
+ indexed by blend indices in the sourceVertexData
+ @param numMatrices Number of matrices in the blendMatrices, it might be used
+ as a hint for optimisation.
+ @param blendNormals If true, normals are blended as well as positions
+ */
+ static void softwareVertexBlend(const VertexData* sourceVertexData,
+ const VertexData* targetVertexData,
+ const Matrix4* const* blendMatrices, size_t numMatrices,
+ bool blendNormals);
+
+ /** Performs a software vertex morph, of the kind used for
+ morph animation although it can be used for other purposes.
+ @remarks
+ This function will linearly interpolate positions between two
+ source buffers, into a third buffer.
+ @param t Parametric distance between the start and end buffer positions
+ @param b1 Vertex buffer containing VET_FLOAT3 entries for the start positions
+ @param b2 Vertex buffer containing VET_FLOAT3 entries for the end positions
+ @param targetVertexData VertexData destination; assumed to have a separate position
+ buffer already bound, and the number of vertices must agree with the
+ number in start and end
+ */
+ static void softwareVertexMorph(Real t,
+ const HardwareVertexBufferSharedPtr& b1,
+ const HardwareVertexBufferSharedPtr& b2,
+ VertexData* targetVertexData);
+
+ /** Performs a software vertex pose blend, of the kind used for
+ morph animation although it can be used for other purposes.
+ @remarks
+ This function will apply a weighted offset to the positions in the
+ incoming vertex data (therefore this is a read/write operation, and
+ if you expect to call it more than once with the same data, then
+ you would be best to suppress hardware uploads of the position buffer
+ for the duration)
+ @param weight Parametric weight to scale the offsets by
+ @param vertexOffsetMap Potentially sparse map of vertex index -> offset
+ @param targetVertexData VertexData destination; assumed to have a separate position
+ buffer already bound, and the number of vertices must agree with the
+ number in start and end
+ */
+ static void softwareVertexPoseBlend(Real weight,
+ const std::map& vertexOffsetMap,
+ VertexData* targetVertexData);
+ /** Gets a reference to the optional name assignments of the SubMeshes. */
+ const SubMeshNameMap& getSubMeshNameMap(void) const { return mSubMeshNameMap; }
+
+ /** Sets whether or not this Mesh should automatically build edge lists
+ when asked for them, or whether it should never build them if
+ they are not already provided.
+ @remarks
+ This allows you to create meshes which do not have edge lists calculated,
+ because you never want to use them. This value defaults to 'true'
+ for mesh formats which did not include edge data, and 'false' for
+ newer formats, where edge lists are expected to have been generated
+ in advance.
+ */
+ void setAutoBuildEdgeLists(bool autobuild) { mAutoBuildEdgeLists = autobuild; }
+ /** Sets whether or not this Mesh should automatically build edge lists
+ when asked for them, or whether it should never build them if
+ they are not already provided.
+ */
+ bool getAutoBuildEdgeLists(void) const { return mAutoBuildEdgeLists; }
+
+ /** Gets the type of vertex animation the shared vertex data of this mesh supports.
+ */
+ virtual VertexAnimationType getSharedVertexDataAnimationType(void) const;
+
+ /** Creates a new Animation object for vertex animating this mesh.
+ @param name The name of this animation
+ @param length The length of the animation in seconds
+ */
+ virtual Animation* createAnimation(const String& name, Real length);
+
+ /** Returns the named vertex Animation object.
+ @param name The name of the animation
+ */
+ virtual Animation* getAnimation(const String& name) const;
+
+ /** Internal access to the named vertex Animation object - returns null
+ if it does not exist.
+ @param name The name of the animation
+ */
+ virtual Animation* _getAnimationImpl(const String& name) const;
+
+ /** Returns whether this mesh contains the named vertex animation. */
+ virtual bool hasAnimation(const String& name);
+
+ /** Removes vertex Animation from this mesh. */
+ virtual void removeAnimation(const String& name);
+
+ /** Gets the number of morph animations in this mesh. */
+ virtual unsigned short getNumAnimations(void) const;
+
+ /** Gets a single morph animation by index.
+ */
+ virtual Animation* getAnimation(unsigned short index) const;
+
+ /** Removes all morph Animations from this mesh. */
+ virtual void removeAllAnimations(void);
+ /** Gets a pointer to a vertex data element based on a morph animation
+ track handle.
+ @remarks
+ 0 means the shared vertex data, 1+ means a submesh vertex data (index+1)
+ */
+ VertexData* getVertexDataByTrackHandle(unsigned short handle);
+ /** Iterates through all submeshes and requests them
+ to apply their texture aliases to the material they use.
+ @remarks
+ The submesh will only apply texture aliases to the material if matching
+ texture alias names are found in the material. If a match is found, the
+ submesh will automatically clone the original material and then apply its
+ texture to the new material.
+ @par
+ This method is normally called by the protected method loadImpl when a
+ mesh if first loaded.
+ */
+ void updateMaterialForAllSubMeshes(void);
+
+ /** Internal method which, if animation types have not been determined,
+ scans any vertex animations and determines the type for each set of
+ vertex data (cannot have 2 different types).
+ */
+ void _determineAnimationTypes(void) const;
+ /** Are the derived animation types out of date? */
+ bool _getAnimationTypesDirty(void) const { return mAnimationTypesDirty; }
+
+ /** Create a new Pose for this mesh or one of its submeshes.
+ @param target The target geometry index; 0 is the shared Mesh geometry, 1+ is the
+ dedicated SubMesh geometry belonging to submesh index + 1.
+ @param name Name to give the pose, which is optional
+ @returns A new Pose ready for population
+ */
+ Pose* createPose(ushort target, const String& name = StringUtil::BLANK);
+ /** Get the number of poses.*/
+ size_t getPoseCount(void) const { return mPoseList.size(); }
+ /** Retrieve an existing Pose by index.*/
+ Pose* getPose(ushort index);
+ /** Retrieve an existing Pose by name.*/
+ Pose* getPose(const String& name);
+ /** Destroy a pose by index.
+ @note This will invalidate any animation tracks referring to this pose or those after it.
+ */
+ void removePose(ushort index);
+ /** Destroy a pose by name.
+ @note This will invalidate any animation tracks referring to this pose or those after it.
+ */
+ void removePose(const String& name);
+ /** Destroy all poses */
+ void removeAllPoses(void);
+
+ typedef VectorIterator PoseIterator;
+ typedef ConstVectorIterator ConstPoseIterator;
+
+ /** Get an iterator over all the poses defined. */
+ PoseIterator getPoseIterator(void);
+ /** Get an iterator over all the poses defined. */
+ ConstPoseIterator getPoseIterator(void) const;
+ /** Get pose list */
+ const PoseList& getPoseList(void) const;
+
+ };
+
+ /** Specialisation of SharedPtr to allow SharedPtr to be assigned to MeshPtr
+ @note Has to be a subclass since we need operator=.
+ We could templatise this instead of repeating per Resource subclass,
+ except to do so requires a form VC6 does not support i.e.
+ ResourceSubclassPtr : public SharedPtr
+ */
+ class _OgreExport MeshPtr : public SharedPtr
+ {
+ public:
+ MeshPtr() : SharedPtr() {}
+ explicit MeshPtr(Mesh* rep) : SharedPtr(rep) {}
+ MeshPtr(const MeshPtr& r) : SharedPtr(r) {}
+ MeshPtr(const ResourcePtr& r);
+ /// Operator used to convert a ResourcePtr to a MeshPtr
+ MeshPtr& operator=(const ResourcePtr& r);
+ protected:
+ /// Override destroy since we need to delete Mesh after fully defined
+ void destroy(void);
+ };
+
+ /** A way of recording the way each LODs is recorded this Mesh. */
+ struct MeshLodUsage
+ {
+ /// squared Z value from which this LOD will apply
+ Real fromDepthSquared;
+ /// Only relevant if mIsLodManual is true, the name of the alternative mesh to use
+ String manualName;
+ /// Hard link to mesh to avoid looking up each time
+ mutable MeshPtr manualMesh;
+ /// Edge list for this LOD level (may be derived from manual mesh)
+ mutable EdgeData* edgeData;
+ };
+
+
+
+} // namespace
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreMeshFileFormat.h b/school/informatik/verkerhssimulation/src/ogre/OgreMeshFileFormat.h
new file mode 100644
index 00000000..c9134f42
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreMeshFileFormat.h
@@ -0,0 +1,277 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __MeshFileFormat_H__
+#define __MeshFileFormat_H__
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre {
+
+/** Definition of the OGRE .mesh file format
+
+ .mesh files are binary files (for read efficiency at runtime) and are arranged into chunks
+ of data, very like 3D Studio's format.
+ A chunk always consists of:
+ unsigned short CHUNK_ID : one of the following chunk ids identifying the chunk
+ unsigned long LENGTH : length of the chunk in bytes, including this header
+ void* DATA : the data, which may contain other sub-chunks (various data types)
+
+ A .mesh file can contain both the definition of the Mesh itself, and optionally the definitions
+ of the materials is uses (although these can be omitted, if so the Mesh assumes that at runtime the
+ Materials referred to by name in the Mesh are loaded/created from another source)
+
+ A .mesh file only contains a single mesh, which can itself have multiple submeshes.
+
+*/
+
+ enum MeshChunkID {
+ M_HEADER = 0x1000,
+ // char* version : Version number check
+ M_MESH = 0x3000,
+ // bool skeletallyAnimated // important flag which affects h/w buffer policies
+ // Optional M_GEOMETRY chunk
+ M_SUBMESH = 0x4000,
+ // char* materialName
+ // bool useSharedVertices
+ // unsigned int indexCount
+ // bool indexes32Bit
+ // unsigned int* faceVertexIndices (indexCount)
+ // OR
+ // unsigned short* faceVertexIndices (indexCount)
+ // M_GEOMETRY chunk (Optional: present only if useSharedVertices = false)
+ M_SUBMESH_OPERATION = 0x4010, // optional, trilist assumed if missing
+ // unsigned short operationType
+ M_SUBMESH_BONE_ASSIGNMENT = 0x4100,
+ // Optional bone weights (repeating section)
+ // unsigned int vertexIndex;
+ // unsigned short boneIndex;
+ // float weight;
+ // Optional chunk that matches a texture name to an alias
+ // a texture alias is sent to the submesh material to use this texture name
+ // instead of the one in the texture unit with a matching alias name
+ M_SUBMESH_TEXTURE_ALIAS = 0x4200, // Repeating section
+ // char* aliasName;
+ // char* textureName;
+
+ M_GEOMETRY = 0x5000, // NB this chunk is embedded within M_MESH and M_SUBMESH
+ // unsigned int vertexCount
+ M_GEOMETRY_VERTEX_DECLARATION = 0x5100,
+ M_GEOMETRY_VERTEX_ELEMENT = 0x5110, // Repeating section
+ // unsigned short source; // buffer bind source
+ // unsigned short type; // VertexElementType
+ // unsigned short semantic; // VertexElementSemantic
+ // unsigned short offset; // start offset in buffer in bytes
+ // unsigned short index; // index of the semantic (for colours and texture coords)
+ M_GEOMETRY_VERTEX_BUFFER = 0x5200, // Repeating section
+ // unsigned short bindIndex; // Index to bind this buffer to
+ // unsigned short vertexSize; // Per-vertex size, must agree with declaration at this index
+ M_GEOMETRY_VERTEX_BUFFER_DATA = 0x5210,
+ // raw buffer data
+ M_MESH_SKELETON_LINK = 0x6000,
+ // Optional link to skeleton
+ // char* skeletonName : name of .skeleton to use
+ M_MESH_BONE_ASSIGNMENT = 0x7000,
+ // Optional bone weights (repeating section)
+ // unsigned int vertexIndex;
+ // unsigned short boneIndex;
+ // float weight;
+ M_MESH_LOD = 0x8000,
+ // Optional LOD information
+ // unsigned short numLevels;
+ // bool manual; (true for manual alternate meshes, false for generated)
+ M_MESH_LOD_USAGE = 0x8100,
+ // Repeating section, ordered in increasing depth
+ // NB LOD 0 (full detail from 0 depth) is omitted
+ // float fromSquaredDepth;
+ M_MESH_LOD_MANUAL = 0x8110,
+ // Required if M_MESH_LOD section manual = true
+ // String manualMeshName;
+ M_MESH_LOD_GENERATED = 0x8120,
+ // Required if M_MESH_LOD section manual = false
+ // Repeating section (1 per submesh)
+ // unsigned int indexCount;
+ // bool indexes32Bit
+ // unsigned short* faceIndexes; (indexCount)
+ // OR
+ // unsigned int* faceIndexes; (indexCount)
+ M_MESH_BOUNDS = 0x9000,
+ // float minx, miny, minz
+ // float maxx, maxy, maxz
+ // float radius
+
+ // Added By DrEvil
+ // optional chunk that contains a table of submesh indexes and the names of
+ // the sub-meshes.
+ M_SUBMESH_NAME_TABLE = 0xA000,
+ // Subchunks of the name table. Each chunk contains an index & string
+ M_SUBMESH_NAME_TABLE_ELEMENT = 0xA100,
+ // short index
+ // char* name
+
+ // Optional chunk which stores precomputed edge data
+ M_EDGE_LISTS = 0xB000,
+ // Each LOD has a separate edge list
+ M_EDGE_LIST_LOD = 0xB100,
+ // unsigned short lodIndex
+ // bool isManual // If manual, no edge data here, loaded from manual mesh
+ // bool isClosed
+ // unsigned long numTriangles
+ // unsigned long numEdgeGroups
+ // Triangle* triangleList
+ // unsigned long indexSet
+ // unsigned long vertexSet
+ // unsigned long vertIndex[3]
+ // unsigned long sharedVertIndex[3]
+ // float normal[4]
+
+ M_EDGE_GROUP = 0xB110,
+ // unsigned long vertexSet
+ // unsigned long triStart
+ // unsigned long triCount
+ // unsigned long numEdges
+ // Edge* edgeList
+ // unsigned long triIndex[2]
+ // unsigned long vertIndex[2]
+ // unsigned long sharedVertIndex[2]
+ // bool degenerate
+
+ // Optional poses section, referred to by pose keyframes
+ M_POSES = 0xC000,
+ M_POSE = 0xC100,
+ // char* name (may be blank)
+ // unsigned short target // 0 for shared geometry,
+ // 1+ for submesh index + 1
+ M_POSE_VERTEX = 0xC111,
+ // unsigned long vertexIndex
+ // float xoffset, yoffset, zoffset
+ // Optional vertex animation chunk
+ M_ANIMATIONS = 0xD000,
+ M_ANIMATION = 0xD100,
+ // char* name
+ // float length
+ M_ANIMATION_TRACK = 0xD110,
+ // unsigned short type // 1 == morph, 2 == pose
+ // unsigned short target // 0 for shared geometry,
+ // 1+ for submesh index + 1
+ M_ANIMATION_MORPH_KEYFRAME = 0xD111,
+ // float time
+ // float x,y,z // repeat by number of vertices in original geometry
+ M_ANIMATION_POSE_KEYFRAME = 0xD112,
+ // float time
+ M_ANIMATION_POSE_REF = 0xD113, // repeat for number of referenced poses
+ // unsigned short poseIndex
+ // float influence
+
+ // Optional submesh extreme vertex list chink
+ M_TABLE_EXTREMES = 0xE000,
+ // unsigned short submesh_index;
+ // float extremes [n_extremes][3];
+
+ /* Version 1.2 of the .mesh fornmat (deprecated)
+ enum MeshChunkID {
+ M_HEADER = 0x1000,
+ // char* version : Version number check
+ M_MESH = 0x3000,
+ // bool skeletallyAnimated // important flag which affects h/w buffer policies
+ // Optional M_GEOMETRY chunk
+ M_SUBMESH = 0x4000,
+ // char* materialName
+ // bool useSharedVertices
+ // unsigned int indexCount
+ // bool indexes32Bit
+ // unsigned int* faceVertexIndices (indexCount)
+ // OR
+ // unsigned short* faceVertexIndices (indexCount)
+ // M_GEOMETRY chunk (Optional: present only if useSharedVertices = false)
+ M_SUBMESH_OPERATION = 0x4010, // optional, trilist assumed if missing
+ // unsigned short operationType
+ M_SUBMESH_BONE_ASSIGNMENT = 0x4100,
+ // Optional bone weights (repeating section)
+ // unsigned int vertexIndex;
+ // unsigned short boneIndex;
+ // float weight;
+ M_GEOMETRY = 0x5000, // NB this chunk is embedded within M_MESH and M_SUBMESH
+ */
+ // unsigned int vertexCount
+ // float* pVertices (x, y, z order x numVertices)
+ M_GEOMETRY_NORMALS = 0x5100, //(Optional)
+ // float* pNormals (x, y, z order x numVertices)
+ M_GEOMETRY_COLOURS = 0x5200, //(Optional)
+ // unsigned long* pColours (RGBA 8888 format x numVertices)
+ M_GEOMETRY_TEXCOORDS = 0x5300, //(Optional, REPEATABLE, each one adds an extra set)
+ // unsigned short dimensions (1 for 1D, 2 for 2D, 3 for 3D)
+ // float* pTexCoords (u [v] [w] order, dimensions x numVertices)
+ /*
+ M_MESH_SKELETON_LINK = 0x6000,
+ // Optional link to skeleton
+ // char* skeletonName : name of .skeleton to use
+ M_MESH_BONE_ASSIGNMENT = 0x7000,
+ // Optional bone weights (repeating section)
+ // unsigned int vertexIndex;
+ // unsigned short boneIndex;
+ // float weight;
+ M_MESH_LOD = 0x8000,
+ // Optional LOD information
+ // unsigned short numLevels;
+ // bool manual; (true for manual alternate meshes, false for generated)
+ M_MESH_LOD_USAGE = 0x8100,
+ // Repeating section, ordered in increasing depth
+ // NB LOD 0 (full detail from 0 depth) is omitted
+ // float fromSquaredDepth;
+ M_MESH_LOD_MANUAL = 0x8110,
+ // Required if M_MESH_LOD section manual = true
+ // String manualMeshName;
+ M_MESH_LOD_GENERATED = 0x8120,
+ // Required if M_MESH_LOD section manual = false
+ // Repeating section (1 per submesh)
+ // unsigned int indexCount;
+ // bool indexes32Bit
+ // unsigned short* faceIndexes; (indexCount)
+ // OR
+ // unsigned int* faceIndexes; (indexCount)
+ M_MESH_BOUNDS = 0x9000
+ // float minx, miny, minz
+ // float maxx, maxy, maxz
+ // float radius
+
+ // Added By DrEvil
+ // optional chunk that contains a table of submesh indexes and the names of
+ // the sub-meshes.
+ M_SUBMESH_NAME_TABLE,
+ // Subchunks of the name table. Each chunk contains an index & string
+ M_SUBMESH_NAME_TABLE_ELEMENT,
+ // short index
+ // char* name
+
+ */
+ };
+} // namespace
+
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreMeshManager.h b/school/informatik/verkerhssimulation/src/ogre/OgreMeshManager.h
new file mode 100644
index 00000000..377da0bf
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreMeshManager.h
@@ -0,0 +1,431 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __MeshManager_H__
+#define __MeshManager_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreResourceManager.h"
+#include "OgreSingleton.h"
+#include "OgreVector3.h"
+#include "OgreHardwareBuffer.h"
+#include "OgreMesh.h"
+#include "OgrePatchMesh.h"
+
+namespace Ogre {
+
+ /** Handles the management of mesh resources.
+ @remarks
+ This class deals with the runtime management of
+ mesh data; like other resource managers it handles
+ the creation of resources (in this case mesh data),
+ working within a fixed memory budget.
+ */
+ class _OgreExport MeshManager: public ResourceManager, public Singleton,
+ public ManualResourceLoader
+ {
+ public:
+ MeshManager();
+ ~MeshManager();
+
+ /** Initialises the manager, only to be called by OGRE internally. */
+ void _initialise(void);
+
+ /** Loads a mesh from a file, making it immediately available for use.
+ @note
+ If the model has already been loaded, the existing instance
+ will be returned.
+ @remarks
+ Ogre loads model files from it's own proprietary
+ format called .mesh. This is because having a single file
+ format is better for runtime performance, and we also have
+ control over pre-processed data (such as
+ collision boxes, LOD reductions etc).
+ @param filename The name of the .mesh file
+ @param groupName The name of the resource group to assign the mesh to
+ @param vertexBufferUsage The usage flags with which the vertex buffer(s)
+ will be created
+ @param indexBufferUsage The usage flags with which the index buffer(s) created for
+ this mesh will be created with.
+ @param vertexBufferShadowed If true, the vertex buffers will be shadowed by system memory
+ copies for faster read access
+ @param indexBufferShadowed If true, the index buffers will be shadowed by system memory
+ copies for faster read access
+ @param priority The priority of this mesh in the resource system
+ */
+ MeshPtr load( const String& filename, const String& groupName,
+ HardwareBuffer::Usage vertexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY,
+ HardwareBuffer::Usage indexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY,
+ bool vertexBufferShadowed = true, bool indexBufferShadowed = true);
+
+
+ /** Creates a new Mesh specifically for manual definition rather
+ than loading from an object file.
+ @remarks
+ Note that once you've defined your mesh, you must call Mesh::_setBounds and
+ Mesh::_setBoundingRadius in order to define the bounds of your mesh. In previous
+ versions of OGRE you could call Mesh::_updateBounds, but OGRE's support of
+ write-only vertex buffers makes this no longer appropriate.
+ @param name The name to give the new mesh
+ @param groupName The name of the resource group to assign the mesh to
+ @param loader ManualResourceLoader which will be called to load this mesh
+ when the time comes. It is recommended that you populate this field
+ in order that the mesh can be rebuilt should the need arise
+ */
+ MeshPtr createManual( const String& name, const String& groupName,
+ ManualResourceLoader* loader = 0);
+
+ /** Creates a basic plane, by default majoring on the x/y axes facing positive Z.
+ @param
+ name The name to give the resulting mesh
+ @param
+ groupName The name of the resource group to assign the mesh to
+ @param
+ plane The orientation of the plane and distance from the origin
+ @param
+ width The width of the plane in world coordinates
+ @param
+ height The height of the plane in world coordinates
+ @param
+ xsegments The number of segements to the plane in the x direction
+ @param
+ ysegments The number of segements to the plane in the y direction
+ @param
+ normals If true, normals are created perpendicular to the plane
+ @param
+ numTexCoordSets The number of 2D texture coordinate sets created - by default the corners
+ are created to be the corner of the texture.
+ @param
+ uTile The number of times the texture should be repeated in the u direction
+ @param
+ vTile The number of times the texture should be repeated in the v direction
+ @param
+ upVector The 'Up' direction of the plane.
+ @param
+ vertexBufferUsage The usage flag with which the vertex buffer for this plane will be created
+ @param
+ indexBufferUsage The usage flag with which the index buffer for this plane will be created
+ @param
+ vertexShadowBuffer If this flag is set to true, the vertex buffer will be created
+ with a system memory shadow buffer,
+ allowing you to read it back more efficiently than if it is in hardware
+ @param
+ indexShadowBuffer If this flag is set to true, the index buffer will be
+ created with a system memory shadow buffer,
+ allowing you to read it back more efficiently than if it is in hardware
+ */
+ MeshPtr createPlane(
+ const String& name, const String& groupName, const Plane& plane,
+ Real width, Real height,
+ int xsegments = 1, int ysegments = 1,
+ bool normals = true, int numTexCoordSets = 1,
+ Real uTile = 1.0f, Real vTile = 1.0f, const Vector3& upVector = Vector3::UNIT_Y,
+ HardwareBuffer::Usage vertexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY,
+ HardwareBuffer::Usage indexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY,
+ bool vertexShadowBuffer = true, bool indexShadowBuffer = true);
+
+
+ /** Creates a plane, which because of it's texture coordinates looks like a curved
+ surface, useful for skies in a skybox.
+ @param
+ name The name to give the resulting mesh
+ @param
+ groupName The name of the resource group to assign the mesh to
+ @param
+ plane The orientation of the plane and distance from the origin
+ @param
+ width The width of the plane in world coordinates
+ @param
+ height The height of the plane in world coordinates
+ @param
+ curvature The curvature of the plane. Good values are
+ between 2 and 65. Higher values are more curved leading to
+ a smoother effect, lower values are less curved meaning
+ more distortion at the horizons but a better distance effect.
+ @param
+ xsegments The number of segements to the plane in the x direction
+ @param
+ ysegments The number of segements to the plane in the y direction
+ @param
+ normals If true, normals are created perpendicular to the plane
+ @param
+ numTexCoordSets The number of 2D texture coordinate sets created - by default the corners
+ are created to be the corner of the texture.
+ @param
+ uTile The number of times the texture should be repeated in the u direction
+ @param
+ vTile The number of times the texture should be repeated in the v direction
+ @param
+ upVector The 'Up' direction of the plane.
+ @param
+ orientation The orientation of the overall sphere that's used to create the illusion
+ @param
+ vertexBufferUsage The usage flag with which the vertex buffer for this plane will be created
+ @param
+ indexBufferUsage The usage flag with which the index buffer for this plane will be created
+ @param
+ vertexShadowBuffer If this flag is set to true, the vertex buffer will be created
+ with a system memory shadow buffer,
+ allowing you to read it back more efficiently than if it is in hardware
+ @param
+ indexShadowBuffer If this flag is set to true, the index buffer will be
+ created with a system memory shadow buffer,
+ allowing you to read it back more efficiently than if it is in hardware
+ @param ySegmentsToKeep The number of segments from the top of the dome
+ downwards to keep. -1 keeps all of them. This can save fillrate if
+ you cannot see much of the sky lower down.
+ */
+ MeshPtr createCurvedIllusionPlane(
+ const String& name, const String& groupName, const Plane& plane,
+ Real width, Real height, Real curvature,
+ int xsegments = 1, int ysegments = 1,
+ bool normals = true, int numTexCoordSets = 1,
+ Real uTile = 1.0f, Real vTile = 1.0f, const Vector3& upVector = Vector3::UNIT_Y,
+ const Quaternion& orientation = Quaternion::IDENTITY,
+ HardwareBuffer::Usage vertexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY,
+ HardwareBuffer::Usage indexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY,
+ bool vertexShadowBuffer = true, bool indexShadowBuffer = true,
+ int ySegmentsToKeep = -1);
+
+ /** Creates a genuinely curved plane, by default majoring on the x/y axes facing positive Z.
+ @param
+ name The name to give the resulting mesh
+ @param
+ groupName The name of the resource group to assign the mesh to
+ @param
+ plane The orientation of the plane and distance from the origin
+ @param
+ width The width of the plane in world coordinates
+ @param
+ height The height of the plane in world coordinates
+ @param
+ bow The amount of 'bow' in the curved plane. (Could also be concidered the depth.)
+ @param
+ xsegments The number of segements to the plane in the x direction
+ @param
+ ysegments The number of segements to the plane in the y direction
+ @param
+ normals If true, normals are created perpendicular to the plane
+ @param
+ numTexCoordSets The number of 2D texture coordinate sets created - by default the corners
+ are created to be the corner of the texture.
+ @param
+ uTile The number of times the texture should be repeated in the u direction
+ @param
+ vTile The number of times the texture should be repeated in the v direction
+ @param
+ upVector The 'Up' direction of the plane.
+ @param
+ vertexBufferUsage The usage flag with which the vertex buffer for this plane will be created
+ @param
+ indexBufferUsage The usage flag with which the index buffer for this plane will be created
+ @param
+ vertexShadowBuffer If this flag is set to true, the vertex buffer will be created
+ with a system memory shadow buffer,
+ allowing you to read it back more efficiently than if it is in hardware
+ @param
+ indexShadowBuffer If this flag is set to true, the index buffer will be
+ created with a system memory shadow buffer,
+ allowing you to read it back more efficiently than if it is in hardware
+ */
+ MeshPtr createCurvedPlane(
+ const String& name, const String& groupName, const Plane& plane,
+ Real width, Real height, Real bow = 0.5f,
+ int xsegments = 1, int ysegments = 1,
+ bool normals = false, int numTexCoordSets = 1,
+ Real xTile = 1.0f, Real yTile = 1.0f, const Vector3& upVector = Vector3::UNIT_Y,
+ HardwareBuffer::Usage vertexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY,
+ HardwareBuffer::Usage indexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY,
+ bool vertexShadowBuffer = true, bool indexShadowBuffer = true);
+
+ /** Creates a Bezier patch based on an array of control vertices.
+ @param
+ name The name to give the newly created mesh.
+ @param
+ groupName The name of the resource group to assign the mesh to
+ @param
+ controlPointBuffer A pointer to a buffer containing the vertex data which defines control points
+ of the curves rather than actual vertices. Note that you are expected to provide not
+ just position information, but potentially normals and texture coordinates too. The
+ format of the buffer is defined in the VertexDeclaration parameter
+ @param
+ decaration VertexDeclaration describing the contents of the buffer.
+ Note this declaration must _only_ draw on buffer source 0!
+ @param
+ width Specifies the width of the patch in control points.
+ Note this parameter must greater than or equal to 3.
+ @param
+ height Specifies the height of the patch in control points.
+ Note this parameter must greater than or equal to 3.
+ @param
+ uMaxSubdivisionLevel,vMaxSubdivisionLevel If you want to manually set the top level of subdivision,
+ do it here, otherwise let the system decide.
+ @param
+ visibleSide Determines which side of the patch (or both) triangles are generated for.
+ @param
+ vbUsage Vertex buffer usage flags. Recommend the default since vertex buffer should be static.
+ @param
+ ibUsage Index buffer usage flags. Recommend the default since index buffer should
+ be dynamic to change levels but not readable.
+ @param
+ vbUseShadow Flag to determine if a shadow buffer is generated for the vertex buffer. See
+ HardwareBuffer for full details.
+ @param
+ ibUseShadow Flag to determine if a shadow buffer is generated for the index buffer. See
+ HardwareBuffer for full details.
+ */
+ PatchMeshPtr createBezierPatch(
+ const String& name, const String& groupName, void* controlPointBuffer,
+ VertexDeclaration *declaration, size_t width, size_t height,
+ size_t uMaxSubdivisionLevel = PatchSurface::AUTO_LEVEL,
+ size_t vMaxSubdivisionLevel = PatchSurface::AUTO_LEVEL,
+ PatchSurface::VisibleSide visibleSide = PatchSurface::VS_FRONT,
+ HardwareBuffer::Usage vbUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY,
+ HardwareBuffer::Usage ibUsage = HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY,
+ bool vbUseShadow = true, bool ibUseShadow = true);
+
+ /** Tells the mesh manager that all future meshes should prepare themselves for
+ shadow volumes on loading.
+ */
+ void setPrepareAllMeshesForShadowVolumes(bool enable);
+ /** Retrieves whether all Meshes should prepare themselves for shadow volumes. */
+ bool getPrepareAllMeshesForShadowVolumes(void);
+
+ /** Override standard Singleton retrieval.
+ @remarks
+ Why do we do this? Well, it's because the Singleton
+ implementation is in a .h file, which means it gets compiled
+ into anybody who includes it. This is needed for the
+ Singleton template to work, but we actually only want it
+ compiled into the implementation of the class based on the
+ Singleton, not all of them. If we don't change this, we get
+ link errors when trying to use the Singleton-based class from
+ an outside dll.
+ @par
+ This method just delegates to the template version anyway,
+ but the implementation stays in this single compilation unit,
+ preventing link errors.
+ */
+ static MeshManager& getSingleton(void);
+ /** Override standard Singleton retrieval.
+ @remarks
+ Why do we do this? Well, it's because the Singleton
+ implementation is in a .h file, which means it gets compiled
+ into anybody who includes it. This is needed for the
+ Singleton template to work, but we actually only want it
+ compiled into the implementation of the class based on the
+ Singleton, not all of them. If we don't change this, we get
+ link errors when trying to use the Singleton-based class from
+ an outside dll.
+ @par
+ This method just delegates to the template version anyway,
+ but the implementation stays in this single compilation unit,
+ preventing link errors.
+ */
+ static MeshManager* getSingletonPtr(void);
+
+ /** Gets the factor by which the bounding box of an entity is padded.
+ Default is 0.01
+ */
+ Real getBoundsPaddingFactor(void);
+
+ /** Sets the factor by which the bounding box of an entity is padded
+ */
+ void setBoundsPaddingFactor(Real paddingFactor);
+
+ /** @see ManualResourceLoader::loadResource */
+ void loadResource(Resource* res);
+
+ protected:
+ /// @copydoc ResourceManager::createImpl
+ Resource* createImpl(const String& name, ResourceHandle handle,
+ const String& group, bool isManual, ManualResourceLoader* loader,
+ const NameValuePairList* createParams);
+
+ /** Utility method for tesselating 2D meshes.
+ */
+ void tesselate2DMesh(SubMesh* pSub, int meshWidth, int meshHeight,
+ bool doubleSided = false,
+ HardwareBuffer::Usage indexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY,
+ bool indexSysMem = false);
+
+ void createPrefabPlane(void);
+ void createPrefabCube(void);
+ void createPrefabSphere(void);
+
+ /** Enum identifying the types of manual mesh built by this manager */
+ enum MeshBuildType
+ {
+ MBT_PLANE,
+ MBT_CURVED_ILLUSION_PLANE,
+ MBT_CURVED_PLANE
+ };
+ /** Saved parameters used to (re)build a manual mesh built by this class */
+ struct MeshBuildParams
+ {
+ MeshBuildType type;
+ Plane plane;
+ Real width;
+ Real height;
+ Real curvature;
+ int xsegments;
+ int ysegments;
+ bool normals;
+ int numTexCoordSets;
+ Real xTile;
+ Real yTile;
+ Vector3 upVector;
+ Quaternion orientation;
+ HardwareBuffer::Usage vertexBufferUsage;
+ HardwareBuffer::Usage indexBufferUsage;
+ bool vertexShadowBuffer;
+ bool indexShadowBuffer;
+ int ySegmentsToKeep;
+ };
+ /** Map from resource pointer to parameter set */
+ typedef std::map MeshBuildParamsMap;
+ MeshBuildParamsMap mMeshBuildParams;
+
+ /** Utility method for manual loading a plane */
+ void loadManualPlane(Mesh* pMesh, MeshBuildParams& params);
+ /** Utility method for manual loading a curved plane */
+ void loadManualCurvedPlane(Mesh* pMesh, MeshBuildParams& params);
+ /** Utility method for manual loading a curved illusion plane */
+ void loadManualCurvedIllusionPlane(Mesh* pMesh, MeshBuildParams& params);
+
+ bool mPrepAllMeshesForShadowVolumes;
+
+ //the factor by which the bounding box of an entity is padded
+ Real mBoundsPaddingFactor;
+ };
+
+
+} //namespace
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreMeshSerializer.h b/school/informatik/verkerhssimulation/src/ogre/OgreMeshSerializer.h
new file mode 100644
index 00000000..ccf7b966
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreMeshSerializer.h
@@ -0,0 +1,99 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __MeshSerializer_H__
+#define __MeshSerializer_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreMeshSerializerImpl.h"
+#include "OgreSerializer.h"
+
+namespace Ogre {
+
+ /** Class for serialising mesh data to/from an OGRE .mesh file.
+ @remarks
+ This class allows exporters to write OGRE .mesh files easily, and allows the
+ OGRE engine to import .mesh files into instatiated OGRE Meshes.
+ Note that a .mesh file can include not only the Mesh, but also definitions of
+ any Materials it uses (although this is optional, the .mesh can rely on the
+ Material being loaded from another source, especially useful if you want to
+ take advantage of OGRE's advanced Material properties which may not be available
+ in your modeller).
+ @par
+ To export a Mesh:
+ - Use the MaterialManager methods to create any dependent Material objects, if you want
+ to export them with the Mesh.
+ - Create a Mesh object and populate it using it's methods.
+ - Call the exportMesh method
+
+ @par
+ It's important to realise that this exporter uses OGRE terminology. In this context,
+ 'Mesh' means a top-level mesh structure which can actually contain many SubMeshes, each
+ of which has only one Material. Modelling packages may refer to these differently, for
+ example in Milkshape, it says 'Model' instead of 'Mesh' and 'Mesh' instead of 'SubMesh',
+ but the theory is the same.
+ */
+ class _OgreExport MeshSerializer : public Serializer
+ {
+ public:
+ MeshSerializer();
+ virtual ~MeshSerializer();
+
+
+ /** Exports a mesh to the file specified.
+ @remarks
+ This method takes an externally created Mesh object, and exports both it
+ and optionally the Materials it uses to a .mesh file.
+ @param pMesh Pointer to the Mesh to export
+ @param filename The destination filename
+ @param endianMode The endian mode of the written file
+ */
+ void exportMesh(const Mesh* pMesh, const String& filename,
+ Endian endianMode = ENDIAN_NATIVE);
+
+ /** Imports Mesh and (optionally) Material data from a .mesh file DataStream.
+ @remarks
+ This method imports data from a DataStream opened from a .mesh file and places it's
+ contents into the Mesh object which is passed in.
+ @param stream The DataStream holding the .mesh data. Must be initialised (pos at the start of the buffer).
+ @param pDest Pointer to the Mesh object which will receive the data. Should be blank already.
+ */
+ void importMesh(DataStreamPtr& stream, Mesh* pDest);
+ protected:
+ static String msCurrentVersion;
+
+ typedef std::map MeshSerializerImplMap;
+ MeshSerializerImplMap mImplementations;
+
+ };
+
+}
+
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreMeshSerializerImpl.h b/school/informatik/verkerhssimulation/src/ogre/OgreMeshSerializerImpl.h
new file mode 100644
index 00000000..c5d1330e
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreMeshSerializerImpl.h
@@ -0,0 +1,218 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __MeshSerializerImpl_H__
+#define __MeshSerializerImpl_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreString.h"
+#include "OgreSerializer.h"
+#include "OgreMaterial.h"
+#include "OgreMesh.h"
+#include "OgreEdgeListBuilder.h"
+
+namespace Ogre {
+
+
+ /** Internal implementation of Mesh reading / writing for the latest version of the
+ .mesh format.
+ @remarks
+ In order to maintain compatibility with older versions of the .mesh format, there
+ will be alternative subclasses of this class to load older versions, whilst this class
+ will remain to load the latest version.
+ */
+ class _OgrePrivate MeshSerializerImpl : public Serializer
+ {
+ public:
+ MeshSerializerImpl();
+ virtual ~MeshSerializerImpl();
+ /** Exports a mesh to the file specified.
+ @remarks
+ This method takes an externally created Mesh object, and exports both it
+ and optionally the Materials it uses to a .mesh file.
+ @param pMesh Pointer to the Mesh to export
+ @param filename The destination filename
+ @param endianMode The endian mode for the written file
+ */
+ void exportMesh(const Mesh* pMesh, const String& filename,
+ Endian endianMode = ENDIAN_NATIVE);
+
+ /** Imports Mesh and (optionally) Material data from a .mesh file DataStream.
+ @remarks
+ This method imports data from a DataStream opened from a .mesh file and places it's
+ contents into the Mesh object which is passed in.
+ @param stream The DataStream holding the .mesh data. Must be initialised (pos at the start of the buffer).
+ @param pDest Pointer to the Mesh object which will receive the data. Should be blank already.
+ */
+ void importMesh(DataStreamPtr& stream, Mesh* pDest);
+
+ protected:
+
+ // Internal methods
+ virtual void writeSubMeshNameTable(const Mesh* pMesh);
+ virtual void writeMesh(const Mesh* pMesh);
+ virtual void writeSubMesh(const SubMesh* s);
+ virtual void writeSubMeshOperation(const SubMesh* s);
+ virtual void writeSubMeshTextureAliases(const SubMesh* s);
+ virtual void writeGeometry(const VertexData* pGeom);
+ virtual void writeSkeletonLink(const String& skelName);
+ virtual void writeMeshBoneAssignment(const VertexBoneAssignment& assign);
+ virtual void writeSubMeshBoneAssignment(const VertexBoneAssignment& assign);
+ virtual void writeLodInfo(const Mesh* pMesh);
+ virtual void writeLodSummary(unsigned short numLevels, bool manual);
+ virtual void writeLodUsageManual(const MeshLodUsage& usage);
+ virtual void writeLodUsageGenerated(const Mesh* pMesh, const MeshLodUsage& usage, unsigned short lodNum);
+ virtual void writeBoundsInfo(const Mesh* pMesh);
+ virtual void writeEdgeList(const Mesh* pMesh);
+ virtual void writeAnimations(const Mesh* pMesh);
+ virtual void writeAnimation(const Animation* anim);
+ virtual void writePoses(const Mesh* pMesh);
+ virtual void writePose(const Pose* pose);
+ virtual void writeAnimationTrack(const VertexAnimationTrack* track);
+ virtual void writeMorphKeyframe(const VertexMorphKeyFrame* kf, size_t vertexCount);
+ virtual void writePoseKeyframe(const VertexPoseKeyFrame* kf);
+ virtual void writePoseKeyframePoseRef(const VertexPoseKeyFrame::PoseRef& poseRef);
+ virtual void writeExtremes(const Mesh *pMesh);
+ virtual void writeSubMeshExtremes(unsigned short idx, const SubMesh* s);
+
+ virtual size_t calcMeshSize(const Mesh* pMesh);
+ virtual size_t calcSubMeshSize(const SubMesh* pSub);
+ virtual size_t calcGeometrySize(const VertexData* pGeom);
+ virtual size_t calcSkeletonLinkSize(const String& skelName);
+ virtual size_t calcBoneAssignmentSize(void);
+ virtual size_t calcSubMeshOperationSize(const SubMesh* pSub);
+ virtual size_t calcSubMeshNameTableSize(const Mesh* pMesh);
+ virtual size_t calcEdgeListSize(const Mesh* pMesh);
+ virtual size_t calcEdgeListLodSize(const EdgeData* data, bool isManual);
+ virtual size_t calcEdgeGroupSize(const EdgeData::EdgeGroup& group);
+ virtual size_t calcPosesSize(const Mesh* pMesh);
+ virtual size_t calcPoseSize(const Pose* pose);
+ virtual size_t calcAnimationsSize(const Mesh* pMesh);
+ virtual size_t calcAnimationSize(const Animation* anim);
+ virtual size_t calcAnimationTrackSize(const VertexAnimationTrack* track);
+ virtual size_t calcMorphKeyframeSize(const VertexMorphKeyFrame* kf, size_t vertexCount);
+ virtual size_t calcPoseKeyframeSize(const VertexPoseKeyFrame* kf);
+ virtual size_t calcPoseKeyframePoseRefSize(void);
+ virtual size_t calcPoseVertexSize(void);
+ virtual size_t calcSubMeshTextureAliasesSize(const SubMesh* pSub);
+
+
+ virtual void readTextureLayer(DataStreamPtr& stream, Mesh* pMesh, MaterialPtr& pMat);
+ virtual void readSubMeshNameTable(DataStreamPtr& stream, Mesh* pMesh);
+ virtual void readMesh(DataStreamPtr& stream, Mesh* pMesh);
+ virtual void readSubMesh(DataStreamPtr& stream, Mesh* pMesh);
+ virtual void readSubMeshOperation(DataStreamPtr& stream, Mesh* pMesh, SubMesh* sub);
+ virtual void readSubMeshTextureAlias(DataStreamPtr& stream, Mesh* pMesh, SubMesh* sub);
+ virtual void readGeometry(DataStreamPtr& stream, Mesh* pMesh, VertexData* dest);
+ virtual void readGeometryVertexDeclaration(DataStreamPtr& stream, Mesh* pMesh, VertexData* dest);
+ virtual void readGeometryVertexElement(DataStreamPtr& stream, Mesh* pMesh, VertexData* dest);
+ virtual void readGeometryVertexBuffer(DataStreamPtr& stream, Mesh* pMesh, VertexData* dest);
+
+ virtual void readSkeletonLink(DataStreamPtr& stream, Mesh* pMesh);
+ virtual void readMeshBoneAssignment(DataStreamPtr& stream, Mesh* pMesh);
+ virtual void readSubMeshBoneAssignment(DataStreamPtr& stream, Mesh* pMesh,
+ SubMesh* sub);
+ virtual void readMeshLodInfo(DataStreamPtr& stream, Mesh* pMesh);
+ virtual void readMeshLodUsageManual(DataStreamPtr& stream, Mesh* pMesh,
+ unsigned short lodNum, MeshLodUsage& usage);
+ virtual void readMeshLodUsageGenerated(DataStreamPtr& stream, Mesh* pMesh,
+ unsigned short lodNum, MeshLodUsage& usage);
+ virtual void readBoundsInfo(DataStreamPtr& stream, Mesh* pMesh);
+ virtual void readEdgeList(DataStreamPtr& stream, Mesh* pMesh);
+ virtual void readEdgeListLodInfo(DataStreamPtr& stream, EdgeData* edgeData);
+ virtual void readPoses(DataStreamPtr& stream, Mesh* pMesh);
+ virtual void readPose(DataStreamPtr& stream, Mesh* pMesh);
+ virtual void readAnimations(DataStreamPtr& stream, Mesh* pMesh);
+ virtual void readAnimation(DataStreamPtr& stream, Mesh* pMesh);
+ virtual void readAnimationTrack(DataStreamPtr& stream, Animation* anim,
+ Mesh* pMesh);
+ virtual void readMorphKeyFrame(DataStreamPtr& stream, VertexAnimationTrack* track);
+ virtual void readPoseKeyFrame(DataStreamPtr& stream, VertexAnimationTrack* track);
+ virtual void readExtremes(DataStreamPtr& stream, Mesh *pMesh);
+
+
+ /// Flip an entire vertex buffer from little endian
+ virtual void flipFromLittleEndian(void* pData, size_t vertexCount, size_t vertexSize, const VertexDeclaration::VertexElementList& elems);
+ /// Flip an entire vertex buffer to little endian
+ virtual void flipToLittleEndian(void* pData, size_t vertexCount, size_t vertexSize, const VertexDeclaration::VertexElementList& elems);
+ /// Flip the endianness of an entire vertex buffer, passed in as a
+ /// pointer to locked or temporary memory
+ virtual void flipEndian(void* pData, size_t vertexCount, size_t vertexSize, const VertexDeclaration::VertexElementList& elems);
+
+
+
+ };
+
+ /** Class for providing backwards-compatibility for loading version 1.3 of the .mesh format. */
+ class _OgrePrivate MeshSerializerImpl_v1_3 : public MeshSerializerImpl
+ {
+ public:
+ MeshSerializerImpl_v1_3();
+ ~MeshSerializerImpl_v1_3();
+ protected:
+ virtual void readEdgeListLodInfo(DataStreamPtr& stream, EdgeData* edgeData);
+
+ /// Reorganise triangles of the edge list to group by vertex set
+ virtual void reorganiseTriangles(EdgeData* edgeData);
+ };
+
+ /** Class for providing backwards-compatibility for loading version 1.2 of the .mesh format. */
+ class _OgrePrivate MeshSerializerImpl_v1_2 : public MeshSerializerImpl_v1_3
+ {
+ public:
+ MeshSerializerImpl_v1_2();
+ ~MeshSerializerImpl_v1_2();
+ protected:
+ virtual void readMesh(DataStreamPtr& stream, Mesh* pMesh);
+ virtual void readGeometry(DataStreamPtr& stream, Mesh* pMesh, VertexData* dest);
+ virtual void readGeometryPositions(unsigned short bindIdx, DataStreamPtr& stream,
+ Mesh* pMesh, VertexData* dest);
+ virtual void readGeometryNormals(unsigned short bindIdx, DataStreamPtr& stream,
+ Mesh* pMesh, VertexData* dest);
+ virtual void readGeometryColours(unsigned short bindIdx, DataStreamPtr& stream,
+ Mesh* pMesh, VertexData* dest);
+ virtual void readGeometryTexCoords(unsigned short bindIdx, DataStreamPtr& stream,
+ Mesh* pMesh, VertexData* dest, unsigned short set);
+ };
+
+ /** Class for providing backwards-compatibility for loading version 1.1 of the .mesh format. */
+ class _OgrePrivate MeshSerializerImpl_v1_1 : public MeshSerializerImpl_v1_2
+ {
+ public:
+ MeshSerializerImpl_v1_1();
+ ~MeshSerializerImpl_v1_1();
+ protected:
+ void readGeometryTexCoords(unsigned short bindIdx, DataStreamPtr& stream,
+ Mesh* pMesh, VertexData* dest, unsigned short set);
+ };
+
+
+}
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreMovableObject.h b/school/informatik/verkerhssimulation/src/ogre/OgreMovableObject.h
new file mode 100644
index 00000000..3474972a
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreMovableObject.h
@@ -0,0 +1,530 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __MovableObject_H__
+#define __MovableObject_H__
+
+// Precompiler options
+#include "OgrePrerequisites.h"
+#include "OgreRenderQueue.h"
+#include "OgreAxisAlignedBox.h"
+#include "OgreSphere.h"
+#include "OgreShadowCaster.h"
+#include "OgreFactoryObj.h"
+#include "OgreAnimable.h"
+#include "OgreAny.h"
+#include "OgreUserDefinedObject.h"
+
+namespace Ogre {
+
+ // Forward declaration
+ class MovableObjectFactory;
+
+ /** Abstract class definining a movable object in a scene.
+ @remarks
+ Instances of this class are discrete, relatively small, movable objects
+ which are attached to SceneNode objects to define their position.
+ */
+ class _OgreExport MovableObject : public ShadowCaster, public AnimableObject
+ {
+ public:
+ /** Listener which gets called back on MovableObject events.
+ */
+ class _OgreExport Listener
+ {
+ public:
+ Listener(void) {}
+ virtual ~Listener() {}
+ /** MovableObject is being destroyed */
+ virtual void objectDestroyed(MovableObject*) {}
+ /** MovableObject has been attached to a node */
+ virtual void objectAttached(MovableObject*) {}
+ /** MovableObject has been detached from a node */
+ virtual void objectDetached(MovableObject*) {}
+ /** MovableObject has been moved */
+ virtual void objectMoved(MovableObject*) {}
+ /** Called when the movable object of the camera to be used for rendering.
+ @returns
+ true if allows queue for rendering, false otherwise.
+ */
+ virtual bool objectRendering(const MovableObject*, const Camera*) { return true; }
+ /** Called when the movable object needs to query a light list.
+ @remarks
+ If you want to customize light finding for this object, you should override
+ this method and hook into MovableObject via MovableObject::setListener.
+ Be aware that the default method caches results within a frame to
+ prevent unnecessary recalculation, so if you override this you
+ should provide your own cacheing to maintain performance.
+ @note
+ If you use texture shadows, there is an additional restriction -
+ since the lights which should have shadow textures rendered for
+ them are determined based on the entire frustum, and not per-object,
+ it is important that the lights returned at the start of this
+ list (up to the number of shadow textures available) are the same
+ lights that were used to generate the shadow textures,
+ and they are in the same order (particularly for additive effects).
+ @returns
+ A pointer to a light list if you populated the light list yourself, or
+ NULL to fall back on the default finding process.
+ */
+ virtual const LightList* objectQueryLights(const MovableObject*) { return 0; }
+ };
+
+ protected:
+ /// Name of this object
+ String mName;
+ /// Creator of this object (if created by a factory)
+ MovableObjectFactory* mCreator;
+ /// SceneManager holding this object (if applicable)
+ SceneManager* mManager;
+ /// node to which this object is attached
+ Node* mParentNode;
+ bool mParentIsTagPoint;
+ /// Is this object visible?
+ bool mVisible;
+ /// Upper distance to still render
+ Real mUpperDistance;
+ Real mSquaredUpperDistance;
+ /// Hidden because of distance?
+ bool mBeyondFarDistance;
+ /// User defined link to another object / value / whatever
+ Any mUserAny;
+ /// The render queue to use when rendering this object
+ uint8 mRenderQueueID;
+ /// Flags whether the RenderQueue's default should be used.
+ bool mRenderQueueIDSet;
+ /// Flags determining whether this object is included / excluded from scene queries
+ uint32 mQueryFlags;
+ /// Flags determining whether this object is visible (compared to SceneManager mask)
+ uint32 mVisibilityFlags;
+ /// Cached world AABB of this object
+ mutable AxisAlignedBox mWorldAABB;
+ // Cached world bounding sphere
+ mutable Sphere mWorldBoundingSphere;
+ /// World space AABB of this object's dark cap
+ mutable AxisAlignedBox mWorldDarkCapBounds;
+ /// Does this object cast shadows?
+ bool mCastShadows;
+
+ /// Does rendering this object disabled by listener?
+ bool mRenderingDisabled;
+ /// MovableObject listener - only one allowed (no list) for size & performance reasons. */
+ Listener* mListener;
+
+ /// List of lights for this object
+ mutable LightList mLightList;
+ /// The last frame that this light list was updated in
+ mutable ulong mLightListUpdated;
+
+ // Static members
+ /// Default query flags
+ static uint32 msDefaultQueryFlags;
+ /// Default visibility flags
+ static uint32 msDefaultVisibilityFlags;
+
+
+
+ public:
+ /// Constructor
+ MovableObject();
+
+ /// Named constructor
+ MovableObject(const String& name);
+ /** Virtual destructor - read Scott Meyers if you don't know why this is needed.
+ */
+ virtual ~MovableObject();
+
+ /** Notify the object of it's creator (internal use only) */
+ virtual void _notifyCreator(MovableObjectFactory* fact) { mCreator = fact; }
+ /** Get the creator of this object, if any (internal use only) */
+ virtual MovableObjectFactory* _getCreator(void) const { return mCreator; }
+ /** Notify the object of it's manager (internal use only) */
+ virtual void _notifyManager(SceneManager* man) { mManager = man; }
+ /** Get the manager of this object, if any (internal use only) */
+ virtual SceneManager* _getManager(void) const { return mManager; }
+
+ /** Returns the name of this object. */
+ virtual const String& getName(void) const { return mName; }
+
+ /** Returns the type name of this object. */
+ virtual const String& getMovableType(void) const = 0;
+
+ /** Returns the node to which this object is attached.
+ @remarks
+ A MovableObject may be attached to either a SceneNode or to a TagPoint,
+ the latter case if it's attached to a bone on an animated entity.
+ Both are Node subclasses so this method will return either.
+ */
+ virtual Node* getParentNode(void) const;
+
+ /** Returns the scene node to which this object is attached.
+ @remarks
+ A MovableObject may be attached to either a SceneNode or to a TagPoint,
+ the latter case if it's attached to a bone on an animated entity.
+ This method will return the scene node of the parent entity
+ if the latter is true.
+ */
+ virtual SceneNode* getParentSceneNode(void) const;
+
+ /** Internal method called to notify the object that it has been attached to a node.
+ */
+ virtual void _notifyAttached(Node* parent, bool isTagPoint = false);
+
+ /** Returns true if this object is attached to a SceneNode or TagPoint. */
+ virtual bool isAttached(void) const;
+
+ /** Returns true if this object is attached to a SceneNode or TagPoint,
+ and this SceneNode / TagPoint is currently in an active part of the
+ scene graph. */
+ virtual bool isInScene(void) const;
+
+ /** Internal method called to notify the object that it has been moved.
+ */
+ virtual void _notifyMoved(void);
+
+ /** Internal method to notify the object of the camera to be used for the next rendering operation.
+ @remarks
+ Certain objects may want to do specific processing based on the camera position. This method notifies
+ them incase they wish to do this.
+ */
+ virtual void _notifyCurrentCamera(Camera* cam);
+
+ /** Retrieves the local axis-aligned bounding box for this object.
+ @remarks
+ This bounding box is in local coordinates.
+ */
+ virtual const AxisAlignedBox& getBoundingBox(void) const = 0;
+
+ /** Retrieves the radius of the origin-centered bounding sphere
+ for this object.
+ */
+ virtual Real getBoundingRadius(void) const = 0;
+
+ /** Retrieves the axis-aligned bounding box for this object in world coordinates. */
+ virtual const AxisAlignedBox& getWorldBoundingBox(bool derive = false) const;
+ /** Retrieves the worldspace bounding sphere for this object. */
+ virtual const Sphere& getWorldBoundingSphere(bool derive = false) const;
+ /** Internal method by which the movable object must add Renderable subclass instances to the rendering queue.
+ @remarks
+ The engine will call this method when this object is to be rendered. The object must then create one or more
+ Renderable subclass instances which it places on the passed in Queue for rendering.
+ */
+ virtual void _updateRenderQueue(RenderQueue* queue) = 0;
+
+ /** Tells this object whether to be visible or not, if it has a renderable component.
+ @note An alternative approach of making an object invisible is to detach it
+ from it's SceneNode, or to remove the SceneNode entirely.
+ Detaching a node means that structurally the scene graph changes.
+ Once this change has taken place, the objects / nodes that have been
+ removed have less overhead to the visbility detection pass than simply
+ making the object invisible, so if you do this and leave the objects
+ out of the tree for a long time, it's faster. However, the act of
+ detaching / reattaching nodes is in itself more expensive than
+ setting an object visibility flag, since in the latter case
+ structural changes are not made. Therefore, small or frequent visbility
+ changes are best done using this method; large or more longer term
+ changes are best done by detaching.
+ */
+ virtual void setVisible(bool visible);
+
+ /** Gets this object whether to be visible or not, if it has a renderable component.
+ @remarks
+ Returns the value set by MovableObject::setVisible only.
+ */
+ virtual bool getVisible(void) const;
+
+ /** Returns whether or not this object is supposed to be visible or not.
+ @remarks
+ Takes into account both upper rendering distance and visible flag.
+ */
+ virtual bool isVisible(void) const;
+
+ /** Sets the distance at which the object is no longer rendered.
+ @param dist Distance beyond which the object will not be rendered
+ (the default is 0, which means objects are always rendered).
+ */
+ virtual void setRenderingDistance(Real dist) {
+ mUpperDistance = dist;
+ mSquaredUpperDistance = mUpperDistance * mUpperDistance;
+ }
+
+ /** Gets the distance at which batches are no longer rendered. */
+ virtual Real getRenderingDistance(void) const { return mUpperDistance; }
+
+ /** Call this to associate your own custom user object instance with this MovableObject.
+ @remarks
+ By simply making your game / application object a subclass of UserDefinedObject, you
+ can establish a link between an OGRE instance of MovableObject and your own application
+ classes. Call this method to establish the link.
+ */
+ virtual void setUserObject(UserDefinedObject* obj) { mUserAny = Any(obj); }
+ /** Retrieves a pointer to a custom application object associated with this movable by an earlier
+ call to setUserObject.
+ */
+ virtual UserDefinedObject* getUserObject(void)
+ {
+ return mUserAny.isEmpty() ? 0 : any_cast(mUserAny);
+ }
+
+ /** Sets any kind of user value on this object.
+ @remarks
+ This method allows you to associate any user value you like with
+ this MovableObject. This can be a pointer back to one of your own
+ classes for instance.
+ @note This value is shared with setUserObject so don't use both!
+ */
+ virtual void setUserAny(const Any& anything) { mUserAny = anything; }
+
+ /** Retrieves the custom user value associated with this object.
+ */
+ virtual const Any& getUserAny(void) const { return mUserAny; }
+
+ /** Sets the render queue group this entity will be rendered through.
+ @remarks
+ Render queues are grouped to allow you to more tightly control the ordering
+ of rendered objects. If you do not call this method, all Entity objects default
+ to the default queue (RenderQueue::getDefaultQueueGroup), which is fine for most objects. You may want to alter this
+ if you want this entity to always appear in front of other objects, e.g. for
+ a 3D menu system or such.
+ @par
+ See RenderQueue for more details.
+ @param queueID Enumerated value of the queue group to use.
+ */
+ virtual void setRenderQueueGroup(uint8 queueID);
+
+ /** Gets the queue group for this entity, see setRenderQueueGroup for full details. */
+ virtual uint8 getRenderQueueGroup(void) const;
+
+ /// return the full transformation of the parent sceneNode or the attachingPoint node
+ virtual const Matrix4& _getParentNodeFullTransform(void) const;
+
+ /** Sets the query flags for this object.
+ @remarks
+ When performing a scene query, this object will be included or excluded according
+ to flags on the object and flags on the query. This is a bitwise value, so only when
+ a bit on these flags is set, will it be included in a query asking for that flag. The
+ meaning of the bits is application-specific.
+ */
+ virtual void setQueryFlags(uint32 flags) { mQueryFlags = flags; }
+
+ /** As setQueryFlags, except the flags passed as parameters are appended to the
+ existing flags on this object. */
+ virtual void addQueryFlags(uint32 flags) { mQueryFlags |= flags; }
+
+ /** As setQueryFlags, except the flags passed as parameters are removed from the
+ existing flags on this object. */
+ virtual void removeQueryFlags(unsigned long flags) { mQueryFlags &= ~flags; }
+
+ /// Returns the query flags relevant for this object
+ virtual uint32 getQueryFlags(void) const { return mQueryFlags; }
+
+ /** Set the default query flags for all future MovableObject instances.
+ */
+ static void setDefaultQueryFlags(uint32 flags) { msDefaultQueryFlags = flags; }
+
+ /** Get the default query flags for all future MovableObject instances.
+ */
+ static uint32 getDefaultQueryFlags() { return msDefaultQueryFlags; }
+
+
+ /** Sets the visiblity flags for this object.
+ @remarks
+ As well as a simple true/false value for visibility (as seen in setVisible),
+ you can also set visiblity flags which when 'and'ed with the SceneManager's
+ visibility mask can also make an object invisible.
+ */
+ virtual void setVisibilityFlags(uint32 flags) { mVisibilityFlags = flags; }
+
+ /** As setVisibilityFlags, except the flags passed as parameters are appended to the
+ existing flags on this object. */
+ virtual void addVisibilityFlags(uint32 flags) { mVisibilityFlags |= flags; }
+
+ /** As setVisibilityFlags, except the flags passed as parameters are removed from the
+ existing flags on this object. */
+ virtual void removeVisibilityFlags(uint32 flags) { mVisibilityFlags &= ~flags; }
+
+ /// Returns the visibility flags relevant for this object
+ virtual uint32 getVisibilityFlags(void) const { return mVisibilityFlags; }
+
+ /** Set the default visibility flags for all future MovableObject instances.
+ */
+ static void setDefaultVisibilityFlags(uint32 flags) { msDefaultVisibilityFlags = flags; }
+
+ /** Get the default visibility flags for all future MovableObject instances.
+ */
+ static uint32 getDefaultVisibilityFlags() { return msDefaultVisibilityFlags; }
+
+ /** Sets a listener for this object.
+ @remarks
+ Note for size and performance reasons only one listener per object
+ is allowed.
+ */
+ virtual void setListener(Listener* listener) { mListener = listener; }
+
+ /** Gets the current listener for this object.
+ */
+ virtual Listener* getListener(void) const { return mListener; }
+
+ /** Gets a list of lights, ordered relative to how close they are to this movable object.
+ @remarks
+ By default, this method gives the listener a chance to populate light list first,
+ if there is no listener or Listener::objectQueryLights returns NULL, it'll
+ query the light list from parent entity if it is present, or returns
+ SceneNode::findLights if it has parent scene node, otherwise it just returns
+ an empty list.
+ @par
+ The object internally caches the light list, so it will recalculate
+ it only when object is moved, or lights that affect the frustum have
+ been changed (@see SceneManager::_getLightsDirtyCounter),
+ but if listener exists, it will be called each time, so the listener
+ should implement their own cache mechanism to optimise performance.
+ @par
+ This method can be useful when implementing Renderable::getLights in case
+ the renderable is a part of the movable.
+ @returns The list of lights use to lighting this object.
+ */
+ virtual const LightList& queryLights(void) const;
+
+ /// Define a default implementation of method from ShadowCaster which implements no shadows
+ EdgeData* getEdgeList(void) { return NULL; }
+ /// Define a default implementation of method from ShadowCaster which implements no shadows
+ bool hasEdgeList(void) { return false; }
+ /// Define a default implementation of method from ShadowCaster which implements no shadows
+ ShadowRenderableListIterator getShadowVolumeRenderableIterator(
+ ShadowTechnique shadowTechnique, const Light* light,
+ HardwareIndexBufferSharedPtr* indexBuffer,
+ bool extrudeVertices, Real extrusionDist, unsigned long flags = 0);
+
+ /** Overridden member from ShadowCaster. */
+ const AxisAlignedBox& getLightCapBounds(void) const;
+ /** Overridden member from ShadowCaster. */
+ const AxisAlignedBox& getDarkCapBounds(const Light& light, Real dirLightExtrusionDist) const;
+ /** Sets whether or not this object will cast shadows.
+ @remarks
+ This setting simply allows you to turn on/off shadows for a given object.
+ An object will not cast shadows unless the scene supports it in any case
+ (see SceneManager::setShadowTechnique), and also the material which is
+ in use must also have shadow casting enabled. By default all entities cast
+ shadows. If, however, for some reason you wish to disable this for a single
+ object then you can do so using this method.
+ @note This method normally refers to objects which block the light, but
+ since Light is also a subclass of MovableObject, in that context it means
+ whether the light causes shadows itself.
+ */
+ void setCastShadows(bool enabled) { mCastShadows = enabled; }
+ /** Returns whether shadow casting is enabled for this object. */
+ bool getCastShadows(void) const { return mCastShadows; }
+ /** Get the distance to extrude for a point/spot light */
+ Real getPointExtrusionDistance(const Light* l) const;
+ /** Get the 'type flags' for this MovableObject.
+ @remarks
+ A type flag identifies the type of the MovableObject as a bitpattern.
+ This is used for categorical inclusion / exclusion in SceneQuery
+ objects. By default, this method returns all ones for objects not
+ created by a MovableObjectFactory (hence always including them);
+ otherwise it returns the value assigned to the MovableObjectFactory.
+ Custom objects which don't use MovableObjectFactory will need to
+ override this if they want to be included in queries.
+ */
+ virtual uint32 getTypeFlags(void) const;
+
+
+
+
+
+ };
+
+ /** Interface definition for a factory class which produces a certain
+ kind of MovableObject, and can be registered with Root in order
+ to allow all clients to produce new instances of this object, integrated
+ with the standard Ogre processing.
+ */
+ class _OgreExport MovableObjectFactory
+ {
+ protected:
+ /// Type flag, allocated if requested
+ unsigned long mTypeFlag;
+
+ /// Internal implementation of create method - must be overridden
+ virtual MovableObject* createInstanceImpl(
+ const String& name, const NameValuePairList* params = 0) = 0;
+ public:
+ MovableObjectFactory() : mTypeFlag(0xFFFFFFFF) {}
+ virtual ~MovableObjectFactory() {}
+ /// Get the type of the object to be created
+ virtual const String& getType(void) const = 0;
+
+ /** Create a new instance of the object.
+ @param name The name of the new object
+ @param manager The SceneManager instance that will be holding the
+ instance once created.
+ @param params Name/value pair list of additional parameters required to
+ construct the object (defined per subtype). Optional.
+ */
+ virtual MovableObject* createInstance(
+ const String& name, SceneManager* manager,
+ const NameValuePairList* params = 0);
+ /** Destroy an instance of the object */
+ virtual void destroyInstance(MovableObject* obj) = 0;
+
+ /** Does this factory require the allocation of a 'type flag', used to
+ selectively include / exclude this type from scene queries?
+ @remarks
+ The default implementation here is to return 'false', ie not to
+ request a unique type mask from Root. For objects that
+ never need to be excluded in SceneQuery results, that's fine, since
+ the default implementation of MovableObject::getTypeFlags is to return
+ all ones, hence matching any query type mask. However, if you want the
+ objects created by this factory to be filterable by queries using a
+ broad type, you have to give them a (preferably unique) type mask -
+ and given that you don't know what other MovableObject types are
+ registered, Root will allocate you one.
+ */
+ virtual bool requestTypeFlags(void) const { return false; }
+ /** Notify this factory of the type mask to apply.
+ @remarks
+ This should normally only be called by Root in response to
+ a 'true' result from requestTypeMask. However, you can actually use
+ it yourself if you're careful; for example to assign the same mask
+ to a number of different types of object, should you always wish them
+ to be treated the same in queries.
+ */
+ void _notifyTypeFlags(unsigned long flag) { mTypeFlag = flag; }
+
+ /** Gets the type flag for this factory.
+ @remarks
+ A type flag is like a query flag, except that it applies to all instances
+ of a certain type of object.
+ */
+ unsigned long getTypeFlags(void) const { return mTypeFlag; }
+
+ };
+
+}
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreMovablePlane.h b/school/informatik/verkerhssimulation/src/ogre/OgreMovablePlane.h
new file mode 100644
index 00000000..48b8da97
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreMovablePlane.h
@@ -0,0 +1,87 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+// Original free version by:
+// Magic Software, Inc.
+// http://www.geometrictools.com/
+// Copyright (c) 2000, All Rights Reserved
+
+#ifndef __MovablePlane_H__
+#define __MovablePlane_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgrePlane.h"
+#include "OgreMovableObject.h"
+
+namespace Ogre {
+
+
+ /** Definition of a Plane that may be attached to a node, and the derived
+ details of it retrieved simply.
+ @remarks
+ This plane is not here for rendering purposes, it's to allow you to attach
+ planes to the scene in order to have them move and follow nodes on their
+ own, which is useful if you're using the plane for some kind of calculation,
+ e.g. reflection.
+ */
+ class _OgreExport MovablePlane : public Plane, public MovableObject
+ {
+ protected:
+ mutable Plane mDerivedPlane;
+ mutable Vector3 mLastTranslate;
+ mutable Quaternion mLastRotate;
+ AxisAlignedBox mNullBB;
+ mutable bool mDirty;
+ static String msMovableType;
+ public:
+
+ MovablePlane(const String& name);
+ MovablePlane (const Plane& rhs);
+ /** Construct a plane through a normal, and a distance to move the plane along the normal.*/
+ MovablePlane (const Vector3& rkNormal, Real fConstant);
+ MovablePlane (const Vector3& rkNormal, const Vector3& rkPoint);
+ MovablePlane (const Vector3& rkPoint0, const Vector3& rkPoint1,
+ const Vector3& rkPoint2);
+ ~MovablePlane() {}
+ /// Overridden from MovableObject
+ void _notifyCurrentCamera(Camera*) { /* don't care */ }
+ /// Overridden from MovableObject
+ const AxisAlignedBox& getBoundingBox(void) const { return mNullBB; }
+ /// Overridden from MovableObject
+ Real getBoundingRadius(void) const { return Math::POS_INFINITY; }
+ /// Overridden from MovableObject
+ void _updateRenderQueue(RenderQueue*) { /* do nothing */}
+ /// Overridden from MovableObject
+ const String& getMovableType(void) const;
+ /// Get the derived plane as transformed by its parent node.
+ const Plane& _getDerivedPlane(void) const;
+
+ };
+}
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreNoMemoryMacros.h b/school/informatik/verkerhssimulation/src/ogre/OgreNoMemoryMacros.h
new file mode 100644
index 00000000..fa2f41ab
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreNoMemoryMacros.h
@@ -0,0 +1,42 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+//-----------------------------------------------------------------------------
+// If you want to use the real C(++) *alloc/free/new/delete functions, you must
+// include this header before the section that uses them.
+#ifdef OGRE_MEMORY_MACROS
+#undef OGRE_MEMORY_MACROS
+#undef new
+#undef delete
+#undef malloc
+#undef calloc
+#undef realloc
+#undef free
+#endif
+//-----------------------------------------------------------------------------
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreNode.h b/school/informatik/verkerhssimulation/src/ogre/OgreNode.h
new file mode 100644
index 00000000..7a4606ac
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreNode.h
@@ -0,0 +1,736 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _Node_H__
+#define _Node_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreMatrix3.h"
+#include "OgreMatrix4.h"
+#include "OgreQuaternion.h"
+#include "OgreString.h"
+#include "OgreRenderable.h"
+#include "OgreIteratorWrappers.h"
+
+namespace Ogre {
+
+
+ /** Class representing a general-purpose node an articulated scene graph.
+ @remarks
+ A node in the scene graph is a node in a structured tree. A node contains
+ information about the transformation which will apply to
+ it and all of it's children. Child nodes can have transforms of their own, which
+ are combined with their parent's transformations.
+ @par
+ This is an abstract class - concrete classes are based on this for specific purposes,
+ e.g. SceneNode, Bone
+ */
+ class _OgreExport Node : public Renderable
+ {
+ public:
+ /** Enumeration denoting the spaces which a transform can be relative to.
+ */
+ enum TransformSpace
+ {
+ /// Transform is relative to the local space
+ TS_LOCAL,
+ /// Transform is relative to the space of the parent node
+ TS_PARENT,
+ /// Transform is relative to world space
+ TS_WORLD
+ };
+ typedef HashMap ChildNodeMap;
+ typedef MapIterator ChildNodeIterator;
+ typedef ConstMapIterator ConstChildNodeIterator;
+
+ /** Listener which gets called back on Node events.
+ */
+ class _OgreExport Listener
+ {
+ public:
+ Listener() {}
+ virtual ~Listener() {}
+ /** Called when a node gets updated.
+ @remarks
+ Note that this happens when the node's derived update happens,
+ not every time a method altering it's state occurs. There may
+ be several state-changing calls but only one of these calls,
+ when the node graph is fully updated.
+ */
+ virtual void nodeUpdated(const Node*) {}
+ /** Node is being destroyed */
+ virtual void nodeDestroyed(const Node*) {};
+ /** Node has been attached to a parent */
+ virtual void nodeAttached(const Node*) {};
+ /** Node has been detached from a parent */
+ virtual void nodeDetached(const Node*) {};
+ };
+
+ protected:
+ /// Pointer to parent node
+ Node* mParent;
+ /// Collection of pointers to direct children; hashmap for efficiency
+ ChildNodeMap mChildren;
+
+ typedef std::set ChildUpdateSet;
+ /// List of children which need updating, used if self is not out of date but children are
+ mutable ChildUpdateSet mChildrenToUpdate;
+ /// Flag to indicate own transform from parent is out of date
+ mutable bool mNeedParentUpdate;
+ /// Flag indicating that all children need to be updated
+ mutable bool mNeedChildUpdate;
+ /// Flag indicating that parent has been notified about update request
+ mutable bool mParentNotified ;
+ /// Flag indicating that the node has been queued for update
+ mutable bool mQueuedForUpdate;
+
+ /// Friendly name of this node, can be automatically generated if you don't care
+ String mName;
+
+ /// Incremented count for next name extension
+ static unsigned long msNextGeneratedNameExt;
+
+ /// Stores the orientation of the node relative to it's parent.
+ Quaternion mOrientation;
+
+ /// Stores the position/translation of the node relative to its parent.
+ Vector3 mPosition;
+
+ /// Stores the scaling factor applied to this node
+ Vector3 mScale;
+
+ /// Stores whether this node inherits orientation from it's parent
+ bool mInheritOrientation;
+
+ /// Stores whether this node inherits scale from it's parent
+ bool mInheritScale;
+
+ /// Material pointer should this node be rendered
+ mutable MaterialPtr mpMaterial;
+
+ /// Only available internally - notification of parent.
+ virtual void setParent(Node* parent);
+
+ /** Cached combined orientation.
+ @par
+ This member is the orientation derived by combining the
+ local transformations and those of it's parents.
+ This is updated when _updateFromParent is called by the
+ SceneManager or the nodes parent.
+ */
+ mutable Quaternion mDerivedOrientation;
+
+ /** Cached combined position.
+ @par
+ This member is the position derived by combining the
+ local transformations and those of it's parents.
+ This is updated when _updateFromParent is called by the
+ SceneManager or the nodes parent.
+ */
+ mutable Vector3 mDerivedPosition;
+
+ /** Cached combined scale.
+ @par
+ This member is the position derived by combining the
+ local transformations and those of it's parents.
+ This is updated when _updateFromParent is called by the
+ SceneManager or the nodes parent.
+ */
+ mutable Vector3 mDerivedScale;
+
+ /** Triggers the node to update it's combined transforms.
+ @par
+ This method is called internally by Ogre to ask the node
+ to update it's complete transformation based on it's parents
+ derived transform.
+ */
+ virtual void _updateFromParent(void) const;
+
+ /** Class-specific implementation of _updateFromParent.
+ @remarks
+ Splitting the implementation of the update away from the update call
+ itself allows the detail to be overridden without disrupting the
+ general sequence of updateFromParent (e.g. raising events)
+ */
+ virtual void updateFromParentImpl(void) const;
+
+
+ /** Internal method for creating a new child node - must be overridden per subclass. */
+ virtual Node* createChildImpl(void) = 0;
+
+ /** Internal method for creating a new child node - must be overridden per subclass. */
+ virtual Node* createChildImpl(const String& name) = 0;
+
+ /// The position to use as a base for keyframe animation
+ Vector3 mInitialPosition;
+ /// The orientation to use as a base for keyframe animation
+ Quaternion mInitialOrientation;
+ /// The scale to use as a base for keyframe animation
+ Vector3 mInitialScale;
+
+ /// Cached derived transform as a 4x4 matrix
+ mutable Matrix4 mCachedTransform;
+ mutable bool mCachedTransformOutOfDate;
+
+ /** Node listener - only one allowed (no list) for size & performance reasons. */
+ Listener* mListener;
+
+ typedef std::vector QueuedUpdates;
+ static QueuedUpdates msQueuedUpdates;
+
+
+ public:
+ /** Constructor, should only be called by parent, not directly.
+ @remarks
+ Generates a name.
+ */
+ Node();
+ /** Constructor, should only be called by parent, not directly.
+ @remarks
+ Assigned a name.
+ */
+ Node(const String& name);
+
+ virtual ~Node();
+
+ /** Returns the name of the node. */
+ const String& getName(void) const;
+
+ /** Gets this node's parent (NULL if this is the root).
+ */
+ virtual Node* getParent(void) const;
+
+ /** Returns a quaternion representing the nodes orientation.
+ */
+ virtual const Quaternion & getOrientation() const;
+
+ /** Sets the orientation of this node via a quaternion.
+ @remarks
+ Orientatings, unlike other transforms, are not always inherited by child nodes.
+ Whether or not orientatings affect the orientation of the child nodes depends on
+ the setInheritOrientation option of the child. In some cases you want a orientating
+ of a parent node to apply to a child node (e.g. where the child node is a part of
+ the same object, so you want it to be the same relative orientation based on the
+ parent's orientation), but not in other cases (e.g. where the child node is just
+ for positioning another object, you want it to maintain it's own orientation).
+ The default is to inherit as with other transforms.
+ @par
+ Note that rotations are oriented around the node's origin.
+ */
+ virtual void setOrientation( const Quaternion& q );
+
+ /** Sets the orientation of this node via quaternion parameters.
+ @remarks
+ Orientatings, unlike other transforms, are not always inherited by child nodes.
+ Whether or not orientatings affect the orientation of the child nodes depends on
+ the setInheritOrientation option of the child. In some cases you want a orientating
+ of a parent node to apply to a child node (e.g. where the child node is a part of
+ the same object, so you want it to be the same relative orientation based on the
+ parent's orientation), but not in other cases (e.g. where the child node is just
+ for positioning another object, you want it to maintain it's own orientation).
+ The default is to inherit as with other transforms.
+ @par
+ Note that rotations are oriented around the node's origin.
+ */
+ virtual void setOrientation( Real w, Real x, Real y, Real z);
+
+ /** Resets the nodes orientation (local axes as world axes, no rotation).
+ @remarks
+ Orientatings, unlike other transforms, are not always inherited by child nodes.
+ Whether or not orientatings affect the orientation of the child nodes depends on
+ the setInheritOrientation option of the child. In some cases you want a orientating
+ of a parent node to apply to a child node (e.g. where the child node is a part of
+ the same object, so you want it to be the same relative orientation based on the
+ parent's orientation), but not in other cases (e.g. where the child node is just
+ for positioning another object, you want it to maintain it's own orientation).
+ The default is to inherit as with other transforms.
+ @par
+ Note that rotations are oriented around the node's origin.
+ */
+ virtual void resetOrientation(void);
+
+ /** Sets the position of the node relative to it's parent.
+ */
+ virtual void setPosition(const Vector3& pos);
+
+ /** Sets the position of the node relative to it's parent.
+ */
+ virtual void setPosition(Real x, Real y, Real z);
+
+ /** Gets the position of the node relative to it's parent.
+ */
+ virtual const Vector3 & getPosition(void) const;
+
+ /** Sets the scaling factor applied to this node.
+ @remarks
+ Scaling factors, unlike other transforms, are not always inherited by child nodes.
+ Whether or not scalings affect the size of the child nodes depends on the setInheritScale
+ option of the child. In some cases you want a scaling factor of a parent node to apply to
+ a child node (e.g. where the child node is a part of the same object, so you want it to be
+ the same relative size based on the parent's size), but not in other cases (e.g. where the
+ child node is just for positioning another object, you want it to maintain it's own size).
+ The default is to inherit as with other transforms.
+ @par
+ Note that like rotations, scalings are oriented around the node's origin.
+ */
+ virtual void setScale(const Vector3& scale);
+
+ /** Sets the scaling factor applied to this node.
+ @remarks
+ Scaling factors, unlike other transforms, are not always inherited by child nodes.
+ Whether or not scalings affect the size of the child nodes depends on the setInheritScale
+ option of the child. In some cases you want a scaling factor of a parent node to apply to
+ a child node (e.g. where the child node is a part of the same object, so you want it to be
+ the same relative size based on the parent's size), but not in other cases (e.g. where the
+ child node is just for positioning another object, you want it to maintain it's own size).
+ The default is to inherit as with other transforms.
+ @par
+ Note that like rotations, scalings are oriented around the node's origin.
+ */
+ virtual void setScale(Real x, Real y, Real z);
+
+ /** Gets the scaling factor of this node.
+ */
+ virtual const Vector3 & getScale(void) const;
+
+ /** Tells the node whether it should inherit orientation from it's parent node.
+ @remarks
+ Orientatings, unlike other transforms, are not always inherited by child nodes.
+ Whether or not orientatings affect the orientation of the child nodes depends on
+ the setInheritOrientation option of the child. In some cases you want a orientating
+ of a parent node to apply to a child node (e.g. where the child node is a part of
+ the same object, so you want it to be the same relative orientation based on the
+ parent's orientation), but not in other cases (e.g. where the child node is just
+ for positioning another object, you want it to maintain it's own orientation).
+ The default is to inherit as with other transforms.
+ @param inherit If true, this node's orientation will be affected by its parent's orientation.
+ If false, it will not be affected.
+ */
+ virtual void setInheritOrientation(bool inherit);
+
+ /** Returns true if this node is affected by orientation applied to the parent node.
+ @remarks
+ Orientatings, unlike other transforms, are not always inherited by child nodes.
+ Whether or not orientatings affect the orientation of the child nodes depends on
+ the setInheritOrientation option of the child. In some cases you want a orientating
+ of a parent node to apply to a child node (e.g. where the child node is a part of
+ the same object, so you want it to be the same relative orientation based on the
+ parent's orientation), but not in other cases (e.g. where the child node is just
+ for positioning another object, you want it to maintain it's own orientation).
+ The default is to inherit as with other transforms.
+ @remarks
+ See setInheritOrientation for more info.
+ */
+ virtual bool getInheritOrientation(void) const;
+
+ /** Tells the node whether it should inherit scaling factors from it's parent node.
+ @remarks
+ Scaling factors, unlike other transforms, are not always inherited by child nodes.
+ Whether or not scalings affect the size of the child nodes depends on the setInheritScale
+ option of the child. In some cases you want a scaling factor of a parent node to apply to
+ a child node (e.g. where the child node is a part of the same object, so you want it to be
+ the same relative size based on the parent's size), but not in other cases (e.g. where the
+ child node is just for positioning another object, you want it to maintain it's own size).
+ The default is to inherit as with other transforms.
+ @param inherit If true, this node's scale will be affected by its parent's scale. If false,
+ it will not be affected.
+ */
+ virtual void setInheritScale(bool inherit);
+
+ /** Returns true if this node is affected by scaling factors applied to the parent node.
+ @remarks
+ See setInheritScale for more info.
+ */
+ virtual bool getInheritScale(void) const;
+
+ /** Scales the node, combining it's current scale with the passed in scaling factor.
+ @remarks
+ This method applies an extra scaling factor to the node's existing scale, (unlike setScale
+ which overwrites it) combining it's current scale with the new one. E.g. calling this
+ method twice with Vector3(2,2,2) would have the same effect as setScale(Vector3(4,4,4)) if
+ the existing scale was 1.
+ @par
+ Note that like rotations, scalings are oriented around the node's origin.
+ */
+ virtual void scale(const Vector3& scale);
+
+ /** Scales the node, combining it's current scale with the passed in scaling factor.
+ @remarks
+ This method applies an extra scaling factor to the node's existing scale, (unlike setScale
+ which overwrites it) combining it's current scale with the new one. E.g. calling this
+ method twice with Vector3(2,2,2) would have the same effect as setScale(Vector3(4,4,4)) if
+ the existing scale was 1.
+ @par
+ Note that like rotations, scalings are oriented around the node's origin.
+ */
+ virtual void scale(Real x, Real y, Real z);
+
+ /** Moves the node along the cartesian axes.
+ @par
+ This method moves the node by the supplied vector along the
+ world cartesian axes, i.e. along world x,y,z
+ @param
+ d Vector with x,y,z values representing the translation.
+ @param
+ relativeTo The space which this transform is relative to.
+ */
+ virtual void translate(const Vector3& d, TransformSpace relativeTo = TS_PARENT);
+ /** Moves the node along the cartesian axes.
+ @par
+ This method moves the node by the supplied vector along the
+ world cartesian axes, i.e. along world x,y,z
+ @param
+ x
+ @param
+ y
+ @param
+ z Real x, y and z values representing the translation.
+ @param
+ relativeTo The space which this transform is relative to.
+ */
+ virtual void translate(Real x, Real y, Real z, TransformSpace relativeTo = TS_PARENT);
+ /** Moves the node along arbitrary axes.
+ @remarks
+ This method translates the node by a vector which is relative to
+ a custom set of axes.
+ @param
+ axes A 3x3 Matrix containg 3 column vectors each representing the
+ axes X, Y and Z respectively. In this format the standard cartesian
+ axes would be expressed as:
+
+ 1 0 0
+ 0 1 0
+ 0 0 1
+
+ i.e. the identity matrix.
+ @param
+ move Vector relative to the axes above.
+ @param
+ relativeTo The space which this transform is relative to.
+ */
+ virtual void translate(const Matrix3& axes, const Vector3& move, TransformSpace relativeTo = TS_PARENT);
+ /** Moves the node along arbitrary axes.
+ @remarks
+ This method translates the node by a vector which is relative to
+ a custom set of axes.
+ @param
+ axes A 3x3 Matrix containg 3 column vectors each representing the
+ axes X, Y and Z respectively. In this format the standard cartesian
+ axes would be expressed as
+
+ 1 0 0
+ 0 1 0
+ 0 0 1
+
+ i.e. the identity matrix.
+ @param
+ x,y,z Translation components relative to the axes above.
+ @param
+ relativeTo The space which this transform is relative to.
+ */
+ virtual void translate(const Matrix3& axes, Real x, Real y, Real z, TransformSpace relativeTo = TS_PARENT);
+
+ /** Rotate the node around the Z-axis.
+ */
+ virtual void roll(const Radian& angle, TransformSpace relativeTo = TS_LOCAL);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+ inline void roll(Real degrees, TransformSpace relativeTo = TS_LOCAL) {
+ roll ( Angle(degrees), relativeTo );
+ }
+#endif//OGRE_FORCE_ANGLE_TYPES
+
+ /** Rotate the node around the X-axis.
+ */
+ virtual void pitch(const Radian& angle, TransformSpace relativeTo = TS_LOCAL);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+ inline void pitch(Real degrees, TransformSpace relativeTo = TS_LOCAL) {
+ pitch ( Angle(degrees), relativeTo );
+ }
+#endif//OGRE_FORCE_ANGLE_TYPES
+
+ /** Rotate the node around the Y-axis.
+ */
+ virtual void yaw(const Radian& angle, TransformSpace relativeTo = TS_LOCAL);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+ inline void yaw(Real degrees, TransformSpace relativeTo = TS_LOCAL) {
+ yaw ( Angle(degrees), relativeTo );
+ }
+#endif//OGRE_FORCE_ANGLE_TYPES
+
+ /** Rotate the node around an arbitrary axis.
+ */
+ virtual void rotate(const Vector3& axis, const Radian& angle, TransformSpace relativeTo = TS_LOCAL);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+ inline void rotate(const Vector3& axis, Real degrees, TransformSpace relativeTo = TS_LOCAL) {
+ rotate ( axis, Angle(degrees), relativeTo );
+ }
+#endif//OGRE_FORCE_ANGLE_TYPES
+
+ /** Rotate the node around an aritrary axis using a Quarternion.
+ */
+ virtual void rotate(const Quaternion& q, TransformSpace relativeTo = TS_LOCAL);
+
+ /** Gets a matrix whose columns are the local axes based on
+ the nodes orientation relative to it's parent. */
+ virtual Matrix3 getLocalAxes(void) const;
+
+ /** Creates an unnamed new Node as a child of this node.
+ @param
+ translate Initial translation offset of child relative to parent
+ @param
+ rotate Initial rotation relative to parent
+ */
+ virtual Node* createChild(
+ const Vector3& translate = Vector3::ZERO,
+ const Quaternion& rotate = Quaternion::IDENTITY );
+
+ /** Creates a new named Node as a child of this node.
+ @remarks
+ This creates a child node with a given name, which allows you to look the node up from
+ the parent which holds this collection of nodes.
+ @param
+ translate Initial translation offset of child relative to parent
+ @param
+ rotate Initial rotation relative to parent
+ */
+ virtual Node* createChild(const String& name, const Vector3& translate = Vector3::ZERO, const Quaternion& rotate = Quaternion::IDENTITY);
+
+ /** Adds a (precreated) child scene node to this node. If it is attached to another node,
+ it must be detached first.
+ @param child The Node which is to become a child node of this one
+ */
+ virtual void addChild(Node* child);
+
+ /** Reports the number of child nodes under this one.
+ */
+ virtual unsigned short numChildren(void) const;
+
+ /** Gets a pointer to a child node.
+ @remarks
+ There is an alternate getChild method which returns a named child.
+ */
+ virtual Node* getChild(unsigned short index) const;
+
+ /** Gets a pointer to a named child node.
+ */
+ virtual Node* getChild(const String& name) const;
+
+ /** Retrieves an iterator for efficiently looping through all children of this node.
+ @remarks
+ Using this is faster than repeatedly calling getChild if you want to go through
+ all (or most of) the children of this node.
+ Note that the returned iterator is only valid whilst no children are added or
+ removed from this node. Thus you should not store this returned iterator for
+ later use, nor should you add / remove children whilst iterating through it;
+ store up changes for later. Note that calling methods on returned items in
+ the iterator IS allowed and does not invalidate the iterator.
+ */
+ virtual ChildNodeIterator getChildIterator(void);
+
+ /** Retrieves an iterator for efficiently looping through all children of this node.
+ @remarks
+ Using this is faster than repeatedly calling getChild if you want to go through
+ all (or most of) the children of this node.
+ Note that the returned iterator is only valid whilst no children are added or
+ removed from this node. Thus you should not store this returned iterator for
+ later use, nor should you add / remove children whilst iterating through it;
+ store up changes for later. Note that calling methods on returned items in
+ the iterator IS allowed and does not invalidate the iterator.
+ */
+ virtual ConstChildNodeIterator getChildIterator(void) const;
+
+ /** Drops the specified child from this node.
+ @remarks
+ Does not delete the node, just detaches it from
+ this parent, potentially to be reattached elsewhere.
+ There is also an alternate version which drops a named
+ child from this node.
+ */
+ virtual Node* removeChild(unsigned short index);
+ /** Drops the specified child from this node.
+ @remarks
+ Does not delete the node, just detaches it from
+ this parent, potentially to be reattached elsewhere.
+ There is also an alternate version which drops a named
+ child from this node.
+ */
+ virtual Node* removeChild(Node* child);
+
+ /** Drops the named child from this node.
+ @remarks
+ Does not delete the node, just detaches it from
+ this parent, potentially to be reattached elsewhere.
+ */
+ virtual Node* removeChild(const String& name);
+ /** Removes all child Nodes attached to this node. Does not delete the nodes, just detaches them from
+ this parent, potentially to be reattached elsewhere.
+ */
+ virtual void removeAllChildren(void);
+
+ /** Gets the orientation of the node as derived from all parents.
+ */
+ virtual const Quaternion & _getDerivedOrientation(void) const;
+
+ /** Gets the position of the node as derived from all parents.
+ */
+ virtual const Vector3 & _getDerivedPosition(void) const;
+
+ /** Gets the scaling factor of the node as derived from all parents.
+ */
+ virtual const Vector3 & _getDerivedScale(void) const;
+
+ /** Gets the full transformation matrix for this node.
+ @remarks
+ This method returns the full transformation matrix
+ for this node, including the effect of any parent node
+ transformations, provided they have been updated using the Node::_update method.
+ This should only be called by a SceneManager which knows the
+ derived transforms have been updated before calling this method.
+ Applications using Ogre should just use the relative transforms.
+ */
+ virtual const Matrix4& _getFullTransform(void) const;
+
+ /** Internal method to update the Node.
+ @note
+ Updates this node and any relevant children to incorporate transforms etc.
+ Don't call this yourself unless you are writing a SceneManager implementation.
+ @param
+ updateChildren If true, the update cascades down to all children. Specify false if you wish to
+ update children separately, e.g. because of a more selective SceneManager implementation.
+ @param
+ parentHasChanged This flag indicates that the parent xform has changed,
+ so the child should retrieve the parent's xform and combine it with its own
+ even if it hasn't changed itself.
+ */
+ virtual void _update(bool updateChildren, bool parentHasChanged);
+
+ /** Sets a listener for this Node.
+ @remarks
+ Note for size and performance reasons only one listener per node is
+ allowed.
+ */
+ virtual void setListener(Listener* listener) { mListener = listener; }
+
+ /** Gets the current listener for this Node.
+ */
+ virtual Listener* getListener(void) const { return mListener; }
+
+ /** Overridden from Renderable.
+ @remarks
+ This is only used if the SceneManager chooses to render the node. This option can be set
+ for SceneNodes at SceneManager::setDisplaySceneNodes, and for entities based on skeletal
+ models using Entity::setDisplayBones()
+ */
+ const MaterialPtr& getMaterial(void) const;
+ /** Overridden from Renderable.
+ @remarks
+ This is only used if the SceneManager chooses to render the node. This option can be set
+ for SceneNodes at SceneManager::setDisplaySceneNodes, and for entities based on skeletal
+ models using Entity::setDisplaySkeleton()
+ */
+ void getRenderOperation(RenderOperation& op);
+ /** Overridden from Renderable.
+ @remarks
+ This is only used if the SceneManager chooses to render the node. This option can be set
+ for SceneNodes at SceneManager::setDisplaySceneNodes, and for entities based on skeletal
+ models using Entity::setDisplaySkeleton()
+ */
+ void getWorldTransforms(Matrix4* xform) const;
+ /** @copydoc Renderable::getWorldOrientation */
+ const Quaternion& getWorldOrientation(void) const;
+ /** @copydoc Renderable::getWorldPosition */
+ const Vector3& getWorldPosition(void) const;
+
+ /** Sets the current transform of this node to be the 'initial state' ie that
+ position / orientation / scale to be used as a basis for delta values used
+ in keyframe animation.
+ @remarks
+ You never need to call this method unless you plan to animate this node. If you do
+ plan to animate it, call this method once you've loaded the node with it's base state,
+ ie the state on which all keyframes are based.
+ @par
+ If you never call this method, the initial state is the identity transform, ie do nothing.
+ */
+ virtual void setInitialState(void);
+
+ /** Resets the position / orientation / scale of this node to it's initial state, see setInitialState for more info. */
+ virtual void resetToInitialState(void);
+
+ /** Gets the initial position of this node, see setInitialState for more info.
+ @remarks
+ Also resets the cumulative animation weight used for blending.
+ */
+ virtual const Vector3& getInitialPosition(void) const;
+
+ /** Gets the initial orientation of this node, see setInitialState for more info. */
+ virtual const Quaternion& getInitialOrientation(void) const;
+
+ /** Gets the initial position of this node, see setInitialState for more info. */
+ virtual const Vector3& getInitialScale(void) const;
+
+ /** Overridden, see Renderable */
+ Real getSquaredViewDepth(const Camera* cam) const;
+
+ /** To be called in the event of transform changes to this node that require it's recalculation.
+ @remarks
+ This not only tags the node state as being 'dirty', it also requests it's parent to
+ know about it's dirtiness so it will get an update next time.
+ @param forceParentUpdate Even if the node thinks it has already told it's
+ parent, tell it anyway
+ */
+ virtual void needUpdate(bool forceParentUpdate = false);
+ /** Called by children to notify their parent that they need an update.
+ @param forceParentUpdate Even if the node thinks it has already told it's
+ parent, tell it anyway
+ */
+ virtual void requestUpdate(Node* child, bool forceParentUpdate = false);
+ /** Called by children to notify their parent that they no longer need an update. */
+ virtual void cancelUpdate(Node* child);
+
+ /** Queue a 'needUpdate' call to a node safely.
+ @ramarks
+ You can't call needUpdate() during the scene graph update, e.g. in
+ response to a Node::Listener hook, because the graph is already being
+ updated, and update flag changes cannot be made reliably in that context.
+ Call this method if you need to queue a needUpdate call in this case.
+ */
+ static void queueNeedUpdate(Node* n);
+ /** Process queued 'needUpdate' calls. */
+ static void processQueuedUpdates(void);
+
+ /** @copydoc Renderable::getLights */
+ const LightList& getLights(void) const;
+
+
+
+ };
+
+} //namespace
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreNumerics.h b/school/informatik/verkerhssimulation/src/ogre/OgreNumerics.h
new file mode 100644
index 00000000..6a004c02
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreNumerics.h
@@ -0,0 +1,55 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __NumericSolvers_H__
+#define __NumericSolvers_H__
+
+#include "OgrePrerequisites.h"
+
+
+namespace Ogre {
+
+ /** Real type for numeric solvers */
+ typedef double PreciseReal;
+
+
+ /** Provides numeric solvers for Ogre
+ @remarks
+ Handles linear algebra numerics.
+ */
+ class _OgreExport NumericSolver
+ {
+ public:
+ /** Solves a full rank NxN linear system of equations
+ @remarks
+ This implements a naive gaussian elimination algorithm.
+ The algorithm is destructive, so there are side effects in coeff and col.
+ */
+ static bool solveNxNLinearSysDestr(int n, PreciseReal **coeff, PreciseReal *col);
+ };
+
+}
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreOptimisedUtil.h b/school/informatik/verkerhssimulation/src/ogre/OgreOptimisedUtil.h
new file mode 100644
index 00000000..b4600bd0
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreOptimisedUtil.h
@@ -0,0 +1,221 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __OptimisedUtil_H__
+#define __OptimisedUtil_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreEdgeListBuilder.h"
+
+namespace Ogre {
+
+ /** Utility class for provides optimised functions.
+ @note
+ This class are supposed used by internal engine only.
+ */
+ class _OgreExport OptimisedUtil
+ {
+ private:
+ /// Privated copy constructor, to prevent misuse
+ OptimisedUtil(const OptimisedUtil& rhs); /* do nothing, should not use */
+ /// Privated operator=, to prevent misuse
+ OptimisedUtil& operator=(const OptimisedUtil& rhs); /* do not use */
+
+ protected:
+ /// Store a pointer to the implementation
+ static OptimisedUtil* msImplementation;
+
+ /// Detect best implementation based on run-time environment
+ static OptimisedUtil* _detectImplementation(void);
+
+ public:
+ // Default constructor
+ OptimisedUtil(void) {}
+ // Destructor
+ virtual ~OptimisedUtil() {}
+
+ /** Gets the implementation of this class.
+ @note
+ Don't cache the pointer returned by this function, it'll change due
+ run-time environment detection to pick up the best implementation.
+ */
+ static OptimisedUtil* getImplementation(void) { return msImplementation; }
+
+ /** Performs software vertex skinning.
+ @param srcPosPtr Pointer to source position buffer.
+ @param destPosPtr Pointer to destination position buffer.
+ @param srcNormPtr Pointer to source normal buffer, if NULL,
+ means blend position only.
+ @param destNormPtr Pointer to destination normal buffer, it's
+ ignored if srcNormPtr is NULL.
+ @param blendWeightPtr Pointer to blend weight buffer.
+ @param blendIndexPtr Pointer to blend index buffer.
+ @param blendMatrices An array of pointer of blend matrix, the matrix
+ must be aligned to SIMD alignment, but not necessary for the array
+ itself.
+ @param srcPosStride The stride of source position in bytes.
+ @param destPosStride The stride of destination position in bytes.
+ @param srcNormStride The stride of source normal in bytes,
+ it's ignored if srcNormPtr is NULL.
+ @param destNormStride The stride of destination normal in bytes,
+ it's ignored if srcNormPtr is NULL.
+ @param blendWeightStride The stride of blend weight buffer in bytes.
+ @param blendIndexStride The stride of blend index buffer in bytes.
+ @param numWeightsPerVertex Number of blend weights per-vertex, as well
+ as for blend indices.
+ @param numVertices Number of vertices to blend.
+ */
+ virtual void softwareVertexSkinning(
+ const float *srcPosPtr, float *destPosPtr,
+ const float *srcNormPtr, float *destNormPtr,
+ const float *blendWeightPtr, const unsigned char* blendIndexPtr,
+ const Matrix4* const* blendMatrices,
+ size_t srcPosStride, size_t destPosStride,
+ size_t srcNormStride, size_t destNormStride,
+ size_t blendWeightStride, size_t blendIndexStride,
+ size_t numWeightsPerVertex,
+ size_t numVertices) = 0;
+
+ /** Performs a software vertex morph, of the kind used for
+ morph animation although it can be used for other purposes.
+ @remarks
+ This function will linearly interpolate positions between two
+ source buffers, into a third buffer.
+ @param t Parametric distance between the start and end positions
+ @param srcPos1 Pointer to buffer for the start positions
+ @param srcPos2 Pointer to buffer for the end positions
+ @param dstPos Pointer to buffer for the destination positions
+ @param numVertices Number of vertices to morph, which agree with
+ the number in start, end and destination buffer. Bear in mind
+ three floating-point values per vertex
+ */
+ virtual void softwareVertexMorph(
+ Real t,
+ const float *srcPos1, const float *srcPos2,
+ float *dstPos,
+ size_t numVertices) = 0;
+
+ /** Concatenate an affine matrix to an array of affine matrices.
+ @note
+ An affine matrix is a 4x4 matrix with row 3 equal to (0, 0, 0, 1),
+ e.g. no projective coefficients.
+ @param baseMatrix The matrix used as first operand.
+ @param srcMatrices An array of matrix used as second operand.
+ @param dstMatrices An array of matrix to store matrix concatenate results.
+ @param numMatrices Number of matrices in the array.
+ */
+ virtual void concatenateAffineMatrices(
+ const Matrix4& baseMatrix,
+ const Matrix4* srcMatrices,
+ Matrix4* dstMatrices,
+ size_t numMatrices) = 0;
+
+ /** Calculate the face normals for the triangles based on position
+ information.
+ @param positions Pointer to position information, which packed in
+ (x, y, z) format, indexing by vertex index in the triangle. No
+ alignment requests.
+ @param triangles The triangles need to calculate face normal, the vertex
+ positions is indexed by vertex index to position information.
+ @param faceNormals The array of Vector4 used to store triangles face normal,
+ Must be aligned to SIMD alignment.
+ @param numTriangles Number of triangles to calculate face normal.
+ */
+ virtual void calculateFaceNormals(
+ const float *positions,
+ const EdgeData::Triangle *triangles,
+ Vector4 *faceNormals,
+ size_t numTriangles) = 0;
+
+ /** Calculate the light facing state of the triangle's face normals
+ @remarks
+ This is normally the first stage of calculating a silhouette, ie
+ establishing which tris are facing the light and which are facing
+ away.
+ @param lightPos 4D position of the light in object space, note that
+ for directional lights (which have no position), the w component
+ is 0 and the x/y/z position are the direction.
+ @param faceNormals An array of face normals for the triangles, the face
+ normal are unit vector othogonal to the triangles, plus distance
+ from origin. This array must be aligned to SIMD alignment.
+ @param lightFacings An array of flags for store light facing state
+ results, the result flag is true if corresponding face normal facing
+ the light, false otherwise. This array no alignment requires.
+ @param numFaces Number of face normals to calculate.
+ */
+ virtual void calculateLightFacing(
+ const Vector4& lightPos,
+ const Vector4* faceNormals,
+ char* lightFacings,
+ size_t numFaces) = 0;
+
+ /** Extruding vertices by a fixed distance based on light position.
+ @param lightPos 4D light position, when w=0.0f this represents a
+ directional light, otherwise, w must be equal to 1.0f, which
+ represents a point light.
+ @param extrudeDist The distance to extrude.
+ @param srcPositions Pointer to source vertex's position buffer, which
+ the position is a 3D vector packed in xyz format. No SIMD alignment
+ requirement but loss performance for unaligned data.
+ @param destPositions Pointer to destination vertex's position buffer,
+ which the position is a 3D vector packed in xyz format. No SIMD
+ alignment requirement but loss performance for unaligned data.
+ @param numVertices Number of vertices need to extruding, which agree
+ with source and destination buffers.
+ */
+ virtual void extrudeVertices(
+ const Vector4& lightPos,
+ Real extrudeDist,
+ const float* srcPositions,
+ float* destPositions,
+ size_t numVertices) = 0;
+ };
+
+ /** Returns raw offseted of the given pointer.
+ @note
+ The offset are in bytes, no matter what type of the pointer.
+ */
+ template
+ static FORCEINLINE T* rawOffsetPointer(T* ptr, ptrdiff_t offset)
+ {
+ return (T*)((char*)(ptr) + offset);
+ }
+
+ /** Advance the pointer with raw offset.
+ @note
+ The offset are in bytes, no matter what type of the pointer.
+ */
+ template
+ static FORCEINLINE void advanceRawPointer(T*& ptr, ptrdiff_t offset)
+ {
+ ptr = rawOffsetPointer(ptr, offset);
+ }
+
+}
+
+#endif // __OptimisedUtil_H__
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreOverlay.h b/school/informatik/verkerhssimulation/src/ogre/OgreOverlay.h
new file mode 100644
index 00000000..cbbc7beb
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreOverlay.h
@@ -0,0 +1,285 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __Overlay_H__
+#define __Overlay_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreSceneNode.h"
+#include "OgreIteratorWrappers.h"
+#include "OgreMatrix4.h"
+
+namespace Ogre {
+
+
+ /** Represents a layer which is rendered on top of the 'normal' scene contents.
+ @remarks
+ An overlay is a container for visual components (2D and 3D) which will be
+ rendered after the main scene in order to composite heads-up-displays, menus
+ or other layers on top of the contents of the scene.
+ @par
+ An overlay always takes up the entire size of the viewport, although the
+ components attached to it do not have to. An overlay has no visual element
+ in itself, it it merely a container for visual elements.
+ @par
+ Overlays are created by calling OverlayManager::create, or by defining them
+ in special text scripts (.overlay files). As many overlays
+ as you like can be defined; after creation an overlay is hidden i.e. not
+ visible until you specifically enable it by calling 'show'. This allows you to have multiple
+ overlays predefined (menus etc) which you make visible only when you want.
+ It is possible to have multiple overlays enabled at once; in this case the
+ relative 'zorder' parameter of the overlays determine which one is displayed
+ on top.
+ @par
+ By default overlays are rendered into all viewports. This is fine when you only
+ have fullscreen viewports, but if you have picture-in-picture views, you probably
+ don't want the overlay displayed in the smaller viewports. You turn this off for
+ a specific viewport by calling the Viewport::setDisplayOverlays method.
+ */
+ class _OgreExport Overlay
+ {
+
+ public:
+ typedef std::list OverlayContainerList;
+ protected:
+ String mName;
+ /// Internal root node, used as parent for 3D objects
+ SceneNode* mRootNode;
+ // 2D elements
+ // OverlayContainers, linked list for easy sorting by zorder later
+ // Not a map because sort can be saved since changes infrequent (unlike render queue)
+ OverlayContainerList m2DElements;
+
+ // Degrees of rotation around center
+ Radian mRotate;
+ // Scroll values, offsets
+ Real mScrollX, mScrollY;
+ // Scale values
+ Real mScaleX, mScaleY;
+
+ mutable Matrix4 mTransform;
+ mutable bool mTransformOutOfDate;
+ bool mTransformUpdated;
+ ulong mZOrder;
+ bool mVisible;
+ bool mInitialised;
+ String mOrigin;
+ /** Internal lazy update method. */
+ void updateTransform(void) const;
+ /** Internal method for initialising an overlay */
+ void initialise(void);
+
+ public:
+ /// Constructor: do not call direct, use OverlayManager::create
+ Overlay(const String& name);
+ virtual ~Overlay();
+
+
+ OverlayContainer* getChild(const String& name);
+
+ /** Gets the name of this overlay. */
+ const String& getName(void) const;
+ /** Alters the ZOrder of this overlay.
+ @remarks
+ Values between 0 and 650 are valid here.
+ */
+ void setZOrder(ushort zorder);
+ /** Gets the ZOrder of this overlay. */
+ ushort getZOrder(void) const;
+
+ /** Gets whether the overlay is displayed or not. */
+ bool isVisible(void) const;
+
+ /** Gets whether the overlay is initialised or not. */
+ bool isInitialised(void) const { return mInitialised; }
+
+ /** Shows the overlay if it was hidden. */
+ void show(void);
+
+ /** Hides the overlay if it was visible. */
+ void hide(void);
+
+ /** Adds a 2D 'container' to the overlay.
+ @remarks
+ Containers are created and managed using the OverlayManager. A container
+ could be as simple as a square panel, or something more complex like
+ a grid or tree view. Containers group collections of other elements,
+ giving them a relative coordinate space and a common z-order.
+ If you want to attach a gui widget to an overlay, you have to do it via
+ a container.
+ @param cont Pointer to a container to add, created using OverlayManager.
+ */
+ void add2D(OverlayContainer* cont);
+
+
+ /** Removes a 2D container from the overlay.
+ @remarks
+ NOT FAST. Consider OverlayElement::hide.
+ */
+ void remove2D(OverlayContainer* cont);
+
+ /** Adds a node capable of holding 3D objects to the overlay.
+ @remarks
+ Although overlays are traditionally associated with 2D elements, there
+ are reasons why you might want to attach 3D elements to the overlay too.
+ For example, if you wanted to have a 3D cockpit, which was overlaid with a
+ HUD, then you would create 2 overlays, one with a 3D object attached for the
+ cockpit, and one with the HUD elements attached (the zorder of the HUD
+ overlay would be higher than the cockpit to ensure it was always on top).
+ @par
+ A SceneNode can have any number of 3D objects attached to it. SceneNodes
+ are usually created using SceneManager::createSceneNode, but in this case
+ you should create a standard SceneNode instance manually; this is
+ because these scene nodes are not managed by the SceneManager and some custom
+ SceneManager plugins will rely on specialist behaviour the overlay does not
+ support. By attaching a SceneNode to an overlay, you indicate that:
+ - You want the contents of this node to only appear when the overlay is active
+ - You want the node to inherit a coordinate space relative to the camera,
+ rather than relative to the root scene node
+ - You want these objects to be rendered after the contents of the main scene
+ to ensure they are rendered on top
+
+ One major consideration when using 3D objects in overlays is the behaviour of
+ the depth buffer. Overlays should use materials with depth checking off, to ensure
+ that their contents are always displayed on top of the main scene (to do
+ otherwise would result in objects 'poking through' the overlay). The problem
+ with using 3D objects is that if they are concave, or self-overlap, then you
+ can get artefacts because of the lack of depth buffer checking. So you should
+ ensure that any 3D objects you us in the overlay are convex, and don't overlap
+ each other. If they must overlap, split them up and put them in 2 overlays.
+ Alternatively, use a 2D element underneath them which will clear the depth buffer
+ values underneath ready for the 3D element to be rendered correctly.
+ */
+ void add3D(SceneNode* node);
+
+ /** Removes a 3D element from the overlay. */
+ void remove3D(SceneNode* node);
+
+ /** Clears the overlay of all attached items. */
+ void clear();
+
+ /** Sets the scrolling factor of this overlay.
+ @remarks
+ You can use this to set an offset to be used to scroll an
+ overlay around the screen.
+ @param x Horizontal scroll value, where 0 = normal, -0.5 = scroll so that only
+ the right half the screen is visible etc
+ @param y Vertical scroll value, where 0 = normal, 0.5 = scroll down by half
+ a screen etc.
+ */
+ void setScroll(Real x, Real y);
+
+ /** Gets the current X scroll value */
+ Real getScrollX(void) const;
+
+ /** Gets the current Y scroll value */
+ Real getScrollY(void) const;
+
+ /** Scrolls the overlay by the offsets provided.
+ @remarks
+ This method moves the overlay by the amounts provided. As with
+ other methods on this object, a full screen width / height is represented
+ by the value 1.0.
+ */
+ void scroll(Real xoff, Real yoff);
+
+ /** Sets the rotation applied to this overlay.*/
+ void setRotate(const Radian& angle);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+ inline void setRotate(Real degrees) {
+ setRotate ( Angle(degrees) );
+ }
+#endif//OGRE_FORCE_ANGLE_TYPES
+
+ /** Gets the rotation applied to this overlay, in degrees.*/
+ const Radian &getRotate(void) const { return mRotate; }
+
+ /** Adds the passed in angle to the rotation applied to this overlay. */
+ void rotate(const Radian& angle);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+ inline void rotate(Real degrees) {
+ rotate ( Angle(degrees) );
+ }
+#endif//OGRE_FORCE_ANGLE_TYPES
+
+ /** Sets the scaling factor of this overlay.
+ @remarks
+ You can use this to set an scale factor to be used to zoom an
+ overlay.
+ @param x Horizontal scale value, where 1.0 = normal, 0.5 = half size etc
+ @param y Vertical scale value, where 1.0 = normal, 0.5 = half size etc
+ */
+ void setScale(Real x, Real y);
+
+ /** Gets the current X scale value */
+ Real getScaleX(void) const;
+
+ /** Gets the current Y scale value */
+ Real getScaleY(void) const;
+
+ /** Used to transform the overlay when scrolling, scaling etc. */
+ void _getWorldTransforms(Matrix4* xform) const;
+ /** @copydoc Renderable::getWorldOrientation */
+ const Quaternion& getWorldOrientation(void) const;
+ /** @copydoc Renderable::getWorldPosition */
+ const Vector3& getWorldPosition(void) const;
+
+ /** Internal method to put the overlay contents onto the render queue. */
+ void _findVisibleObjects(Camera* cam, RenderQueue* queue);
+
+ /** This returns a OverlayElement at position x,y. */
+ virtual OverlayElement* findElementAt(Real x, Real y);
+
+ /** Returns an iterator over all 2D elements in this manager.
+ @remarks
+ VectorIterator is actually a too generic name, since it also works for lists.
+ */
+ typedef VectorIterator Overlay2DElementsIterator ;
+ Overlay2DElementsIterator get2DElementsIterator ()
+ {
+ return Overlay2DElementsIterator (m2DElements.begin(), m2DElements.end());
+ }
+ /** Get the origin of this overlay, e.g. a script file name.
+ @remarks
+ This property will only contain something if the creator of
+ this overlay chose to populate it. Script loaders are advised
+ to populate it.
+ */
+ const String& getOrigin(void) const { return mOrigin; }
+ /// Notify this overlay of it's origin
+ void _notifyOrigin(const String& origin) { mOrigin = origin; }
+
+
+ };
+
+}
+
+
+#endif
+
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreOverlayContainer.h b/school/informatik/verkerhssimulation/src/ogre/OgreOverlayContainer.h
new file mode 100644
index 00000000..7d340c71
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreOverlayContainer.h
@@ -0,0 +1,145 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __OverlayContainer_H__
+#define __OverlayContainer_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreOverlayElement.h"
+#include "OgreIteratorWrappers.h"
+
+
+namespace Ogre {
+
+
+ /** A 2D element which contains other OverlayElement instances.
+ @remarks
+ This is a specialisation of OverlayElement for 2D elements that contain other
+ elements. These are also the smallest elements that can be attached directly
+ to an Overlay.
+ @remarks
+ OverlayContainers should be managed using OverlayManager. This class is responsible for
+ instantiating / deleting elements, and also for accepting new types of element
+ from plugins etc.
+ */
+ class _OgreExport OverlayContainer : public OverlayElement
+ {
+ public:
+ typedef std::map ChildMap;
+ typedef MapIterator ChildIterator;
+ typedef std::map ChildContainerMap;
+ typedef MapIterator ChildContainerIterator;
+ protected:
+ // Map of all children
+ ChildMap mChildren;
+ // Map of container children (subset of mChildren)
+ ChildContainerMap mChildContainers;
+
+ bool mChildrenProcessEvents;
+
+ public:
+ /// Constructor: do not call direct, use OverlayManager::createOverlayElement
+ OverlayContainer(const String& name);
+ virtual ~OverlayContainer();
+
+ /** Adds another OverlayElement to this container. */
+ virtual void addChild(OverlayElement* elem);
+ /** Adds another OverlayElement to this container. */
+ virtual void addChildImpl(OverlayElement* elem);
+ /** Add a nested container to this container. */
+ virtual void addChildImpl(OverlayContainer* cont);
+ /** Removes a named element from this container. */
+ virtual void removeChild(const String& name);
+ /** Gets the named child of this container. */
+ virtual OverlayElement* getChild(const String& name);
+
+ /** @copydoc OverlayElement::initialise */
+ void initialise(void);
+
+ void _addChild(OverlayElement* elem);
+ void _removeChild(OverlayElement* elem) { _removeChild(elem->getName()); }
+ void _removeChild(const String& name);
+
+ /** Gets an object for iterating over all the children of this object. */
+ virtual ChildIterator getChildIterator(void);
+
+ /** Gets an iterator for just the container children of this object.
+ @remarks
+ Good for cascading updates without having to use RTTI
+ */
+ virtual ChildContainerIterator getChildContainerIterator(void);
+
+ /** Tell the object and its children to recalculate */
+ virtual void _positionsOutOfDate(void);
+
+ /** Overridden from OverlayElement. */
+ virtual void _update(void);
+
+ /** Overridden from OverlayElement. */
+ virtual void _notifyZOrder(ushort newZOrder);
+
+ /** Overridden from OverlayElement. */
+ virtual void _notifyViewport();
+
+ /** Overridden from OverlayElement. */
+ virtual void _notifyWorldTransforms(const Matrix4& xform);
+
+ /** Overridden from OverlayElement. */
+ virtual void _notifyParent(OverlayContainer* parent, Overlay* overlay);
+
+ /** Overridden from OverlayElement. */
+ virtual void _updateRenderQueue(RenderQueue* queue);
+
+ /** Overridden from OverlayElement. */
+ inline bool isContainer() const
+ { return true; }
+
+ /** Should this container pass events to their children */
+ virtual inline bool isChildrenProcessEvents() const
+ { return true; }
+
+ /** Should this container pass events to their children */
+ virtual inline void setChildrenProcessEvents(bool val)
+ { mChildrenProcessEvents = val; }
+
+ /** This returns a OverlayElement at position x,y. */
+ virtual OverlayElement* findElementAt(Real x, Real y); // relative to parent
+
+ void copyFromTemplate(OverlayElement* templateOverlay);
+ virtual OverlayElement* clone(const String& instanceName);
+
+ };
+
+
+
+}
+
+
+#endif
+
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreOverlayElement.h b/school/informatik/verkerhssimulation/src/ogre/OgreOverlayElement.h
new file mode 100644
index 00000000..1ab87869
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreOverlayElement.h
@@ -0,0 +1,490 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __OverlayElement_H__
+#define __OverlayElement_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreString.h"
+#include "OgreRenderable.h"
+#include "OgreUTFString.h"
+#include "OgreStringInterface.h"
+#include "OgreOverlayElementCommands.h"
+
+#include "OgreColourValue.h"
+#include "OgreRectangle.h"
+
+namespace Ogre {
+
+#if OGRE_UNICODE_SUPPORT
+ typedef UTFString DisplayString;
+# define OGRE_DEREF_DISPLAYSTRING_ITERATOR(it) it.getCharacter()
+#else
+ typedef String DisplayString;
+# define OGRE_DEREF_DISPLAYSTRING_ITERATOR(it) *it
+#endif
+ /** Enum describing how the position / size of an element is to be recorded.
+ */
+ enum GuiMetricsMode
+ {
+ /// 'left', 'top', 'height' and 'width' are parametrics from 0.0 to 1.0
+ GMM_RELATIVE,
+ /// Positions & sizes are in absolute pixels
+ GMM_PIXELS,
+ /// Positions & sizes are in virtual pixels
+ GMM_RELATIVE_ASPECT_ADJUSTED
+ };
+
+ /** Enum describing where '0' is in relation to the parent in the horizontal dimension.
+ @remarks Affects how 'left' is interpreted.
+ */
+ enum GuiHorizontalAlignment
+ {
+ GHA_LEFT,
+ GHA_CENTER,
+ GHA_RIGHT
+ };
+ /** Enum describing where '0' is in relation to the parent in the vertical dimension.
+ @remarks Affects how 'top' is interpreted.
+ */
+ enum GuiVerticalAlignment
+ {
+ GVA_TOP,
+ GVA_CENTER,
+ GVA_BOTTOM
+ };
+
+ /** Abstract definition of a 2D element to be displayed in an Overlay.
+ @remarks
+ This class abstracts all the details of a 2D element which will appear in
+ an overlay. In fact, not all OverlayElement instances can be directly added to an
+ Overlay, only those which are OverlayContainer instances (a subclass of this class).
+ OverlayContainer objects can contain any OverlayElement however. This is just to
+ enforce some level of grouping on widgets.
+ @par
+ OverlayElements should be managed using OverlayManager. This class is responsible for
+ instantiating / deleting elements, and also for accepting new types of element
+ from plugins etc.
+ @par
+ Note that positions / dimensions of 2D screen elements are expressed as parametric
+ values (0.0 - 1.0) because this makes them resolution-independent. However, most
+ screen resolutions have an aspect ratio of 1.3333:1 (width : height) so note that
+ in physical pixels 0.5 is wider than it is tall, so a 0.5x0.5 panel will not be
+ square on the screen (but it will take up exactly half the screen in both dimensions).
+ @par
+ Because this class is designed to be extensible, it subclasses from StringInterface
+ so its parameters can be set in a generic way.
+ */
+ class _OgreExport OverlayElement : public StringInterface, public Renderable
+ {
+ public:
+
+ protected:
+ // Command object for setting / getting parameters
+ static OverlayElementCommands::CmdLeft msLeftCmd;
+ static OverlayElementCommands::CmdTop msTopCmd;
+ static OverlayElementCommands::CmdWidth msWidthCmd;
+ static OverlayElementCommands::CmdHeight msHeightCmd;
+ static OverlayElementCommands::CmdMaterial msMaterialCmd;
+ static OverlayElementCommands::CmdCaption msCaptionCmd;
+ static OverlayElementCommands::CmdMetricsMode msMetricsModeCmd;
+ static OverlayElementCommands::CmdHorizontalAlign msHorizontalAlignCmd;
+ static OverlayElementCommands::CmdVerticalAlign msVerticalAlignCmd;
+ static OverlayElementCommands::CmdVisible msVisibleCmd;
+
+
+ String mName;
+ bool mVisible;
+ bool mCloneable;
+ Real mLeft;
+ Real mTop;
+ Real mWidth;
+ Real mHeight;
+ String mMaterialName;
+ MaterialPtr mpMaterial;
+ DisplayString mCaption;
+ ColourValue mColour;
+ Rectangle mClippingRegion;
+
+ GuiMetricsMode mMetricsMode;
+ GuiHorizontalAlignment mHorzAlign;
+ GuiVerticalAlignment mVertAlign;
+
+ // metric-mode positions, used in GMM_PIXELS & GMM_RELATIVE_ASPECT_ADJUSTED mode.
+ Real mPixelTop;
+ Real mPixelLeft;
+ Real mPixelWidth;
+ Real mPixelHeight;
+ Real mPixelScaleX;
+ Real mPixelScaleY;
+
+ // Parent pointer
+ OverlayContainer* mParent;
+ // Overlay attached to
+ Overlay* mOverlay;
+
+ // Derived positions from parent
+ Real mDerivedLeft;
+ Real mDerivedTop;
+ bool mDerivedOutOfDate;
+
+ /// Flag indicating if the vertex positons need recalculating
+ bool mGeomPositionsOutOfDate;
+ /// Flag indicating if the vertex uvs need recalculating
+ bool mGeomUVsOutOfDate;
+
+ // Zorder for when sending to render queue
+ // Derived from parent
+ ushort mZOrder;
+
+ // world transforms
+ Matrix4 mXForm;
+
+ // is element enabled
+ bool mEnabled;
+
+ // is element initialised
+ bool mInitialised;
+
+ // Used to see if this element is created from a Template
+ OverlayElement* mSourceTemplate ;
+
+ /** Internal method which is triggered when the positions of the element get updated,
+ meaning the element should be rebuilding it's mesh positions. Abstract since
+ subclasses must implement this.
+ */
+ virtual void updatePositionGeometry(void) = 0;
+ /** Internal method which is triggered when the UVs of the element get updated,
+ meaning the element should be rebuilding it's mesh UVs. Abstract since
+ subclasses must implement this.
+ */
+ virtual void updateTextureGeometry(void) = 0;
+
+ /** Internal method for setting up the basic parameter definitions for a subclass.
+ @remarks
+ Because StringInterface holds a dictionary of parameters per class, subclasses need to
+ call this to ask the base class to add it's parameters to their dictionary as well.
+ Can't do this in the constructor because that runs in a non-virtual context.
+ @par
+ The subclass must have called it's own createParamDictionary before calling this method.
+ */
+ virtual void addBaseParameters(void);
+
+ public:
+ /// Constructor: do not call direct, use OverlayManager::createElement
+ OverlayElement(const String& name);
+ virtual ~OverlayElement();
+
+ /** Initialise gui element */
+ virtual void initialise(void) = 0;
+
+ /** Gets the name of this overlay. */
+ const String& getName(void) const;
+
+
+ /** Shows this element if it was hidden. */
+ virtual void show(void);
+
+ /** Hides this element if it was visible. */
+ virtual void hide(void);
+
+ /** Returns whether or not the element is visible. */
+ bool isVisible(void) const;
+
+ bool isEnabled() const;
+ virtual void setEnabled(bool b);
+
+
+ /** Sets the dimensions of this element in relation to the screen (1.0 = screen width/height). */
+ void setDimensions(Real width, Real height);
+
+ /** Sets the position of the top-left corner of the element, relative to the screen size
+ (1.0 = screen width / height) */
+ void setPosition(Real left, Real top);
+
+ /** Sets the width of this element in relation to the screen (where 1.0 = screen width) */
+ void setWidth(Real width);
+ /** Gets the width of this element in relation to the screen (where 1.0 = screen width) */
+ Real getWidth(void) const;
+
+ /** Sets the height of this element in relation to the screen (where 1.0 = screen height) */
+ void setHeight(Real height);
+ /** Gets the height of this element in relation to the screen (where 1.0 = screen height) */
+ Real getHeight(void) const;
+
+ /** Sets the left of this element in relation to the screen (where 0 = far left, 1.0 = far right) */
+ void setLeft(Real left);
+ /** Gets the left of this element in relation to the screen (where 0 = far left, 1.0 = far right) */
+ Real getLeft(void) const;
+
+ /** Sets the top of this element in relation to the screen (where 0 = top, 1.0 = bottom) */
+ void setTop(Real Top);
+ /** Gets the top of this element in relation to the screen (where 0 = top, 1.0 = bottom) */
+ Real getTop(void) const;
+
+ /** Gets the left of this element in relation to the screen (where 0 = far left, 1.0 = far right) */
+ Real _getLeft(void) const { return mLeft; }
+ /** Gets the top of this element in relation to the screen (where 0 = far left, 1.0 = far right) */
+ Real _getTop(void) const { return mTop; }
+ /** Gets the width of this element in relation to the screen (where 1.0 = screen width) */
+ Real _getWidth(void) const { return mWidth; }
+ /** Gets the height of this element in relation to the screen (where 1.0 = screen height) */
+ Real _getHeight(void) const { return mHeight; }
+ /** Sets the left of this element in relation to the screen (where 1.0 = screen width) */
+ void _setLeft(Real left);
+ /** Sets the top of this element in relation to the screen (where 1.0 = screen width) */
+ void _setTop(Real top);
+ /** Sets the width of this element in relation to the screen (where 1.0 = screen width) */
+ void _setWidth(Real width);
+ /** Sets the height of this element in relation to the screen (where 1.0 = screen width) */
+ void _setHeight(Real height);
+ /** Sets the left and top of this element in relation to the screen (where 1.0 = screen width) */
+ void _setPosition(Real left, Real top);
+ /** Sets the width and height of this element in relation to the screen (where 1.0 = screen width) */
+ void _setDimensions(Real width, Real height);
+
+ /** Gets the name of the material this element uses. */
+ virtual const String& getMaterialName(void) const;
+
+ /** Sets the name of the material this element will use.
+ @remarks
+ Different elements will use different materials. One constant about them
+ all though is that a Material used for a OverlayElement must have it's depth
+ checking set to 'off', which means it always gets rendered on top. OGRE
+ will set this flag for you if necessary. What it does mean though is that
+ you should not use the same Material for rendering OverlayElements as standard
+ scene objects. It's fine to use the same textures, just not the same
+ Material.
+ */
+ virtual void setMaterialName(const String& matName);
+
+
+ // --- Renderable Overrides ---
+ /** See Renderable */
+ const MaterialPtr& getMaterial(void) const;
+
+ // NB getRenderOperation not implemented, still abstract here
+
+ /** See Renderable */
+ void getWorldTransforms(Matrix4* xform) const;
+ /** @copydoc Renderable::getWorldOrientation */
+ const Quaternion& getWorldOrientation(void) const;
+ /** @copydoc Renderable::getWorldPosition */
+ const Vector3& getWorldPosition(void) const;
+
+ /** Tell the object to recalculate */
+ virtual void _positionsOutOfDate(void);
+
+ /** Internal method to update the element based on transforms applied. */
+ virtual void _update(void);
+
+ /** Updates this elements transform based on it's parent. */
+ virtual void _updateFromParent(void);
+
+ /** Internal method for notifying the gui element of it's parent and ultimate overlay. */
+ virtual void _notifyParent(OverlayContainer* parent, Overlay* overlay);
+
+ /** Gets the 'left' position as derived from own left and that of parents. */
+ virtual Real _getDerivedLeft(void);
+
+ /** Gets the 'top' position as derived from own left and that of parents. */
+ virtual Real _getDerivedTop(void);
+
+ /** Gets the 'width' as derived from own width and metrics mode. */
+ virtual Real _getRelativeWidth(void);
+ /** Gets the 'height' as derived from own height and metrics mode. */
+ virtual Real _getRelativeHeight(void);
+
+
+ /** Gets the clipping region of the element */
+ virtual void _getClippingRegion(Rectangle &clippingRegion);
+
+ /** Internal method to notify the element when Zorder of parent overlay
+ has changed.
+ @remarks
+ Overlays have explicit Z orders. OverlayElements do not, they inherit the
+ ZOrder of the overlay, and the Zorder is incremented for every container
+ nested within this to ensure that containers are displayed behind contained
+ items. This method is used internally to notify the element of a change in
+ final zorder which is used to render the element.
+ */
+ virtual void _notifyZOrder(ushort newZOrder);
+
+ /** Internal method to notify the element when it's world transform
+ of parent overlay has changed.
+ */
+ virtual void _notifyWorldTransforms(const Matrix4& xform);
+
+ /** Internal method to notify the element when the viewport
+ of parent overlay has changed.
+ */
+ virtual void _notifyViewport();
+
+ /** Internal method to put the contents onto the render queue. */
+ virtual void _updateRenderQueue(RenderQueue* queue);
+
+ /** Gets the type name of the element. All concrete subclasses must implement this. */
+ virtual const String& getTypeName(void) const = 0;
+
+ /** Sets the caption on elements that support it.
+ @remarks
+ This property doesn't do something on all elements, just those that support it.
+ However, being a common requirement it is in the top-level interface to avoid
+ having to set it via the StringInterface all the time.
+ */
+ virtual void setCaption(const DisplayString& text);
+ /** Gets the caption for this element. */
+ virtual const DisplayString& getCaption(void) const;
+ /** Sets the colour on elements that support it.
+ @remarks
+ This property doesn't do something on all elements, just those that support it.
+ However, being a common requirement it is in the top-level interface to avoid
+ having to set it via the StringInterface all the time.
+ */
+ virtual void setColour(const ColourValue& col);
+
+ /** Gets the colour for this element. */
+ virtual const ColourValue& getColour(void) const;
+
+ /** Tells this element how to interpret the position and dimension values it is given.
+ @remarks
+ By default, OverlayElements are positioned and sized according to relative dimensions
+ of the screen. This is to ensure portability between different resolutions when you
+ want things to be positioned and sized the same way across all resolutions. However,
+ sometimes you want things to be sized according to fixed pixels. In order to do this,
+ you can call this method with the parameter GMM_PIXELS. Note that if you then want
+ to place your element relative to the center, right or bottom of it's parent, you will
+ need to use the setHorizontalAlignment and setVerticalAlignment methods.
+ */
+ virtual void setMetricsMode(GuiMetricsMode gmm);
+ /** Retrieves the current settings of how the element metrics are interpreted. */
+ virtual GuiMetricsMode getMetricsMode(void) const;
+ /** Sets the horizontal origin for this element.
+ @remarks
+ By default, the horizontal origin for a OverlayElement is the left edge of the parent container
+ (or the screen if this is a root element). You can alter this by calling this method, which is
+ especially useful when you want to use pixel-based metrics (see setMetricsMode) since in this
+ mode you can't use relative positioning.
+ @par
+ For example, if you were using GMM_PIXELS metrics mode, and you wanted to place a 30x30 pixel
+ crosshair in the center of the screen, you would use GHA_CENTER with a 'left' property of -15.
+ @par
+ Note that neither GHA_CENTER or GHA_RIGHT alter the position of the element based
+ on it's width, you have to alter the 'left' to a negative number to do that; all this
+ does is establish the origin. This is because this way you can align multiple things
+ in the center and right with different 'left' offsets for maximum flexibility.
+ */
+ virtual void setHorizontalAlignment(GuiHorizontalAlignment gha);
+ /** Gets the horizontal alignment for this element. */
+ virtual GuiHorizontalAlignment getHorizontalAlignment(void) const;
+ /** Sets the vertical origin for this element.
+ @remarks
+ By default, the vertical origin for a OverlayElement is the top edge of the parent container
+ (or the screen if this is a root element). You can alter this by calling this method, which is
+ especially useful when you want to use pixel-based metrics (see setMetricsMode) since in this
+ mode you can't use relative positioning.
+ @par
+ For example, if you were using GMM_PIXELS metrics mode, and you wanted to place a 30x30 pixel
+ crosshair in the center of the screen, you would use GHA_CENTER with a 'top' property of -15.
+ @par
+ Note that neither GVA_CENTER or GVA_BOTTOM alter the position of the element based
+ on it's height, you have to alter the 'top' to a negative number to do that; all this
+ does is establish the origin. This is because this way you can align multiple things
+ in the center and bottom with different 'top' offsets for maximum flexibility.
+ */
+ virtual void setVerticalAlignment(GuiVerticalAlignment gva);
+ /** Gets the vertical alignment for this element. */
+ virtual GuiVerticalAlignment getVerticalAlignment(void) const;
+
+
+
+
+ /** Returns true if xy is within the constraints of the component */
+ virtual bool contains(Real x, Real y) const;
+
+ /** Returns true if xy is within the constraints of the component */
+ virtual OverlayElement* findElementAt(Real x, Real y); // relative to parent
+
+ /**
+ * returns false as this class is not a container type
+ */
+ inline virtual bool isContainer() const
+ { return false; }
+
+ inline virtual bool isKeyEnabled() const
+ { return false; }
+
+ inline virtual bool isCloneable() const
+ { return mCloneable; }
+
+ inline virtual void setCloneable(bool c)
+ { mCloneable = c; }
+
+ /**
+ * Returns the parent container.
+ */
+ OverlayContainer* getParent() ;
+ void _setParent(OverlayContainer* parent) { mParent = parent; }
+
+ /**
+ * Returns the zOrder of the element
+ */
+ inline ushort getZOrder() const
+ { return mZOrder; }
+
+ /** Overridden from Renderable */
+ Real getSquaredViewDepth(const Camera* cam) const
+ {
+ return 10000 - getZOrder();
+ }
+
+ /** @copydoc Renderable::getLights */
+ const LightList& getLights(void) const
+ {
+ // Overlayelements should not be lit by the scene, this will not get called
+ static LightList ll;
+ return ll;
+ }
+
+ virtual void copyFromTemplate(OverlayElement* templateOverlay);
+ virtual OverlayElement* clone(const String& instanceName);
+
+ // Returns the SourceTemplate for this element
+ const OverlayElement* getSourceTemplate () const {
+ return mSourceTemplate ;
+ }
+ };
+
+
+
+}
+
+
+#endif
+
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreOverlayElementCommands.h b/school/informatik/verkerhssimulation/src/ogre/OgreOverlayElementCommands.h
new file mode 100644
index 00000000..b57184cf
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreOverlayElementCommands.h
@@ -0,0 +1,115 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __OverlayElementEmitterCommands_H__
+#define __OverlayElementEmitterCommands_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreStringInterface.h"
+
+namespace Ogre {
+
+
+ namespace OverlayElementCommands {
+ /// Command object for OverlayElement - see ParamCommand
+ class _OgreExport CmdLeft : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /// Command object for OverlayElement - see ParamCommand
+ class _OgreExport CmdTop : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /// Command object for OverlayElement - see ParamCommand
+ class _OgreExport CmdWidth : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /// Command object for OverlayElement - see ParamCommand
+ class _OgreExport CmdHeight : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /// Command object for OverlayElement - see ParamCommand
+ class _OgreExport CmdMaterial : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /// Command object for OverlayElement - see ParamCommand
+ class _OgreExport CmdCaption : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /// Command object for OverlayElement - see ParamCommand
+ class _OgreExport CmdMetricsMode : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /// Command object for OverlayElement - see ParamCommand
+ class _OgreExport CmdHorizontalAlign : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /// Command object for OverlayElement - see ParamCommand
+ class _OgreExport CmdVerticalAlign : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /// Command object for OverlayElement - see ParamCommand
+ class _OgreExport CmdVisible : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+
+ }
+}
+
+#endif
+
+
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreOverlayElementFactory.h b/school/informatik/verkerhssimulation/src/ogre/OgreOverlayElementFactory.h
new file mode 100644
index 00000000..ef4f08e0
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreOverlayElementFactory.h
@@ -0,0 +1,121 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __OverlayElementFactory_H__
+#define __OverlayElementFactory_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreOverlayElement.h"
+#include "OgrePanelOverlayElement.h"
+#include "OgreBorderPanelOverlayElement.h"
+#include "OgreTextAreaOverlayElement.h"
+
+namespace Ogre {
+
+ /** Defines the interface which all components wishing to
+ supply OverlayElement subclasses must implement.
+ @remarks
+ To allow the OverlayElement types available for inclusion on
+ overlays to be extended, OGRE allows external apps or plugins
+ to register their ability to create custom OverlayElements with
+ the OverlayManager, using the addOverlayElementFactory method. Classes
+ wanting to do this must implement this interface.
+ @par
+ Each OverlayElementFactory creates a single type of OverlayElement,
+ identified by a 'type name' which must be unique.
+ */
+ class _OgreExport OverlayElementFactory
+ {
+ public:
+ /** Destroy the overlay element factory */
+ virtual ~OverlayElementFactory () {}
+ /** Creates a new OverlayElement instance with the name supplied. */
+ virtual OverlayElement* createOverlayElement(const String& instanceName) = 0;
+ /** Destroys a OverlayElement which this factory created previously. */
+ virtual void destroyOverlayElement(OverlayElement* pElement) { delete pElement; };
+ /** Gets the string uniquely identifying the type of element this factory creates. */
+ virtual const String& getTypeName(void) const = 0;
+ };
+
+
+ /** Factory for creating PanelOverlayElement instances. */
+ class _OgreExport PanelOverlayElementFactory: public OverlayElementFactory
+ {
+ public:
+ /** See OverlayElementFactory */
+ OverlayElement* createOverlayElement(const String& instanceName)
+ {
+ return new PanelOverlayElement(instanceName);
+ }
+ /** See OverlayElementFactory */
+ const String& getTypeName(void) const
+ {
+ static String name = "Panel";
+ return name;
+ }
+ };
+
+ /** Factory for creating BorderPanelOverlayElement instances. */
+ class _OgreExport BorderPanelOverlayElementFactory: public OverlayElementFactory
+ {
+ public:
+ /** See OverlayElementFactory */
+ OverlayElement* createOverlayElement(const String& instanceName)
+ {
+ return new BorderPanelOverlayElement(instanceName);
+ }
+ /** See OverlayElementFactory */
+ const String& getTypeName(void) const
+ {
+ static String name = "BorderPanel";
+ return name;
+ }
+ };
+
+ /** Factory for creating TextAreaOverlayElement instances. */
+ class _OgreExport TextAreaOverlayElementFactory: public OverlayElementFactory
+ {
+ public:
+ /** See OverlayElementFactory */
+ OverlayElement* createOverlayElement(const String& instanceName)
+ {
+ return new TextAreaOverlayElement(instanceName);
+ }
+ /** See OverlayElementFactory */
+ const String& getTypeName(void) const
+ {
+ static String name = "TextArea";
+ return name;
+ }
+ };
+
+}
+
+
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreOverlayManager.h b/school/informatik/verkerhssimulation/src/ogre/OgreOverlayManager.h
new file mode 100644
index 00000000..952671bb
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreOverlayManager.h
@@ -0,0 +1,235 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __OverlayManager_H__
+#define __OverlayManager_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreSingleton.h"
+#include "OgreStringVector.h"
+#include "OgreOverlay.h"
+#include "OgreScriptLoader.h"
+
+namespace Ogre {
+
+ /** Manages Overlay objects, parsing them from .overlay files and
+ storing a lookup library of them. Alo manages the creation of
+ OverlayContainers and OverlayElements, used for non-interactive 2D
+ elements such as HUDs.
+ */
+ class _OgreExport OverlayManager : public Singleton, public ScriptLoader
+ {
+ public:
+ typedef std::map OverlayMap;
+ typedef std::map ElementMap;
+ protected:
+ OverlayMap mOverlayMap;
+ StringVector mScriptPatterns;
+
+ void parseNewElement( DataStreamPtr& chunk, String& elemType, String& elemName,
+ bool isContainer, Overlay* pOverlay, bool isTemplate, String templateName = String(""), OverlayContainer* container = 0);
+ void parseAttrib( const String& line, Overlay* pOverlay);
+ void parseElementAttrib( const String& line, Overlay* pOverlay, OverlayElement* pElement );
+ void skipToNextCloseBrace(DataStreamPtr& chunk);
+ void skipToNextOpenBrace(DataStreamPtr& chunk);
+
+ int mLastViewportWidth, mLastViewportHeight;
+ bool mViewportDimensionsChanged;
+
+ bool parseChildren( DataStreamPtr& chunk, const String& line,
+ Overlay* pOverlay, bool isTemplate, OverlayContainer* parent = NULL);
+
+ typedef std::map FactoryMap;
+ FactoryMap mFactories;
+
+ ElementMap mInstances;
+ ElementMap mTemplates;
+
+ typedef std::set LoadedScripts;
+ LoadedScripts mLoadedScripts;
+
+
+
+
+ ElementMap& getElementMap(bool isTemplate);
+
+ OverlayElement* createOverlayElementImpl(const String& typeName, const String& instanceName, ElementMap& elementMap);
+
+ OverlayElement* getOverlayElementImpl(const String& name, ElementMap& elementMap);
+
+ void destroyOverlayElementImpl(const String& instanceName, ElementMap& elementMap);
+
+ void destroyOverlayElementImpl(OverlayElement* pInstance, ElementMap& elementMap);
+
+ void destroyAllOverlayElementsImpl(ElementMap& elementMap);
+
+ public:
+ OverlayManager();
+ virtual ~OverlayManager();
+
+ /// @copydoc ScriptLoader::getScriptPatterns
+ const StringVector& getScriptPatterns(void) const;
+ /// @copydoc ScriptLoader::parseScript
+ void parseScript(DataStreamPtr& stream, const String& groupName);
+ /// @copydoc ScriptLoader::getLoadingOrder
+ Real getLoadingOrder(void) const;
+
+ /** Create a new Overlay. */
+ Overlay* create(const String& name);
+ /** Retrieve an Overlay by name
+ @returns A pointer to the Overlay, or 0 if not found
+ */
+ Overlay* getByName(const String& name);
+ /** Destroys an existing overlay by name */
+ void destroy(const String& name);
+ /** Destroys an existing overlay */
+ void destroy(Overlay* overlay);
+ /** Destroys all existing overlays */
+ void destroyAll(void);
+ typedef MapIterator OverlayMapIterator;
+ OverlayMapIterator getOverlayIterator(void);
+
+ /** Internal method for queueing the visible overlays for rendering. */
+ void _queueOverlaysForRendering(Camera* cam, RenderQueue* pQueue, Viewport *vp);
+
+ /** Method for determining if the viewport has changed dimensions.
+ @remarks This is used by pixel-based OverlayElements to work out if they need to
+ reclaculate their sizes.
+ */
+ bool hasViewportChanged(void) const;
+
+ /** Gets the height of the destination viewport in pixels. */
+ int getViewportHeight(void) const;
+
+ /** Gets the width of the destination viewport in pixels. */
+ int getViewportWidth(void) const;
+ Real getViewportAspectRatio(void) const;
+
+
+ /** Creates a new OverlayElement of the type requested.
+ @remarks
+ The type of element to create is passed in as a string because this
+ allows plugins to register new types of component.
+ @param typeName The type of element to create.
+ @param instanceName The name to give the new instance.
+ */
+ OverlayElement* createOverlayElement(const String& typeName, const String& instanceName, bool isTemplate = false);
+
+ /** Gets a reference to an existing element. */
+ OverlayElement* getOverlayElement(const String& name, bool isTemplate = false);
+
+ /** Destroys a OverlayElement.
+ @remarks
+ Make sure you're not still using this in an Overlay. If in
+ doubt, let OGRE destroy elements on shutdown.
+ */
+ void destroyOverlayElement(const String& instanceName, bool isTemplate = false);
+
+ /** Destroys a OverlayElement.
+ @remarks
+ Make sure you're not still using this in an Overlay. If in
+ doubt, let OGRE destroy elements on shutdown.
+ */
+ void destroyOverlayElement(OverlayElement* pInstance, bool isTemplate = false);
+
+ /** Destroys all the OverlayElement created so far.
+ @remarks
+ Best to leave this to the engine to call internally, there
+ should rarely be a need to call it yourself.
+ */
+ void destroyAllOverlayElements(bool isTemplate = false);
+
+ /** Registers a new OverlayElementFactory with this manager.
+ @remarks
+ Should be used by plugins or other apps wishing to provide
+ a new OverlayElement subclass.
+ */
+ void addOverlayElementFactory(OverlayElementFactory* elemFactory);
+
+ OverlayElement* createOverlayElementFromTemplate(const String& templateName, const String& typeName, const String& instanceName, bool isTemplate = false);
+ /**
+ * @remarks
+ * Creates a new OverlayElement object from the specified template name. The new
+ * object's name, and all of it's children, will be instanceName/orignalName.
+ */
+ OverlayElement* cloneOverlayElementFromTemplate(const String& templateName, const String& instanceName);
+
+ OverlayElement* createOverlayElementFromFactory(const String& typeName, const String& instanceName);
+
+ typedef MapIterator TemplateIterator;
+ /** Returns an iterator over all templates in this manager.*/
+ TemplateIterator getTemplateIterator ()
+ {
+ return TemplateIterator (mTemplates.begin (), mTemplates.end ()) ;
+ }
+ /* Returns whether the Element with the given name is a Template */
+ bool isTemplate (String strName) const {
+ return (mTemplates.find (strName) != mTemplates.end()) ;
+ }
+
+
+ /** Override standard Singleton retrieval.
+ @remarks
+ Why do we do this? Well, it's because the Singleton
+ implementation is in a .h file, which means it gets compiled
+ into anybody who includes it. This is needed for the
+ Singleton template to work, but we actually only want it
+ compiled into the implementation of the class based on the
+ Singleton, not all of them. If we don't change this, we get
+ link errors when trying to use the Singleton-based class from
+ an outside dll.
+ @par
+ This method just delegates to the template version anyway,
+ but the implementation stays in this single compilation unit,
+ preventing link errors.
+ */
+ static OverlayManager& getSingleton(void);
+ /** Override standard Singleton retrieval.
+ @remarks
+ Why do we do this? Well, it's because the Singleton
+ implementation is in a .h file, which means it gets compiled
+ into anybody who includes it. This is needed for the
+ Singleton template to work, but we actually only want it
+ compiled into the implementation of the class based on the
+ Singleton, not all of them. If we don't change this, we get
+ link errors when trying to use the Singleton-based class from
+ an outside dll.
+ @par
+ This method just delegates to the template version anyway,
+ but the implementation stays in this single compilation unit,
+ preventing link errors.
+ */
+ static OverlayManager* getSingletonPtr(void);
+ };
+
+
+
+}
+
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgrePanelOverlayElement.h b/school/informatik/verkerhssimulation/src/ogre/OgrePanelOverlayElement.h
new file mode 100644
index 00000000..05e35abb
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgrePanelOverlayElement.h
@@ -0,0 +1,154 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __PanelOverlayElement_H__
+#define __PanelOverlayElement_H__
+
+#include "OgreOverlayContainer.h"
+
+namespace Ogre {
+
+
+ /** OverlayElement representing a flat, single-material (or transparent) panel which can contain other elements.
+ @remarks
+ This class subclasses OverlayContainer because it can contain other elements. Like other
+ containers, if hidden it's contents are also hidden, if moved it's contents also move etc.
+ The panel itself is a 2D rectangle which is either completely transparent, or is rendered
+ with a single material. The texture(s) on the panel can be tiled depending on your requirements.
+ @par
+ This component is suitable for backgrounds and grouping other elements. Note that because
+ it has a single repeating material it cannot have a discrete border (unless the texture has one and
+ the texture is tiled only once). For a bordered panel, see it's subclass BorderPanelOverlayElement.
+ @par
+ Note that the material can have all the usual effects applied to it like multiple texture
+ layers, scrolling / animated textures etc. For multiple texture layers, you have to set
+ the tiling level for each layer.
+ */
+ class _OgreExport PanelOverlayElement : public OverlayContainer
+ {
+ public:
+ /** Constructor. */
+ PanelOverlayElement(const String& name);
+ virtual ~PanelOverlayElement();
+
+ /** Initialise */
+ virtual void initialise(void);
+
+ /** Sets the number of times textures should repeat.
+ @param x The number of times the texture should repeat horizontally
+ @param y The number of times the texture should repeat vertically
+ @param layer The texture layer to specify (only needs to be altered if
+ you're using a multi-texture layer material)
+ */
+ void setTiling(Real x, Real y, ushort layer = 0);
+
+ Real getTileX(ushort layer = 0) const;
+ /** Gets the number of times the texture should repeat vertically.
+ @param layer The texture layer to specify (only needs to be altered if
+ you're using a multi-texture layer material)
+ */
+ Real getTileY(ushort layer = 0) const;
+
+ /** Sets the texture coordinates for the panel. */
+ void setUV(Real u1, Real v1, Real u2, Real v2);
+
+ /** Get the uv coordinates for the panel*/
+ void getUV(Real& u1, Real& v1, Real& u2, Real& v2) const;
+
+ /** Sets whether this panel is transparent (used only as a grouping level), or
+ if it is actually renderred.
+ */
+ void setTransparent(bool isTransparent);
+
+ /** Returns whether this panel is transparent. */
+ bool isTransparent(void) const;
+
+ /** See OverlayElement. */
+ virtual const String& getTypeName(void) const;
+ /** See Renderable. */
+ void getRenderOperation(RenderOperation& op);
+ /** Overridden from OverlayElement */
+ void setMaterialName(const String& matName);
+ /** Overridden from OverlayContainer */
+ void _updateRenderQueue(RenderQueue* queue);
+
+
+ /** Command object for specifying tiling (see ParamCommand).*/
+ class _OgrePrivate CmdTiling : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /** Command object for specifying transparency (see ParamCommand).*/
+ class _OgrePrivate CmdTransparent : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /** Command object for specifying UV coordinates (see ParamCommand).*/
+ class _OgrePrivate CmdUVCoords : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ protected:
+ // Flag indicating if this panel should be visual or just group things
+ bool mTransparent;
+ // Texture tiling
+ Real mTileX[OGRE_MAX_TEXTURE_LAYERS];
+ Real mTileY[OGRE_MAX_TEXTURE_LAYERS];
+ size_t mNumTexCoordsInBuffer;
+ Real mU1, mV1, mU2, mV2;
+
+ RenderOperation mRenderOp;
+
+ /// internal method for setting up geometry, called by OverlayElement::update
+ virtual void updatePositionGeometry(void);
+
+ /// Called to update the texture coords when layers change
+ virtual void updateTextureGeometry(void);
+
+ /// Method for setting up base parameters for this class
+ void addBaseParameters(void);
+
+ static String msTypeName;
+
+ // Command objects
+ static CmdTiling msCmdTiling;
+ static CmdTransparent msCmdTransparent;
+ static CmdUVCoords msCmdUVCoords;
+
+ };
+
+}
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreParticle.h b/school/informatik/verkerhssimulation/src/ogre/OgreParticle.h
new file mode 100644
index 00000000..42c825f2
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreParticle.h
@@ -0,0 +1,147 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Particle_H__
+#define __Particle_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreBillboard.h"
+
+namespace Ogre {
+
+ /** Abstract class containing any additional data required to be associated
+ with a particle to perform the required rendering.
+ @remarks
+ Because you can specialise the way that particles are renderered by supplying
+ custom ParticleSystemRenderer classes, you might well need some additional
+ data for your custom rendering routine which is not held on the default particle
+ class. If that's the case, then you should define a subclass of this class,
+ and construct it when asked in your custom ParticleSystemRenderer class.
+ */
+ class _OgreExport ParticleVisualData
+ {
+ public:
+ ParticleVisualData() {}
+ virtual ~ParticleVisualData() {}
+
+ };
+
+ /** Class representing a single particle instance. */
+ class _OgreExport Particle
+ {
+ protected:
+ /// Parent ParticleSystem
+ ParticleSystem* mParentSystem;
+ /// Additional visual data you might want to associate with the Particle
+ ParticleVisualData* mVisual;
+ public:
+ /// Type of particle
+ enum ParticleType
+ {
+ Visual,
+ Emitter
+ };
+
+ /// Does this particle have it's own dimensions?
+ bool mOwnDimensions;
+ /// Personal width if mOwnDimensions == true
+ Real mWidth;
+ /// Personal height if mOwnDimensions == true
+ Real mHeight;
+ /// Current rotation value
+ Radian rotation;
+ // Note the intentional public access to internal variables
+ // Accessing via get/set would be too costly for 000's of particles
+ /// World position
+ Vector3 position;
+ /// Direction (and speed)
+ Vector3 direction;
+ /// Current colour
+ ColourValue colour;
+ /// Time to live, number of seconds left of particles natural life
+ Real timeToLive;
+ /// Total Time to live, number of seconds of particles natural life
+ Real totalTimeToLive;
+ /// Speed of rotation in radians/sec
+ Radian rotationSpeed;
+ /// Determines the type of particle.
+ ParticleType particleType;
+
+ Particle()
+ : mParentSystem(0), mVisual(0), mOwnDimensions(false), rotation(0),
+ position(Vector3::ZERO), direction(Vector3::ZERO),
+ colour(ColourValue::White), timeToLive(10), totalTimeToLive(10),
+ rotationSpeed(0), particleType(Visual)
+ {
+ }
+
+ /** Sets the width and height for this particle.
+ @remarks
+ Note that it is most efficient for every particle in a ParticleSystem to have the same dimensions. If you
+ choose to alter the dimensions of an individual particle the set will be less efficient. Do not call
+ this method unless you really need to have different particle dimensions within the same set. Otherwise
+ just call the ParticleSystem::setDefaultDimensions method instead.
+ */
+ void setDimensions(Real width, Real height);
+
+ /** Returns true if this particle deviates from the ParticleSystem's default dimensions (i.e. if the
+ particle::setDimensions method has been called for this instance).
+ @see
+ particle::setDimensions
+ */
+ bool hasOwnDimensions(void) const { return mOwnDimensions; }
+
+ /** Retrieves the particle's personal width, if hasOwnDimensions is true. */
+ Real getOwnWidth(void) const { return mWidth; }
+
+ /** Retrieves the particle's personal width, if hasOwnDimensions is true. */
+ Real getOwnHeight(void) const { return mHeight; }
+
+ /** Sets the current rotation */
+ void setRotation(const Radian& rad);
+
+ const Radian& getRotation(void) const { return rotation; }
+
+ /** Internal method for notifying the particle of it's owner.
+ */
+ void _notifyOwner(ParticleSystem* owner);
+
+ /** Internal method for notifying the particle of it's optional visual data.
+ */
+ void _notifyVisualData(ParticleVisualData* vis) { mVisual = vis; }
+
+ /// Get the optional visual data associated with the class
+ ParticleVisualData* getVisualData(void) const { return mVisual; }
+
+ /// Utility method to reset this particle
+ void resetDimensions(void);
+ };
+}
+
+#endif
+
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreParticleAffector.h b/school/informatik/verkerhssimulation/src/ogre/OgreParticleAffector.h
new file mode 100644
index 00000000..bb551089
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreParticleAffector.h
@@ -0,0 +1,116 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ParticleAffector_H__
+#define __ParticleAffector_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreString.h"
+#include "OgreStringInterface.h"
+
+
+namespace Ogre {
+
+ /** Abstract class defining the interface to be implemented by particle affectors.
+ @remarks
+ Particle affectors modify particles in a particle system over their lifetime. They can be
+ grouped into types, e.g. 'vector force' affectors, 'fader' affectors etc; each type will
+ modify particles in a different way, using different parameters.
+ @par
+ Because there are so many types of affectors you could use, OGRE chooses not to dictate
+ the available types. It comes with some in-built, but allows plugins or applications to extend the affector types available.
+ This is done by subclassing ParticleAffector to have the appropriate emission behaviour you want,
+ and also creating a subclass of ParticleAffectorFactory which is responsible for creating instances
+ of your new affector type. You register this factory with the ParticleSystemManager using
+ addAffectorFactory, and from then on affectors of this type can be created either from code or through
+ text particle scripts by naming the type.
+ @par
+ This same approach is used for ParticleEmitters (which are the source of particles in a system).
+ This means that OGRE is particularly flexible when it comes to creating particle system effects,
+ with literally infinite combinations of affector and affector types, and paramters within those
+ types.
+ */
+ class _OgreExport ParticleAffector : public StringInterface
+ {
+ protected:
+ /// Name of the type of affector, MUST be initialised by subclasses
+ String mType;
+
+ /** Internal method for setting up the basic parameter definitions for a subclass.
+ @remarks
+ Because StringInterface holds a dictionary of parameters per class, subclasses need to
+ call this to ask the base class to add it's parameters to their dictionary as well.
+ Can't do this in the constructor because that runs in a non-virtual context.
+ @par
+ The subclass must have called it's own createParamDictionary before calling this method.
+ */
+ void addBaseParameters(void) { /* actually do nothing - for future possible use */ }
+
+ ParticleSystem* mParent;
+ public:
+ ParticleAffector(ParticleSystem* parent): mParent(parent) {}
+
+ /** Virtual destructor essential. */
+ virtual ~ParticleAffector();
+
+ /** Method called to allow the affector to initialize all newly created particles in the system.
+ @remarks
+ This is where the affector gets the chance to initialize it's effects to the particles of a system.
+ The affector is expected to initialize some or all of the particles in the system
+ passed to it, depending on the affector's approach.
+ @param
+ pParticle Pointer to a Particle to initialize.
+ */
+ virtual void _initParticle(Particle* pParticle) { /* by default do nothing */ }
+
+ /** Method called to allow the affector to 'do it's stuff' on all active particles in the system.
+ @remarks
+ This is where the affector gets the chance to apply it's effects to the particles of a system.
+ The affector is expected to apply it's effect to some or all of the particles in the system
+ passed to it, depending on the affector's approach.
+ @param
+ pSystem Pointer to a ParticleSystem to affect.
+ @param
+ timeElapsed The number of seconds which have elapsed since the last call.
+ */
+ virtual void _affectParticles(ParticleSystem* pSystem, Real timeElapsed) = 0;
+
+ /** Returns the name of the type of affector.
+ @remarks
+ This property is useful for determining the type of affector procedurally so another
+ can be created.
+ */
+ const String &getType(void) const { return mType; }
+
+ };
+
+}
+
+
+#endif
+
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreParticleAffectorFactory.h b/school/informatik/verkerhssimulation/src/ogre/OgreParticleAffectorFactory.h
new file mode 100644
index 00000000..664a512c
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreParticleAffectorFactory.h
@@ -0,0 +1,74 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ParticleAffectorFactory_H__
+#define __ParticleAffectorFactory_H__
+
+
+#include "OgrePrerequisites.h"
+#include "OgreParticleAffector.h"
+
+namespace Ogre {
+
+ /** Abstract class defining the interface to be implemented by creators of ParticleAffector subclasses.
+ @remarks
+ Plugins or 3rd party applications can add new types of particle affectors to Ogre by creating
+ subclasses of the ParticleAffector class. Because multiple instances of these affectors may be
+ required, a factory class to manage the instances is also required.
+ @par
+ ParticleAffectorFactory subclasses must allow the creation and destruction of ParticleAffector
+ subclasses. They must also be registered with the ParticleSystemManager. All factories have
+ a name which identifies them, examples might be 'force_vector', 'attractor', or 'fader', and these can be
+ also be used from particle system scripts.
+ */
+ class _OgreExport ParticleAffectorFactory
+ {
+ protected:
+ std::vector mAffectors;
+ public:
+ ParticleAffectorFactory() {};
+ virtual ~ParticleAffectorFactory();
+ /** Returns the name of the factory, the name which identifies the particle affector type this factory creates. */
+ virtual String getName() const = 0;
+
+ /** Creates a new affector instance.
+ @remarks
+ The subclass MUST add a pointer to the created instance to mAffectors.
+ */
+ virtual ParticleAffector* createAffector(ParticleSystem* psys) = 0;
+
+ /** Destroys the affector pointed to by the parameter (for early clean up if reauired). */
+ virtual void destroyAffector(ParticleAffector* e);
+ };
+
+
+}
+
+
+#endif
+
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreParticleEmitter.h b/school/informatik/verkerhssimulation/src/ogre/OgreParticleEmitter.h
new file mode 100644
index 00000000..463c546b
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreParticleEmitter.h
@@ -0,0 +1,506 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ParticleEmitter_H__
+#define __ParticleEmitter_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreString.h"
+#include "OgreVector3.h"
+#include "OgreColourValue.h"
+#include "OgreStringInterface.h"
+#include "OgreParticleEmitterCommands.h"
+#include "OgreParticle.h"
+
+
+namespace Ogre {
+
+
+ /** Abstract class defining the interface to be implemented by particle emitters.
+ @remarks
+ Particle emitters are the sources of particles in a particle system.
+ This class defines the ParticleEmitter interface, and provides a basic implementation
+ for tasks which most emitters will do (these are of course overridable).
+ Particle emitters can be grouped into types, e.g. 'point' emitters, 'box' emitters etc; each type will
+ create particles with a different starting point, direction and velocity (although
+ within the types you can configure the ranges of these parameters).
+ @par
+ Because there are so many types of emitters you could use, OGRE chooses not to dictate
+ the available types. It comes with some in-built, but allows plugins or applications to extend the emitter types available.
+ This is done by subclassing ParticleEmitter to have the appropriate emission behaviour you want,
+ and also creating a subclass of ParticleEmitterFactory which is responsible for creating instances
+ of your new emitter type. You register this factory with the ParticleSystemManager using
+ addEmitterFactory, and from then on emitters of this type can be created either from code or through
+ text particle scripts by naming the type.
+ @par
+ This same approach is used for ParticleAffectors (which modify existing particles per frame).
+ This means that OGRE is particularly flexible when it comes to creating particle system effects,
+ with literally infinite combinations of emitter and affector types, and paramters within those
+ types.
+ */
+ class _OgreExport ParticleEmitter : public StringInterface, public Particle
+ {
+ protected:
+
+ // Command object for setting / getting parameters
+ static EmitterCommands::CmdAngle msAngleCmd;
+ static EmitterCommands::CmdColour msColourCmd;
+ static EmitterCommands::CmdColourRangeStart msColourRangeStartCmd;
+ static EmitterCommands::CmdColourRangeEnd msColourRangeEndCmd;
+ static EmitterCommands::CmdDirection msDirectionCmd;
+ static EmitterCommands::CmdEmissionRate msEmissionRateCmd;
+ static EmitterCommands::CmdMaxTTL msMaxTTLCmd;
+ static EmitterCommands::CmdMaxVelocity msMaxVelocityCmd;
+ static EmitterCommands::CmdMinTTL msMinTTLCmd;
+ static EmitterCommands::CmdMinVelocity msMinVelocityCmd;
+ static EmitterCommands::CmdPosition msPositionCmd;
+ static EmitterCommands::CmdTTL msTTLCmd;
+ static EmitterCommands::CmdVelocity msVelocityCmd;
+ static EmitterCommands::CmdDuration msDurationCmd;
+ static EmitterCommands::CmdMinDuration msMinDurationCmd;
+ static EmitterCommands::CmdMaxDuration msMaxDurationCmd;
+ static EmitterCommands::CmdRepeatDelay msRepeatDelayCmd;
+ static EmitterCommands::CmdMinRepeatDelay msMinRepeatDelayCmd;
+ static EmitterCommands::CmdMaxRepeatDelay msMaxRepeatDelayCmd;
+ static EmitterCommands::CmdName msNameCmd;
+ static EmitterCommands::CmdEmittedEmitter msEmittedEmitterCmd;
+
+
+ /// Parent particle system
+ ParticleSystem* mParent;
+ /// Position relative to the center of the ParticleSystem
+ Vector3 mPosition;
+ /// Rate in particles per second at which this emitter wishes to emit particles
+ Real mEmissionRate;
+ /// Name of the type of emitter, MUST be initialised by subclasses
+ String mType;
+ /// Base direction of the emitter, may not be used by some emitters
+ Vector3 mDirection;
+ // Notional up vector, just used to speed up generation of variant directions
+ Vector3 mUp;
+ /// Angle around direction which particles may be emitted, internally radians but angleunits for interface
+ Radian mAngle;
+ /// Min speed of particles
+ Real mMinSpeed;
+ /// Max speed of particles
+ Real mMaxSpeed;
+ /// Initial time-to-live of particles (min)
+ Real mMinTTL;
+ /// Initial time-to-live of particles (max)
+ Real mMaxTTL;
+ /// Initial colour of particles (range start)
+ ColourValue mColourRangeStart;
+ /// Initial colour of particles (range end)
+ ColourValue mColourRangeEnd;
+
+ /// Whether this emitter is currently enabled (defaults to true)
+ bool mEnabled;
+
+ /// Start time (in seconds from start of first call to ParticleSystem to update)
+ Real mStartTime;
+ /// Minimum length of time emitter will run for (0 = forever)
+ Real mDurationMin;
+ /// Maximum length of time the emitter will run for (0 = forever)
+ Real mDurationMax;
+ /// Current duration remainder
+ Real mDurationRemain;
+
+ /// Time between each repeat
+ Real mRepeatDelayMin;
+ Real mRepeatDelayMax;
+ /// Repeat delay left
+ Real mRepeatDelayRemain;
+
+ // Fractions of particles wanted to be emitted last time
+ Real mRemainder;
+
+ /// The name of the emitter. The name is optional unless it is used as an emitter that is emitted itself.
+ String mName;
+
+ /// The name of the emitter to be emitted (optional)
+ String mEmittedEmitter;
+
+ // If 'true', this emitter is emitted by another emitter.
+ // NB. That doesn´t imply that the emitter itself emits other emitters (that could or could not be the case)
+ bool mEmitted;
+
+ // NB Method below here are to help out people implementing emitters by providing the
+ // most commonly used approaches as piecemeal methods
+
+ /** Internal utility method for generating particle exit direction
+ @param destVector Reference to vector to complete with new direction (normalised)
+ */
+ virtual void genEmissionDirection(Vector3& destVector);
+
+ /** Internal utility method to apply velocity to a particle direction.
+ @param destVector The vector to scale by a randomly generated scale between min and max speed.
+ Assumed normalised already, and likely already oriented in the right direction.
+ */
+ virtual void genEmissionVelocity(Vector3& destVector);
+
+ /** Internal utility method for generating a time-to-live for a particle. */
+ virtual Real genEmissionTTL(void);
+
+ /** Internal utility method for generating a colour for a particle. */
+ virtual void genEmissionColour(ColourValue& destColour);
+
+ /** Internal utility method for generating an emission count based on a constant emission rate. */
+ virtual unsigned short genConstantEmissionCount(Real timeElapsed);
+
+ /** Internal method for setting up the basic parameter definitions for a subclass.
+ @remarks
+ Because StringInterface holds a dictionary of parameters per class, subclasses need to
+ call this to ask the base class to add it's parameters to their dictionary as well.
+ Can't do this in the constructor because that runs in a non-virtual context.
+ @par
+ The subclass must have called it's own createParamDictionary before calling this method.
+ */
+ void addBaseParameters(void);
+
+ /** Internal method for initialising the duration & repeat of an emitter. */
+ void initDurationRepeat(void);
+
+
+ public:
+ ParticleEmitter(ParticleSystem* psys);
+ /** Virtual destructor essential. */
+ virtual ~ParticleEmitter();
+
+ /** Sets the position of this emitter relative to the particle system center. */
+ virtual void setPosition(const Vector3& pos);
+
+ /** Returns the position of this emitter relative to thte center of the particle system. */
+ virtual const Vector3& getPosition(void) const;
+
+ /** Sets the direction of the emitter.
+ @remarks
+ Most emitters will have a base direction in which they emit particles (those which
+ emit in all directions will ignore this parameter). They may not emit exactly along this
+ vector for every particle, many will introduce a random scatter around this vector using
+ the angle property.
+ @param direction
+ The base direction for particles emitted.
+ */
+ virtual void setDirection(const Vector3& direction);
+
+ /** Returns the base direction of the emitter. */
+ virtual const Vector3& getDirection(void) const;
+
+ /** Sets the maximum angle away from the emitter direction which particle will be emitted.
+ @remarks
+ Whilst the direction property defines the general direction of emission for particles,
+ this property defines how far the emission angle can deviate away from this base direction.
+ This allows you to create a scatter effect - if set to 0, all particles will be emitted
+ exactly along the emitters direction vector, wheras if you set it to 180 degrees or more,
+ particles will be emitted in a sphere, i.e. in all directions.
+ @param degrees
+ Maximum angle which initial particle direction can deviate from the emitter base direction vector.
+ */
+ virtual void setAngle(const Radian& angle);
+#ifndef OGRE_FORCE_ANGLE_TYPES
+ inline void setAngle(Real angle) {
+ setAngle ( Angle(angle) );
+ }
+#endif//OGRE_FORCE_ANGLE_TYPES
+
+ /** Returns the maximum angle which the initial particle direction can deviate from the emitters base direction. */
+ virtual const Radian& getAngle(void) const;
+
+ /** Sets the initial velocity of particles emitted.
+ @remarks
+ This method sets a constant speed for emitted particles. See the alternate version
+ of this method which takes 2 parameters if you want a variable speed.
+ @param
+ speed The initial speed in world units per second which every particle emitted starts with.
+ */
+ virtual void setParticleVelocity(Real speed);
+
+
+ /** Sets the initial velocity range of particles emitted.
+ @remarks
+ This method sets the range of starting speeds for emitted particles.
+ See the alternate version of this method which takes 1 parameter if you want a
+ constant speed. This emitter will randomly choose a speed between the minimum and
+ maximum for each particle.
+ @param max The maximum speed in world units per second for the initial particle speed on emission.
+ @param min The minimum speed in world units per second for the initial particle speed on emission.
+ */
+ virtual void setParticleVelocity(Real min, Real max);
+ /** Returns the minimum particle velocity. */
+ virtual void setMinParticleVelocity(Real min);
+ /** Returns the maximum particle velocity. */
+ virtual void setMaxParticleVelocity(Real max);
+
+ /** Returns the initial velocity of particles emitted. */
+ virtual Real getParticleVelocity(void) const;
+
+ /** Returns the minimum particle velocity. */
+ virtual Real getMinParticleVelocity(void) const;
+
+ /** Returns the maximum particle velocity. */
+ virtual Real getMaxParticleVelocity(void) const;
+
+ /** Sets the emission rate for this emitter.
+ @remarks
+ This method tells the emitter how many particles per second should be emitted. The emitter
+ subclass does not have to emit these in a continuous burst - this is a relative parameter
+ and the emitter may choose to emit all of the second's worth of particles every half-second
+ for example. This is controlled by the emitter's getEmissionCount method.
+ @par
+ Also, if the ParticleSystem's particle quota is exceeded, not all the particles requested
+ may be actually emitted.
+ @param
+ particlesPerSecond The number of particles to be emitted every second.
+ */
+ virtual void setEmissionRate(Real particlesPerSecond);
+
+ /** Returns the emission rate set for this emitter. */
+ virtual Real getEmissionRate(void) const;
+
+ /** Sets the lifetime of all particles emitted.
+ @remarks
+ The emitter initialises particles with a time-to-live (TTL), the number of seconds a particle
+ will exist before being destroyed. This method sets a constant TTL for all particles emitted.
+ Note that affectors are able to modify the TTL of particles later.
+ @par
+ Also see the alternate version of this method which takes a min and max TTL in order to
+ have the TTL vary per particle.
+ @param ttl The number of seconds each particle will live for.
+ */
+ virtual void setTimeToLive(Real ttl);
+ /** Sets the range of lifetime for particles emitted.
+ @remarks
+ The emitter initialises particles with a time-to-live (TTL), the number of seconds a particle
+ will exist before being destroyed. This method sets a range for the TTL for all particles emitted;
+ the ttl may be randomised between these 2 extremes or will vary some other way depending on the
+ emitter.
+ Note that affectors are able to modify the TTL of particles later.
+ @par
+ Also see the alternate version of this method which takes a single TTL in order to
+ set a constant TTL for all particles.
+ @param minTtl The minimum number of seconds each particle will live for.
+ @param maxTtl The maximum number of seconds each particle will live for.
+ */
+ virtual void setTimeToLive(Real minTtl, Real maxTtl);
+
+ /** Sets the minimum time each particle will live for. */
+ virtual void setMinTimeToLive(Real min);
+ /** Sets the maximum time each particle will live for. */
+ virtual void setMaxTimeToLive(Real max);
+
+ /** Gets the time each particle will live for. */
+ virtual Real getTimeToLive(void) const;
+
+ /** Gets the minimum time each particle will live for. */
+ virtual Real getMinTimeToLive(void) const;
+ /** Gets the maximum time each particle will live for. */
+ virtual Real getMaxTimeToLive(void) const;
+
+ /** Sets the initial colour of particles emitted.
+ @remarks
+ Particles have an initial colour on emission which the emitter sets. This method sets
+ this colour. See the alternate version of this method which takes 2 colours in order to establish
+ a range of colours to be assigned to particles.
+ @param colour The colour which all particles will be given on emission.
+ */
+ virtual void setColour(const ColourValue& colour);
+ /** Sets the range of colours for emitted particles.
+ @remarks
+ Particles have an initial colour on emission which the emitter sets. This method sets
+ the range of this colour. See the alternate version of this method which takes a single colour
+ in order to set a constant colour for all particles. Emitters may choose to randomly assign
+ a colour in this range, or may use some other method to vary the colour.
+ @param colourStart The start of the colour range
+ @param colourEnd The end of the colour range
+ */
+ virtual void setColour(const ColourValue& colourStart, const ColourValue& colourEnd);
+ /** Sets the minimum colour of particles to be emitted. */
+ virtual void setColourRangeStart(const ColourValue& colour);
+ /** Sets the maximum colour of particles to be emitted. */
+ virtual void setColourRangeEnd(const ColourValue& colour);
+ /** Gets the colour of particles to be emitted. */
+ virtual const ColourValue& getColour(void) const;
+ /** Gets the minimum colour of particles to be emitted. */
+ virtual const ColourValue& getColourRangeStart(void) const;
+ /** Gets the maximum colour of particles to be emitted. */
+ virtual const ColourValue& getColourRangeEnd(void) const;
+
+ /** Gets the number of particles which this emitter would like to emit based on the time elapsed.
+ @remarks
+ For efficiency the emitter does not actually create new Particle instances (these are reused
+ by the ParticleSystem as existing particles 'die'). The implementation for this method must
+ return the number of particles the emitter would like to emit given the number of seconds which
+ have elapsed (passed in as a parameter).
+ @par
+ Based on the return value from this method, the ParticleSystem class will call
+ _initParticle once for each particle it chooses to allow to be emitted by this emitter.
+ The emitter should not track these _initParticle calls, it should assume all emissions
+ requested were made (even if they could not be because of particle quotas).
+ */
+ virtual unsigned short _getEmissionCount(Real timeElapsed) = 0;
+
+ /** Initialises a particle based on the emitter's approach and parameters.
+ @remarks
+ See the _getEmissionCount method for details of why there is a separation between
+ 'requested' emissions and actual initialised particles.
+ @param
+ pParticle Pointer to a particle which must be initialised based on how this emitter
+ starts particles. This is passed as a pointer rather than being created by the emitter so the
+ ParticleSystem can reuse Particle instances, and can also set defaults itself.
+ */
+ virtual void _initParticle(Particle* pParticle) {
+ // Initialise size incase it's been altered
+ pParticle->resetDimensions();
+ }
+
+
+ /** Returns the name of the type of emitter.
+ @remarks
+ This property is useful for determining the type of emitter procedurally so another
+ can be created.
+ */
+ const String &getType(void) const { return mType; }
+
+ /** Sets whether or not the emitter is enabled.
+ @remarks
+ You can turn an emitter off completely by setting this parameter to false.
+ */
+ virtual void setEnabled(bool enabled);
+
+ /** Gets the flag indicating if this emitter is enabled or not. */
+ virtual bool getEnabled(void) const;
+
+ /** Sets the 'start time' of this emitter.
+ @remarks
+ By default an emitter starts straight away as soon as a ParticleSystem is first created,
+ or also just after it is re-enabled. This parameter allows you to set a time delay so
+ that the emitter does not 'kick in' until later.
+ @param startTime The time in seconds from the creation or enabling of the emitter.
+ */
+ virtual void setStartTime(Real startTime);
+ /** Gets the start time of the emitter. */
+ virtual Real getStartTime(void) const;
+
+ /** Sets the duration of the emitter.
+ @remarks
+ By default emitters run indefinitely (unless you manually disable them). By setting this
+ parameter, you can make an emitter turn off on it's own after a set number of seconds. It
+ will then remain disabled until either setEnabled(true) is called, or if the 'repeatAfter' parameter
+ has been set it will also repeat after a number of seconds.
+ @par
+ Also see the alternative version of this method which allows you to set a min and max duration for
+ a random variable duration.
+ @param duration The duration in seconds.
+ */
+ virtual void setDuration(Real duration);
+
+ /** Gets the duration of the emitter from when it is created or re-enabled. */
+ virtual Real getDuration(void) const;
+
+ /** Sets the range of random duration for this emitter.
+ @remarks
+ By default emitters run indefinitely (unless you manually disable them). By setting this
+ parameter, you can make an emitter turn off on it's own after a random number of seconds. It
+ will then remain disabled until either setEnabled(true) is called, or if the 'repeatAfter' parameter
+ has been set it will also repeat after a number of seconds.
+ @par
+ Also see the alternative version of this method which allows you to set a constant duration.
+ @param min The minimum duration in seconds.
+ @param max The minimum duration in seconds.
+ */
+ virtual void setDuration(Real min, Real max);
+ /** Sets the minimum duration of this emitter in seconds (see setDuration for more details) */
+ virtual void setMinDuration(Real min);
+ /** Sets the maximum duration of this emitter in seconds (see setDuration for more details) */
+ virtual void setMaxDuration(Real max);
+ /** Gets the minimum duration of this emitter in seconds (see setDuration for more details) */
+ virtual Real getMinDuration(void) const;
+ /** Gets the maximum duration of this emitter in seconds (see setDuration for more details) */
+ virtual Real getMaxDuration(void) const;
+
+ /** Sets the time between repeats of the emitter.
+ @remarks
+ By default emitters run indefinitely (unless you manually disable them). However, if you manually
+ disable the emitter (by calling setEnabled(false), or it's duration runs out, it will cease to emit
+ @par
+ Also see the alternative version of this method which allows you to set a min and max duration for
+ a random variable duration.
+ @param duration The duration in seconds.
+ */
+ virtual void setRepeatDelay(Real duration);
+
+ /** Gets the duration of the emitter from when it is created or re-enabled. */
+ virtual Real getRepeatDelay(void) const;
+
+ /** Sets the range of random duration for this emitter.
+ @remarks
+ By default emitters run indefinitely (unless you manually disable them). By setting this
+ parameter, you can make an emitter turn off on it's own after a random number of seconds. It
+ will then remain disabled until either setEnabled(true) is called, or if the 'repeatAfter' parameter
+ has been set it will also repeat after a number of seconds.
+ @par
+ Also see the alternative version of this method which allows you to set a constant duration.
+ @param min The minimum duration in seconds.
+ @param max The minimum duration in seconds.
+ */
+ virtual void setRepeatDelay(Real min, Real max);
+ /** Sets the minimum duration of this emitter in seconds (see setRepeatDelay for more details) */
+ virtual void setMinRepeatDelay(Real min);
+ /** Sets the maximum duration of this emitter in seconds (see setRepeatDelay for more details) */
+ virtual void setMaxRepeatDelay(Real max);
+ /** Gets the minimum duration of this emitter in seconds (see setRepeatDelay for more details) */
+ virtual Real getMinRepeatDelay(void) const;
+ /** Gets the maximum duration of this emitter in seconds (see setRepeatDelay for more details) */
+ virtual Real getMaxRepeatDelay(void) const;
+
+ /** Returns the name of the emitter */
+ const String &getName(void) const;
+
+ /** Sets the name of the emitter */
+ virtual void setName(const String& newName);
+
+ /** Returns the name of the emitter to be emitted */
+ const String &getEmittedEmitter(void) const;
+
+ /** Sets the name of the emitter to be emitted*/
+ virtual void setEmittedEmitter(const String& emittedEmitter);
+
+ /** Return ´true´ if the emitter is emitted by another emitter */
+ virtual bool isEmitted(void) const;
+
+ /** Set the indication (true/false) to indicate that the emitter is emitted by another emitter */
+ virtual void setEmitted(bool emitted);
+
+
+ };
+
+}
+
+
+#endif
+
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreParticleEmitterCommands.h b/school/informatik/verkerhssimulation/src/ogre/OgreParticleEmitterCommands.h
new file mode 100644
index 00000000..8406a5b2
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreParticleEmitterCommands.h
@@ -0,0 +1,200 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ParticleEmitterCommands_H__
+#define __ParticleEmitterCommands_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreStringInterface.h"
+
+namespace Ogre {
+
+
+ namespace EmitterCommands {
+ /// Command object for ParticleEmitter - see ParamCommand
+ class _OgreExport CmdAngle : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /// Command object for particle emitter - see ParamCommand
+ class _OgreExport CmdColour : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+
+ /// Command object for particle emitter - see ParamCommand
+ class _OgreExport CmdColourRangeStart : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /// Command object for particle emitter - see ParamCommand
+ class _OgreExport CmdColourRangeEnd : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+
+ /// Command object for particle emitter - see ParamCommand
+ class _OgreExport CmdDirection : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+
+ /// Command object for particle emitter - see ParamCommand
+ class _OgreExport CmdEmissionRate : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /// Command object for particle emitter - see ParamCommand
+ class _OgreExport CmdVelocity : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /// Command object for particle emitter - see ParamCommand
+ class _OgreExport CmdMinVelocity : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /// Command object for particle emitter - see ParamCommand
+ class _OgreExport CmdMaxVelocity : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /// Command object for particle emitter - see ParamCommand
+ class _OgreExport CmdTTL : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /// Command object for particle emitter - see ParamCommand
+ class _OgreExport CmdMinTTL : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /// Command object for particle emitter - see ParamCommand
+ class _OgreExport CmdMaxTTL : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /// Command object for particle emitter - see ParamCommand
+ class _OgreExport CmdPosition : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /// Command object for particle emitter - see ParamCommand
+ class _OgreExport CmdDuration : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /// Command object for particle emitter - see ParamCommand
+ class _OgreExport CmdMinDuration : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /// Command object for particle emitter - see ParamCommand
+ class _OgreExport CmdMaxDuration : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /// Command object for particle emitter - see ParamCommand
+ class _OgreExport CmdRepeatDelay : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /// Command object for particle emitter - see ParamCommand
+ class _OgreExport CmdMinRepeatDelay : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /// Command object for particle emitter - see ParamCommand
+ class _OgreExport CmdMaxRepeatDelay : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /// Command object for particle emitter - see ParamCommand
+ class _OgreExport CmdName : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+
+ /// Command object for particle emitter - see ParamCommand
+ class _OgreExport CmdEmittedEmitter : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+
+ }
+
+}
+
+
+
+
+
+#endif
+
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreParticleEmitterFactory.h b/school/informatik/verkerhssimulation/src/ogre/OgreParticleEmitterFactory.h
new file mode 100644
index 00000000..233863df
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreParticleEmitterFactory.h
@@ -0,0 +1,77 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ParticleEmitterFactory_H__
+#define __ParticleEmitterFactory_H__
+
+
+#include "OgrePrerequisites.h"
+#include "OgreParticleEmitter.h"
+#include "OgreString.h"
+
+namespace Ogre {
+
+ /** Abstract class defining the interface to be implemented by creators of ParticleEmitter subclasses.
+ @remarks
+ Plugins or 3rd party applications can add new types of particle emitters to Ogre by creating
+ subclasses of the ParticleEmitter class. Because multiple instances of these emitters may be
+ required, a factory class to manage the instances is also required.
+ @par
+ ParticleEmitterFactory subclasses must allow the creation and destruction of ParticleEmitter
+ subclasses. They must also be registered with the ParticleSystemManager. All factories have
+ a name which identifies them, examples might be 'point', 'cone', or 'box', and these can be
+ also be used from particle system scripts.
+ */
+ class _OgreExport ParticleEmitterFactory
+ {
+ protected:
+ std::vector mEmitters;
+ public:
+ ParticleEmitterFactory() {};
+ virtual ~ParticleEmitterFactory();
+
+ /** Returns the name of the factory, the name which identifies the particle emitter type this factory creates. */
+ virtual String getName() const = 0;
+
+ /** Creates a new emitter instance.
+ @remarks
+ The subclass MUST add a pointer to the created instance to mEmitters.
+ */
+ virtual ParticleEmitter* createEmitter(ParticleSystem* psys) = 0;
+
+ /** Destroys the emitter pointed to by the parameter (for early clean up if reauired). */
+ virtual void destroyEmitter(ParticleEmitter* e);
+
+ };
+
+
+}
+
+
+#endif
+
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreParticleIterator.h b/school/informatik/verkerhssimulation/src/ogre/OgreParticleIterator.h
new file mode 100644
index 00000000..c5a60a5f
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreParticleIterator.h
@@ -0,0 +1,61 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ParticleIterator_H__
+#define __ParticleIterator_H__
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre {
+
+
+ /** Convenience class to make it easy to step through all particles in a ParticleSystem.
+ */
+ class _OgreExport ParticleIterator
+ {
+ friend class ParticleSystem;
+ protected:
+ std::list::iterator mPos;
+ std::list::iterator mStart;
+ std::list::iterator mEnd;
+
+ /// Protected constructor, only available from ParticleSystem::getIterator
+ ParticleIterator(std::list::iterator start, std::list::iterator end);
+
+ public:
+ // Returns true when at the end of the particle list
+ bool end(void);
+
+ /** Returns a pointer to the next particle, and moves the iterator on by 1 element. */
+ Particle* getNext(void);
+ };
+}
+
+
+#endif
+
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreParticleSystem.h b/school/informatik/verkerhssimulation/src/ogre/OgreParticleSystem.h
new file mode 100644
index 00000000..ba09398e
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreParticleSystem.h
@@ -0,0 +1,878 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ParticleSystem_H__
+#define __ParticleSystem_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreVector3.h"
+#include "OgreString.h"
+#include "OgreParticleIterator.h"
+#include "OgreStringInterface.h"
+#include "OgreMovableObject.h"
+#include "OgreRadixSort.h"
+#include "OgreController.h"
+
+
+namespace Ogre {
+
+ /** Class defining particle system based special effects.
+ @remarks
+ Particle systems are special effects generators which are based on a
+ number of moving points to create the impression of things like like
+ sparkles, smoke, blood spurts, dust etc.
+ @par
+ This class simply manages a single collection of particles in world space
+ with a shared local origin for emission. The visual aspect of the
+ particles is handled by a ParticleSystemRenderer instance.
+ @par
+ Particle systems are created using the SceneManager, never directly.
+ In addition, like all subclasses of MovableObject, the ParticleSystem
+ will only be considered for rendering once it has been attached to a
+ SceneNode.
+ */
+ class _OgreExport ParticleSystem : public StringInterface, public MovableObject
+ {
+ public:
+
+ /** Command object for quota (see ParamCommand).*/
+ class _OgrePrivate CmdQuota : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /** Command object for emittedEmitterQuota (see ParamCommand).*/
+ class _OgrePrivate CmdEmittedEmitterQuota : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /** Command object for material (see ParamCommand).*/
+ class _OgrePrivate CmdMaterial : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /** Command object for cull_each (see ParamCommand).*/
+ class _OgrePrivate CmdCull : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /** Command object for particle_width (see ParamCommand).*/
+ class _OgrePrivate CmdWidth : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /** Command object for particle_height (see ParamCommand).*/
+ class _OgrePrivate CmdHeight : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /** Command object for renderer (see ParamCommand).*/
+ class _OgrePrivate CmdRenderer : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /** Command object for sorting (see ParamCommand).*/
+ class CmdSorted : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /** Command object for local space (see ParamCommand).*/
+ class CmdLocalSpace : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /** Command object for iteration interval(see ParamCommand).*/
+ class CmdIterationInterval : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+ /** Command object for nonvisible timeout (see ParamCommand).*/
+ class CmdNonvisibleTimeout : public ParamCommand
+ {
+ public:
+ String doGet(const void* target) const;
+ void doSet(void* target, const String& val);
+ };
+
+ /// Default constructor required for STL creation in manager
+ ParticleSystem();
+ /** Creates a particle system with no emitters or affectors.
+ @remarks
+ You should use the ParticleSystemManager to create particle systems rather than creating
+ them directly.
+ */
+ ParticleSystem(const String& name, const String& resourceGroupName);
+
+ virtual ~ParticleSystem();
+
+ /** Sets the ParticleRenderer to be used to render this particle system.
+ @remarks
+ The main ParticleSystem just manages the creation and movement of
+ particles; they are rendered using functions in ParticleRenderer
+ and the ParticleVisual instances they create.
+ @param typeName String identifying the type of renderer to use; a new
+ instance of this type will be created; a factory must have been registered
+ with ParticleSystemManager.
+ */
+ void setRenderer(const String& typeName);
+
+ /** Gets the ParticleRenderer to be used to render this particle system. */
+ ParticleSystemRenderer* getRenderer(void) const;
+ /** Gets the name of the ParticleRenderer to be used to render this particle system. */
+ const String& getRendererName(void) const;
+
+ /** Adds an emitter to this particle system.
+ @remarks
+ Particles are created in a particle system by emitters - see the ParticleEmitter
+ class for more details.
+ @param
+ emitterType String identifying the emitter type to create. Emitter types are defined
+ by registering new factories with the manager - see ParticleEmitterFactory for more details.
+ Emitter types can be extended by OGRE, plugin authors or application developers.
+ */
+ ParticleEmitter* addEmitter(const String& emitterType);
+
+ /** Retrieves an emitter by it's index (zero-based).
+ @remarks
+ Used to retrieve a pointer to an emitter for a particle system to procedurally change
+ emission parameters etc.
+ You should check how many emitters are registered against this system before calling
+ this method with an arbitrary index using getNumEmitters.
+ @param
+ index Zero-based index of the emitter to retrieve.
+ */
+ ParticleEmitter* getEmitter(unsigned short index) const;
+
+ /** Returns the number of emitters for this particle system. */
+ unsigned short getNumEmitters(void) const;
+
+ /** Removes an emitter from the system.
+ @remarks
+ Drops the emitter with the index specified from this system.
+ You should check how many emitters are registered against this system before calling
+ this method with an arbitrary index using getNumEmitters.
+ @param
+ index Zero-based index of the emitter to retrieve.
+ */
+ void removeEmitter(unsigned short index);
+
+ /** Removes all the emitters from this system. */
+ void removeAllEmitters(void);
+
+
+ /** Adds an affector to this particle system.
+ @remarks
+ Particles are modified over time in a particle system by affectors - see the ParticleAffector
+ class for more details.
+ @param
+ affectorType String identifying the affector type to create. Affector types are defined
+ by registering new factories with the manager - see ParticleAffectorFactory for more details.
+ Affector types can be extended by OGRE, plugin authors or application developers.
+ */
+ ParticleAffector* addAffector(const String& affectorType);
+
+ /** Retrieves an affector by it's index (zero-based).
+ @remarks
+ Used to retrieve a pointer to an affector for a particle system to procedurally change
+ affector parameters etc.
+ You should check how many affectors are registered against this system before calling
+ this method with an arbitrary index using getNumAffectors.
+ @param
+ index Zero-based index of the affector to retrieve.
+ */
+ ParticleAffector* getAffector(unsigned short index) const;
+
+ /** Returns the number of affectors for this particle system. */
+ unsigned short getNumAffectors(void) const;
+
+ /** Removes an affector from the system.
+ @remarks
+ Drops the affector with the index specified from this system.
+ You should check how many affectors are registered against this system before calling
+ this method with an arbitrary index using getNumAffectors.
+ @param
+ index Zero-based index of the affector to retrieve.
+ */
+ void removeAffector(unsigned short index);
+
+ /** Removes all the affectors from this system. */
+ void removeAllAffectors(void);
+
+ /** Empties this set of all particles.
+ */
+ void clear();
+
+ /** Gets the number of individual particles in the system right now.
+ @remarks
+ The number of particles active in a system at a point in time depends on
+ the number of emitters, their emission rates, the time-to-live (TTL) each particle is
+ given on emission (and whether any affectors modify that TTL) and the maximum
+ number of particles allowed in this system at once (particle quota).
+ */
+ size_t getNumParticles(void) const;
+
+ /** Manually add a particle to the system.
+ @remarks
+ Instead of using an emitter, you can manually add a particle to the system.
+ You must initialise the returned particle instance immediately with the
+ 'emission' state.
+ @note
+ There is no corresponding 'destroyParticle' method - if you want to dispose of a
+ particle manually (say, if you've used setSpeedFactor(0) to make particles live forever)
+ you should use getParticle() and modify it's timeToLive to zero, meaning that it will
+ get cleaned up in the next update.
+ */
+ Particle* createParticle(void);
+
+ /** Manually add an emitter particle to the system.
+ @remarks
+ The purpose of a particle emitter is to emit particles. Besides visual particles, also other other
+ particle types can be emitted, other emitters for example. The emitted emitters have a double role;
+ they behave as particles and can be influenced by affectors, but they are still emitters and capable
+ to emit other particles (or emitters). It is possible to create a chain of emitters - emitters
+ emitting other emitters, which also emit emitters.
+ @param emitterName The name of a particle emitter that must be emitted.
+ */
+ Particle* createEmitterParticle(const String& emitterName);
+
+ /** Retrieve a particle from the system for manual tweaking.
+ @remarks
+ Normally you use an affector to alter particles in flight, but
+ for small manually controlled particle systems you might want to use
+ this method.
+ */
+ Particle* getParticle(size_t index);
+
+ /** Returns the maximum number of particles this system is allowed to have active at once.
+ @remarks
+ See ParticleSystem::setParticleQuota for more info.
+ */
+ size_t getParticleQuota(void) const;
+
+ /** Sets the maximum number of particles this system is allowed to have active at once.
+ @remarks
+ Particle systems all have a particle quota, i.e. a maximum number of particles they are
+ allowed to have active at a time. This allows the application to set a keep particle systems
+ under control should they be affected by complex parameters which alter their emission rates
+ etc. If a particle system reaches it's particle quota, none of the emitters will be able to
+ emit any more particles. As existing particles die, the spare capacity will be allocated
+ equally across all emitters to be as consistent to the origina particle system style as possible.
+ @param quota The maximum number of particles this system is allowed to have.
+ */
+ void setParticleQuota(size_t quota);
+
+ /** Returns the maximum number of emitted emitters this system is allowed to have active at once.
+ @remarks
+ See ParticleSystem::setEmittedEmitterQuota for more info.
+ */
+ size_t getEmittedEmitterQuota(void) const;
+
+ /** Sets the maximum number of emitted emitters this system is allowed to have active at once.
+ @remarks
+ Particle systems can have - besides a particle quota - also an emitted emitter quota.
+ @param quota The maximum number of emitted emitters this system is allowed to have.
+ */
+ void setEmittedEmitterQuota(size_t quota);
+
+ /** Assignment operator for copying.
+ @remarks
+ This operator deep copies all particle emitters and effectors, but not particles. The
+ system's name is also not copied.
+ */
+ ParticleSystem& operator=(const ParticleSystem& rhs);
+
+ /** Updates the particles in the system based on time elapsed.
+ @remarks
+ This is called automatically every frame by OGRE.
+ @param
+ timeElapsed The amount of time, in seconds, since the last frame.
+ */
+ void _update(Real timeElapsed);
+
+ /** Returns an iterator for stepping through all particles in this system.
+ @remarks
+ This method is designed to be used by people providing new ParticleAffector subclasses,
+ this is the easiest way to step through all the particles in a system and apply the
+ changes the affector wants to make.
+ */
+ ParticleIterator _getIterator(void);
+
+ /** Sets the name of the material to be used for this billboard set.
+ @param
+ name The new name of the material to use for this set.
+ */
+ virtual void setMaterialName(const String& name);
+
+ /** Sets the name of the material to be used for this billboard set.
+ @returns The name of the material that is used for this set.
+ */
+ virtual const String& getMaterialName(void) const;
+
+ /** Overridden from MovableObject
+ @see
+ MovableObject
+ */
+ virtual void _notifyCurrentCamera(Camera* cam);
+
+ /** Overridden from MovableObject
+ @see
+ MovableObject
+ */
+ void _notifyAttached(Node* parent, bool isTagPoint = false);
+
+ /** Overridden from MovableObject
+ @see
+ MovableObject
+ */
+ virtual const AxisAlignedBox& getBoundingBox(void) const { return mAABB; }
+
+ /** Overridden from MovableObject
+ @see
+ MovableObject
+ */
+ virtual Real getBoundingRadius(void) const { return mBoundingRadius; }
+
+ /** Overridden from MovableObject
+ @see
+ MovableObject
+ */
+ virtual void _updateRenderQueue(RenderQueue* queue);
+
+ /** Fast-forwards this system by the required number of seconds.
+ @remarks
+ This method allows you to fast-forward a system so that it effectively looks like
+ it has already been running for the time you specify. This is useful to avoid the
+ 'startup sequence' of a system, when you want the system to be fully populated right
+ from the start.
+ @param
+ time The number of seconds to fast-forward by.
+ @param
+ interval The sampling interval used to generate particles, apply affectors etc. The lower this
+ is the more realistic the fast-forward, but it takes more iterations to do it.
+ */
+ void fastForward(Real time, Real interval = 0.1);
+
+ /** Sets a 'speed factor' on this particle system, which means it scales the elapsed
+ real time which has passed by this factor before passing it to the emitters, affectors,
+ and the particle life calculation.
+ @remarks
+ An interesting side effect - if you want to create a completely manual particle system
+ where you control the emission and life of particles yourself, you can set the speed
+ factor to 0.0f, thus disabling normal particle emission, alteration, and death.
+ */
+ void setSpeedFactor(Real speedFactor) { mSpeedFactor = speedFactor; }
+
+ /** Gets the 'speed factor' on this particle system.
+ */
+ Real getSpeedFactor(void) const { return mSpeedFactor; }
+
+ /** Sets a 'iteration interval' on this particle system.
+ @remarks
+ The default Particle system update interval, based on elapsed frame time,
+ will cause different behavior between low frame-rate and high frame-rate.
+ By using this option, you can make the particle system update at
+ a fixed interval, keeping the behavior the same no matter what frame-rate
+ is.
+ @par
+ When iteration interval is set to zero, it means the update occurs based
+ on an elapsed frame time, otherwise each iteration will take place
+ at the given interval, repeating until it has used up all the elapsed
+ frame time.
+ @param
+ iterationInterval The iteration interval, default to zero.
+ */
+ void setIterationInterval(Real iterationInterval);
+
+ /** Gets a 'iteration interval' on this particle system.
+ */
+ Real getIterationInterval(void) const { return mIterationInterval; }
+
+ /** Set the default iteration interval for all ParticleSystem instances.
+ */
+ static void setDefaultIterationInterval(Real iterationInterval) { msDefaultIterationInterval = iterationInterval; }
+
+ /** Get the default iteration interval for all ParticleSystem instances.
+ */
+ static Real getDefaultIterationInterval(void) { return msDefaultIterationInterval; }
+
+ /** Sets when the particle system should stop updating after it hasn't been
+ visible for a while.
+ @remarks
+ By default, visible particle systems update all the time, even when
+ not in view. This means that they are guaranteed to be consistent when
+ they do enter view. However, this comes at a cost, updating particle
+ systems can be expensive, especially if they are perpetual.
+ @par
+ This option lets you set a 'timeout' on the particle system, so that
+ if it isn't visible for this amount of time, it will stop updating
+ until it is next visible.
+ @param timeout The time after which the particle system will be disabled
+ if it is no longer visible. 0 to disable the timeout and always update.
+ */
+ void setNonVisibleUpdateTimeout(Real timeout);
+ /** Gets when the particle system should stop updating after it hasn't been
+ visible for a while.
+ */
+ Real getNonVisibleUpdateTimeout(void) const { return mNonvisibleTimeout; }
+
+ /** Set the default nonvisible timeout for all ParticleSystem instances.
+ */
+ static void setDefaultNonVisibleUpdateTimeout(Real timeout)
+ { msDefaultNonvisibleTimeout = timeout; }
+
+ /** Get the default nonvisible timeout for all ParticleSystem instances.
+ */
+ static Real getDefaultNonVisibleUpdateTimeout(void) { return msDefaultNonvisibleTimeout; }
+
+ /** Overridden from MovableObject */
+ const String& getMovableType(void) const;
+
+ /** Internal callback used by Particles to notify their parent that they have been resized.
+ */
+ virtual void _notifyParticleResized(void);
+
+ /** Internal callback used by Particles to notify their parent that they have been rotated.
+ */
+ virtual void _notifyParticleRotated(void);
+
+ /** Sets the default dimensions of the particles in this set.
+ @remarks
+ All particles in a set are created with these default dimensions. The set will render most efficiently if
+ all the particles in the set are the default size. It is possible to alter the size of individual
+ particles at the expense of extra calculation. See the Particle class for more info.
+ @param width
+ The new default width for the particles in this set.
+ @param height
+ The new default height for the particles in this set.
+ */
+ virtual void setDefaultDimensions(Real width, Real height);
+
+ /** See setDefaultDimensions - this sets 1 component individually. */
+ virtual void setDefaultWidth(Real width);
+ /** See setDefaultDimensions - this gets 1 component individually. */
+ virtual Real getDefaultWidth(void) const;
+ /** See setDefaultDimensions - this sets 1 component individually. */
+ virtual void setDefaultHeight(Real height);
+ /** See setDefaultDimensions - this gets 1 component individually. */
+ virtual Real getDefaultHeight(void) const;
+ /** Returns whether or not particles in this are tested individually for culling. */
+ virtual bool getCullIndividually(void) const;
+ /** Sets whether culling tests particles in this individually as well as in a group.
+ @remarks
+ Particle sets are always culled as a whole group, based on a bounding box which
+ encloses all particles in the set. For fairly localised sets, this is enough. However, you
+ can optionally tell the set to also cull individual particles in the set, i.e. to test
+ each individual particle before rendering. The default is not to do this.
+ @par
+ This is useful when you have a large, fairly distributed set of particles, like maybe
+ trees on a landscape. You probably still want to group them into more than one
+ set (maybe one set per section of landscape), which will be culled coarsely, but you also
+ want to cull the particles individually because they are spread out. Whilst you could have
+ lots of single-tree sets which are culled separately, this would be inefficient to render
+ because each tree would be issued as it's own rendering operation.
+ @par
+ By calling this method with a parameter of true, you can have large particle sets which
+ are spaced out and so get the benefit of batch rendering and coarse culling, but also have
+ fine-grained culling so unnecessary rendering is avoided.
+ @param cullIndividual If true, each particle is tested before being sent to the pipeline as well
+ as the whole set having to pass the coarse group bounding test.
+ */
+ virtual void setCullIndividually(bool cullIndividual);
+ /// Return the resource group to be used to load dependent resources
+ virtual const String& getResourceGroupName(void) const { return mResourceGroupName; }
+ /** Get the origin of this particle system, e.g. a script file name.
+ @remarks
+ This property will only contain something if the creator of
+ this particle system chose to populate it. Script loaders are advised
+ to populate it.
+ */
+ const String& getOrigin(void) const { return mOrigin; }
+ /// Notify this particle system of it's origin
+ void _notifyOrigin(const String& origin) { mOrigin = origin; }
+
+ /** @copydoc MovableObject::setRenderQueueGroup */
+ void setRenderQueueGroup(uint8 queueID);
+
+ /** Set whether or not particles are sorted according to the camera.
+ @remarks
+ Enabling sorting alters the order particles are sent to the renderer.
+ When enabled, particles are sent to the renderer in order of
+ furthest distance from the camera.
+ */
+ void setSortingEnabled(bool enabled) { mSorted = enabled; }
+ /// Gets whether particles are sorted relative to the camera.
+ bool getSortingEnabled(void) const { return mSorted; }
+
+ /** Set the (initial) bounds of the particle system manually.
+ @remarks
+ If you can, set the bounds of a particle system up-front and
+ call setBoundsAutoUpdated(false); this is the most efficient way to
+ organise it. Otherwise, set an initial bounds and let the bounds increase
+ for a little while (the default is 5 seconds), after which time the
+ AABB is fixed to save time.
+ @param aabb Bounds in local space.
+ */
+ void setBounds(const AxisAlignedBox& aabb);
+
+ /** Sets whether the bounds will be automatically updated
+ for the life of the particle system
+ @remarks
+ If you have a stationary particle system, it would be a good idea to
+ call this method and set the value to 'false', since the maximum
+ bounds of the particle system will eventually be static. If you do
+ this, you can either set the bounds manually using the setBounds()
+ method, or set the second parameter of this method to a positive
+ number of seconds, so that the bounds are calculated for a few
+ seconds and then frozen.
+ @param autoUpdate If true (the default), the particle system will
+ update it's bounds every frame. If false, the bounds update will
+ cease after the 'stopIn' number of seconds have passed.
+ @param stopIn Only applicable if the first parameter is true, this is the
+ number of seconds after which the automatic update will cease.
+ */
+ void setBoundsAutoUpdated(bool autoUpdate, Real stopIn = 0.0f);
+
+ /** Sets whether particles (and any affector effects) remain relative
+ to the node the particle system is attached to.
+ @remarks
+ By defalt particles are in world space once emitted, so they are not
+ affected by movement in the parent node of the particle system. This
+ makes the most sense when dealing with completely independent particles,
+ but if you want to constrain them to follow local motion too, you
+ can set this to true.
+ */
+ void setKeepParticlesInLocalSpace(bool keepLocal);
+
+ /** Gets whether particles (and any affector effects) remain relative
+ to the node the particle system is attached to.
+ */
+ bool getKeepParticlesInLocalSpace(void) const { return mLocalSpace; }
+
+ /** Internal method for updating the bounds of the particle system.
+ @remarks
+ This is called automatically for a period of time after the system's
+ creation (10 seconds by default, settable by setBoundsAutoUpdated)
+ to increase (and only increase) the bounds of the system according
+ to the emitted and affected particles. After this period, the
+ system is assumed to achieved its maximum size, and the bounds are
+ no longer computed for efficiency. You can tweak the behaviour by
+ either setting the bounds manually (setBounds, preferred), or
+ changing the time over which the bounds are updated (performance cost).
+ You can also call this method manually if you need to update the
+ bounds on an ad-hoc basis.
+ */
+ void _updateBounds(void);
+
+ /// Override to return specific type flag
+ uint32 getTypeFlags(void) const;
+ protected:
+
+ /// Command objects
+ static CmdCull msCullCmd;
+ static CmdHeight msHeightCmd;
+ static CmdMaterial msMaterialCmd;
+ static CmdQuota msQuotaCmd;
+ static CmdEmittedEmitterQuota msEmittedEmitterQuotaCmd;
+ static CmdWidth msWidthCmd;
+ static CmdRenderer msRendererCmd;
+ static CmdSorted msSortedCmd;
+ static CmdLocalSpace msLocalSpaceCmd;
+ static CmdIterationInterval msIterationIntervalCmd;
+ static CmdNonvisibleTimeout msNonvisibleTimeoutCmd;
+
+
+ AxisAlignedBox mAABB;
+ Real mBoundingRadius;
+ bool mBoundsAutoUpdate;
+ Real mBoundsUpdateTime;
+ Real mUpdateRemainTime;
+
+ /// World AABB, only used to compare world-space positions to calc bounds
+ AxisAlignedBox mWorldAABB;
+
+ /// Name of the resource group to use to load materials
+ String mResourceGroupName;
+ /// Name of the material to use
+ String mMaterialName;
+ /// Have we set the material etc on the renderer?
+ bool mIsRendererConfigured;
+ /// Pointer to the material to use
+ MaterialPtr mpMaterial;
+ /// Default width of each particle
+ Real mDefaultWidth;
+ /// Default height of each particle
+ Real mDefaultHeight;
+ /// Speed factor
+ Real mSpeedFactor;
+ /// Iteration interval
+ Real mIterationInterval;
+ /// Iteration interval set? Otherwise track default
+ bool mIterationIntervalSet;
+ /// Particles sorted according to camera?
+ bool mSorted;
+ /// Particles in local space?
+ bool mLocalSpace;
+ /// Update timeout when nonvisible (0 for no timeout)
+ Real mNonvisibleTimeout;
+ /// Update timeout when nonvisible set? Otherwise track default
+ bool mNonvisibleTimeoutSet;
+ /// Amount of time non-visible so far
+ Real mTimeSinceLastVisible;
+ /// Last frame in which known to be visible
+ unsigned long mLastVisibleFrame;
+ /// Controller for time update
+ Controller* mTimeController;
+ /// Indication whether the emitted emitter pool (= pool with particle emitters that are emitted) is initialised
+ bool mEmittedEmitterPoolInitialised;
+
+ typedef std::list ActiveParticleList;
+ typedef std::list FreeParticleList;
+ typedef std::vector ParticlePool;
+
+ /** Sort by direction functor */
+ struct SortByDirectionFunctor
+ {
+ /// Direction to sort in
+ Vector3 sortDir;
+
+ SortByDirectionFunctor(const Vector3& dir);
+ float operator()(Particle* p) const;
+ };
+
+ /** Sort by distance functor */
+ struct SortByDistanceFunctor
+ {
+ /// Position to sort in
+ Vector3 sortPos;
+
+ SortByDistanceFunctor(const Vector3& pos);
+ float operator()(Particle* p) const;
+ };
+
+ static RadixSort mRadixSorter;
+
+ /** Active particle list.
+ @remarks
+ This is a linked list of pointers to particles in the particle pool.
+ @par
+ This allows very fast instertions and deletions from anywhere in
+ the list to activate / deactivate particles as well as resuse of
+ Particle instances in the pool without construction & destruction
+ which avoids memory thrashing.
+ */
+ ActiveParticleList mActiveParticles;
+
+ /** Free particle queue.
+ @remarks
+ This contains a list of the particles free for use as new instances
+ as required by the set. Particle instances are preconstructed up
+ to the estimated size in the mParticlePool vector and are
+ referenced on this deque at startup. As they get used this list
+ reduces, as they get released back to to the set they get added
+ back to the list.
+ */
+ FreeParticleList mFreeParticles;
+
+ /** Pool of particle instances for use and reuse in the active particle list.
+ @remarks
+ This vector will be preallocated with the estimated size of the set,and will extend as required.
+ */
+ ParticlePool mParticlePool;
+
+ typedef std::list FreeEmittedEmitterList;
+ typedef std::list ActiveEmittedEmitterList;
+ typedef std::vector EmittedEmitterList;
+ typedef std::map FreeEmittedEmitterMap;
+ typedef std::map EmittedEmitterPool;
+
+ /** Pool of emitted emitters for use and reuse in the active emitted emitter list.
+ @remarks
+ The emitters in this pool act as particles and as emitters. The pool is a map containing lists
+ of emitters, identified by their name.
+ @par
+ The emitters in this pool are cloned using emitters that are kept in the main emitter list
+ of the ParticleSystem.
+ */
+ EmittedEmitterPool mEmittedEmitterPool;
+
+ /** Free emitted emitter list.
+ @remarks
+ This contains a list of the emitters free for use as new instances as required by the set.
+ */
+ FreeEmittedEmitterMap mFreeEmittedEmitters;
+
+ /** Active emitted emitter list.
+ @remarks
+ This is a linked list of pointers to emitters in the emitted emitter pool.
+ Emitters that are used are stored (their pointers) in both the list with active particles and in
+ the list with active emitted emitters. */
+ ActiveEmittedEmitterList mActiveEmittedEmitters;
+
+ typedef std::vector ParticleEmitterList;
+ typedef std::vector ParticleAffectorList;
+
+ /// List of particle emitters, ie sources of particles
+ ParticleEmitterList mEmitters;
+ /// List of particle affectors, ie modifiers of particles
+ ParticleAffectorList mAffectors;
+
+ /// The renderer used to render this particle system
+ ParticleSystemRenderer* mRenderer;
+
+ /// Do we cull each particle individually?
+ bool mCullIndividual;
+
+ /// The name of the type of renderer used to render this system
+ String mRendererType;
+
+ /// The number of particles in the pool.
+ size_t mPoolSize;
+
+ /// The number of emitted emitters in the pool.
+ size_t mEmittedEmitterPoolSize;
+
+ /// Optional origin of this particle system (eg script name)
+ String mOrigin;
+
+ /// Default iteration interval
+ static Real msDefaultIterationInterval;
+ /// Default nonvisible update timeout
+ static Real msDefaultNonvisibleTimeout;
+
+ /** Internal method used to expire dead particles. */
+ void _expire(Real timeElapsed);
+
+ /** Spawn new particles based on free quota and emitter requirements. */
+ void _triggerEmitters(Real timeElapsed);
+
+ /** Helper function that actually performs the emission of particles
+ */
+ void _executeTriggerEmitters(ParticleEmitter* emitter, unsigned requested, Real timeElapsed);
+
+ /** Updates existing particle based on their momentum. */
+ void _applyMotion(Real timeElapsed);
+
+ /** Applies the effects of affectors. */
+ void _triggerAffectors(Real timeElapsed);
+
+ /** Sort the particles in the system **/
+ void _sortParticles(Camera* cam);
+
+ /** Resize the internal pool of particles. */
+ void increasePool(size_t size);
+
+ /** Resize the internal pool of emitted emitters.
+ @remarks
+ The pool consists of multiple vectors containing pointers to particle emitters. Increasing the
+ pool with ´size´ implies that the vectors are equally increased. The quota of emitted emitters is
+ defined on a particle system level and not on a particle emitter level. This is to prevent that
+ the number of created emitters becomes too high; the quota is shared amongst the emitted emitters.
+ */
+ void increaseEmittedEmitterPool(size_t size);
+
+ /** Internal method for initialising string interface. */
+ void initParameters(void);
+
+ /** Internal method to configure the renderer. */
+ void configureRenderer(void);
+
+ /// Internal method for creating ParticleVisualData instances for the pool
+ void createVisualParticles(size_t poolstart, size_t poolend);
+ /// Internal method for destroying ParticleVisualData instances for the pool
+ void destroyVisualParticles(size_t poolstart, size_t poolend);
+
+ /** Create a pool of emitted emitters and assign them to the free emitter list.
+ @remarks
+ The emitters in the pool are grouped by name. This name is the name of the base emitter in the
+ main list with particle emitters, which forms the template of the created emitted emitters.
+ */
+ void initialiseEmittedEmitters(void);
+
+ /** Determine which emitters in the Particle Systems main emitter become a template for creating an
+ pool of emitters that can be emitted.
+ */
+ void initialiseEmittedEmitterPool(void);
+
+ /** Add emitters from the pool to the free emitted emitter queue. */
+ void addFreeEmittedEmitters(void);
+
+ /** Removes all emitted emitters from this system. */
+ void removeAllEmittedEmitters(void);
+
+ /** Find the list with free emitted emitters.
+ @param name The name that identifies the list with free emitted emitters.
+ */
+ FreeEmittedEmitterList* findFreeEmittedEmitter (const String& name);
+
+ /** Removes an emitter from the active emitted emitter list.
+ @remarks
+ The emitter will not be destroyed!
+ @param emitter Pointer to a particle emitter.
+ */
+ void removeFromActiveEmittedEmitters (ParticleEmitter* emitter);
+
+ /** Moves all emitted emitters from the active list to the free list
+ @remarks
+ The active emitted emitter list will not be cleared and still keeps references to the emitters!
+ */
+ void addActiveEmittedEmittersToFreeList (void);
+
+ /** This function clears all data structures that are used in combination with emitted emitters and
+ sets the flag to indicate that the emitted emitter pool must be initialised again.
+ @remarks
+ This function should be called if new emitters are added to a ParticleSystem or deleted from a
+ ParticleSystem. The emitted emitter data structures become out of sync and need to be build up
+ again. The data structures are not reorganised in this function, but by setting a ´flag´,
+ they are rebuild in the regular process flow.
+ */
+ void _notifyReorganiseEmittedEmitterData (void);
+ };
+
+}
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreParticleSystemManager.h b/school/informatik/verkerhssimulation/src/ogre/OgreParticleSystemManager.h
new file mode 100644
index 00000000..57276fbd
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreParticleSystemManager.h
@@ -0,0 +1,389 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ParticleSystemManager_H__
+#define __ParticleSystemManager_H__
+
+
+#include "OgrePrerequisites.h"
+#include "OgreParticleSystem.h"
+#include "OgreFrameListener.h"
+#include "OgreSingleton.h"
+#include "OgreIteratorWrappers.h"
+#include "OgreScriptLoader.h"
+#include "OgreResourceGroupManager.h"
+
+namespace Ogre {
+
+ // Forward decl
+ class ParticleSystemFactory;
+
+ /** Manages particle systems, particle system scripts (templates) and the
+ available emitter & affector factories.
+ @remarks
+ This singleton class is responsible for creating and managing particle
+ systems. All particle systems must be created and destroyed using this
+ object, although the user interface to creating them is via
+ SceneManager. Remember that like all other MovableObject
+ subclasses, ParticleSystems do not get rendered until they are
+ attached to a SceneNode object.
+ @par
+ This class also manages factories for ParticleEmitter and
+ ParticleAffector classes. To enable easy extensions to the types of
+ emitters (particle sources) and affectors (particle modifiers), the
+ ParticleSystemManager lets plugins or applications register factory
+ classes which submit new subclasses to ParticleEmitter and
+ ParticleAffector. Ogre comes with a number of them already provided,
+ such as cone, sphere and box-shaped emitters, and simple affectors such
+ as constant directional force and colour faders. However using this
+ registration process, a plugin can create any behaviour required.
+ @par
+ This class also manages the loading and parsing of particle system
+ scripts, which are text files describing named particle system
+ templates. Instances of particle systems using these templates can
+ then be created easily through the createParticleSystem method.
+ */
+ class _OgreExport ParticleSystemManager:
+ public Singleton, public ScriptLoader
+ {
+ friend class ParticleSystemFactory;
+ public:
+ typedef std::map ParticleTemplateMap;
+ typedef std::map ParticleAffectorFactoryMap;
+ typedef std::map ParticleEmitterFactoryMap;
+ typedef std::map ParticleSystemRendererFactoryMap;
+ protected:
+ OGRE_AUTO_MUTEX
+ /// Templates based on scripts
+ ParticleTemplateMap mSystemTemplates;
+
+ /// Factories for named emitter types (can be extended using plugins)
+ ParticleEmitterFactoryMap mEmitterFactories;
+
+ /// Factories for named affector types (can be extended using plugins)
+ ParticleAffectorFactoryMap mAffectorFactories;
+
+ /// Map of renderer types to factories
+ ParticleSystemRendererFactoryMap mRendererFactories;
+
+ StringVector mScriptPatterns;
+
+ // Factory instance
+ ParticleSystemFactory* mFactory;
+
+ /** Internal script parsing method. */
+ void parseNewEmitter(const String& type, DataStreamPtr& chunk, ParticleSystem* sys);
+ /** Internal script parsing method. */
+ void parseNewAffector(const String& type, DataStreamPtr& chunk, ParticleSystem* sys);
+ /** Internal script parsing method. */
+ void parseAttrib(const String& line, ParticleSystem* sys);
+ /** Internal script parsing method. */
+ void parseEmitterAttrib(const String& line, ParticleEmitter* sys);
+ /** Internal script parsing method. */
+ void parseAffectorAttrib(const String& line, ParticleAffector* sys);
+ /** Internal script parsing method. */
+ void skipToNextCloseBrace(DataStreamPtr& chunk);
+ /** Internal script parsing method. */
+ void skipToNextOpenBrace(DataStreamPtr& chunk);
+
+ /// Internal implementation of createSystem
+ ParticleSystem* createSystemImpl(const String& name, size_t quota,
+ const String& resourceGroup);
+ /// Internal implementation of createSystem
+ ParticleSystem* createSystemImpl(const String& name, const String& templateName);
+ /// Internal implementation of destroySystem
+ void destroySystemImpl(ParticleSystem* sys);
+
+
+ public:
+
+ ParticleSystemManager();
+ virtual ~ParticleSystemManager();
+
+ /** Adds a new 'factory' object for emitters to the list of available emitter types.
+ @remarks
+ This method allows plugins etc to add new particle emitter types to Ogre. Particle emitters
+ are sources of particles, and generate new particles with their start positions, colours and
+ momentums appropriately. Plugins would create new subclasses of ParticleEmitter which
+ emit particles a certain way, and register a subclass of ParticleEmitterFactory to create them (since multiple
+ emitters can be created for different particle systems).
+ @par
+ All particle emitter factories have an assigned name which is used to identify the emitter
+ type. This must be unique.
+ @par
+ Note that the object passed to this function will not be destroyed by the ParticleSystemManager,
+ since it may have been allocted on a different heap in the case of plugins. The caller must
+ destroy the object later on, probably on plugin shutdown.
+ @param
+ factory Pointer to a ParticleEmitterFactory subclass created by the plugin or application code.
+ */
+ void addEmitterFactory(ParticleEmitterFactory* factory);
+
+ /** Adds a new 'factory' object for affectors to the list of available affector types.
+ @remarks
+ This method allows plugins etc to add new particle affector types to Ogre. Particle
+ affectors modify the particles in a system a certain way such as affecting their direction
+ or changing their colour, lifespan etc. Plugins would
+ create new subclasses of ParticleAffector which affect particles a certain way, and register
+ a subclass of ParticleAffectorFactory to create them.
+ @par
+ All particle affector factories have an assigned name which is used to identify the affector
+ type. This must be unique.
+ @par
+ Note that the object passed to this function will not be destroyed by the ParticleSystemManager,
+ since it may have been allocted on a different heap in the case of plugins. The caller must
+ destroy the object later on, probably on plugin shutdown.
+ @param
+ factory Pointer to a ParticleAffectorFactory subclass created by the plugin or application code.
+ */
+ void addAffectorFactory(ParticleAffectorFactory* factory);
+
+ /** Registers a factory class for creating ParticleSystemRenderer instances.
+ @par
+ Note that the object passed to this function will not be destroyed by the ParticleSystemManager,
+ since it may have been allocted on a different heap in the case of plugins. The caller must
+ destroy the object later on, probably on plugin shutdown.
+ @param
+ factory Pointer to a ParticleSystemRendererFactory subclass created by the plugin or application code.
+ */
+ void addRendererFactory(ParticleSystemRendererFactory* factory);
+
+ /** Adds a new particle system template to the list of available templates.
+ @remarks
+ Instances of particle systems in a scene are not normally unique - often you want to place the
+ same effect in many places. This method allows you to register a ParticleSystem as a named template,
+ which can subsequently be used to create instances using the createSystem method.
+ @par
+ Note that particle system templates can either be created programmatically by an application
+ and registered using this method, or they can be defined in a script file (*.particle) which is
+ loaded by the engine at startup, very much like Material scripts.
+ @param
+ name The name of the template. Must be unique across all templates.
+ @param
+ sysTemplate A pointer to a particle system to be used as a template. The manager
+ will take over ownership of this pointer.
+
+ */
+ void addTemplate(const String& name, ParticleSystem* sysTemplate);
+
+ /** Removes a specified template from the ParticleSystemManager.
+ @remarks
+ This method removes a given template from the particle system manager, optionally deleting
+ the template if the deleteTemplate method is called. Throws an exception if the template
+ could not be found.
+ @param
+ name The name of the template to remove.
+ @param
+ deleteTemplate Whether or not to delete the template before removing it.
+ */
+ void removeTemplate(const String& name, bool deleteTemplate = true);
+
+ /** Removes a specified template from the ParticleSystemManager.
+ @remarks
+ This method removes all templates from the ParticleSystemManager.
+ @param
+ deleteTemplate Whether or not to delete the templates before removing them.
+ */
+ void removeAllTemplates(bool deleteTemplate = true);
+
+ /** Create a new particle system template.
+ @remarks
+ This method is similar to the addTemplate method, except this just creates a new template
+ and returns a pointer to it to be populated. Use this when you don't already have a system
+ to add as a template and just want to create a new template which you will build up in-place.
+ @param
+ name The name of the template. Must be unique across all templates.
+ @param
+ resourceGroup The name of the resource group which will be used to
+ load any dependent resources.
+
+ */
+ ParticleSystem* createTemplate(const String& name, const String& resourceGroup);
+
+ /** Retrieves a particle system template for possible modification.
+ @remarks
+ Modifying a template does not affect the settings on any ParticleSystems already created
+ from this template.
+ */
+ ParticleSystem* getTemplate(const String& name);
+
+ /** Internal method for creating a new emitter from a factory.
+ @remarks
+ Used internally by the engine to create new ParticleEmitter instances from named
+ factories. Applications should use the ParticleSystem::addEmitter method instead,
+ which calls this method to create an instance.
+ @param
+ emitterType String name of the emitter type to be created. A factory of this type must have been registered.
+ @param
+ psys The particle system this is being created for
+ */
+ ParticleEmitter* _createEmitter(const String& emitterType, ParticleSystem* psys);
+
+ /** Internal method for destroying an emitter.
+ @remarks
+ Because emitters are created by factories which may allocate memory from separate heaps,
+ the memory allocated must be freed from the same place. This method is used to ask the factory
+ to destroy the instance passed in as a pointer.
+ @param
+ emitter Pointer to emitter to be destroyed. On return this pointer will point to invalid (freed) memory.
+ */
+ void _destroyEmitter(ParticleEmitter* emitter);
+
+ /** Internal method for creating a new affector from a factory.
+ @remarks
+ Used internally by the engine to create new ParticleAffector instances from named
+ factories. Applications should use the ParticleSystem::addAffector method instead,
+ which calls this method to create an instance.
+ @param
+ effectorType String name of the affector type to be created. A factory of this type must have been registered.
+ @param
+ psys The particle system it is being created for
+ */
+ ParticleAffector* _createAffector(const String& affectorType, ParticleSystem* psys);
+
+ /** Internal method for destroying an affector.
+ @remarks
+ Because affectors are created by factories which may allocate memory from separate heaps,
+ the memory allocated must be freed from the same place. This method is used to ask the factory
+ to destroy the instance passed in as a pointer.
+ @param
+ affector Pointer to affector to be destroyed. On return this pointer will point to invalid (freed) memory.
+ */
+ void _destroyAffector(ParticleAffector* affector);
+
+ /** Internal method for creating a new renderer from a factory.
+ @remarks
+ Used internally by the engine to create new ParticleSystemRenderer instances from named
+ factories. Applications should use the ParticleSystem::setRenderer method instead,
+ which calls this method to create an instance.
+ @param
+ rendererType String name of the renderer type to be created. A factory of this type must have been registered.
+ */
+ ParticleSystemRenderer* _createRenderer(const String& rendererType);
+
+ /** Internal method for destroying a renderer.
+ @remarks
+ Because renderer are created by factories which may allocate memory from separate heaps,
+ the memory allocated must be freed from the same place. This method is used to ask the factory
+ to destroy the instance passed in as a pointer.
+ @param
+ renderer Pointer to renderer to be destroyed. On return this pointer will point to invalid (freed) memory.
+ */
+ void _destroyRenderer(ParticleSystemRenderer* renderer);
+
+ /** Init method to be called by OGRE system.
+ @remarks
+ Due to dependencies between various objects certain initialisation tasks cannot be done
+ on construction. OGRE will call this method when the rendering subsystem is initialised.
+ */
+ void _initialise(void);
+
+ /// @copydoc ScriptLoader::getScriptPatterns
+ const StringVector& getScriptPatterns(void) const;
+ /// @copydoc ScriptLoader::parseScript
+ void parseScript(DataStreamPtr& stream, const String& groupName);
+ /// @copydoc ScriptLoader::getLoadingOrder
+ Real getLoadingOrder(void) const;
+
+ typedef MapIterator ParticleAffectorFactoryIterator;
+ typedef MapIterator ParticleEmitterFactoryIterator;
+ typedef MapIterator ParticleRendererFactoryIterator;
+ /** Return an iterator over the affector factories currently registered */
+ ParticleAffectorFactoryIterator getAffectorFactoryIterator(void);
+ /** Return an iterator over the emitter factories currently registered */
+ ParticleEmitterFactoryIterator getEmitterFactoryIterator(void);
+ /** Return an iterator over the renderer factories currently registered */
+ ParticleRendererFactoryIterator getRendererFactoryIterator(void);
+
+
+ typedef MapIterator ParticleSystemTemplateIterator;
+ /** Gets an iterator over the list of particle system templates. */
+ ParticleSystemTemplateIterator getTemplateIterator(void)
+ {
+ return ParticleSystemTemplateIterator(
+ mSystemTemplates.begin(), mSystemTemplates.end());
+ }
+
+ /** Get an instance of ParticleSystemFactory (internal use). */
+ ParticleSystemFactory* _getFactory(void) { return mFactory; }
+
+ /** Override standard Singleton retrieval.
+ @remarks
+ Why do we do this? Well, it's because the Singleton
+ implementation is in a .h file, which means it gets compiled
+ into anybody who includes it. This is needed for the
+ Singleton template to work, but we actually only want it
+ compiled into the implementation of the class based on the
+ Singleton, not all of them. If we don't change this, we get
+ link errors when trying to use the Singleton-based class from
+ an outside dll.
+ @par
+ This method just delegates to the template version anyway,
+ but the implementation stays in this single compilation unit,
+ preventing link errors.
+ */
+ static ParticleSystemManager& getSingleton(void);
+ /** Override standard Singleton retrieval.
+ @remarks
+ Why do we do this? Well, it's because the Singleton
+ implementation is in a .h file, which means it gets compiled
+ into anybody who includes it. This is needed for the
+ Singleton template to work, but we actually only want it
+ compiled into the implementation of the class based on the
+ Singleton, not all of them. If we don't change this, we get
+ link errors when trying to use the Singleton-based class from
+ an outside dll.
+ @par
+ This method just delegates to the template version anyway,
+ but the implementation stays in this single compilation unit,
+ preventing link errors.
+ */
+ static ParticleSystemManager* getSingletonPtr(void);
+
+ };
+
+ /** Factory object for creating ParticleSystem instances */
+ class _OgreExport ParticleSystemFactory : public MovableObjectFactory
+ {
+ protected:
+ MovableObject* createInstanceImpl(const String& name, const NameValuePairList* params);
+ public:
+ ParticleSystemFactory() {}
+ ~ParticleSystemFactory() {}
+
+ static String FACTORY_TYPE_NAME;
+
+ const String& getType(void) const;
+ void destroyInstance( MovableObject* obj);
+
+ };
+
+}
+
+#endif
+
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreParticleSystemRenderer.h b/school/informatik/verkerhssimulation/src/ogre/OgreParticleSystemRenderer.h
new file mode 100644
index 00000000..5b923394
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreParticleSystemRenderer.h
@@ -0,0 +1,124 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ParticleSystemRenderer_H__
+#define __ParticleSystemRenderer_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreStringInterface.h"
+#include "OgreFactoryObj.h"
+#include "OgreRenderQueue.h"
+#include "OgreCommon.h"
+
+namespace Ogre {
+
+ /** Abstract class defining the interface required to be implemented
+ by classes which provide rendering capability to ParticleSystem instances.
+ */
+ class _OgreExport ParticleSystemRenderer : public StringInterface
+ {
+ public:
+ /// Constructor
+ ParticleSystemRenderer() {}
+ /// Destructor
+ virtual ~ParticleSystemRenderer() {}
+
+ /** Gets the type of this renderer - must be implemented by subclasses */
+ virtual const String& getType(void) const = 0;
+
+ /** Delegated to by ParticleSystem::_updateRenderQueue
+ @remarks
+ The subclass must update the render queue using whichever Renderable
+ instance(s) it wishes.
+ */
+ virtual void _updateRenderQueue(RenderQueue* queue,
+ std::list& currentParticles, bool cullIndividually) = 0;
+
+ /** Sets the material this renderer must use; called by ParticleSystem. */
+ virtual void _setMaterial(MaterialPtr& mat) = 0;
+ /** Delegated to by ParticleSystem::_notifyCurrentCamera */
+ virtual void _notifyCurrentCamera(Camera* cam) = 0;
+ /** Delegated to by ParticleSystem::_notifyAttached */
+ virtual void _notifyAttached(Node* parent, bool isTagPoint = false) = 0;
+ /** Optional callback notified when particles are rotated */
+ virtual void _notifyParticleRotated(void) {}
+ /** Optional callback notified when particles are resized individually */
+ virtual void _notifyParticleResized(void) {}
+ /** Tells the renderer that the particle quota has changed */
+ virtual void _notifyParticleQuota(size_t quota) = 0;
+ /** Tells the renderer that the particle default size has changed */
+ virtual void _notifyDefaultDimensions(Real width, Real height) = 0;
+ /** Optional callback notified when particle emitted */
+ virtual void _notifyParticleEmitted(Particle* particle) {}
+ /** Optional callback notified when particle expired */
+ virtual void _notifyParticleExpired(Particle* particle) {}
+ /** Optional callback notified when particles moved */
+ virtual void _notifyParticleMoved(std::list& currentParticles) {}
+ /** Optional callback notified when particles cleared */
+ virtual void _notifyParticleCleared(std::list& currentParticles) {}
+ /** Create a new ParticleVisualData instance for attachment to a particle.
+ @remarks
+ If this renderer needs additional data in each particle, then this should
+ be held in an instance of a subclass of ParticleVisualData, and this method
+ should be overridden to return a new instance of it. The default
+ behaviour is to return null.
+ */
+ virtual ParticleVisualData* _createVisualData(void) { return 0; }
+ /** Destroy a ParticleVisualData instance.
+ @remarks
+ If this renderer needs additional data in each particle, then this should
+ be held in an instance of a subclass of ParticleVisualData, and this method
+ should be overridden to destroy an instance of it. The default
+ behaviour is to do nothing.
+ */
+ virtual void _destroyVisualData(ParticleVisualData* vis) { assert (vis == 0); }
+
+ /** Sets which render queue group this renderer should target with it's
+ output.
+ */
+ virtual void setRenderQueueGroup(uint8 queueID) = 0;
+
+ /** Setting carried over from ParticleSystem.
+ */
+ virtual void setKeepParticlesInLocalSpace(bool keepLocal) = 0;
+
+ /** Gets the desired particles sort mode of this renderer */
+ virtual SortMode _getSortMode(void) const = 0;
+
+ };
+
+ /** Abstract class definition of a factory object for ParticleSystemRenderer. */
+ class _OgreExport ParticleSystemRendererFactory : public FactoryObj
+ {
+ public:
+ // No methods, must just override all methods inherited from FactoryObj
+ };
+
+}
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgrePass.h b/school/informatik/verkerhssimulation/src/ogre/OgrePass.h
new file mode 100644
index 00000000..a82956c6
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgrePass.h
@@ -0,0 +1,1321 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Pass_H__
+#define __Pass_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreGpuProgram.h"
+#include "OgreColourValue.h"
+#include "OgreBlendMode.h"
+#include "OgreCommon.h"
+#include "OgreLight.h"
+#include "OgreTextureUnitState.h"
+
+namespace Ogre {
+ /** Class defining a single pass of a Technique (of a Material), ie
+ a single rendering call.
+ @remarks
+ Rendering can be repeated with many passes for more complex effects.
+ Each pass is either a fixed-function pass (meaning it does not use
+ a vertex or fragment program) or a programmable pass (meaning it does
+ use either a vertex and fragment program, or both).
+ @par
+ Programmable passes are complex to define, because they require custom
+ programs and you have to set all constant inputs to the programs (like
+ the position of lights, any base material colours you wish to use etc), but
+ they do give you much total flexibility over the algorithms used to render your
+ pass, and you can create some effects which are impossible with a fixed-function pass.
+ On the other hand, you can define a fixed-function pass in very little time, and
+ you can use a range of fixed-function effects like environment mapping very
+ easily, plus your pass will be more likely to be compatible with older hardware.
+ There are pros and cons to both, just remember that if you use a programmable
+ pass to create some great effects, allow more time for definition and testing.
+ */
+ class _OgreExport Pass
+ {
+ public:
+ /** Definition of a functor for calculating the hashcode of a Pass.
+ @remarks
+ The hashcode of a Pass is used to sort Passes for rendering, in order
+ to reduce the number of render state changes. Each Pass represents a
+ single unique set of states, but by ordering them, state changes can
+ be minimised between passes. An implementation of this functor should
+ order passes so that the elements that you want to keep constant are
+ sorted next to each other.
+ @see Pass::setHashFunc
+ */
+ struct HashFunc
+ {
+ virtual uint32 operator()(const Pass* p) const = 0;
+ /// Need virtual destructor in case subclasses use it
+ virtual ~HashFunc() {}
+ };
+ protected:
+ Technique* mParent;
+ unsigned short mIndex; // pass index
+ String mName; // optional name for the pass
+ uint32 mHash; // pass hash
+ //-------------------------------------------------------------------------
+ // Colour properties, only applicable in fixed-function passes
+ ColourValue mAmbient;
+ ColourValue mDiffuse;
+ ColourValue mSpecular;
+ ColourValue mEmissive;
+ Real mShininess;
+ TrackVertexColourType mTracking;
+ //-------------------------------------------------------------------------
+
+ //-------------------------------------------------------------------------
+ // Blending factors
+ SceneBlendFactor mSourceBlendFactor;
+ SceneBlendFactor mDestBlendFactor;
+ //-------------------------------------------------------------------------
+
+ //-------------------------------------------------------------------------
+ // Depth buffer settings
+ bool mDepthCheck;
+ bool mDepthWrite;
+ CompareFunction mDepthFunc;
+ float mDepthBiasConstant;
+ float mDepthBiasSlopeScale;
+
+ // Colour buffer settings
+ bool mColourWrite;
+
+ // Alpha reject settings
+ CompareFunction mAlphaRejectFunc;
+ unsigned char mAlphaRejectVal;
+ //-------------------------------------------------------------------------
+
+ //-------------------------------------------------------------------------
+ // Culling mode
+ CullingMode mCullMode;
+ ManualCullingMode mManualCullMode;
+ //-------------------------------------------------------------------------
+
+ /// Lighting enabled?
+ bool mLightingEnabled;
+ /// Max simultaneous lights
+ unsigned short mMaxSimultaneousLights;
+ /// Starting light index
+ unsigned short mStartLight;
+ /// Run this pass once per light?
+ bool mIteratePerLight;
+ /// Iterate per how many lights?
+ unsigned short mLightsPerIteration;
+ // Should it only be run for a certain light type?
+ bool mRunOnlyForOneLightType;
+ Light::LightTypes mOnlyLightType;
+
+ /// Shading options
+ ShadeOptions mShadeOptions;
+ /// Polygon mode
+ PolygonMode mPolygonMode;
+
+ //-------------------------------------------------------------------------
+ // Fog
+ bool mFogOverride;
+ FogMode mFogMode;
+ ColourValue mFogColour;
+ Real mFogStart;
+ Real mFogEnd;
+ Real mFogDensity;
+ //-------------------------------------------------------------------------
+
+ /// Storage of texture unit states
+ typedef std::vector TextureUnitStates;
+ TextureUnitStates mTextureUnitStates;
+
+ // Vertex program details
+ GpuProgramUsage *mVertexProgramUsage;
+ // Vertex program details
+ GpuProgramUsage *mShadowCasterVertexProgramUsage;
+ // Vertex program details
+ GpuProgramUsage *mShadowReceiverVertexProgramUsage;
+ // Fragment program details
+ GpuProgramUsage *mFragmentProgramUsage;
+ // Fragment program details
+ GpuProgramUsage *mShadowReceiverFragmentProgramUsage;
+ // Is this pass queued for deletion?
+ bool mQueuedForDeletion;
+ // number of pass iterations to perform
+ size_t mPassIterationCount;
+ // point size, applies when not using per-vertex point size
+ Real mPointSize;
+ Real mPointMinSize;
+ Real mPointMaxSize;
+ bool mPointSpritesEnabled;
+ bool mPointAttenuationEnabled;
+ // constant, linear, quadratic coeffs
+ Real mPointAttenuationCoeffs[3];
+ // TU Content type lookups
+ typedef std::vector ContentTypeLookup;
+ mutable ContentTypeLookup mShadowContentTypeLookup;
+ mutable bool mContentTypeLookupBuilt;
+
+ public:
+ typedef std::set PassSet;
+ protected:
+ /// List of Passes whose hashes need recalculating
+ static PassSet msDirtyHashList;
+ /// The place where passes go to die
+ static PassSet msPassGraveyard;
+ /// The Pass hash functor
+ static HashFunc* msHashFunc;
+ public:
+ OGRE_STATIC_MUTEX(msDirtyHashListMutex);
+ OGRE_STATIC_MUTEX(msPassGraveyardMutex);
+ /// Default constructor
+ Pass(Technique* parent, unsigned short index);
+ /// Copy constructor
+ Pass(Technique* parent, unsigned short index, const Pass& oth );
+ /// Operator = overload
+ Pass& operator=(const Pass& oth);
+ ~Pass();
+
+ /// Returns true if this pass is programmable ie includes either a vertex or fragment program.
+ bool isProgrammable(void) const { return mVertexProgramUsage || mFragmentProgramUsage; }
+ /// Returns true if this pass uses a programmable vertex pipeline
+ bool hasVertexProgram(void) const { return mVertexProgramUsage != NULL; }
+ /// Returns true if this pass uses a programmable fragment pipeline
+ bool hasFragmentProgram(void) const { return mFragmentProgramUsage != NULL; }
+ /// Returns true if this pass uses a shadow caster vertex program
+ bool hasShadowCasterVertexProgram(void) const { return mShadowCasterVertexProgramUsage != NULL; }
+ /// Returns true if this pass uses a shadow receiver vertex program
+ bool hasShadowReceiverVertexProgram(void) const { return mShadowReceiverVertexProgramUsage != NULL; }
+ /// Returns true if this pass uses a shadow receiver fragment program
+ bool hasShadowReceiverFragmentProgram(void) const { return mShadowReceiverFragmentProgramUsage != NULL; }
+
+
+ /// Gets the index of this Pass in the parent Technique
+ unsigned short getIndex(void) const { return mIndex; }
+ /* Set the name of the pass
+ @remarks
+ The name of the pass is optional. Its usefull in material scripts where a material could inherit
+ from another material and only want to modify a particalar pass.
+ */
+ void setName(const String& name);
+ /// get the name of the pass
+ const String& getName(void) const { return mName; }
+
+ /** Sets the ambient colour reflectance properties of this pass.
+ @remarks
+ The base colour of a pass is determined by how much red, green and blue light is reflects
+ (provided texture layer #0 has a blend mode other than LBO_REPLACE). This property determines how
+ much ambient light (directionless global light) is reflected. The default is full white, meaning
+ objects are completely globally illuminated. Reduce this if you want to see diffuse or specular light
+ effects, or change the blend of colours to make the object have a base colour other than white.
+ @note
+ This setting has no effect if dynamic lighting is disabled (see Pass::setLightingEnabled),
+ or if this is a programmable pass.
+ */
+ void setAmbient(Real red, Real green, Real blue);
+
+ /** Sets the ambient colour reflectance properties of this pass.
+ @remarks
+ The base colour of a pass is determined by how much red, green and blue light is reflects
+ (provided texture layer #0 has a blend mode other than LBO_REPLACE). This property determines how
+ much ambient light (directionless global light) is reflected. The default is full white, meaning
+ objects are completely globally illuminated. Reduce this if you want to see diffuse or specular light
+ effects, or change the blend of colours to make the object have a base colour other than white.
+ @note
+ This setting has no effect if dynamic lighting is disabled (see Pass::setLightingEnabled),
+ or if this is a programmable pass.
+ */
+
+ void setAmbient(const ColourValue& ambient);
+
+ /** Sets the diffuse colour reflectance properties of this pass.
+ @remarks
+ The base colour of a pass is determined by how much red, green and blue light is reflects
+ (provided texture layer #0 has a blend mode other than LBO_REPLACE). This property determines how
+ much diffuse light (light from instances of the Light class in the scene) is reflected. The default
+ is full white, meaning objects reflect the maximum white light they can from Light objects.
+ @note
+ This setting has no effect if dynamic lighting is disabled (see Pass::setLightingEnabled),
+ or if this is a programmable pass.
+ */
+ void setDiffuse(Real red, Real green, Real blue, Real alpha);
+
+ /** Sets the diffuse colour reflectance properties of this pass.
+ @remarks
+ The base colour of a pass is determined by how much red, green and blue light is reflects
+ (provided texture layer #0 has a blend mode other than LBO_REPLACE). This property determines how
+ much diffuse light (light from instances of the Light class in the scene) is reflected. The default
+ is full white, meaning objects reflect the maximum white light they can from Light objects.
+ @note
+ This setting has no effect if dynamic lighting is disabled (see Pass::setLightingEnabled),
+ or if this is a programmable pass.
+ */
+ void setDiffuse(const ColourValue& diffuse);
+
+ /** Sets the specular colour reflectance properties of this pass.
+ @remarks
+ The base colour of a pass is determined by how much red, green and blue light is reflects
+ (provided texture layer #0 has a blend mode other than LBO_REPLACE). This property determines how
+ much specular light (highlights from instances of the Light class in the scene) is reflected.
+ The default is to reflect no specular light.
+ @note
+ The size of the specular highlights is determined by the separate 'shininess' property.
+ @note
+ This setting has no effect if dynamic lighting is disabled (see Pass::setLightingEnabled),
+ or if this is a programmable pass.
+ */
+ void setSpecular(Real red, Real green, Real blue, Real alpha);
+
+ /** Sets the specular colour reflectance properties of this pass.
+ @remarks
+ The base colour of a pass is determined by how much red, green and blue light is reflects
+ (provided texture layer #0 has a blend mode other than LBO_REPLACE). This property determines how
+ much specular light (highlights from instances of the Light class in the scene) is reflected.
+ The default is to reflect no specular light.
+ @note
+ The size of the specular highlights is determined by the separate 'shininess' property.
+ @note
+ This setting has no effect if dynamic lighting is disabled (see Pass::setLightingEnabled),
+ or if this is a programmable pass.
+ */
+ void setSpecular(const ColourValue& specular);
+
+ /** Sets the shininess of the pass, affecting the size of specular highlights.
+ @note
+ This setting has no effect if dynamic lighting is disabled (see Pass::setLightingEnabled),
+ or if this is a programmable pass.
+ */
+ void setShininess(Real val);
+
+ /** Sets the amount of self-illumination an object has.
+ @remarks
+ If an object is self-illuminating, it does not need external sources to light it, ambient or
+ otherwise. It's like the object has it's own personal ambient light. This property is rarely useful since
+ you can already specify per-pass ambient light, but is here for completeness.
+ @note
+ This setting has no effect if dynamic lighting is disabled (see Pass::setLightingEnabled),
+ or if this is a programmable pass.
+ */
+ void setSelfIllumination(Real red, Real green, Real blue);
+
+ /** Sets the amount of self-illumination an object has.
+ @remarks
+ If an object is self-illuminating, it does not need external sources to light it, ambient or
+ otherwise. It's like the object has it's own personal ambient light. This property is rarely useful since
+ you can already specify per-pass ambient light, but is here for completeness.
+ @note
+ This setting has no effect if dynamic lighting is disabled (see Pass::setLightingEnabled),
+ or if this is a programmable pass.
+ */
+ void setSelfIllumination(const ColourValue& selfIllum);
+
+ /** Sets which material properties follow the vertex colour
+ */
+ void setVertexColourTracking(TrackVertexColourType tracking);
+
+ /** Gets the point size of the pass.
+ @remarks
+ This property determines what point size is used to render a point
+ list.
+ */
+ Real getPointSize(void) const;
+
+ /** Sets the point size of this pass.
+ @remarks
+ This setting allows you to change the size of points when rendering
+ a point list, or a list of point sprites. The interpretation of this
+ command depends on the Pass::setPointSizeAttenuation option - if it
+ is off (the default), the point size is in screen pixels, if it is on,
+ it expressed as normalised screen coordinates (1.0 is the height of
+ the screen) when the point is at the origin.
+ @note
+ Some drivers have an upper limit on the size of points they support
+ - this can even vary between APIs on the same card! Don't rely on
+ point sizes that cause the point sprites to get very large on screen,
+ since they may get clamped on some cards. Upper sizes can range from
+ 64 to 256 pixels.
+ */
+ void setPointSize(Real ps);
+
+ /** Sets whether or not rendering points using OT_POINT_LIST will
+ render point sprites (textured quads) or plain points (dots).
+ @param enabled True enables point sprites, false returns to normal
+ point rendering.
+ */
+ void setPointSpritesEnabled(bool enabled);
+
+ /** Returns whether point sprites are enabled when rendering a
+ point list.
+ */
+ bool getPointSpritesEnabled(void) const;
+
+ /** Sets how points are attenuated with distance.
+ @remarks
+ When performing point rendering or point sprite rendering,
+ point size can be attenuated with distance. The equation for
+ doing this is attenuation = 1 / (constant + linear * dist + quadratic * d^2).
+ @par
+ For example, to disable distance attenuation (constant screensize)
+ you would set constant to 1, and linear and quadratic to 0. A
+ standard perspective attenuation would be 0, 1, 0 respectively.
+ @note
+ The resulting size is clamped to the minimum and maximum point
+ size.
+ @param enabled Whether point attenuation is enabled
+ @param constant, linear, quadratic Parameters to the attentuation
+ function defined above
+ */
+ void setPointAttenuation(bool enabled,
+ Real constant = 0.0f, Real linear = 1.0f, Real quadratic = 0.0f);
+
+ /** Returns whether points are attenuated with distance. */
+ bool isPointAttenuationEnabled(void) const;
+
+ /** Returns the constant coefficient of point attenuation. */
+ Real getPointAttenuationConstant(void) const;
+ /** Returns the linear coefficient of point attenuation. */
+ Real getPointAttenuationLinear(void) const;
+ /** Returns the quadratic coefficient of point attenuation. */
+ Real getPointAttenuationQuadratic(void) const;
+
+ /** Set the minimum point size, when point attenuation is in use. */
+ void setPointMinSize(Real min);
+ /** Get the minimum point size, when point attenuation is in use. */
+ Real getPointMinSize(void) const;
+ /** Set the maximum point size, when point attenuation is in use.
+ @remarks Setting this to 0 indicates the max size supported by the card.
+ */
+ void setPointMaxSize(Real max);
+ /** Get the maximum point size, when point attenuation is in use.
+ @remarks 0 indicates the max size supported by the card.
+ */
+ Real getPointMaxSize(void) const;
+
+ /** Gets the ambient colour reflectance of the pass.
+ */
+ const ColourValue& getAmbient(void) const;
+
+ /** Gets the diffuse colour reflectance of the pass.
+ */
+ const ColourValue& getDiffuse(void) const;
+
+ /** Gets the specular colour reflectance of the pass.
+ */
+ const ColourValue& getSpecular(void) const;
+
+ /** Gets the self illumination colour of the pass.
+ */
+ const ColourValue& getSelfIllumination(void) const;
+
+ /** Gets the 'shininess' property of the pass (affects specular highlights).
+ */
+ Real getShininess(void) const;
+
+ /** Gets which material properties follow the vertex colour
+ */
+ TrackVertexColourType getVertexColourTracking(void) const;
+
+ /** Inserts a new TextureUnitState object into the Pass.
+ @remarks
+ This unit is is added on top of all previous units.
+ */
+ TextureUnitState* createTextureUnitState(void);
+ /** Inserts a new TextureUnitState object into the Pass.
+ @remarks
+ This unit is is added on top of all previous units.
+ @param
+ name The basic name of the texture e.g. brickwall.jpg, stonefloor.png
+ @param
+ texCoordSet The index of the texture coordinate set to use.
+ @note
+ Applies to both fixed-function and programmable passes.
+ */
+ TextureUnitState* createTextureUnitState( const String& textureName, unsigned short texCoordSet = 0);
+ /** Adds the passed in TextureUnitState, to the existing Pass.
+ @param
+ state The Texture Unit State to be attached to this pass. It must not be attached to another pass.
+ @note
+ Throws an exception if the TextureUnitState is attached to another Pass.*/
+ void addTextureUnitState(TextureUnitState* state);
+ /** Retrieves a pointer to a texture unit state so it may be modified.
+ */
+ TextureUnitState* getTextureUnitState(unsigned short index);
+ /** Retrieves the Texture Unit State matching name.
+ Returns 0 if name match is not found.
+ */
+ TextureUnitState* getTextureUnitState(const String& name);
+ /** Retrieves a const pointer to a texture unit state.
+ */
+ const TextureUnitState* getTextureUnitState(unsigned short index) const;
+ /** Retrieves the Texture Unit State matching name.
+ Returns 0 if name match is not found.
+ */
+ const TextureUnitState* getTextureUnitState(const String& name) const;
+
+ /** Retrieve the index of the Texture Unit State in the pass.
+ @param
+ state The Texture Unit State this is attached to this pass.
+ @note
+ Throws an exception if the state is not attached to the pass.
+ */
+ unsigned short getTextureUnitStateIndex(const TextureUnitState* state) const;
+
+ typedef VectorIterator TextureUnitStateIterator;
+ /** Get an iterator over the TextureUnitStates contained in this Pass. */
+ TextureUnitStateIterator getTextureUnitStateIterator(void);
+
+ typedef ConstVectorIterator ConstTextureUnitStateIterator;
+ /** Get an iterator over the TextureUnitStates contained in this Pass. */
+ ConstTextureUnitStateIterator getTextureUnitStateIterator(void) const;
+
+ /** Removes the indexed texture unit state from this pass.
+ @remarks
+ Note that removing a texture which is not the topmost will have a larger performance impact.
+ */
+ void removeTextureUnitState(unsigned short index);
+
+ /** Removes all texture unit settings.
+ */
+ void removeAllTextureUnitStates(void);
+
+ /** Returns the number of texture unit settings.
+ */
+ unsigned short getNumTextureUnitStates(void) const
+ {
+ return static_cast(mTextureUnitStates.size());
+ }
+
+ /** Sets the kind of blending this pass has with the existing contents of the scene.
+ @remarks
+ Wheras the texture blending operations seen in the TextureUnitState class are concerned with
+ blending between texture layers, this blending is about combining the output of the Pass
+ as a whole with the existing contents of the rendering target. This blending therefore allows
+ object transparency and other special effects. If all passes in a technique have a scene
+ blend, then the whole technique is considered to be transparent.
+ @par
+ This method allows you to select one of a number of predefined blending types. If you require more
+ control than this, use the alternative version of this method which allows you to specify source and
+ destination blend factors.
+ @note
+ This method is applicable for both the fixed-function and programmable pipelines.
+ @param
+ sbt One of the predefined SceneBlendType blending types
+ */
+ void setSceneBlending( const SceneBlendType sbt );
+
+ /** Allows very fine control of blending this Pass with the existing contents of the scene.
+ @remarks
+ Wheras the texture blending operations seen in the TextureUnitState class are concerned with
+ blending between texture layers, this blending is about combining the output of the material
+ as a whole with the existing contents of the rendering target. This blending therefore allows
+ object transparency and other special effects.
+ @par
+ This version of the method allows complete control over the blending operation, by specifying the
+ source and destination blending factors. The result of the blending operation is:
+
+ final = (texture * sourceFactor) + (pixel * destFactor)
+
+ @par
+ Each of the factors is specified as one of a number of options, as specified in the SceneBlendFactor
+ enumerated type.
+ @param
+ sourceFactor The source factor in the above calculation, i.e. multiplied by the texture colour components.
+ @param
+ destFactor The destination factor in the above calculation, i.e. multiplied by the pixel colour components.
+ @note
+ This method is applicable for both the fixed-function and programmable pipelines.
+ */
+ void setSceneBlending( const SceneBlendFactor sourceFactor, const SceneBlendFactor destFactor);
+
+ /** Retrieves the source blending factor for the material (as set using Materiall::setSceneBlending).
+ */
+ SceneBlendFactor getSourceBlendFactor() const;
+
+ /** Retrieves the destination blending factor for the material (as set using Materiall::setSceneBlending).
+ */
+ SceneBlendFactor getDestBlendFactor() const;
+
+ /** Returns true if this pass has some element of transparency. */
+ bool isTransparent(void) const;
+
+ /** Sets whether or not this pass renders with depth-buffer checking on or not.
+ @remarks
+ If depth-buffer checking is on, whenever a pixel is about to be written to the frame buffer
+ the depth buffer is checked to see if the pixel is in front of all other pixels written at that
+ point. If not, the pixel is not written.
+ @par
+ If depth checking is off, pixels are written no matter what has been rendered before.
+ Also see setDepthFunction for more advanced depth check configuration.
+ @see
+ setDepthFunction
+ */
+ void setDepthCheckEnabled(bool enabled);
+
+ /** Returns whether or not this pass renders with depth-buffer checking on or not.
+ @see
+ setDepthCheckEnabled
+ */
+ bool getDepthCheckEnabled(void) const;
+
+ /** Sets whether or not this pass renders with depth-buffer writing on or not.
+ @remarks
+ If depth-buffer writing is on, whenever a pixel is written to the frame buffer
+ the depth buffer is updated with the depth value of that new pixel, thus affecting future
+ rendering operations if future pixels are behind this one.
+ @par
+ If depth writing is off, pixels are written without updating the depth buffer Depth writing should
+ normally be on but can be turned off when rendering static backgrounds or when rendering a collection
+ of transparent objects at the end of a scene so that they overlap each other correctly.
+ */
+ void setDepthWriteEnabled(bool enabled);
+
+ /** Returns whether or not this pass renders with depth-buffer writing on or not.
+ @see
+ setDepthWriteEnabled
+ */
+ bool getDepthWriteEnabled(void) const;
+
+ /** Sets the function used to compare depth values when depth checking is on.
+ @remarks
+ If depth checking is enabled (see setDepthCheckEnabled) a comparison occurs between the depth
+ value of the pixel to be written and the current contents of the buffer. This comparison is
+ normally CMPF_LESS_EQUAL, i.e. the pixel is written if it is closer (or at the same distance)
+ than the current contents. If you wish you can change this comparison using this method.
+ */
+ void setDepthFunction( CompareFunction func );
+ /** Returns the function used to compare depth values when depth checking is on.
+ @see
+ setDepthFunction
+ */
+ CompareFunction getDepthFunction(void) const;
+
+ /** Sets whether or not colour buffer writing is enabled for this Pass.
+ @remarks
+ For some effects, you might wish to turn off the colour write operation
+ when rendering geometry; this means that only the depth buffer will be
+ updated (provided you have depth buffer writing enabled, which you
+ probably will do, although you may wish to only update the stencil
+ buffer for example - stencil buffer state is managed at the RenderSystem
+ level only, not the Material since you are likely to want to manage it
+ at a higher level).
+ */
+ void setColourWriteEnabled(bool enabled);
+ /** Determines if colour buffer writing is enabled for this pass. */
+ bool getColourWriteEnabled(void) const;
+
+ /** Sets the culling mode for this pass based on the 'vertex winding'.
+ @remarks
+ A typical way for the rendering engine to cull triangles is based on the 'vertex winding' of
+ triangles. Vertex winding refers to the direction in which the vertices are passed or indexed
+ to in the rendering operation as viewed from the camera, and will wither be clockwise or
+ anticlockwise (that's 'counterclockwise' for you Americans out there ;) The default is
+ CULL_CLOCKWISE i.e. that only triangles whose vertices are passed/indexed in anticlockwise order
+ are rendered - this is a common approach and is used in 3D studio models for example. You can
+ alter this culling mode if you wish but it is not advised unless you know what you are doing.
+ @par
+ You may wish to use the CULL_NONE option for mesh data that you cull yourself where the vertex
+ winding is uncertain.
+ */
+ void setCullingMode( CullingMode mode );
+
+ /** Returns the culling mode for geometry rendered with this pass. See setCullingMode for more information.
+ */
+ CullingMode getCullingMode(void) const;
+
+ /** Sets the manual culling mode, performed by CPU rather than hardware.
+ @pemarks
+ In some situations you want to use manual culling of triangles rather than sending the
+ triangles to the hardware and letting it cull them. This setting only takes effect on SceneManager's
+ that use it (since it is best used on large groups of planar world geometry rather than on movable
+ geometry since this would be expensive), but if used can cull geometry before it is sent to the
+ hardware.
+ @note
+ The default for this setting is MANUAL_CULL_BACK.
+ @param
+ mode The mode to use - see enum ManualCullingMode for details
+
+ */
+ void setManualCullingMode( ManualCullingMode mode );
+
+ /** Retrieves the manual culling mode for this pass
+ @see
+ setManualCullingMode
+ */
+ ManualCullingMode getManualCullingMode(void) const;
+
+ /** Sets whether or not dynamic lighting is enabled.
+ @param
+ enabled
+ If true, dynamic lighting is performed on geometry with normals supplied, geometry without
+ normals will not be displayed.
+ @par
+ If false, no lighting is applied and all geometry will be full brightness.
+ */
+ void setLightingEnabled(bool enabled);
+
+ /** Returns whether or not dynamic lighting is enabled.
+ */
+ bool getLightingEnabled(void) const;
+
+ /** Sets the maximum number of lights to be used by this pass.
+ @remarks
+ During rendering, if lighting is enabled (or if the pass uses an automatic
+ program parameter based on a light) the engine will request the nearest lights
+ to the object being rendered in order to work out which ones to use. This
+ parameter sets the limit on the number of lights which should apply to objects
+ rendered with this pass.
+ */
+ void setMaxSimultaneousLights(unsigned short maxLights);
+ /** Gets the maximum number of lights to be used by this pass. */
+ unsigned short getMaxSimultaneousLights(void) const;
+
+ /** Sets the light index that this pass will start at in the light list.
+ @remarks
+ Normally the lights passed to a pass will start from the beginning
+ of the light list for this object. This option allows you to make this
+ pass start from a higher light index, for example if one of your earlier
+ passes could deal with lights 0-3, and this pass dealt with lights 4+.
+ This option also has an interaction with pass iteration, in that
+ if you choose to iterate this pass per light too, the iteration will
+ only begin from light 4.
+ */
+ void setStartLight(unsigned short startLight);
+ /** Gets the light index that this pass will start at in the light list. */
+ unsigned short getStartLight(void) const;
+
+ /** Sets the type of light shading required
+ @note
+ The default shading method is Gouraud shading.
+ */
+ void setShadingMode( ShadeOptions mode );
+
+ /** Returns the type of light shading to be used.
+ */
+ ShadeOptions getShadingMode(void) const;
+
+ /** Sets the type of polygon rendering required
+ @note
+ The default shading method is Solid
+ */
+ void setPolygonMode( PolygonMode mode );
+
+ /** Returns the type of light shading to be used.
+ */
+ PolygonMode getPolygonMode(void) const;
+
+ /** Sets the fogging mode applied to this pass.
+ @remarks
+ Fogging is an effect that is applied as polys are rendered. Sometimes, you want
+ fog to be applied to an entire scene. Other times, you want it to be applied to a few
+ polygons only. This pass-level specification of fog parameters lets you easily manage
+ both.
+ @par
+ The SceneManager class also has a setFog method which applies scene-level fog. This method
+ lets you change the fog behaviour for this pass compared to the standard scene-level fog.
+ @param
+ overrideScene If true, you authorise this pass to override the scene's fog params with it's own settings.
+ If you specify false, so other parameters are necessary, and this is the default behaviour for passs.
+ @param
+ mode Only applicable if overrideScene is true. You can disable fog which is turned on for the
+ rest of the scene by specifying FOG_NONE. Otherwise, set a pass-specific fog mode as
+ defined in the enum FogMode.
+ @param
+ colour The colour of the fog. Either set this to the same as your viewport background colour,
+ or to blend in with a skydome or skybox.
+ @param
+ expDensity The density of the fog in FOG_EXP or FOG_EXP2 mode, as a value between 0 and 1.
+ The default is 0.001.
+ @param
+ linearStart Distance in world units at which linear fog starts to encroach.
+ Only applicable if mode is FOG_LINEAR.
+ @param
+ linearEnd Distance in world units at which linear fog becomes completely opaque.
+ Only applicable if mode is FOG_LINEAR.
+ */
+ void setFog(
+ bool overrideScene,
+ FogMode mode = FOG_NONE,
+ const ColourValue& colour = ColourValue::White,
+ Real expDensity = 0.001, Real linearStart = 0.0, Real linearEnd = 1.0 );
+
+ /** Returns true if this pass is to override the scene fog settings.
+ */
+ bool getFogOverride(void) const;
+
+ /** Returns the fog mode for this pass.
+ @note
+ Only valid if getFogOverride is true.
+ */
+ FogMode getFogMode(void) const;
+
+ /** Returns the fog colour for the scene.
+ */
+ const ColourValue& getFogColour(void) const;
+
+ /** Returns the fog start distance for this pass.
+ @note
+ Only valid if getFogOverride is true.
+ */
+ Real getFogStart(void) const;
+
+ /** Returns the fog end distance for this pass.
+ @note
+ Only valid if getFogOverride is true.
+ */
+ Real getFogEnd(void) const;
+
+ /** Returns the fog density for this pass.
+ @note
+ Only valid if getFogOverride is true.
+ */
+ Real getFogDensity(void) const;
+
+ /** Sets the depth bias to be used for this material.
+ @remarks
+ When polygons are coplanar, you can get problems with 'depth fighting' where
+ the pixels from the two polys compete for the same screen pixel. This is particularly
+ a problem for decals (polys attached to another surface to represent details such as
+ bulletholes etc.).
+ @par
+ A way to combat this problem is to use a depth bias to adjust the depth buffer value
+ used for the decal such that it is slightly higher than the true value, ensuring that
+ the decal appears on top. There are two aspects to the biasing, a constant
+ bias value and a slope-relative biasing value, which varies according to the
+ maximum depth slope relative to the camera, ie:
+ finalBias = maxSlope * slopeScaleBias + constantBias
+ Note that slope scale bias, whilst more accurate, may be ignored by old hardware.
+ @param constantBias The constant bias value, expressed as a factor of the
+ minimum observable depth
+ @param slopeScaleBias The slope-relative bias value, expressed as a factor
+ of the depth slope
+ */
+ void setDepthBias(float constantBias, float slopeScaleBias = 0.0f);
+
+ /** Retrieves the const depth bias value as set by setDepthBias. */
+ float getDepthBiasConstant(void) const;
+ /** Retrieves the slope-scale depth bias value as set by setDepthBias. */
+ float getDepthBiasSlopeScale(void) const;
+
+ /** Sets the way the pass will have use alpha to totally reject pixels from the pipeline.
+ @remarks
+ The default is CMPF_ALWAYS_PASS i.e. alpha is not used to reject pixels.
+ @param func The comparison which must pass for the pixel to be written.
+ @param value 1 byte value against which alpha values will be tested(0-255)
+ @note
+ This option applies in both the fixed function and the programmable pipeline.
+ */
+ void setAlphaRejectSettings(CompareFunction func, unsigned char value);
+
+ /** Sets the alpha reject function. See setAlphaRejectSettings for more information.
+ */
+ void setAlphaRejectFunction(CompareFunction func);
+
+ /** Gets the alpha reject value. See setAlphaRejectSettings for more information.
+ */
+ void setAlphaRejectValue(unsigned char val);
+
+ /** Gets the alpha reject function. See setAlphaRejectSettings for more information.
+ */
+ CompareFunction getAlphaRejectFunction(void) const { return mAlphaRejectFunc; }
+
+ /** Gets the alpha reject value. See setAlphaRejectSettings for more information.
+ */
+ unsigned char getAlphaRejectValue(void) const { return mAlphaRejectVal; }
+ /** Sets whether or not this pass should iterate per light or number of
+ lights which can affect the object being rendered.
+ @remarks
+ The default behaviour for a pass (when this option is 'false'), is
+ for a pass to be rendered only once (or the number of times set in
+ setPassIterationCount), with all the lights which could
+ affect this object set at the same time (up to the maximum lights
+ allowed in the render system, which is typically 8).
+ @par
+ Setting this option to 'true' changes this behaviour, such that
+ instead of trying to issue render this pass once per object, it
+ is run per light, or for a group of 'n' lights each time
+ which can affect this object, the number of
+ times set in setPassIterationCount (default is once). In
+ this case, only light index 0 is ever used, and is a different light
+ every time the pass is issued, up to the total number of lights
+ which is affecting this object. This has 2 advantages:
+ - There is no limit on the number of lights which can be
+ supported
+ - It's easier to write vertex / fragment programs for this because
+ a single program can be used for any number of lights
+
+ However, this technique is more expensive, and typically you
+ will want an additional ambient pass, because if no lights are
+ affecting the object it will not be rendered at all, which will look
+ odd even if ambient light is zero (imagine if there are lit objects
+ behind it - the objects silhouette would not show up). Therefore,
+ use this option with care, and you would be well advised to provide
+ a less expensive fallback technique for use in the distance.
+ @note
+ The number of times this pass runs is still limited by the maximum
+ number of lights allowed as set in setMaxSimultaneousLights, so
+ you will never get more passes than this. Also, the iteration is
+ started from the 'start light' as set in Pass::setStartLight, and
+ the number of passes is the number of lights to iterate over divided
+ by the number of lights per iteration (default 1, set by
+ setLightCountPerIteration).
+ @param enabled Whether this feature is enabled
+ @param onlyForOneLightType If true, the pass will only be run for a single type
+ of light, other light types will be ignored.
+ @param lightType The single light type which will be considered for this pass
+ */
+ void setIteratePerLight(bool enabled,
+ bool onlyForOneLightType = true, Light::LightTypes lightType = Light::LT_POINT);
+
+ /** Does this pass run once for every light in range? */
+ bool getIteratePerLight(void) const { return mIteratePerLight; }
+ /** Does this pass run only for a single light type (if getIteratePerLight is true). */
+ bool getRunOnlyForOneLightType(void) const { return mRunOnlyForOneLightType; }
+ /** Gets the single light type this pass runs for if getIteratePerLight and
+ getRunOnlyForOneLightType are both true. */
+ Light::LightTypes getOnlyLightType() const { return mOnlyLightType; }
+
+ /** If light iteration is enabled, determine the number of lights per
+ iteration.
+ @remarks
+ The default for this setting is 1, so if you enable light iteration
+ (Pass::setIteratePerLight), the pass is rendered once per light. If
+ you set this value higher, the passes will occur once per 'n' lights.
+ The start of the iteration is set by Pass::setStartLight and the end
+ by Pass::setMaxSimultaneousLights.
+ */
+ void setLightCountPerIteration(unsigned short c);
+ /** If light iteration is enabled, determine the number of lights per
+ iteration.
+ */
+ unsigned short getLightCountPerIteration(void) const;
+
+ /// Gets the parent Technique
+ Technique* getParent(void) const { return mParent; }
+
+ /// Gets the resource group of the ultimate parent Material
+ const String& getResourceGroup(void) const;
+
+ /** Sets the details of the vertex program to use.
+ @remarks
+ Only applicable to programmable passes, this sets the details of
+ the vertex program to use in this pass. The program will not be
+ loaded until the parent Material is loaded.
+ @param name The name of the program - this must have been
+ created using GpuProgramManager by the time that this Pass
+ is loaded. If this parameter is blank, any vertex program in this pass is disabled.
+ @param resetParams
+ If true, this will create a fresh set of parameters from the
+ new program being linked, so if you had previously set parameters
+ you will have to set them again. If you set this to false, you must
+ be absolutely sure that the parameters match perfectly, and in the
+ case of named parameters refers to the indexes underlying them,
+ not just the names.
+ */
+ void setVertexProgram(const String& name, bool resetParams = true);
+ /** Sets the vertex program parameters.
+ @remarks
+ Only applicable to programmable passes, and this particular call is
+ designed for low-level programs; use the named parameter methods
+ for setting high-level program parameters.
+ */
+ void setVertexProgramParameters(GpuProgramParametersSharedPtr params);
+ /** Gets the name of the vertex program used by this pass. */
+ const String& getVertexProgramName(void) const;
+ /** Gets the vertex program parameters used by this pass. */
+ GpuProgramParametersSharedPtr getVertexProgramParameters(void) const;
+ /** Gets the vertex program used by this pass, only available after _load(). */
+ const GpuProgramPtr& getVertexProgram(void) const;
+
+
+ /** Sets the details of the vertex program to use when rendering as a
+ shadow caster.
+ @remarks
+ Texture-based shadows require that the caster is rendered to a texture
+ in a solid colour (the shadow colour in the case of modulative texture
+ shadows). Whilst Ogre can arrange this for the fixed function
+ pipeline, passes which use vertex programs might need the vertex
+ programs still to run in order to preserve any deformation etc
+ that it does. However, lighting calculations must be a lot simpler,
+ with only the ambient colour being used (which the engine will ensure
+ is bound to the shadow colour).
+ @par
+ Therefore, it is up to implemetors of vertex programs to provide an
+ alternative vertex program which can be used to render the object
+ to a shadow texture. Do all the same vertex transforms, but set the
+ colour of the vertex to the ambient colour, as bound using the
+ standard auto parameter binding mechanism.
+ @note
+ Some vertex programs will work without doing this, because Ogre ensures
+ that all lights except for ambient are set black. However, the chances
+ are that your vertex program is doing a lot of unnecessary work in this
+ case, since the other lights are having no effect, and it is good practice
+ to supply an alternative.
+ @note
+ This is only applicable to programmable passes.
+ @par
+ The default behaviour is for Ogre to switch to fixed-function
+ rendering if an explict vertex program alternative is not set.
+ */
+ void setShadowCasterVertexProgram(const String& name);
+ /** Sets the vertex program parameters for rendering as a shadow caster.
+ @remarks
+ Only applicable to programmable passes, and this particular call is
+ designed for low-level programs; use the named parameter methods
+ for setting high-level program parameters.
+ */
+ void setShadowCasterVertexProgramParameters(GpuProgramParametersSharedPtr params);
+ /** Gets the name of the vertex program used by this pass when rendering shadow casters. */
+ const String& getShadowCasterVertexProgramName(void) const;
+ /** Gets the vertex program parameters used by this pass when rendering shadow casters. */
+ GpuProgramParametersSharedPtr getShadowCasterVertexProgramParameters(void) const;
+ /** Gets the vertex program used by this pass when rendering shadow casters,
+ only available after _load(). */
+ const GpuProgramPtr& getShadowCasterVertexProgram(void) const;
+
+ /** Sets the details of the vertex program to use when rendering as a
+ shadow receiver.
+ @remarks
+ Texture-based shadows require that the shadow receiver is rendered using
+ a projective texture. Whilst Ogre can arrange this for the fixed function
+ pipeline, passes which use vertex programs might need the vertex
+ programs still to run in order to preserve any deformation etc
+ that it does. So in this case, we need a vertex program which does the
+ appropriate vertex transformation, but generates projective texture
+ coordinates.
+ @par
+ Therefore, it is up to implemetors of vertex programs to provide an
+ alternative vertex program which can be used to render the object
+ as a shadow receiver. Do all the same vertex transforms, but generate
+ 2 sets of texture coordinates using the auto parameter
+ ACT_TEXTURE_VIEWPROJ_MATRIX, which Ogre will bind to the parameter name /
+ index you supply as the second parameter to this method. 2 texture
+ sets are needed because Ogre needs to use 2 texture units for some
+ shadow effects.
+ @note
+ This is only applicable to programmable passes.
+ @par
+ The default behaviour is for Ogre to switch to fixed-function
+ rendering if an explict vertex program alternative is not set.
+ */
+ void setShadowReceiverVertexProgram(const String& name);
+ /** Sets the vertex program parameters for rendering as a shadow receiver.
+ @remarks
+ Only applicable to programmable passes, and this particular call is
+ designed for low-level programs; use the named parameter methods
+ for setting high-level program parameters.
+ */
+ void setShadowReceiverVertexProgramParameters(GpuProgramParametersSharedPtr params);
+
+ /** This method allows you to specify a fragment program for use when
+ rendering a texture shadow receiver.
+ @remarks
+ Texture shadows are applied by rendering the receiver. Modulative texture
+ shadows are performed as a post-render darkening pass, and as such
+ fragment programs are generally not required per-object. Additive
+ texture shadows, however, are applied by accumulating light masked
+ out using a texture shadow (black & white by default, unless you
+ customise this using SceneManager::setCustomShadowCasterMaterial).
+ OGRE can do this for you for most materials, but if you use a custom
+ lighting program (e.g. per pixel lighting) then you'll need to provide
+ a custom version for receiving shadows. You don't need to provide
+ this for shadow casters if you don't use self-shadowing since they
+ will never be shadow receivers too.
+ @par
+ The shadow texture is always bound to texture unit 0 when rendering
+ texture shadow passes. Therefore your custom shadow receiver program
+ may well just need to shift it's texture unit usage up by one unit,
+ and take the shadow texture into account in its calculations.
+ */
+ void setShadowReceiverFragmentProgram(const String& name);
+ /** Sets the fragment program parameters for rendering as a shadow receiver.
+ @remarks
+ Only applicable to programmable passes, and this particular call is
+ designed for low-level programs; use the named parameter methods
+ for setting high-level program parameters.
+ */
+ void setShadowReceiverFragmentProgramParameters(GpuProgramParametersSharedPtr params);
+
+ /** Gets the name of the vertex program used by this pass when rendering shadow receivers. */
+ const String& getShadowReceiverVertexProgramName(void) const;
+ /** Gets the vertex program parameters used by this pass when rendering shadow receivers. */
+ GpuProgramParametersSharedPtr getShadowReceiverVertexProgramParameters(void) const;
+ /** Gets the vertex program used by this pass when rendering shadow receivers,
+ only available after _load(). */
+ const GpuProgramPtr& getShadowReceiverVertexProgram(void) const;
+
+ /** Gets the name of the fragment program used by this pass when rendering shadow receivers. */
+ const String& getShadowReceiverFragmentProgramName(void) const;
+ /** Gets the fragment program parameters used by this pass when rendering shadow receivers. */
+ GpuProgramParametersSharedPtr getShadowReceiverFragmentProgramParameters(void) const;
+ /** Gets the fragment program used by this pass when rendering shadow receivers,
+ only available after _load(). */
+ const GpuProgramPtr& getShadowReceiverFragmentProgram(void) const;
+
+ /** Sets the details of the fragment program to use.
+ @remarks
+ Only applicable to programmable passes, this sets the details of
+ the fragment program to use in this pass. The program will not be
+ loaded until the parent Material is loaded.
+ @param name The name of the program - this must have been
+ created using GpuProgramManager by the time that this Pass
+ is loaded. If this parameter is blank, any fragment program in this pass is disabled.
+ @param resetParams
+ If true, this will create a fresh set of parameters from the
+ new program being linked, so if you had previously set parameters
+ you will have to set them again. If you set this to false, you must
+ be absolutely sure that the parameters match perfectly, and in the
+ case of named parameters refers to the indexes underlying them,
+ not just the names.
+ */
+ void setFragmentProgram(const String& name, bool resetParams = true);
+ /** Sets the fragment program parameters.
+ @remarks
+ Only applicable to programmable passes.
+ */
+ void setFragmentProgramParameters(GpuProgramParametersSharedPtr params);
+ /** Gets the name of the fragment program used by this pass. */
+ const String& getFragmentProgramName(void) const;
+ /** Gets the fragment program parameters used by this pass. */
+ GpuProgramParametersSharedPtr getFragmentProgramParameters(void) const;
+ /** Gets the fragment program used by this pass, only available after _load(). */
+ const GpuProgramPtr& getFragmentProgram(void) const;
+
+ /** Splits this Pass to one which can be handled in the number of
+ texture units specified.
+ @remarks
+ Only works on non-programmable passes, programmable passes cannot be
+ split, it's up to the author to ensure that there is a fallback Technique
+ for less capable cards.
+ @param numUnits The target number of texture units
+ @returns A new Pass which contains the remaining units, and a scene_blend
+ setting appropriate to approximate the multitexture. This Pass will be
+ attached to the parent Technique of this Pass.
+ */
+ Pass* _split(unsigned short numUnits);
+
+ /** Internal method to adjust pass index. */
+ void _notifyIndex(unsigned short index);
+
+ /** Internal method for loading this pass. */
+ void _load(void);
+ /** Internal method for unloading this pass. */
+ void _unload(void);
+ // Is this loaded?
+ bool isLoaded(void) const;
+
+ /** Gets the 'hash' of this pass, ie a precomputed number to use for sorting
+ @remarks
+ This hash is used to sort passes, and for this reason the pass is hashed
+ using firstly its index (so that all passes are rendered in order), then
+ by the textures which it's TextureUnitState instances are using.
+ */
+ uint32 getHash(void) const { return mHash; }
+ /// Mark the hash as dirty
+ void _dirtyHash(void);
+ /** Internal method for recalculating the hash.
+ @remarks
+ Do not call this unless you are sure the old hash is not still being
+ used by anything. If in doubt, call _dirtyHash if you want to force
+ recalculation of the has next time.
+ */
+ void _recalculateHash(void);
+ /** Tells the pass that it needs recompilation. */
+ void _notifyNeedsRecompile(void);
+
+ /** Update any automatic parameters (except lights) on this pass */
+ void _updateAutoParamsNoLights(const AutoParamDataSource& source) const;
+ /** Update any automatic light parameters on this pass */
+ void _updateAutoParamsLightsOnly(const AutoParamDataSource& source) const;
+
+ /** Gets the 'nth' texture which references the given content type.
+ @remarks
+ If the 'nth' texture unit which references the content type doesn't
+ exist, then this method returns an arbitrary high-value outside the
+ valid range to index texture units.
+ */
+ unsigned short _getTextureUnitWithContentTypeIndex(
+ TextureUnitState::ContentType contentType, unsigned short index) const;
+
+ /** Set texture filtering for every texture unit
+ @note
+ This property actually exists on the TextureUnitState class
+ For simplicity, this method allows you to set these properties for
+ every current TeextureUnitState, If you need more precision, retrieve the
+ TextureUnitState instance and set the property there.
+ @see TextureUnitState::setTextureFiltering
+ */
+ void setTextureFiltering(TextureFilterOptions filterType);
+ /** Sets the anisotropy level to be used for all textures.
+ @note
+ This property has been moved to the TextureUnitState class, which is accessible via the
+ Technique and Pass. For simplicity, this method allows you to set these properties for
+ every current TeextureUnitState, If you need more precision, retrieve the Technique,
+ Pass and TextureUnitState instances and set the property there.
+ @see TextureUnitState::setTextureAnisotropy
+ */
+ void setTextureAnisotropy(unsigned int maxAniso);
+ /** Static method to retrieve all the Passes which need their
+ hash values recalculated.
+ */
+ static const PassSet& getDirtyHashList(void)
+ { return msDirtyHashList; }
+ /** Static method to retrieve all the Passes which are pending deletion.
+ */
+ static const PassSet& getPassGraveyard(void)
+ { return msPassGraveyard; }
+ /** Static method to reset the list of passes which need their hash
+ values recalculated.
+ @remarks
+ For performance, the dirty list is not updated progressively as
+ the hashes are recalculated, instead we expect the processor of the
+ dirty hash list to clear the list when they are done.
+ */
+ static void clearDirtyHashList(void);
+
+ /** Process all dirty and pending deletion passes. */
+ static void processPendingPassUpdates(void);
+
+ /** Queue this pass for deletion when appropriate. */
+ void queueForDeletion(void);
+
+ /** Returns whether this pass is ambient only.
+ */
+ bool isAmbientOnly(void) const;
+
+ /** set the number of iterations that this pass
+ should perform when doing fast multi pass operation.
+ @remarks
+ Only applicable for programmable passes.
+ @param count number of iterations to perform fast multi pass operations.
+ A value greater than 1 will cause the pass to be executed count number of
+ times without changing the render state. This is very usefull for passes
+ that use programmable shaders that have to iterate more than once but don't
+ need a render state change. Using multi pass can dramatically speed up rendering
+ for materials that do things like fur, blur.
+ A value of 1 turns off multi pass operation and the pass does
+ the normal pass operation.
+ */
+ void setPassIterationCount(const size_t count) { mPassIterationCount = count; }
+
+ /** Gets the pass iteration count value.
+ */
+ size_t getPassIterationCount(void) const { return mPassIterationCount; }
+
+ /** Applies texture names to Texture Unit State with matching texture name aliases.
+ All Texture Unit States within the pass are checked.
+ If matching texture aliases are found then true is returned.
+
+ @param
+ aliasList is a map container of texture alias, texture name pairs
+ @param
+ apply set true to apply the texture aliases else just test to see if texture alias matches are found.
+ @return
+ True if matching texture aliases were found in the pass.
+ */
+ bool applyTextureAliases(const AliasTextureNamePairList& aliasList, const bool apply = true) const;
+
+
+ /** There are some default hash functions used to order passes so that
+ render state changes are minimised, this enumerates them.
+ */
+ enum BuiltinHashFunction
+ {
+ /** Try to minimise the number of texture changes. */
+ MIN_TEXTURE_CHANGE,
+ /** Try to minimise the number of GPU program changes.
+ @note Only really useful if you use GPU programs for all of your
+ materials.
+ */
+ MIN_GPU_PROGRAM_CHANGE
+ };
+ /** Sets one of the default hash functions to be used.
+ @remarks
+ You absolutely must not change the hash function whilst any Pass instances
+ exist in the render queue. The only time you can do this is either
+ before you render anything, or directly after you manuall call
+ RenderQueue::clear(true) to completely destroy the queue structures.
+ The default is MIN_TEXTURE_CHANGE.
+ @note
+ You can also implement your own hash function, see the alternate version
+ of this method.
+ @see HashFunc
+ */
+ static void setHashFunction(BuiltinHashFunction builtin);
+
+ /** Set the hash function used for all passes.
+ @remarks
+ You absolutely must not change the hash function whilst any Pass instances
+ exist in the render queue. The only time you can do this is either
+ before you render anything, or directly after you manuall call
+ RenderQueue::clear(true) to completely destroy the queue structures.
+ @note
+ You can also use one of the built-in hash functions, see the alternate version
+ of this method. The default is MIN_TEXTURE_CHANGE.
+ @see HashFunc
+ */
+ static void setHashFunction(HashFunc* hashFunc) { msHashFunc = hashFunc; }
+
+ /** Get the hash function used for all passes.
+ */
+ static HashFunc* getHashFunction(void) { return msHashFunc; }
+
+ };
+
+ enum IlluminationStage
+ {
+ /// Part of the rendering which occurs without any kind of direct lighting
+ IS_AMBIENT,
+ /// Part of the rendering which occurs per light
+ IS_PER_LIGHT,
+ /// Post-lighting rendering
+ IS_DECAL
+ };
+ /** Struct recording a pass which can be used for a specific illumination stage.
+ @remarks
+ This structure is used to record categorised passes which fit into a
+ number of distinct illumination phases - ambient, diffuse / specular
+ (per-light) and decal (post-lighting texturing).
+ An original pass may fit into one of these categories already, or it
+ may require splitting into its component parts in order to be categorised
+ properly.
+ */
+ struct IlluminationPass
+ {
+ IlluminationStage stage;
+ /// The pass to use in this stage
+ Pass* pass;
+ /// Whether this pass is one which should be deleted itself
+ bool destroyOnShutdown;
+ /// The original pass which spawned this one
+ Pass* originalPass;
+ };
+
+ typedef std::vector IlluminationPassList;
+
+
+}
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgrePatchMesh.h b/school/informatik/verkerhssimulation/src/ogre/OgrePatchMesh.h
new file mode 100644
index 00000000..dd331c19
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgrePatchMesh.h
@@ -0,0 +1,152 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __PatchMesh_H__
+#define __PatchMesh_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreMesh.h"
+#include "OgrePatchSurface.h"
+
+namespace Ogre {
+
+ /** Patch specialisation of Mesh.
+ @remarks
+ Instances of this class should be created by calling MeshManager::createBezierPatch.
+ */
+ class _OgreExport PatchMesh : public Mesh
+ {
+ protected:
+ /// Internal surface definition
+ PatchSurface mSurface;
+ /// Vertex declaration, cloned from the input
+ VertexDeclaration* mDeclaration;
+ public:
+ /// Constructor
+ PatchMesh(ResourceManager* creator, const String& name, ResourceHandle handle,
+ const String& group);
+
+ /// Define the patch, as defined in MeshManager::createBezierPatch
+ void define(void* controlPointBuffer,
+ VertexDeclaration *declaration, size_t width, size_t height,
+ size_t uMaxSubdivisionLevel = PatchSurface::AUTO_LEVEL,
+ size_t vMaxSubdivisionLevel = PatchSurface::AUTO_LEVEL,
+ PatchSurface::VisibleSide visibleSide = PatchSurface::VS_FRONT,
+ HardwareBuffer::Usage vbUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY,
+ HardwareBuffer::Usage ibUsage = HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY,
+ bool vbUseShadow = false, bool ibUseShadow = false);
+
+ /* Sets the current subdivision level as a proportion of full detail.
+ @param factor Subdivision factor as a value from 0 (control points only) to 1 (maximum
+ subdivision). */
+ void setSubdivision(Real factor);
+ protected:
+ /// Overridden from Resource
+ void loadImpl(void);
+
+ };
+ /** Specialisation of SharedPtr to allow SharedPtr to be assigned to PatchMeshPtr
+ @note Has to be a subclass since we need operator=.
+ We could templatise this instead of repeating per Resource subclass,
+ except to do so requires a form VC6 does not support i.e.
+ ResourceSubclassPtr : public SharedPtr
+ */
+ class _OgreExport PatchMeshPtr : public SharedPtr
+ {
+ public:
+ PatchMeshPtr() : SharedPtr() {}
+ explicit PatchMeshPtr(PatchMesh* rep) : SharedPtr(rep) {}
+ PatchMeshPtr(const PatchMeshPtr& r) : SharedPtr(r) {}
+ PatchMeshPtr(const ResourcePtr& r) : SharedPtr()
+ {
+ // lock & copy other mutex pointer
+ OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
+ {
+ OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+ OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+ pRep = static_cast(r.getPointer());
+ pUseCount = r.useCountPointer();
+ if (pUseCount)
+ {
+ ++(*pUseCount);
+ }
+ }
+ }
+
+ /// Operator used to convert a ResourcePtr to a PatchMeshPtr
+ PatchMeshPtr& operator=(const ResourcePtr& r)
+ {
+ if (pRep == static_cast(r.getPointer()))
+ return *this;
+ release();
+
+ OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
+ {
+ // lock & copy other mutex pointer
+ OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+ OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+ pRep = static_cast(r.getPointer());
+ pUseCount = r.useCountPointer();
+ if (pUseCount)
+ {
+ ++(*pUseCount);
+ }
+ }
+ else
+ {
+ // RHS must be a null pointer
+ assert(r.isNull() && "RHS must be null if it has no mutex!");
+ setNull();
+ }
+ return *this;
+ }
+ /// Operator used to convert a MeshPtr to a PatchMeshPtr
+ PatchMeshPtr& operator=(const MeshPtr& r)
+ {
+ if (pRep == static_cast(r.getPointer()))
+ return *this;
+ release();
+ // lock & copy other mutex pointer
+ OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
+ {
+ OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
+ OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
+ pRep = static_cast(r.getPointer());
+ pUseCount = r.useCountPointer();
+ if (pUseCount)
+ {
+ ++(*pUseCount);
+ }
+ }
+ return *this;
+ }
+ };
+
+}
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgrePatchSurface.h b/school/informatik/verkerhssimulation/src/ogre/OgrePatchSurface.h
new file mode 100644
index 00000000..cb5aa5b2
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgrePatchSurface.h
@@ -0,0 +1,233 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __PatchSurface_H__
+#define __PatchSurface_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreVector3.h"
+#include "OgreString.h"
+#include "OgreRenderOperation.h"
+#include "OgreAxisAlignedBox.h"
+
+namespace Ogre {
+
+ /** A surface which is defined by curves of some kind to form a patch, e.g. a Bezier patch.
+ @remarks
+ This object will take a list of control points with various assorted data, and will
+ subdivide it into a patch mesh. Currently only Bezier curves are supported for defining
+ the surface, but other techniques such as NURBS would follow the same basic approach.
+ */
+ class _OgreExport PatchSurface
+ {
+ public:
+ PatchSurface();
+ ~PatchSurface();
+
+ enum PatchSurfaceType
+ {
+ /// A patch defined by a set of bezier curves
+ PST_BEZIER
+ };
+
+ /// Constant for indicating automatic determination of subdivision level for patches
+ enum
+ {
+ AUTO_LEVEL = -1
+ };
+
+ enum VisibleSide {
+ /// The side from which u goes right and v goes up (as in texture coords)
+ VS_FRONT,
+ /// The side from which u goes right and v goes down (reverse of texture coords)
+ VS_BACK,
+ /// Both sides are visible - warning this creates 2x the number of triangles and adds extra overhead for calculating normals
+ VS_BOTH
+ };
+ /** Sets up the surface by defining it's control points, type and initial subdivision level.
+ @remarks
+ This method initialises the surface by passing it a set of control points. The type of curves to be used
+ are also defined here, although the only supported option currently is a bezier patch. You can also
+ specify a global subdivision level here if you like, although it is recommended that the parameter
+ is left as AUTO_LEVEL, which means the system decides how much subdivision is required (based on the
+ curvature of the surface)
+ @param
+ controlPointBuffer A pointer to a buffer containing the vertex data which defines control points
+ of the curves rather than actual vertices. Note that you are expected to provide not
+ just position information, but potentially normals and texture coordinates too. The
+ format of the buffer is defined in the VertexDeclaration parameter
+ @param
+ decaration VertexDeclaration describing the contents of the buffer.
+ Note this declaration must _only_ draw on buffer source 0!
+ @param
+ width Specifies the width of the patch in control points.
+ @param
+ height Specifies the height of the patch in control points.
+ @param
+ pType The type of surface - currently only PST_BEZIER is supported
+ @param
+ uMaxSubdivisionLevel,vMaxSubdivisionLevel If you want to manually set the top level of subdivision,
+ do it here, otherwise let the system decide.
+ @param
+ visibleSide Determines which side of the patch (or both) triangles are generated for.
+ */
+ void defineSurface(void* controlPointBuffer,
+ VertexDeclaration *declaration, size_t width, size_t height,
+ PatchSurfaceType pType = PST_BEZIER,
+ size_t uMaxSubdivisionLevel = AUTO_LEVEL, size_t vMaxSubdivisionLevel = AUTO_LEVEL,
+ VisibleSide visibleSide = VS_FRONT);
+
+ /** Based on a previous call to defineSurface, establishes the number of vertices required
+ to hold this patch at the maximum detail level.
+ @remarks This is useful when you wish to build the patch into external vertex / index buffers.
+
+ */
+ size_t getRequiredVertexCount(void) const;
+ /** Based on a previous call to defineSurface, establishes the number of indexes required
+ to hold this patch at the maximum detail level.
+ @remarks This is useful when you wish to build the patch into external vertex / index buffers.
+
+ */
+ size_t getRequiredIndexCount(void) const;
+
+ /** Gets the current index count based on the current subdivision level. */
+ size_t getCurrentIndexCount(void) const;
+ /// Returns the index offset used by this buffer to write data into the buffer
+ size_t getIndexOffset(void) const { return mIndexOffset; }
+ /// Returns the vertex offset used by this buffer to write data into the buffer
+ size_t getVertexOffset(void) const { return mVertexOffset; }
+
+
+ /** Gets the bounds of this patch, only valid after calling defineSurface. */
+ const AxisAlignedBox& getBounds(void) const;
+ /** Gets the radius of the bounding sphere for this patch, only valid after defineSurface
+ has been called. */
+ Real getBoundingSphereRadius(void) const;
+ /** Tells the system to build the mesh relating to the surface into externally created
+ buffers.
+ @remarks
+ The VertexDeclaration of the vertex buffer must be identical to the one passed into
+ defineSurface. In addition, there must be enough space in the buffer to
+ accommodate the patch at full detail level; you should call getRequiredVertexCount
+ and getRequiredIndexCount to determine this. This method does not create an internal
+ mesh for this patch and so getMesh will return null if you call it after building the
+ patch this way.
+ @param destVertexBuffer The destination vertex buffer in which to build the patch.
+ @param vertexStart The offset at which to start writing vertices for this patch
+ @param destIndexBuffer The destination index buffer in which to build the patch.
+ @param vertexStart The offset at which to start writing indexes for this patch
+
+ */
+ void build(HardwareVertexBufferSharedPtr destVertexBuffer, size_t vertexStart,
+ HardwareIndexBufferSharedPtr destIndexBuffer, size_t indexStart);
+
+ /** Alters the level of subdivision for this surface.
+ @remarks
+ This method changes the proportionate detail level of the patch; since
+ the U and V directions can have different subdivision levels, this method
+ takes a single Real value where 0 is the minimum detail (the control points)
+ and 1 is the maximum detail level as supplied to the original call to
+ defineSurface.
+ */
+ void setSubdivisionFactor(Real factor);
+
+ /** Gets the current level of subdivision. */
+ Real getSubdivisionFactor(void) const;
+
+ void* getControlPointBuffer(void) const
+ {
+ return mControlPointBuffer;
+ }
+ /** Convenience method for telling the patch that the control points have been
+ deleted, since once the patch has been built they are not required. */
+ void notifyControlPointBufferDeallocated(void) {
+ mControlPointBuffer = 0;
+ }
+ protected:
+ /// Vertex declaration describing the control point buffer
+ VertexDeclaration* mDeclaration;
+ /// Buffer containing the system-memory control points
+ void* mControlPointBuffer;
+ /// Type of surface
+ PatchSurfaceType mType;
+ /// Width in control points
+ size_t mCtlWidth;
+ /// Height in control points
+ size_t mCtlHeight;
+ /// TotalNumber of control points
+ size_t mCtlCount;
+ /// U-direction subdivision level
+ size_t mULevel;
+ /// V-direction subdivision level
+ size_t mVLevel;
+ /// Max subdivision level
+ size_t mMaxULevel;
+ size_t mMaxVLevel;
+ /// Width of the subdivided mesh (big enough for max level)
+ size_t mMeshWidth;
+ /// Height of the subdivided mesh (big enough for max level)
+ size_t mMeshHeight;
+ /// Which side is visible
+ VisibleSide mVSide;
+
+ Real mSubdivisionFactor;
+
+ std::vector mVecCtlPoints;
+
+ /** Internal method for finding the subdivision level given 3 control points.
+ */
+ size_t findLevel( Vector3& a, Vector3& b, Vector3& c);
+
+ void distributeControlPoints(void* lockedBuffer);
+ void subdivideCurve(void* lockedBuffer, size_t startIdx, size_t stepSize, size_t numSteps, size_t iterations);
+ void interpolateVertexData(void* lockedBuffer, size_t leftIndex, size_t rightIndex, size_t destIndex);
+ void makeTriangles(void);
+
+ size_t getAutoULevel(bool forMax = false);
+ size_t getAutoVLevel(bool forMax = false);
+
+ HardwareVertexBufferSharedPtr mVertexBuffer;
+ HardwareIndexBufferSharedPtr mIndexBuffer;
+ size_t mVertexOffset;
+ size_t mIndexOffset;
+ size_t mRequiredVertexCount;
+ size_t mRequiredIndexCount;
+ size_t mCurrIndexCount;
+
+ AxisAlignedBox mAABB;
+ Real mBoundingSphere;
+
+
+
+ };
+
+
+} // namespace
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgrePixelFormat.h b/school/informatik/verkerhssimulation/src/ogre/OgrePixelFormat.h
new file mode 100644
index 00000000..c8b5c437
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgrePixelFormat.h
@@ -0,0 +1,473 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _PixelFormat_H__
+#define _PixelFormat_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreCommon.h"
+
+namespace Ogre {
+ /** The pixel format used for images, textures, and render surfaces */
+ enum PixelFormat
+ {
+ /// Unknown pixel format.
+ PF_UNKNOWN = 0,
+ /// 8-bit pixel format, all bits luminace.
+ PF_L8 = 1,
+ PF_BYTE_L = PF_L8,
+ /// 16-bit pixel format, all bits luminace.
+ PF_L16 = 2,
+ PF_SHORT_L = PF_L16,
+ /// 8-bit pixel format, all bits alpha.
+ PF_A8 = 3,
+ PF_BYTE_A = PF_A8,
+ /// 8-bit pixel format, 4 bits alpha, 4 bits luminace.
+ PF_A4L4 = 4,
+ /// 2 byte pixel format, 1 byte luminance, 1 byte alpha
+ PF_BYTE_LA = 5,
+ /// 16-bit pixel format, 5 bits red, 6 bits green, 5 bits blue.
+ PF_R5G6B5 = 6,
+ /// 16-bit pixel format, 5 bits red, 6 bits green, 5 bits blue.
+ PF_B5G6R5 = 7,
+ /// 8-bit pixel format, 2 bits blue, 3 bits green, 3 bits red.
+ PF_R3G3B2 = 31,
+ /// 16-bit pixel format, 4 bits for alpha, red, green and blue.
+ PF_A4R4G4B4 = 8,
+ /// 16-bit pixel format, 5 bits for blue, green, red and 1 for alpha.
+ PF_A1R5G5B5 = 9,
+ /// 24-bit pixel format, 8 bits for red, green and blue.
+ PF_R8G8B8 = 10,
+ /// 24-bit pixel format, 8 bits for blue, green and red.
+ PF_B8G8R8 = 11,
+ /// 32-bit pixel format, 8 bits for alpha, red, green and blue.
+ PF_A8R8G8B8 = 12,
+ /// 32-bit pixel format, 8 bits for blue, green, red and alpha.
+ PF_A8B8G8R8 = 13,
+ /// 32-bit pixel format, 8 bits for blue, green, red and alpha.
+ PF_B8G8R8A8 = 14,
+ /// 32-bit pixel format, 8 bits for red, green, blue and alpha.
+ PF_R8G8B8A8 = 28,
+ /// 32-bit pixel format, 8 bits for red, 8 bits for green, 8 bits for blue
+ /// like PF_A8R8G8B8, but alpha will get discarded
+ PF_X8R8G8B8 = 26,
+ /// 32-bit pixel format, 8 bits for blue, 8 bits for green, 8 bits for red
+ /// like PF_A8B8G8R8, but alpha will get discarded
+ PF_X8B8G8R8 = 27,
+#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+ /// 3 byte pixel format, 1 byte for red, 1 byte for green, 1 byte for blue
+ PF_BYTE_RGB = PF_R8G8B8,
+ /// 3 byte pixel format, 1 byte for blue, 1 byte for green, 1 byte for red
+ PF_BYTE_BGR = PF_B8G8R8,
+ /// 4 byte pixel format, 1 byte for blue, 1 byte for green, 1 byte for red and one byte for alpha
+ PF_BYTE_BGRA = PF_B8G8R8A8,
+ /// 4 byte pixel format, 1 byte for red, 1 byte for green, 1 byte for blue, and one byte for alpha
+ PF_BYTE_RGBA = PF_R8G8B8A8,
+#else
+ /// 3 byte pixel format, 1 byte for red, 1 byte for green, 1 byte for blue
+ PF_BYTE_RGB = PF_B8G8R8,
+ /// 3 byte pixel format, 1 byte for blue, 1 byte for green, 1 byte for red
+ PF_BYTE_BGR = PF_R8G8B8,
+ /// 4 byte pixel format, 1 byte for blue, 1 byte for green, 1 byte for red and one byte for alpha
+ PF_BYTE_BGRA = PF_A8R8G8B8,
+ /// 4 byte pixel format, 1 byte for red, 1 byte for green, 1 byte for blue, and one byte for alpha
+ PF_BYTE_RGBA = PF_A8B8G8R8,
+#endif
+ /// 32-bit pixel format, 2 bits for alpha, 10 bits for red, green and blue.
+ PF_A2R10G10B10 = 15,
+ /// 32-bit pixel format, 10 bits for blue, green and red, 2 bits for alpha.
+ PF_A2B10G10R10 = 16,
+ /// DDS (DirectDraw Surface) DXT1 format
+ PF_DXT1 = 17,
+ /// DDS (DirectDraw Surface) DXT2 format
+ PF_DXT2 = 18,
+ /// DDS (DirectDraw Surface) DXT3 format
+ PF_DXT3 = 19,
+ /// DDS (DirectDraw Surface) DXT4 format
+ PF_DXT4 = 20,
+ /// DDS (DirectDraw Surface) DXT5 format
+ PF_DXT5 = 21,
+ // 16-bit pixel format, 16 bits (float) for red
+ PF_FLOAT16_R = 32,
+ // 48-bit pixel format, 16 bits (float) for red, 16 bits (float) for green, 16 bits (float) for blue
+ PF_FLOAT16_RGB = 22,
+ // 64-bit pixel format, 16 bits (float) for red, 16 bits (float) for green, 16 bits (float) for blue, 16 bits (float) for alpha
+ PF_FLOAT16_RGBA = 23,
+ // 16-bit pixel format, 16 bits (float) for red
+ PF_FLOAT32_R = 33,
+ // 96-bit pixel format, 32 bits (float) for red, 32 bits (float) for green, 32 bits (float) for blue
+ PF_FLOAT32_RGB = 24,
+ // 128-bit pixel format, 32 bits (float) for red, 32 bits (float) for green, 32 bits (float) for blue, 32 bits (float) for alpha
+ PF_FLOAT32_RGBA = 25,
+ // 32-bit, 2-channel s10e5 floating point pixel format, 16-bit green, 16-bit red
+ PF_FLOAT16_GR = 35,
+ // 64-bit, 2-channel floating point pixel format, 32-bit green, 32-bit red
+ PF_FLOAT32_GR = 36,
+ // Depth texture format
+ PF_DEPTH = 29,
+ // 64-bit pixel format, 16 bits for red, green, blue and alpha
+ PF_SHORT_RGBA = 30,
+ // 32-bit pixel format, 16-bit green, 16-bit red
+ PF_SHORT_GR = 34,
+ // 48-bit pixel format, 16 bits for red, green and blue
+ PF_SHORT_RGB = 37,
+ // Number of pixel formats currently defined
+ PF_COUNT = 38
+ };
+
+ /**
+ * Flags defining some on/off properties of pixel formats
+ */
+ enum PixelFormatFlags {
+ // This format has an alpha channel
+ PFF_HASALPHA = 0x00000001,
+ // This format is compressed. This invalidates the values in elemBytes,
+ // elemBits and the bit counts as these might not be fixed in a compressed format.
+ PFF_COMPRESSED = 0x00000002,
+ // This is a floating point format
+ PFF_FLOAT = 0x00000004,
+ // This is a depth format (for depth textures)
+ PFF_DEPTH = 0x00000008,
+ // Format is in native endian. Generally true for the 16, 24 and 32 bits
+ // formats which can be represented as machine integers.
+ PFF_NATIVEENDIAN = 0x00000010,
+ // This is an intensity format instead of a RGB one. The luminance
+ // replaces R,G and B. (but not A)
+ PFF_LUMINANCE = 0x00000020
+ };
+
+ /** Pixel component format */
+ enum PixelComponentType
+ {
+ PCT_BYTE = 0, /// Byte per component (8 bit fixed 0.0..1.0)
+ PCT_SHORT = 1, /// Short per component (16 bit fixed 0.0..1.0))
+ PCT_FLOAT16 = 2, /// 16 bit float per component
+ PCT_FLOAT32 = 3, /// 32 bit float per component
+ PCT_COUNT = 4 /// Number of pixel types
+ };
+
+ /** A primitive describing a volume (3D), image (2D) or line (1D) of pixels in memory.
+ In case of a rectangle, depth must be 1.
+ Pixels are stored as a succession of "depth" slices, each containing "height" rows of
+ "width" pixels.
+ */
+ class _OgreExport PixelBox: public Box {
+ public:
+ /// Parameter constructor for setting the members manually
+ PixelBox() {}
+ /** Constructor providing extents in the form of a Box object. This constructor
+ assumes the pixel data is laid out consecutively in memory. (this
+ means row after row, slice after slice, with no space in between)
+ @param extents Extents of the region defined by data
+ @param pixelFormat Format of this buffer
+ @param pixelData Pointer to the actual data
+ */
+ PixelBox(const Box &extents, PixelFormat pixelFormat, void *pixelData=0):
+ Box(extents), data(pixelData), format(pixelFormat)
+ {
+ setConsecutive();
+ }
+ /** Constructor providing width, height and depth. This constructor
+ assumes the pixel data is laid out consecutively in memory. (this
+ means row after row, slice after slice, with no space in between)
+ @param width Width of the region
+ @param height Height of the region
+ @param depth Depth of the region
+ @param pixelFormat Format of this buffer
+ @param pixelData Pointer to the actual data
+ */
+ PixelBox(size_t width, size_t height, size_t depth, PixelFormat pixelFormat, void *pixelData=0):
+ Box(0, 0, 0, width, height, depth),
+ data(pixelData), format(pixelFormat)
+ {
+ setConsecutive();
+ }
+
+ /// The data pointer
+ void *data;
+ /// The pixel format
+ PixelFormat format;
+ /** Number of elements between the leftmost pixel of one row and the left
+ pixel of the next. This value must always be equal to getWidth() (consecutive)
+ for compressed formats.
+ */
+ size_t rowPitch;
+ /** Number of elements between the top left pixel of one (depth) slice and
+ the top left pixel of the next. This can be a negative value. Must be a multiple of
+ rowPitch. This value must always be equal to getWidth()*getHeight() (consecutive)
+ for compressed formats.
+ */
+ size_t slicePitch;
+
+ /** Set the rowPitch and slicePitch so that the buffer is laid out consecutive
+ in memory.
+ */
+ void setConsecutive()
+ {
+ rowPitch = getWidth();
+ slicePitch = getWidth()*getHeight();
+ }
+ /** Get the number of elements between one past the rightmost pixel of
+ one row and the leftmost pixel of the next row. (IE this is zero if rows
+ are consecutive).
+ */
+ size_t getRowSkip() const { return rowPitch - getWidth(); }
+ /** Get the number of elements between one past the right bottom pixel of
+ one slice and the left top pixel of the next slice. (IE this is zero if slices
+ are consecutive).
+ */
+ size_t getSliceSkip() const { return slicePitch - (getHeight() * rowPitch); }
+
+ /** Return whether this buffer is laid out consecutive in memory (ie the pitches
+ are equal to the dimensions)
+ */
+ bool isConsecutive() const
+ {
+ return rowPitch == getWidth() && slicePitch == getWidth()*getHeight();
+ }
+ /** Return the size (in bytes) this image would take if it was
+ laid out consecutive in memory
+ */
+ size_t getConsecutiveSize() const;
+ /** Return a subvolume of this PixelBox.
+ @param def Defines the bounds of the subregion to return
+ @returns A pixel box describing the region and the data in it
+ @remarks This function does not copy any data, it just returns
+ a PixelBox object with a data pointer pointing somewhere inside
+ the data of object.
+ @throws Exception(ERR_INVALIDPARAMS) if def is not fully contained
+ */
+ PixelBox getSubVolume(const Box &def) const;
+ };
+
+
+ /**
+ * Some utility functions for packing and unpacking pixel data
+ */
+ class _OgreExport PixelUtil {
+ public:
+ /** Returns the size in bytes of an element of the given pixel format.
+ @returns
+ The size in bytes of an element. See Remarks.
+ @remarks
+ Passing PF_UNKNOWN will result in returning a size of 0 bytes.
+ */
+ static size_t getNumElemBytes( PixelFormat format );
+
+ /** Returns the size in bits of an element of the given pixel format.
+ @returns
+ The size in bits of an element. See Remarks.
+ @remarks
+ Passing PF_UNKNOWN will result in returning a size of 0 bits.
+ */
+ static size_t getNumElemBits( PixelFormat format );
+
+ /** Returns the size in memory of a region with the given extents and pixel
+ format with consecutive memory layout.
+ @param width
+ The width of the area
+ @param height
+ The height of the area
+ @param depth
+ The depth of the area
+ @param format
+ The format of the area
+ @returns
+ The size in bytes
+ @remarks
+ In case that the format is non-compressed, this simply returns
+ width*height*depth*PixelUtil::getNumElemBytes(format). In the compressed
+ case, this does serious magic.
+ */
+ static size_t getMemorySize(size_t width, size_t height, size_t depth, PixelFormat format);
+
+ /** Returns the property flags for this pixel format
+ @returns
+ A bitfield combination of PFF_HASALPHA, PFF_ISCOMPRESSED,
+ PFF_FLOAT, PFF_DEPTH, PFF_NATIVEENDIAN, PFF_LUMINANCE
+ @remarks
+ This replaces the seperate functions for formatHasAlpha, formatIsFloat, ...
+ */
+ static unsigned int getFlags( PixelFormat format );
+
+ /** Shortcut method to determine if the format has an alpha component */
+ static bool hasAlpha(PixelFormat format);
+ /** Shortcut method to determine if the format is floating point */
+ static bool isFloatingPoint(PixelFormat format);
+ /** Shortcut method to determine if the format is compressed */
+ static bool isCompressed(PixelFormat format);
+ /** Shortcut method to determine if the format is a depth format. */
+ static bool isDepth(PixelFormat format);
+ /** Shortcut method to determine if the format is in native endian format. */
+ static bool isNativeEndian(PixelFormat format);
+ /** Shortcut method to determine if the format is a luminance format. */
+ static bool isLuminance(PixelFormat format);
+
+ /** Return wether a certain image extent is valid for this image format.
+ @param width
+ The width of the area
+ @param height
+ The height of the area
+ @param depth
+ The depth of the area
+ @param format
+ The format of the area
+ @remarks For non-compressed formats, this is always true. For DXT formats,
+ only sizes with a width and height multiple of 4 and depth 1 are allowed.
+ */
+ static bool isValidExtent(size_t width, size_t height, size_t depth, PixelFormat format);
+
+ /** Gives the number of bits (RGBA) for a format. See remarks.
+ @remarks For non-colour formats (dxt, depth) this returns [0,0,0,0].
+ */
+ static void getBitDepths(PixelFormat format, int rgba[4]);
+
+ /** Gives the masks for the R, G, B and A component
+ @note Only valid for native endian formats
+ */
+ static void getBitMasks(PixelFormat format, uint32 rgba[4]);
+
+ /** Gets the name of an image format
+ */
+ static String getFormatName(PixelFormat srcformat);
+
+ /** Returns wether the format can be packed or unpacked with the packColour()
+ and unpackColour() functions. This is generally not true for compressed and
+ depth formats as they are special. It can only be true for formats with a
+ fixed element size.
+ @returns
+ true if yes, otherwise false
+ */
+ static bool isAccessible(PixelFormat srcformat);
+
+ /** Returns the component type for a certain pixel format. Returns PCT_BYTE
+ in case there is no clear component type like with compressed formats.
+ This is one of PCT_BYTE, PCT_SHORT, PCT_FLOAT16, PCT_FLOAT32.
+ */
+ static PixelComponentType getComponentType(PixelFormat fmt);
+
+ /** Returns the component count for a certain pixel format. Returns 3(no alpha) or
+ 4 (has alpha) in case there is no clear component type like with compressed formats.
+ */
+ static size_t getComponentCount(PixelFormat fmt);
+
+ /** Gets the format from given name.
+ @param name The string of format name
+ @param accessibleOnly If true, non-accessible format will treat as invalid format,
+ otherwise, all supported format are valid.
+ @param caseSensitive Should be set true if string match should use case sensitivity.
+ @returns The format match the format name, or PF_UNKNOWN if is invalid name.
+ */
+ static PixelFormat getFormatFromName(const String& name, bool accessibleOnly = false, bool caseSensitive = false);
+
+ /** Gets the BNF expression of the pixel-formats.
+ @note The string returned by this function is intented to use as a BNF expression
+ to work with Compiler2Pass.
+ @param accessibleOnly If true, only accessible pixel format will take into account, otherwise all
+ pixel formats list in PixelFormat enumeration will being returned.
+ @returns A string contains the BNF expression.
+ */
+ static String getBNFExpressionOfPixelFormats(bool accessibleOnly = false);
+
+ /** Returns the similar format but acoording with given bit depths.
+ @param fmt The original foamt.
+ @param integerBits Preferred bit depth (pixel bits) for integer pixel format.
+ Available values: 0, 16 and 32, where 0 (the default) means as it is.
+ @param floatBits Preferred bit depth (channel bits) for float pixel format.
+ Available values: 0, 16 and 32, where 0 (the default) means as it is.
+ @returns The format that similar original format with bit depth according
+ with preferred bit depth, or original format if no convertion occuring.
+ */
+ static PixelFormat getFormatForBitDepths(PixelFormat fmt, ushort integerBits, ushort floatBits);
+
+ /** Pack a colour value to memory
+ @param colour The colour
+ @param pf Pixelformat in which to write the colour
+ @param dest Destination memory location
+ */
+ static void packColour(const ColourValue &colour, const PixelFormat pf, void* dest);
+ /** Pack a colour value to memory
+ @param r,g,b,a The four colour components, range 0x00 to 0xFF
+ @param pf Pixelformat in which to write the colour
+ @param dest Destination memory location
+ */
+ static void packColour(const uint8 r, const uint8 g, const uint8 b, const uint8 a, const PixelFormat pf, void* dest);
+ /** Pack a colour value to memory
+ @param r,g,b,a The four colour components, range 0.0f to 1.0f
+ (an exception to this case exists for floating point pixel
+ formats, which don't clamp to 0.0f..1.0f)
+ @param pf Pixelformat in which to write the colour
+ @param dest Destination memory location
+ */
+ static void packColour(const float r, const float g, const float b, const float a, const PixelFormat pf, void* dest);
+
+ /** Unpack a colour value from memory
+ @param colour The colour is returned here
+ @param pf Pixelformat in which to read the colour
+ @param src Source memory location
+ */
+ static void unpackColour(ColourValue *colour, PixelFormat pf, const void* src);
+ /** Unpack a colour value from memory
+ @param r,g,b,a The colour is returned here (as byte)
+ @param pf Pixelformat in which to read the colour
+ @param src Source memory location
+ @remarks This function returns the colour components in 8 bit precision,
+ this will lose precision when coming from PF_A2R10G10B10 or floating
+ point formats.
+ */
+ static void unpackColour(uint8 *r, uint8 *g, uint8 *b, uint8 *a, PixelFormat pf, const void* src);
+ /** Unpack a colour value from memory
+ @param r,g,b,a The colour is returned here (as float)
+ @param pf Pixelformat in which to read the colour
+ @param src Source memory location
+ */
+ static void unpackColour(float *r, float *g, float *b, float *a, PixelFormat pf, const void* src);
+
+ /** Convert consecutive pixels from one format to another. No dithering or filtering is being done.
+ Converting from RGB to luminance takes the R channel. In case the source and destination format match,
+ just a copy is done.
+ @param src Pointer to source region
+ @param srcFormat Pixel format of source region
+ @param dst Pointer to destination region
+ @param dstFormat Pixel format of destination region
+ */
+ static void bulkPixelConversion(void *src, PixelFormat srcFormat, void *dest, PixelFormat dstFormat, unsigned int count);
+
+ /** Convert pixels from one format to another. No dithering or filtering is being done. Converting
+ from RGB to luminance takes the R channel.
+ @param src PixelBox containing the source pixels, pitches and format
+ @param dst PixelBox containing the destination pixels, pitches and format
+ @remarks The source and destination boxes must have the same
+ dimensions. In case the source and destination format match, a plain copy is done.
+ */
+ static void bulkPixelConversion(const PixelBox &src, const PixelBox &dst);
+ };
+
+}
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgrePlane.h b/school/informatik/verkerhssimulation/src/ogre/OgrePlane.h
new file mode 100644
index 00000000..88cd5ca4
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgrePlane.h
@@ -0,0 +1,154 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+// Original free version by:
+// Magic Software, Inc.
+// http://www.geometrictools.com/
+// Copyright (c) 2000, All Rights Reserved
+
+#ifndef __Plane_H__
+#define __Plane_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreVector3.h"
+
+namespace Ogre {
+
+ /** Defines a plane in 3D space.
+ @remarks
+ A plane is defined in 3D space by the equation
+ Ax + By + Cz + D = 0
+ @par
+ This equates to a vector (the normal of the plane, whose x, y
+ and z components equate to the coefficients A, B and C
+ respectively), and a constant (D) which is the distance along
+ the normal you have to go to move the plane back to the origin.
+ */
+ class _OgreExport Plane
+ {
+ public:
+ /** Default constructor - sets everything to 0.
+ */
+ Plane ();
+ Plane (const Plane& rhs);
+ /** Construct a plane through a normal, and a distance to move the plane along the normal.*/
+ Plane (const Vector3& rkNormal, Real fConstant);
+ Plane (const Vector3& rkNormal, const Vector3& rkPoint);
+ Plane (const Vector3& rkPoint0, const Vector3& rkPoint1,
+ const Vector3& rkPoint2);
+
+ /** The "positive side" of the plane is the half space to which the
+ plane normal points. The "negative side" is the other half
+ space. The flag "no side" indicates the plane itself.
+ */
+ enum Side
+ {
+ NO_SIDE,
+ POSITIVE_SIDE,
+ NEGATIVE_SIDE,
+ BOTH_SIDE
+ };
+
+ Side getSide (const Vector3& rkPoint) const;
+
+ /**
+ returns the side where the aligneBox is. the flag BOTH_SIDE indicates an intersecting box.
+ one corner ON the plane is sufficient to consider the box and the plane intersecting.
+ */
+ Side getSide (const AxisAlignedBox& rkBox) const;
+
+ /** Returns which side of the plane that the given box lies on.
+ The box is defined as centre/half-size pairs for effectively.
+ @param centre The centre of the box.
+ @param halfSize The half-size of the box.
+ @returns
+ POSITIVE_SIDE if the box complete lies on the "positive side" of the plane,
+ NEGATIVE_SIDE if the box complete lies on the "negative side" of the plane,
+ and BOTH_SIDE if the box intersects the plane.
+ */
+ Side getSide (const Vector3& centre, const Vector3& halfSize) const;
+
+ /** This is a pseudodistance. The sign of the return value is
+ positive if the point is on the positive side of the plane,
+ negative if the point is on the negative side, and zero if the
+ point is on the plane.
+ @par
+ The absolute value of the return value is the true distance only
+ when the plane normal is a unit length vector.
+ */
+ Real getDistance (const Vector3& rkPoint) const;
+
+ /** Redefine this plane based on 3 points. */
+ void redefine(const Vector3& rkPoint0, const Vector3& rkPoint1,
+ const Vector3& rkPoint2);
+
+ /** Redefine this plane based on a normal and a point. */
+ void redefine(const Vector3& rkNormal, const Vector3& rkPoint);
+
+ /** Project a vector onto the plane.
+ @remarks This gives you the element of the input vector that is perpendicular
+ to the normal of the plane. You can get the element which is parallel
+ to the normal of the plane by subtracting the result of this method
+ from the original vector, since parallel + perpendicular = original.
+ @param v The input vector
+ */
+ Vector3 projectVector(const Vector3& v) const;
+
+ /** Normalises the plane.
+ @remarks
+ This method normalises the plane's normal and the length scale of d
+ is as well.
+ @note
+ This function will not crash for zero-sized vectors, but there
+ will be no changes made to their components.
+ @returns The previous length of the plane's normal.
+ */
+ Real normalise(void);
+
+ Vector3 normal;
+ Real d;
+
+ /// Comparison operator
+ bool operator==(const Plane& rhs) const
+ {
+ return (rhs.d == d && rhs.normal == normal);
+ }
+ bool operator!=(const Plane& rhs) const
+ {
+ return (rhs.d != d && rhs.normal != normal);
+ }
+
+ _OgreExport friend std::ostream& operator<< (std::ostream& o, const Plane& p);
+ };
+
+ typedef std::vector PlaneList;
+
+} // namespace Ogre
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgrePlaneBoundedVolume.h b/school/informatik/verkerhssimulation/src/ogre/OgrePlaneBoundedVolume.h
new file mode 100644
index 00000000..17fe40ef
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgrePlaneBoundedVolume.h
@@ -0,0 +1,128 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __PlaneBoundedVolume_H_
+#define __PlaneBoundedVolume_H_
+
+// Precompiler options
+#include "OgrePrerequisites.h"
+#include "OgreAxisAlignedBox.h"
+#include "OgreSphere.h"
+#include "OgreMath.h"
+#include "OgrePlane.h"
+
+namespace Ogre {
+
+ /** Represents a convex volume bounded by planes.
+ */
+ class _OgreExport PlaneBoundedVolume
+ {
+ public:
+ typedef std::vector PlaneList;
+ /// Publicly accessible plane list, you can modify this direct
+ PlaneList planes;
+ Plane::Side outside;
+
+ PlaneBoundedVolume() :outside(Plane::NEGATIVE_SIDE) {}
+ /** Constructor, determines which side is deemed to be 'outside' */
+ PlaneBoundedVolume(Plane::Side theOutside)
+ : outside(theOutside) {}
+
+ /** Intersection test with AABB
+ @remarks May return false positives but will never miss an intersection.
+ */
+ inline bool intersects(const AxisAlignedBox& box) const
+ {
+ if (box.isNull()) return false;
+ if (box.isInfinite()) return true;
+
+ // Get centre of the box
+ Vector3 centre = box.getCenter();
+ // Get the half-size of the box
+ Vector3 halfSize = box.getHalfSize();
+
+ PlaneList::const_iterator i, iend;
+ iend = planes.end();
+ for (i = planes.begin(); i != iend; ++i)
+ {
+ const Plane& plane = *i;
+
+ Plane::Side side = plane.getSide(centre, halfSize);
+ if (side == outside)
+ {
+ // Found a splitting plane therefore return not intersecting
+ return false;
+ }
+ }
+
+ // couldn't find a splitting plane, assume intersecting
+ return true;
+
+ }
+ /** Intersection test with Sphere
+ @remarks May return false positives but will never miss an intersection.
+ */
+ inline bool intersects(const Sphere& sphere) const
+ {
+ PlaneList::const_iterator i, iend;
+ iend = planes.end();
+ for (i = planes.begin(); i != iend; ++i)
+ {
+ const Plane& plane = *i;
+
+ // Test which side of the plane the sphere is
+ Real d = plane.getDistance(sphere.getCenter());
+ // Negate d if planes point inwards
+ if (outside == Plane::NEGATIVE_SIDE) d = -d;
+
+ if ( (d - sphere.getRadius()) > 0)
+ return false;
+ }
+
+ return true;
+
+ }
+
+ /** Intersection test with a Ray
+ @returns std::pair of hit (bool) and distance
+ @remarks May return false positives but will never miss an intersection.
+ */
+ inline std::pair intersects(const Ray& ray)
+ {
+ return Math::intersects(ray, planes, outside == Plane::POSITIVE_SIDE);
+ }
+
+ };
+
+ typedef std::vector PlaneBoundedVolumeList;
+
+
+}
+
+#endif
+
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgrePlatform.h b/school/informatik/verkerhssimulation/src/ogre/OgrePlatform.h
new file mode 100644
index 00000000..b1e0ba03
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgrePlatform.h
@@ -0,0 +1,219 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Platform_H_
+#define __Platform_H_
+
+#include "OgreConfig.h"
+
+namespace Ogre {
+/* Initial platform/compiler-related stuff to set.
+*/
+#define OGRE_PLATFORM_WIN32 1
+#define OGRE_PLATFORM_LINUX 2
+#define OGRE_PLATFORM_APPLE 3
+
+#define OGRE_COMPILER_MSVC 1
+#define OGRE_COMPILER_GNUC 2
+#define OGRE_COMPILER_BORL 3
+
+#define OGRE_ENDIAN_LITTLE 1
+#define OGRE_ENDIAN_BIG 2
+
+#define OGRE_ARCHITECTURE_32 1
+#define OGRE_ARCHITECTURE_64 2
+
+/* Finds the compiler type and version.
+*/
+#if defined( _MSC_VER )
+# define OGRE_COMPILER OGRE_COMPILER_MSVC
+# define OGRE_COMP_VER _MSC_VER
+
+#elif defined( __GNUC__ )
+# define OGRE_COMPILER OGRE_COMPILER_GNUC
+# define OGRE_COMP_VER (((__GNUC__)*100) + \
+ (__GNUC_MINOR__*10) + \
+ __GNUC_PATCHLEVEL__)
+
+#elif defined( __BORLANDC__ )
+# define OGRE_COMPILER OGRE_COMPILER_BORL
+# define OGRE_COMP_VER __BCPLUSPLUS__
+
+#else
+# pragma error "No known compiler. Abort! Abort!"
+
+#endif
+
+/* See if we can use __forceinline or if we need to use __inline instead */
+#if OGRE_COMPILER == OGRE_COMPILER_MSVC
+# if OGRE_COMP_VER >= 1200
+# define FORCEINLINE __forceinline
+# endif
+#elif defined(__MINGW32__)
+# if !defined(FORCEINLINE)
+# define FORCEINLINE __inline
+# endif
+#else
+# define FORCEINLINE __inline
+#endif
+
+/* Finds the current platform */
+
+#if defined( __WIN32__ ) || defined( _WIN32 )
+# define OGRE_PLATFORM OGRE_PLATFORM_WIN32
+
+#elif defined( __APPLE_CC__)
+# define OGRE_PLATFORM OGRE_PLATFORM_APPLE
+
+#else
+# define OGRE_PLATFORM OGRE_PLATFORM_LINUX
+#endif
+
+ /* Find the arch type */
+#if defined(__x86_64__) || defined(_M_X64) || defined(__powerpc64__) || defined(__alpha__) || defined(__ia64__) || defined(__s390__) || defined(__s390x__)
+# define OGRE_ARCH_TYPE OGRE_ARCHITECTURE_64
+#else
+# define OGRE_ARCH_TYPE OGRE_ARCHITECTURE_32
+#endif
+
+// For generating compiler warnings - should work on any compiler
+// As a side note, if you start your message with 'Warning: ', the MSVC
+// IDE actually does catch a warning :)
+#define OGRE_QUOTE_INPLACE(x) # x
+#define OGRE_QUOTE(x) OGRE_QUOTE_INPLACE(x)
+#define OGRE_WARN( x ) message( __FILE__ "(" QUOTE( __LINE__ ) ") : " x "\n" )
+
+//----------------------------------------------------------------------------
+// Windows Settings
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+
+// If we're not including this from a client build, specify that the stuff
+// should get exported. Otherwise, import it.
+# if defined( OGRE_STATIC_LIB )
+ // Linux compilers don't have symbol import/export directives.
+# define _OgreExport
+# define _OgrePrivate
+# else
+# if defined( OGRE_NONCLIENT_BUILD )
+# define _OgreExport __declspec( dllexport )
+# else
+# if defined( __MINGW32__ )
+# define _OgreExport
+# else
+# define _OgreExport __declspec( dllimport )
+# endif
+# endif
+# define _OgrePrivate
+# endif
+// Win32 compilers use _DEBUG for specifying debug builds.
+# ifdef _DEBUG
+# define OGRE_DEBUG_MODE 1
+# else
+# define OGRE_DEBUG_MODE 0
+# endif
+
+// Disable unicode support on MingW at the moment, poorly supported in stdlibc++
+// STLPORT fixes this though so allow if found
+// MinGW C++ Toolkit supports unicode and sets the define __MINGW32_TOOLKIT_UNICODE__ in _mingw.h
+#if defined( __MINGW32__ ) && !defined(_STLPORT_VERSION)
+# include<_mingw.h>
+# if defined(__MINGW32_TOOLBOX_UNICODE__)
+# define OGRE_UNICODE_SUPPORT 1
+# else
+# define OGRE_UNICODE_SUPPORT 0
+# endif
+#else
+# define OGRE_UNICODE_SUPPORT 1
+#endif
+
+#endif
+//----------------------------------------------------------------------------
+
+//----------------------------------------------------------------------------
+// Linux/Apple Settings
+#if OGRE_PLATFORM == OGRE_PLATFORM_LINUX || OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+
+// Enable GCC symbol visibility
+# if defined( OGRE_GCC_VISIBILITY )
+# define _OgreExport __attribute__ ((visibility("default")))
+# define _OgrePrivate __attribute__ ((visibility("hidden")))
+# else
+# define _OgreExport
+# define _OgrePrivate
+# endif
+
+// A quick define to overcome different names for the same function
+# define stricmp strcasecmp
+
+// Unlike the Win32 compilers, Linux compilers seem to use DEBUG for when
+// specifying a debug build.
+// (??? this is wrong, on Linux debug builds aren't marked in any way unless
+// you mark it yourself any way you like it -- zap ???)
+# ifdef DEBUG
+# define OGRE_DEBUG_MODE 1
+# else
+# define OGRE_DEBUG_MODE 0
+# endif
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+ #define OGRE_PLATFORM_LIB "OgrePlatform.bundle"
+#else
+ //OGRE_PLATFORM_LINUX
+ #define OGRE_PLATFORM_LIB "libOgrePlatform.so"
+#endif
+
+// Always enable unicode support for the moment
+// Perhaps disable in old versions of gcc if necessary
+#define OGRE_UNICODE_SUPPORT 1
+
+#endif
+
+//For apple, we always have a custom config.h file
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+# include "config.h"
+#endif
+
+//----------------------------------------------------------------------------
+
+//----------------------------------------------------------------------------
+// Endian Settings
+// check for BIG_ENDIAN config flag, set OGRE_ENDIAN correctly
+#ifdef OGRE_CONFIG_BIG_ENDIAN
+# define OGRE_ENDIAN OGRE_ENDIAN_BIG
+#else
+# define OGRE_ENDIAN OGRE_ENDIAN_LITTLE
+#endif
+
+// Integer formats of fixed bit width
+typedef unsigned int uint32;
+typedef unsigned short uint16;
+typedef unsigned char uint8;
+
+}
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgrePlatformInformation.h b/school/informatik/verkerhssimulation/src/ogre/OgrePlatformInformation.h
new file mode 100644
index 00000000..5fd2969a
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgrePlatformInformation.h
@@ -0,0 +1,168 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __PlatformInformation_H__
+#define __PlatformInformation_H__
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre {
+//
+// TODO: Puts following macros into OgrePlatform.h?
+//
+
+/* Initial CPU stuff to set.
+*/
+#define OGRE_CPU_UNKNOWN 0
+#define OGRE_CPU_X86 1
+#define OGRE_CPU_PPC 2
+
+/* Find CPU type
+*/
+#if (defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))) || \
+ (defined(__GNUC__) && (defined(__i386__) /*|| defined(__x86_64__)*/))
+# define OGRE_CPU OGRE_CPU_X86
+
+#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE && defined(__BIG_ENDIAN__)
+# define OGRE_CPU OGRE_CPU_PPC
+#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+# define OGRE_CPU OGRE_CPU_X86
+
+#else
+# define OGRE_CPU OGRE_CPU_UNKNOWN
+#endif
+
+/* Find how to declare aligned variable.
+*/
+#if OGRE_COMPILER == OGRE_COMPILER_MSVC
+# define OGRE_ALIGNED_DECL(type, var, alignment) __declspec(align(alignment)) type var
+
+#elif OGRE_COMPILER == OGRE_COMPILER_GNUC
+# define OGRE_ALIGNED_DECL(type, var, alignment) type var __attribute__((__aligned__(alignment)))
+
+#else
+# define OGRE_ALIGNED_DECL(type, var, alignment) type var
+#endif
+
+/** Find perfect alignment (should supports SIMD alignment if SIMD available)
+*/
+#if OGRE_CPU == OGRE_CPU_X86
+# define OGRE_SIMD_ALIGNMENT 16
+
+#else
+# define OGRE_SIMD_ALIGNMENT 16
+#endif
+
+/* Declare variable aligned to SIMD alignment.
+*/
+#define OGRE_SIMD_ALIGNED_DECL(type, var) OGRE_ALIGNED_DECL(type, var, OGRE_SIMD_ALIGNMENT)
+
+/* Define whether or not Ogre compiled with SSE supports.
+*/
+#if OGRE_DOUBLE_PRECISION == 0 && OGRE_CPU == OGRE_CPU_X86 && OGRE_COMPILER == OGRE_COMPILER_MSVC
+# define __OGRE_HAVE_SSE 1
+#elif OGRE_DOUBLE_PRECISION == 0 && OGRE_CPU == OGRE_CPU_X86 && OGRE_COMPILER == OGRE_COMPILER_GNUC
+# define __OGRE_HAVE_SSE 1
+#endif
+
+
+#ifndef __OGRE_HAVE_SSE
+# define __OGRE_HAVE_SSE 0
+#endif
+
+
+
+
+ /** Class which provides the run-time platform information Ogre runs on.
+ @remarks
+ Ogre is designed to be platform-independent, but there some platform
+ and run-time environment specific optimised functions are built-in
+ for maximise performance, and those special optimised routines are
+ need to determine run-time environment for select variant executing
+ path.
+ @par
+ This class manages that provides a couple of functions to determine
+ platform information of the run-time environment.
+ @note
+ This class is supposed to use by advanced user only.
+ */
+ class _OgreExport PlatformInformation
+ {
+ public:
+
+ /// Enum describing the different CPU features we want to check for, platform-dependent
+ enum CpuFeatures
+ {
+#if OGRE_CPU == OGRE_CPU_X86
+ CPU_FEATURE_SSE = 1 << 0,
+ CPU_FEATURE_SSE2 = 1 << 1,
+ CPU_FEATURE_SSE3 = 1 << 2,
+ CPU_FEATURE_MMX = 1 << 3,
+ CPU_FEATURE_MMXEXT = 1 << 4,
+ CPU_FEATURE_3DNOW = 1 << 5,
+ CPU_FEATURE_3DNOWEXT = 1 << 6,
+ CPU_FEATURE_CMOV = 1 << 7,
+ CPU_FEATURE_TSC = 1 << 8,
+ CPU_FEATURE_FPU = 1 << 9,
+ CPU_FEATURE_PRO = 1 << 10,
+ CPU_FEATURE_HTT = 1 << 11,
+#endif
+
+ CPU_FEATURE_NONE = 0
+ };
+
+ /** Gets a string of the CPU identifier.
+ @note
+ Actual detecting are performs in the first time call to this function,
+ and then all future calls with return internal cached value.
+ */
+ static const String& getCpuIdentifier(void);
+
+ /** Gets a or-masked of enum CpuFeatures that are supported by the CPU.
+ @note
+ Actual detecting are performs in the first time call to this function,
+ and then all future calls with return internal cached value.
+ */
+ static uint getCpuFeatures(void);
+
+ /** Gets whether a specific feature is supported by the CPU.
+ @note
+ Actual detecting are performs in the first time call to this function,
+ and then all future calls with return internal cached value.
+ */
+ static bool hasCpuFeature(CpuFeatures feature);
+
+
+ /** Write the CPU information to the passed in Log */
+ static void log(Log* pLog);
+
+ };
+
+}
+
+#endif // __PlatformInformation_H__
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgrePlugin.h b/school/informatik/verkerhssimulation/src/ogre/OgrePlugin.h
new file mode 100644
index 00000000..7bb06b7c
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgrePlugin.h
@@ -0,0 +1,132 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __OGREPLUGIN_H__
+#define __OGREPLUGIN_H__
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre
+{
+ /** Class defining a generic OGRE plugin.
+ @remarks
+ OGRE is very plugin-oriented and you can customise much of its behaviour
+ by registering new plugins, dynamically if you are using dynamic linking.
+ This class abstracts the generic interface that all plugins must support.
+ Within the implementations of this interface, the plugin must call other
+ OGRE classes in order to register the detailed customisations it is
+ providing, e.g. registering a new SceneManagerFactory, a new
+ MovableObjectFactory, or a new RenderSystem.
+ @par
+ Plugins can be linked statically or dynamically. If they are linked
+ dynamically (ie the plugin is in a DLL or Shared Object file), then you
+ load the plugin by calling the Root::loadPlugin method (or some other
+ mechanism which leads to that call, e.g. plugins.cfg), passing the name of
+ the DLL. OGRE will then call a global init function on that DLL, and it
+ will be expected to register one or more Plugin implementations using
+ Root::installPlugin. The procedure is very similar if you use a static
+ linked plugin, except that you simply instantiate the Plugin implementation
+ yourself and pass it to Root::installPlugin.
+ @note
+ Lifecycle of a Plugin instance is very important. The Plugin instance must
+ remain valid until the Plugin is uninstalled. Here are the things you
+ must bear in mind:
+ - If your plugin is in a DLL:
+
- Create the Plugin instance and call Root::installPlugin in dllStartPlugin
+ - Call Root::uninstallPlugin, then delete it in dllStopPlugin
+ - If your plugin is statically linked in your app:
+
- Create the Plugin anytime you like
+ - Call Root::installPlugin any time whilst Root is valid
+ - Call Root::uninstallPlugin if you like so long as Root is valid. However,
+ it will be done for you when Root is destroyed, so the Plugin instance must
+ still be valid at that point if you haven't manually uninstalled it.
+
+ The install and unninstall methods will be called when the plugin is
+ installed or uninstalled. The initialise and shutdown will be called when
+ there is a system initialisation or shutdown, e.g. when Root::initialise
+ or Root::shutdown are called.
+ */
+ class _OgreExport Plugin
+ {
+ public:
+ Plugin() {}
+ virtual ~Plugin() {}
+
+ /** Get the name of the plugin.
+ @remarks An implementation must be supplied for this method to uniquely
+ identify the plugin.
+ */
+ virtual const String& getName() const = 0;
+
+ /** Perform the plugin initial installation sequence.
+ @remarks An implementation must be supplied for this method. It must perform
+ the startup tasks necessary to install any rendersystem customisations
+ or anything else that is not dependent on system initialisation, ie
+ only dependent on the core of Ogre. It must not perform any
+ operations that would create rendersystem-specific objects at this stage,
+ that should be done in initialise().
+ */
+ virtual void install() = 0;
+
+ /** Perform any tasks the plugin needs to perform on full system
+ initialisation.
+ @remarks An implementation must be supplied for this method. It is called
+ just after the system is fully initialised (either after Root::initialise
+ if a window is created then, or after the frist window is created)
+ and therefore all rendersystem functionality is available at this
+ time. You can use this hook to create any resources which are
+ dependent on a rendersystem or have rendersystem-specific implementations.
+ */
+ virtual void initialise() = 0;
+
+ /** Perform any tasks the plugin needs to perform when the system is shut down.
+ @remarks An implementation must be supplied for this method.
+ This method is called just before key parts of the system are unloaded,
+ such as rendersystems being shut down. You should use this hook to free up
+ resources and decouple custom objects from the OGRE system, whilst all the
+ instances of other plugins (e.g. rendersystems) still exist.
+ */
+ virtual void shutdown() = 0;
+
+ /** Perform the final plugin uninstallation sequence.
+ @remarks An implementation must be supplied for this method. It must perform
+ the cleanup tasks which haven't already been performed in shutdown()
+ (e.g. final deletion of custom instances, if you kept them around incase
+ the system was reinitialised). At this stage you cannot be sure what other
+ plugins are still loaded or active. It must therefore not perform any
+ operations that would reference any rendersystem-specific objects - those
+ should have been sorted out in the 'shutdown' method.
+ */
+ virtual void uninstall() = 0;
+ };
+
+}
+
+#endif
+
+
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgrePolygon.h b/school/informatik/verkerhssimulation/src/ogre/OgrePolygon.h
new file mode 100644
index 00000000..38e46a41
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgrePolygon.h
@@ -0,0 +1,130 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Copyright (c) 2006 Matthias Fink, netAllied GmbH
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Polygon_H__
+#define __Polygon_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreVector3.h"
+
+
+namespace Ogre
+{
+
+
+ /** The class represents a polygon in 3D space.
+ @remarks
+ It is made up of 3 or more vertices in a single plane, listed in
+ counter-clockwise order.
+ */
+ class _OgreExport Polygon
+ {
+
+ public:
+ typedef std::vector VertexList;
+
+ typedef std::multimap EdgeMap;
+ typedef std::pair< Vector3, Vector3> Edge;
+
+ protected:
+ VertexList mVertexList;
+ Vector3 mNormal;
+ bool mIsNormalSet;
+ /** Updates the normal.
+ */
+ void updateNormal(void);
+
+
+ public:
+ Polygon();
+ ~Polygon();
+ Polygon( const Polygon& cpy );
+
+ /** Inserts a vertex at a specific position.
+ @note Vertices must be coplanar.
+ */
+ void insertVertex(const Vector3& vdata, size_t vertexIndex);
+ /** Inserts a vertex at the end of the polygon.
+ @note Vertices must be coplanar.
+ */
+ void insertVertex(const Vector3& vdata);
+
+ /** Returns a vertex.
+ */
+ const Vector3& getVertex(size_t vertex) const;
+
+ /** Sets a specific vertex of a polygon.
+ @note Vertices must be coplanar.
+ */
+ void setVertex(const Vector3& vdata, size_t vertexIndex);
+
+ /** Removes duplicate vertices from a polygon.
+ */
+ void removeDuplicates(void);
+
+ /** Vertex count.
+ */
+ size_t getVertexCount(void) const;
+
+ /** Returns the polygon normal.
+ */
+ const Vector3& getNormal(void);
+
+ /** Deletes a specific vertex.
+ */
+ void deleteVertex(size_t vertex);
+
+ /** Stores the edges of the polygon in ccw order.
+ The vertices are copied so the user has to take the
+ deletion into account.
+ */
+ void storeEdges(EdgeMap *edgeMap) const;
+
+ /** Resets the object.
+ */
+ void reset(void);
+
+ /** Determines if the current object is equal to the compared one.
+ */
+ bool operator == (const Polygon& rhs) const;
+
+ /** Determines if the current object is not equal to the compared one.
+ */
+ bool operator != (const Polygon& rhs) const
+ { return !( *this == rhs ); }
+
+ /** Prints out the polygon data.
+ */
+ _OgreExport friend std::ostream& operator<< ( std::ostream& strm, const Polygon& poly );
+
+ };
+
+}
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgrePose.h b/school/informatik/verkerhssimulation/src/ogre/OgrePose.h
new file mode 100644
index 00000000..0a717d25
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgrePose.h
@@ -0,0 +1,111 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2005 The OGRE Team
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __OGRE_POSE_H
+#define __OGRE_POSE_H
+
+#include "OgrePrerequisites.h"
+#include "OgreString.h"
+#include "OgreHardwareVertexBuffer.h"
+#include "OgreVector3.h"
+#include "OgreIteratorWrappers.h"
+
+namespace Ogre {
+
+ /** A pose is a linked set of vertex offsets applying to one set of vertex
+ data.
+ @remarks
+ The target index referred to by the pose has a meaning set by the user
+ of this class; but for example when used by Mesh it refers to either the
+ Mesh shared geometry (0) or a SubMesh dedicated geometry (1+).
+ Pose instances can be referred to by keyframes in VertexAnimationTrack in
+ order to animate based on blending poses together.
+ */
+ class _OgreExport Pose
+ {
+ public:
+ /** Constructor
+ @param target The target vertexdata index (0 for shared, 1+ for
+ dedicated at the submesh index + 1)
+ @param name Optional name
+ */
+ Pose(ushort target, const String& name = StringUtil::BLANK);
+ virtual ~Pose();
+ /// Return the name of the pose (may be blank)
+ const String& getName(void) const { return mName; }
+ /// Return the target geometry index of the pose
+ ushort getTarget(void) const { return mTarget; }
+ /// A collection of vertex offsets based on the vertex index
+ typedef std::map VertexOffsetMap;
+ /// An iterator over the vertex offsets
+ typedef MapIterator VertexOffsetIterator;
+ /// An iterator over the vertex offsets
+ typedef ConstMapIterator ConstVertexOffsetIterator;
+
+ /** Adds an offset to a vertex for this pose.
+ @param index The vertex index
+ @param offset The position offset for this pose
+ */
+ void addVertex(size_t index, const Vector3& offset);
+
+ /** Remove a vertex offset. */
+ void removeVertex(size_t index);
+
+ /** Clear all vertex offsets. */
+ void clearVertexOffsets(void);
+
+ /** Gets an iterator over all the vertex offsets. */
+ ConstVertexOffsetIterator getVertexOffsetIterator(void) const;
+ /** Gets an iterator over all the vertex offsets. */
+ VertexOffsetIterator getVertexOffsetIterator(void);
+ /** Gets a const reference to the vertex offsets. */
+ const VertexOffsetMap& getVertexOffsets(void) const { return mVertexOffsetMap; }
+
+ /** Get a hardware vertex buffer version of the vertex offsets. */
+ const HardwareVertexBufferSharedPtr& _getHardwareVertexBuffer(size_t numVertices) const;
+
+ /** Clone this pose and create another one configured exactly the same
+ way (only really useful for cloning holders of this class).
+ */
+ Pose* clone(void) const;
+ protected:
+ /// Target geometry index
+ ushort mTarget;
+ /// Optional name
+ String mName;
+ /// Primary storage, sparse vertex use
+ VertexOffsetMap mVertexOffsetMap;
+ /// Derived hardware buffer, covers all vertices
+ mutable HardwareVertexBufferSharedPtr mBuffer;
+ };
+ typedef std::vector PoseList;
+
+
+}
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgrePredefinedControllers.h b/school/informatik/verkerhssimulation/src/ogre/OgrePredefinedControllers.h
new file mode 100644
index 00000000..aca67b9c
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgrePredefinedControllers.h
@@ -0,0 +1,285 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __PredefinedControllers_H__
+#define __PredefinedControllers_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreCommon.h"
+#include "OgreController.h"
+#include "OgreFrameListener.h"
+#include "OgreGpuProgram.h"
+
+namespace Ogre {
+
+ //-----------------------------------------------------------------------
+ // Controller Values
+ //-----------------------------------------------------------------------
+ /** Predefined controller value for getting the latest frame time.
+ */
+ class _OgreExport FrameTimeControllerValue : public ControllerValue, public FrameListener
+ {
+ protected:
+ Real mFrameTime;
+ Real mTimeFactor;
+ Real mElapsedTime;
+ Real mFrameDelay;
+
+ public:
+ FrameTimeControllerValue();
+ bool frameEnded(const FrameEvent &evt);
+ bool frameStarted(const FrameEvent &evt);
+ Real getValue(void) const;
+ void setValue(Real value);
+ Real getTimeFactor(void) const;
+ void setTimeFactor(Real tf);
+ Real getFrameDelay(void) const;
+ void setFrameDelay(Real fd);
+ Real getElapsedTime(void) const;
+ void setElapsedTime(Real elapsedTime);
+ };
+
+ //-----------------------------------------------------------------------
+ /** Predefined controller value for getting / setting the frame number of a texture layer
+ */
+ class _OgreExport TextureFrameControllerValue : public ControllerValue
+ {
+ protected:
+ TextureUnitState* mTextureLayer;
+ public:
+ TextureFrameControllerValue(TextureUnitState* t);
+
+ /** Gets the frame number as a parametric value in the range [0,1]
+ */
+ Real getValue(void) const;
+ /** Sets the frame number as a parametric value in the range [0,1]; the actual frame number is value * (numFrames-1).
+ */
+ void setValue(Real value);
+
+ };
+ //-----------------------------------------------------------------------
+ /** Predefined controller value for getting / setting a texture coordinate modifications (scales and translates).
+ @remarks
+ Effects can be applied to the scale or the offset of the u or v coordinates, or both. If separate
+ modifications are required to u and v then 2 instances are required to control both independently, or 4
+ if you ant separate u and v scales as well as separate u and v offsets.
+ @par
+ Because of the nature of this value, it can accept values outside the 0..1 parametric range.
+ */
+ class _OgreExport TexCoordModifierControllerValue : public ControllerValue
+ {
+ protected:
+ bool mTransU, mTransV;
+ bool mScaleU, mScaleV;
+ bool mRotate;
+ TextureUnitState* mTextureLayer;
+ public:
+ /** Constructor.
+ @param
+ t TextureUnitState to apply the modification to.
+ @param
+ translateU If true, the u coordinates will be translated by the modification.
+ @param
+ translateV If true, the v coordinates will be translated by the modification.
+ @param
+ scaleU If true, the u coordinates will be scaled by the modification.
+ @param
+ scaleV If true, the v coordinates will be scaled by the modification.
+ @param
+ rotate If true, the texture will be rotated by the modification.
+ */
+ TexCoordModifierControllerValue(TextureUnitState* t, bool translateU = false, bool translateV = false,
+ bool scaleU = false, bool scaleV = false, bool rotate = false );
+
+ Real getValue(void) const;
+ void setValue(Real value);
+
+ };
+
+ //-----------------------------------------------------------------------
+ /** Predefined controller value for setting a single floating-
+ point value in a constant paramter of a vertex or fragment program.
+ @remarks
+ Any value is accepted, it is propagated into the 'x'
+ component of the constant register identified by the index. If you
+ need to use named parameters, retrieve the index from the param
+ object before setting this controller up.
+ @note
+ Retrieving a value from the program parameters is not currently
+ supported, therefore do not use this controller value as a source,
+ only as a target.
+ */
+ class _OgreExport FloatGpuParameterControllerValue : public ControllerValue
+ {
+ protected:
+ /// The parameters to access
+ GpuProgramParameters* mParams;
+ /// The index of the parameter to e read or set
+ size_t mParamIndex;
+ public:
+ /** Constructor.
+ @param
+ params The parameters object to access
+ @param
+ index The index of the parameter to be set
+ */
+ FloatGpuParameterControllerValue(GpuProgramParameters* params,
+ size_t index );
+
+ ~FloatGpuParameterControllerValue() {}
+
+ Real getValue(void) const;
+ void setValue(Real value);
+
+ };
+ //-----------------------------------------------------------------------
+ // Controller functions
+ //-----------------------------------------------------------------------
+
+ /** Predefined controller function which just passes through the original source
+ directly to dest.
+ */
+ class _OgreExport PassthroughControllerFunction : public ControllerFunction
+ {
+ public:
+ /** Constructor.
+ @param
+ sequenceTime The amount of time in seconds it takes to loop through the whole animation sequence.
+ @param
+ timeOffset The offset in seconds at which to start (default is start at 0)
+ */
+ PassthroughControllerFunction(bool deltaInput = false);
+
+ /** Overriden function.
+ */
+ Real calculate(Real source);
+ };
+
+ /** Predefined controller function for dealing with animation.
+ */
+ class _OgreExport AnimationControllerFunction : public ControllerFunction
+ {
+ protected:
+ Real mSeqTime;
+ Real mTime;
+ public:
+ /** Constructor.
+ @param
+ sequenceTime The amount of time in seconds it takes to loop through the whole animation sequence.
+ @param
+ timeOffset The offset in seconds at which to start (default is start at 0)
+ */
+ AnimationControllerFunction(Real sequenceTime, Real timeOffset = 0.0f);
+
+ /** Overriden function.
+ */
+ Real calculate(Real source);
+
+ /** Set the time value manually. */
+ void setTime(Real timeVal);
+ /** Set the sequence duration value manually. */
+ void setSequenceTime(Real seqVal);
+ };
+
+ //-----------------------------------------------------------------------
+ /** Predefined controller function which simply scales an input to an output value.
+ */
+ class _OgreExport ScaleControllerFunction : public ControllerFunction
+ {
+ protected:
+ Real mScale;
+ public:
+ /** Constructor, requires a scale factor.
+ @param
+ scalefactor The multipier applied to the input to produce the output.
+ @param
+ deltaInput If true, signifies that the input will be a delta value such that the function should
+ add it to an internal counter before calculating the output.
+ */
+ ScaleControllerFunction(Real scalefactor, bool deltaInput);
+
+ /** Overriden method.
+ */
+ Real calculate(Real source);
+
+ };
+
+ //-----------------------------------------------------------------------
+ /** Predefined controller function based on a waveform.
+ @remarks
+ A waveform function translates parametric intput to parametric output based on a wave. The factors
+ affecting the function are:
+ - wave type - the shape of the wave
+ - base - the base value of the output from the wave
+ - frequency - the speed of the wave in cycles per second
+ - phase - the offset of the start of the wave, e.g. 0.5 to start half-way through the wave
+ - amplitude - scales the output so that instead of lying within [0,1] it lies within [0,1] * amplitude
+ - duty cycle - the active width of a PWM signal
+ @par
+ Note that for simplicity of integration with the rest of the controller insfrastructure, the output of
+ the wave is parametric i.e. 0..1, rather than the typical wave output of [-1,1]. To compensate for this, the
+ traditional output of the wave is scaled by the following function before output:
+ @par
+ output = (waveoutput + 1) * 0.5
+ @par
+ Hence a wave output of -1 becomes 0, a wave ouput of 1 becomes 1, and a wave output of 0 becomes 0.5.
+ */
+ class _OgreExport WaveformControllerFunction : public ControllerFunction
+ {
+ protected:
+ WaveformType mWaveType;
+ Real mBase;
+ Real mFrequency;
+ Real mPhase;
+ Real mAmplitude;
+ Real mDutyCycle;
+
+ /** Overridden from ControllerFunction. */
+ Real getAdjustedInput(Real input);
+
+ public:
+ /** Default contructor, requires at least a wave type, other parameters can be defaulted unless required.
+ @param
+ deltaInput If true, signifies that the input will be a delta value such that the function should
+ add it to an internal counter before calculating the output.
+ @param
+ dutyCycle Used in PWM mode to specify the pulse width.
+ */
+ WaveformControllerFunction(WaveformType wType, Real base = 0, Real frequency = 1, Real phase = 0, Real amplitude = 1, bool deltaInput = true, Real dutyCycle = 0.5);
+
+ /** Overriden function.
+ */
+ Real calculate(Real source);
+
+ };
+ //-----------------------------------------------------------------------
+
+}
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgrePrefabFactory.h b/school/informatik/verkerhssimulation/src/ogre/OgrePrefabFactory.h
new file mode 100644
index 00000000..6db90d88
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgrePrefabFactory.h
@@ -0,0 +1,66 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __PrefabFactory_H__
+#define __PrefabFactory_H__
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre {
+
+ /** A factory class that can create various mesh prefabs.
+ @remarks
+ This class is used by OgreMeshManager to offload the loading of various prefab types
+ to a central location.
+ */
+ class _OgreExport PrefabFactory
+ {
+ public:
+ /** If the given mesh has a known prefab resource name (e.g "Prefab_Plane")
+ then this prefab will be created as a submesh of the given mesh.
+
+ @param mesh The mesh that the potential prefab will be created in.
+ @returns true if a prefab has been created, otherwise false.
+ */
+ static bool createPrefab(Mesh* mesh);
+
+ private:
+ /// Creates a plane as a submesh of the given mesh
+ static void createPlane(Mesh* mesh);
+
+ /// Creates a 100x100x100 cube as a submesh of the given mesh
+ static void createCube(Mesh* mesh);
+
+ /// Creates a sphere with a diameter of 100 units as a submesh of the given mesh
+ static void createSphere(Mesh* mesh);
+ };
+
+} // namespace Ogre
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgrePrerequisites.h b/school/informatik/verkerhssimulation/src/ogre/OgrePrerequisites.h
new file mode 100644
index 00000000..a7d3c3f6
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgrePrerequisites.h
@@ -0,0 +1,390 @@
+/*-------------------------------------------------------------------------
+This source file is a part of OGRE
+(Object-oriented Graphics Rendering Engine)
+
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This library is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License (LGPL) as
+published by the Free Software Foundation; either version 2.1 of the
+License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this library; if not, write to the Free Software Foundation,
+Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA or go to
+http://www.gnu.org/copyleft/lesser.txt
+-------------------------------------------------------------------------*/
+#ifndef __OgrePrerequisites_H__
+#define __OgrePrerequisites_H__
+
+// undefine this to not require new angular units where applicable
+#define OGRE_FORCE_ANGLE_TYPES
+
+// Platform-specific stuff
+#include "OgrePlatform.h"
+
+#if OGRE_COMPILER == OGRE_COMPILER_MSVC
+// Turn off warnings generated by long std templates
+// This warns about truncation to 255 characters in debug/browse info
+# pragma warning (disable : 4786)
+
+// Turn off warnings generated by long std templates
+// This warns about truncation to 255 characters in debug/browse info
+# pragma warning (disable : 4503)
+
+// disable: "conversion from 'double' to 'float', possible loss of data
+# pragma warning (disable : 4244)
+
+// disable: "truncation from 'double' to 'float'
+# pragma warning (disable : 4305)
+
+// disable: " needs to have dll-interface to be used by clients'
+// Happens on STL member variables which are not public therefore is ok
+# pragma warning (disable : 4251)
+
+// disable: "non dll-interface class used as base for dll-interface class"
+// Happens when deriving from Singleton because bug in compiler ignores
+// template export
+# pragma warning (disable : 4275)
+
+// disable: "C++ Exception Specification ignored"
+// This is because MSVC 6 did not implement all the C++ exception
+// specifications in the ANSI C++ draft.
+# pragma warning( disable : 4290 )
+
+// disable: "no suitable definition provided for explicit template
+// instantiation request" Occurs in VC7 for no justifiable reason on all
+// #includes of Singleton
+# pragma warning( disable: 4661)
+
+// disable: deprecation warnings when using CRT calls in VC8
+// These show up on all C runtime lib code in VC8, disable since they clutter
+// the warnings with things we may not be able to do anything about (e.g.
+// generated code from nvparse etc). I doubt very much that these calls
+// will ever be actually removed from VC anyway, it would break too much code.
+# pragma warning( disable: 4996)
+
+// disable: "conditional expression constant", always occurs on
+// OGRE_MUTEX_CONDITIONAL when no threading enabled
+# pragma warning (disable : 201)
+
+#endif
+
+/* Include all the standard header *after* all the configuration
+ settings have been made.
+*/
+//#include "OgreStdHeaders.h"
+
+
+#include "OgreMemoryManager.h"
+
+namespace Ogre {
+ // Define ogre version
+ #define OGRE_VERSION_MAJOR 1
+ #define OGRE_VERSION_MINOR 4
+ #define OGRE_VERSION_PATCH 4
+ #define OGRE_VERSION_SUFFIX ""
+ #define OGRE_VERSION_NAME "Eihort"
+
+ #define OGRE_VERSION ((OGRE_VERSION_MAJOR << 16) | (OGRE_VERSION_MINOR << 8) | OGRE_VERSION_PATCH)
+
+ // define the real number values to be used
+ // default to use 'float' unless precompiler option set
+ #if OGRE_DOUBLE_PRECISION == 1
+ /** Software floating point type.
+ @note Not valid as a pointer to GPU buffers / parameters
+ */
+ typedef double Real;
+ #else
+ /** Software floating point type.
+ @note Not valid as a pointer to GPU buffers / parameters
+ */
+ typedef float Real;
+ #endif
+
+ #if OGRE_COMPILER == OGRE_COMPILER_GNUC && OGRE_COMP_VER >= 310 && !defined(STLPORT)
+ # define HashMap ::__gnu_cxx::hash_map
+ #else
+ # if OGRE_COMPILER == OGRE_COMPILER_MSVC
+ # if OGRE_COMP_VER > 1300 && !defined(_STLP_MSVC)
+ # define HashMap ::stdext::hash_map
+ # else
+ # define HashMap ::std::hash_map
+ # endif
+ # else
+ # define HashMap ::std::hash_map
+ # endif
+ #endif
+
+ /** In order to avoid finger-aches :)
+ */
+ typedef unsigned char uchar;
+ typedef unsigned short ushort;
+ typedef unsigned int uint;
+ typedef unsigned long ulong;
+
+ /// Useful macros
+ #define OGRE_DELETE(p) { if(p) { delete (p); (p)=NULL; } }
+ #define OGRE_DELETE_ARRAY(p) { if(p) { delete[] (p); (p)=NULL; } }
+
+ #if OGRE_WCHAR_T_STRINGS
+ typedef std::wstring _StringBase;
+ #else
+ typedef std::string _StringBase;
+ #endif
+
+ typedef _StringBase String;
+
+ // Useful threading defines
+ #define OGRE_AUTO_MUTEX_NAME mutex
+ #if OGRE_THREAD_SUPPORT
+ #define OGRE_AUTO_MUTEX mutable boost::recursive_mutex OGRE_AUTO_MUTEX_NAME;
+ #define OGRE_LOCK_AUTO_MUTEX boost::recursive_mutex::scoped_lock ogreAutoMutexLock(OGRE_AUTO_MUTEX_NAME);
+ #define OGRE_MUTEX(name) mutable boost::recursive_mutex name;
+ #define OGRE_STATIC_MUTEX(name) static boost::recursive_mutex name;
+ #define OGRE_STATIC_MUTEX_INSTANCE(name) boost::recursive_mutex name;
+ #define OGRE_LOCK_MUTEX(name) boost::recursive_mutex::scoped_lock ogrenameLock(name);
+ #define OGRE_LOCK_MUTEX_NAMED(mutexName, lockName) boost::recursive_mutex::scoped_lock lockName(mutexName);
+ // like OGRE_AUTO_MUTEX but mutex held by pointer
+ #define OGRE_AUTO_SHARED_MUTEX mutable boost::recursive_mutex *OGRE_AUTO_MUTEX_NAME;
+ #define OGRE_LOCK_AUTO_SHARED_MUTEX assert(OGRE_AUTO_MUTEX_NAME); boost::recursive_mutex::scoped_lock ogreAutoMutexLock(*OGRE_AUTO_MUTEX_NAME);
+ #define OGRE_NEW_AUTO_SHARED_MUTEX assert(!OGRE_AUTO_MUTEX_NAME); OGRE_AUTO_MUTEX_NAME = new boost::recursive_mutex();
+ #define OGRE_DELETE_AUTO_SHARED_MUTEX assert(OGRE_AUTO_MUTEX_NAME); delete OGRE_AUTO_MUTEX_NAME;
+ #define OGRE_COPY_AUTO_SHARED_MUTEX(from) assert(!OGRE_AUTO_MUTEX_NAME); OGRE_AUTO_MUTEX_NAME = from;
+ #define OGRE_SET_AUTO_SHARED_MUTEX_NULL OGRE_AUTO_MUTEX_NAME = 0;
+ #define OGRE_MUTEX_CONDITIONAL(mutex) if (mutex)
+ #define OGRE_THREAD_SYNCHRONISER(sync) boost::condition sync;
+ #define OGRE_THREAD_WAIT(sync, lock) sync.wait(lock);
+ #define OGRE_THREAD_NOTIFY_ONE(sync) sync.notify_one();
+ #define OGRE_THREAD_NOTIFY_ALL(sync) sync.notify_all();
+ // Thread-local pointer
+ #define OGRE_THREAD_POINTER(T, var) boost::thread_specific_ptr var
+ #define OGRE_THREAD_POINTER_SET(var, expr) var.reset(expr)
+ #define OGRE_THREAD_POINTER_DELETE(var) var.reset(0)
+ #define OGRE_THREAD_POINTER_GET(var) var.get()
+ #else
+ #define OGRE_AUTO_MUTEX
+ #define OGRE_LOCK_AUTO_MUTEX
+ #define OGRE_MUTEX(name)
+ #define OGRE_STATIC_MUTEX(name)
+ #define OGRE_STATIC_MUTEX_INSTANCE(name)
+ #define OGRE_LOCK_MUTEX(name)
+ #define OGRE_LOCK_MUTEX_NAMED(mutexName, lockName)
+ #define OGRE_AUTO_SHARED_MUTEX
+ #define OGRE_LOCK_AUTO_SHARED_MUTEX
+ #define OGRE_NEW_AUTO_SHARED_MUTEX
+ #define OGRE_DELETE_AUTO_SHARED_MUTEX
+ #define OGRE_COPY_AUTO_SHARED_MUTEX(from)
+ #define OGRE_SET_AUTO_SHARED_MUTEX_NULL
+ #define OGRE_MUTEX_CONDITIONAL(name) if(true)
+ #define OGRE_THREAD_SYNCHRONISER(sync)
+ #define OGRE_THREAD_WAIT(sync, lock)
+ #define OGRE_THREAD_NOTIFY_ONE(sync)
+ #define OGRE_THREAD_NOTIFY_ALL(sync)
+ #define OGRE_THREAD_POINTER(T, var) T* var
+ #define OGRE_THREAD_POINTER_SET(var, expr) var = expr
+ #define OGRE_THREAD_POINTER_DELETE(var) delete var; var = 0
+ #define OGRE_THREAD_POINTER_GET(var) var
+ #endif
+
+
+// Pre-declare classes
+// Allows use of pointers in header files without including individual .h
+// so decreases dependencies between files
+ class Angle;
+ class Animation;
+ class AnimationState;
+ class AnimationStateSet;
+ class AnimationTrack;
+ class Archive;
+ class ArchiveFactory;
+ class ArchiveManager;
+ class AutoParamDataSource;
+ class AxisAlignedBox;
+ class AxisAlignedBoxSceneQuery;
+ class Billboard;
+ class BillboardChain;
+ class BillboardSet;
+ class Bone;
+ class Camera;
+ class Codec;
+ class ColourValue;
+ class ConfigDialog;
+ template class Controller;
+ template class ControllerFunction;
+ class ControllerManager;
+ template class ControllerValue;
+ class Degree;
+ class DynLib;
+ class DynLibManager;
+ class EdgeData;
+ class EdgeListBuilder;
+ class Entity;
+ class ErrorDialog;
+ class ExternalTextureSourceManager;
+ class Factory;
+ class Font;
+ class FontPtr;
+ class FontManager;
+ struct FrameEvent;
+ class FrameListener;
+ class Frustum;
+ class GpuProgram;
+ class GpuProgramPtr;
+ class GpuProgramManager;
+ class GpuProgramUsage;
+ class HardwareIndexBuffer;
+ class HardwareOcclusionQuery;
+ class HardwareVertexBuffer;
+ class HardwarePixelBuffer;
+ class HardwarePixelBufferSharedPtr;
+ class HighLevelGpuProgram;
+ class HighLevelGpuProgramPtr;
+ class HighLevelGpuProgramManager;
+ class HighLevelGpuProgramFactory;
+ class IndexData;
+ class IntersectionSceneQuery;
+ class IntersectionSceneQueryListener;
+ class Image;
+ class KeyFrame;
+ class Light;
+ class Log;
+ class LogManager;
+ class ManualResourceLoader;
+ class ManualObject;
+ class Material;
+ class MaterialPtr;
+ class MaterialManager;
+ class MaterialScriptCompiler;
+ class Math;
+ class Matrix3;
+ class Matrix4;
+ class MemoryManager;
+ class Mesh;
+ class MeshPtr;
+ class MeshSerializer;
+ class MeshSerializerImpl;
+ class MeshManager;
+ class MovableObject;
+ class MovablePlane;
+ class Node;
+ class NodeAnimationTrack;
+ class NodeKeyFrame;
+ class NumericAnimationTrack;
+ class NumericKeyFrame;
+ class Overlay;
+ class OverlayContainer;
+ class OverlayElement;
+ class OverlayElementFactory;
+ class OverlayManager;
+ class Particle;
+ class ParticleAffector;
+ class ParticleAffectorFactory;
+ class ParticleEmitter;
+ class ParticleEmitterFactory;
+ class ParticleSystem;
+ class ParticleSystemManager;
+ class ParticleSystemRenderer;
+ class ParticleSystemRendererFactory;
+ class ParticleVisualData;
+ class Pass;
+ class PatchMesh;
+ class PixelBox;
+ class Plane;
+ class PlaneBoundedVolume;
+ class Plugin;
+ class Pose;
+ class ProgressiveMesh;
+ class Profile;
+ class Profiler;
+ class Quaternion;
+ class Radian;
+ class Ray;
+ class RaySceneQuery;
+ class RaySceneQueryListener;
+ class Renderable;
+ class RenderPriorityGroup;
+ class RenderQueue;
+ class RenderQueueGroup;
+ class RenderQueueInvocation;
+ class RenderQueueInvocationSequence;
+ class RenderQueueListener;
+ class RenderSystem;
+ class RenderSystemCapabilities;
+ class RenderTarget;
+ class RenderTargetListener;
+ class RenderTexture;
+ class MultiRenderTarget;
+ class RenderWindow;
+ class RenderOperation;
+ class Resource;
+ class ResourceBackgroundQueue;
+ class ResourceGroupManager;
+ class ResourceManager;
+ class RibbonTrail;
+ class Root;
+ class SceneManager;
+ class SceneManagerEnumerator;
+ class SceneNode;
+ class SceneQuery;
+ class SceneQueryListener;
+ class ScriptLoader;
+ class Serializer;
+ class ShadowCaster;
+ class ShadowRenderable;
+ class ShadowTextureManager;
+ class SimpleRenderable;
+ class SimpleSpline;
+ class Skeleton;
+ class SkeletonPtr;
+ class SkeletonInstance;
+ class SkeletonManager;
+ class Sphere;
+ class SphereSceneQuery;
+ class StaticGeometry;
+ class StringConverter;
+ class StringInterface;
+ class SubEntity;
+ class SubMesh;
+ class TagPoint;
+ class Technique;
+ class TempBlendedBufferInfo;
+ class ExternalTextureSource;
+ class TextureUnitState;
+ class Texture;
+ class TexturePtr;
+ class TextureFont;
+ class TextureManager;
+ class TransformKeyFrame;
+ class Timer;
+ class UserDefinedObject;
+ class Vector2;
+ class Vector3;
+ class Vector4;
+ class Viewport;
+ class VertexAnimationTrack;
+ class VertexBufferBinding;
+ class VertexData;
+ class VertexDeclaration;
+ class VertexMorphKeyFrame;
+ class WireBoundingBox;
+ class Compositor;
+ class CompositorManager;
+ class CompositorChain;
+ class CompositorInstance;
+ class CompositionTechnique;
+ class CompositionPass;
+ class CompositionTargetPass;
+}
+
+#endif // __OgrePrerequisites_H__
+
+
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreProfiler.h b/school/informatik/verkerhssimulation/src/ogre/OgreProfiler.h
new file mode 100644
index 00000000..0c862324
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreProfiler.h
@@ -0,0 +1,415 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+/*
+
+ Although the code is original, many of the ideas for the profiler were borrowed from
+"Real-Time In-Game Profiling" by Steve Rabin which can be found in Game Programming
+Gems 1.
+
+ This code can easily be adapted to your own non-Ogre project. The only code that is
+Ogre-dependent is in the visualization/logging routines and the use of the Timer class.
+
+ Enjoy!
+
+*/
+
+#ifndef __Profiler_H__
+#define __Profiler_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreSingleton.h"
+#include "OgreString.h"
+#include "OgreOverlay.h"
+
+#if OGRE_PROFILING == 1
+# if OGRE_COMPILER != OGRE_COMPILER_BORL
+# define OgreProfile( a ) Ogre::Profile _OgreProfileInstance( (a) )
+# define OgreProfileBegin( a ) Ogre::Profiler::getSingleton().beginProfile( (a) )
+# define OgreProfileEnd( a ) Ogre::Profiler::getSingleton().endProfile( (a) )
+# else
+# define OgreProfile( a ) Ogre::Profile _OgreProfileInstance( __FUNC__ )
+# define OgreProfileBegin( a ) Ogre::Profiler::getSingleton().beginProfile( __FUNC__ )
+# define OgreProfileEnd( a ) Ogre::Profiler::getSingleton().endProfile( __FUNC__ )
+# endif
+#else
+# define OgreProfile( a )
+# define OgreProfileBegin( a )
+# define OgreProfileEnd( a )
+#endif
+
+namespace Ogre {
+
+ /** An individual profile that will be processed by the Profiler
+ @remarks
+ Use the macro OgreProfile(name) instead of instantiating this profile directly
+ @remarks
+ We use this Profile to allow scoping rules to signify the beginning and end of
+ the profile. Use the Profiler singleton (through the macro OgreProfileBegin(name)
+ and OgreProfileEnd(name)) directly if you want a profile to last
+ outside of a scope (ie the main game loop).
+ @author Amit Mathew (amitmathew (at) yahoo (dot) com)
+ */
+ class _OgreExport Profile {
+
+ public:
+ Profile(const String& profileName);
+ ~Profile();
+
+ protected:
+
+ /// The name of this profile
+ String mName;
+
+
+ };
+
+ /** The profiler allows you to measure the performance of your code
+ @remarks
+ Do not create profiles directly from this unless you want a profile to last
+ outside of its scope (ie the main game loop). For most cases, use the macro
+ OgreProfile(name) and braces to limit the scope. You must enable the Profile
+ before you can used it with setEnabled(true). If you want to disable profiling
+ in Ogre, simply set the macro OGRE_PROFILING to 0.
+ @author Amit Mathew (amitmathew (at) yahoo (dot) com)
+ @todo resolve artificial cap on number of profiles displayed
+ @todo fix display ordering of profiles not called every frame
+ */
+ class _OgreExport Profiler : public Singleton {
+
+ public:
+ Profiler();
+ ~Profiler();
+
+ /** Sets the timer for the profiler */
+ void setTimer(Timer* t);
+
+ /** Retrieves the timer for the profiler */
+ Timer* getTimer();
+
+ /** Begins a profile
+ @remarks
+ Use the macro OgreProfileBegin(name) instead of calling this directly
+ so that profiling can be ignored in the release version of your app.
+ @remarks
+ You only use the macro (or this) if you want a profile to last outside
+ of its scope (ie the main game loop). If you use this function, make sure you
+ use a corresponding OgreProfileEnd(name). Usually you would use the macro
+ OgreProfile(name). This function will be ignored for a profile that has been
+ disabled or if the profiler is disabled.
+ @param profileName Must be unique and must not be an empty string
+ */
+ void beginProfile(const String& profileName);
+
+ /** Ends a profile
+ @remarks
+ Use the macro OgreProfileEnd(name) instead of calling this directly so that
+ profiling can be ignored in the release version of your app.
+ @remarks
+ This function is usually not called directly unless you want a profile to
+ last outside of its scope. In most cases, using the macro OgreProfile(name)
+ which will call this function automatically when it goes out of scope. Make
+ sure the name of this profile matches its corresponding beginProfile name.
+ This function will be ignored for a profile that has been disabled or if the
+ profiler is disabled.
+ */
+ void endProfile(const String& profileName);
+
+ /** Sets whether this profiler is enabled. Only takes effect after the
+ the frame has ended.
+ @remarks When this is called the first time with the parameter true,
+ it initializes the GUI for the Profiler
+ */
+ void setEnabled(bool enabled);
+
+ /** Gets whether this profiler is enabled */
+ bool getEnabled() const;
+
+ /** Enables a previously disabled profile
+ @remarks Only enables the profile if this function is not
+ called during the profile it is trying to enable.
+ */
+ void enableProfile(const String& profileName);
+
+ /** Disables a profile
+ @remarks Only disables the profile if this function is not called during
+ the profile it is trying to disable.
+ */
+ void disableProfile(const String& profileName);
+
+ /** Returns true if the specified profile reaches a new frame time maximum
+ @remarks If this is called during a frame, it will be reading the results
+ from the previous frame. Therefore, it is best to use this after the frame
+ has ended.
+ */
+ bool watchForMax(const String& profileName);
+
+ /** Returns true if the specified profile reaches a new frame time minimum
+ @remarks If this is called during a frame, it will be reading the results
+ from the previous frame. Therefore, it is best to use this after the frame
+ has ended.
+ */
+ bool watchForMin(const String& profileName);
+
+ /** Returns true if the specified profile goes over or under the given limit
+ frame time
+ @remarks If this is called during a frame, it will be reading the results
+ from the previous frame. Therefore, it is best to use this after the frame
+ has ended.
+ @param limit A number between 0 and 1 representing the percentage of frame time
+ @param greaterThan If true, this will return whether the limit is exceeded. Otherwise,
+ it will return if the frame time has gone under this limit.
+ */
+ bool watchForLimit(const String& profileName, Real limit, bool greaterThan = true);
+
+ /** Outputs current profile statistics to the log */
+ void logResults();
+
+ /** Clears the profiler statistics */
+ void reset();
+
+ /** Sets the Profiler so the display of results are updated ever n frames*/
+ void setUpdateDisplayFrequency(uint freq);
+
+ /** Gets the frequency that the Profiler display is updated */
+ uint getUpdateDisplayFrequency() const;
+
+ /** Override standard Singleton retrieval.
+ @remarks
+ Why do we do this? Well, it's because the Singleton
+ implementation is in a .h file, which means it gets compiled
+ into anybody who includes it. This is needed for the
+ Singleton template to work, but we actually only want it
+ compiled into the implementation of the class based on the
+ Singleton, not all of them. If we don't change this, we get
+ link errors when trying to use the Singleton-based class from
+ an outside dll.
+ @par
+ This method just delegates to the template version anyway,
+ but the implementation stays in this single compilation unit,
+ preventing link errors.
+ */
+ static Profiler& getSingleton(void);
+ /** Override standard Singleton retrieval.
+ @remarks
+ Why do we do this? Well, it's because the Singleton
+ implementation is in a .h file, which means it gets compiled
+ into anybody who includes it. This is needed for the
+ Singleton template to work, but we actually only want it
+ compiled into the implementation of the class based on the
+ Singleton, not all of them. If we don't change this, we get
+ link errors when trying to use the Singleton-based class from
+ an outside dll.
+ @par
+ This method just delegates to the template version anyway,
+ but the implementation stays in this single compilation unit,
+ preventing link errors.
+ */
+ static Profiler* getSingletonPtr(void);
+
+ protected:
+
+ /** Initializes the profiler's gui elements */
+ void initialize();
+
+ /** Prints the profiling results of each frame */
+ void displayResults();
+
+ /** Processes the profiler data after each frame */
+ void processFrameStats();
+
+ /** Handles a change of the profiler's enabled state*/
+ void changeEnableState();
+
+ /** An internal function to create the container which will hold our display elements*/
+ OverlayContainer* createContainer();
+
+ /** An internal function to create a text area */
+ OverlayElement* createTextArea(const String& name, Real width, Real height, Real top, Real left,
+ uint fontSize, const String& caption, bool show = true);
+
+ /** An internal function to create a panel */
+ OverlayElement* createPanel(const String& name, Real width, Real height, Real top, Real left,
+ const String& materialName, bool show = true);
+
+ /// Represents an individual profile call
+ struct ProfileInstance {
+
+ /// The name of the profile
+ String name;
+
+ /// The name of the parent, empty string if root
+ String parent;
+
+ /// The time this profile was started
+ ulong currTime;
+
+ /// Represents the total time of all child profiles to subtract
+ /// from this profile
+ ulong accum;
+
+ /// The hierarchical level of this profile, 0 being the root profile
+ uint hierarchicalLvl;
+ };
+
+ /// Represents the total timing information of a profile
+ /// since profiles can be called more than once each frame
+ struct ProfileFrame {
+
+ /// The name of the profile
+ String name;
+
+ /// The total time this profile has taken this frame
+ ulong frameTime;
+
+ /// The number of times this profile was called this frame
+ uint calls;
+
+ /// The hierarchical level of this profile, 0 being the main loop
+ uint hierarchicalLvl;
+
+ };
+
+ /// Represents a history of each profile during the duration of the app
+ struct ProfileHistory {
+
+ /// The name of the profile
+ String name;
+
+ /// The current percentage of frame time this profile has taken
+ Real currentTime; // %
+
+ /// The maximum percentage of frame time this profile has taken
+ Real maxTime; // %
+
+ /// The minimum percentage of frame time this profile has taken
+ Real minTime; // %
+
+ /// The number of times this profile has been called each frame
+ uint numCallsThisFrame;
+
+ /// The total percentage of frame time this profile has taken
+ /// (used to calculate average)
+ Real totalTime; // %
+
+ /// The total number of times this profile was called
+ /// (used to calculate average)
+ ulong totalCalls; // %
+
+ /// The hierarchical level of this profile, 0 being the root profile
+ uint hierarchicalLvl;
+
+ };
+
+
+ typedef std::list ProfileStack;
+ typedef std::list ProfileFrameList;
+ typedef std::list ProfileHistoryList;
+ typedef std::map ProfileHistoryMap;
+ typedef std::map DisabledProfileMap;
+
+ typedef std::list ProfileBarList;
+
+ /// A stack for each individual profile per frame
+ ProfileStack mProfiles;
+
+ /// Accumulates the results of each profile per frame (since a profile can be called
+ /// more than once a frame)
+ ProfileFrameList mProfileFrame;
+
+ /// Keeps track of the statistics of each profile
+ ProfileHistoryList mProfileHistory;
+
+ /// We use this for quick look-ups of profiles in the history list
+ ProfileHistoryMap mProfileHistoryMap;
+
+ /// Holds the names of disabled profiles
+ DisabledProfileMap mDisabledProfiles;
+
+ /// Holds the display bars for each profile results
+ ProfileBarList mProfileBars;
+
+ /// Whether the GUI elements have been initialized
+ bool mInitialized;
+
+ /// The max number of profiles we can display
+ uint maxProfiles;
+
+ /// The overlay which contains our profiler results display
+ Overlay* mOverlay;
+
+ /// The window that displays the profiler results
+ OverlayContainer* mProfileGui;
+
+ /// The height of each bar
+ Real mBarHeight;
+
+ /// The height of the stats window
+ Real mGuiHeight;
+
+ /// The width of the stats window
+ Real mGuiWidth;
+
+ /// The size of the indent for each profile display bar
+ Real mBarIndent;
+
+ /// The width of the border between the profile window and each bar
+ Real mGuiBorderWidth;
+
+ /// The width of the min, avg, and max lines in a profile display
+ Real mBarLineWidth;
+
+ /// The number of frames that must elapse before the current
+ /// frame display is updated
+ uint mUpdateDisplayFrequency;
+
+ /// The number of elasped frame, used with mUpdateDisplayFrequency
+ uint mCurrentFrame;
+
+ /// The timer used for profiling
+ Timer* mTimer;
+
+ /// The total time each frame takes
+ ulong mTotalFrameTime;
+
+ /// Whether this profiler is enabled
+ bool mEnabled;
+
+ /// Keeps track of whether this profiler has
+ /// received a request to be enabled/disabled
+ bool mEnableStateChangePending;
+
+ /// Keeps track of the new enabled/disabled state that the user has requested
+ /// which will be applied after the frame ends
+ bool mNewEnableState;
+
+ }; // end class
+
+} // end namespace
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreProgressiveMesh.h b/school/informatik/verkerhssimulation/src/ogre/OgreProgressiveMesh.h
new file mode 100644
index 00000000..19b898fe
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreProgressiveMesh.h
@@ -0,0 +1,248 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+// The underlying algorithms in this class are based heavily on:
+/*
+ * Progressive Mesh type Polygon Reduction Algorithm
+ * by Stan Melax (c) 1998
+ */
+
+#ifndef __ProgressiveMesh_H_
+#define __ProgressiveMesh_H_
+
+#include "OgrePrerequisites.h"
+#include "OgreVector3.h"
+#include "OgreHardwareVertexBuffer.h"
+#include "OgreHardwareIndexBuffer.h"
+#include "OgreRenderOperation.h"
+
+namespace Ogre {
+
+ /** This class reduces the complexity of the geometry it is given.
+ This class is dedicated to reducing the number of triangles in a given mesh
+ taking into account seams in both geometry and texture co-ordinates and meshes
+ which have multiple frames.
+ @par
+ The primary use for this is generating LOD versions of Mesh objects, but it can be
+ used by any geometry provider. The only limitation at the moment is that the
+ provider uses a common vertex buffer for all LODs and one index buffer per LOD.
+ Therefore at the moment this class can only handle indexed geometry.
+ @par
+ NB the interface of this class will certainly change when compiled vertex buffers are
+ supported.
+ */
+ class _OgreExport ProgressiveMesh
+ {
+ public:
+
+ /** The way to derive the quota of vertices which are reduced at each LOD. */
+ enum VertexReductionQuota
+ {
+ /// A set number of vertices are removed at each reduction
+ VRQ_CONSTANT,
+ /// A proportion of the remaining number of vertices are removed at each reduction
+ VRQ_PROPORTIONAL
+ };
+
+ typedef std::vector LODFaceList;
+
+ /** Constructor, takes the geometry data and index buffer.
+ @remarks
+ DO NOT pass write-only, unshadowed buffers to this method! They will not
+ work. Pass only shadowed buffers, or better yet perform mesh reduction as
+ an offline process using DefaultHardwareBufferManager to manage vertex
+ buffers in system memory.
+ */
+ ProgressiveMesh(const VertexData* vertexData, const IndexData* indexData);
+ virtual ~ProgressiveMesh();
+
+ /** Adds an extra vertex position buffer.
+ @remarks
+ As well as the main vertex buffer, the client of this class may add extra versions
+ of the vertex buffer which will also be taken into account when the cost of
+ simplifying the mesh is taken into account. This is because the cost of
+ simplifying an animated mesh cannot be calculated from just the reference position,
+ multiple positions needs to be assessed in order to find the best simplification option.
+ @par
+ DO NOT pass write-only, unshadowed buffers to this method! They will not
+ work. Pass only shadowed buffers, or better yet perform mesh reduction as
+ an offline process using DefaultHardwareBufferManager to manage vertex
+ buffers in system memory.
+ @param buffer Pointer to x/y/z buffer with vertex positions. The number of vertices
+ must be the same as in the original GeometryData passed to the constructor.
+ */
+ virtual void addExtraVertexPositionBuffer(const VertexData* vertexData);
+
+ /** Builds the progressive mesh with the specified number of levels.
+ @param numLevels The number of levels to include in the output excluding the full detail version.
+ @param outList Pointer to a list of LOD geometry data which will be completed by the application.
+ Each entry is a reduced form of the mesh, in decreasing order of detail.
+ @param quota The way to derive the number of vertices removed at each LOD
+ @param reductionValue Either the proportion of vertices to remove at each level, or a fixed
+ number of vertices to remove at each level, depending on the value of quota
+ */
+ virtual void build(ushort numLevels, LODFaceList* outList,
+ VertexReductionQuota quota = VRQ_PROPORTIONAL, Real reductionValue = 0.5f );
+
+ protected:
+ const VertexData *mpVertexData;
+ const IndexData *mpIndexData;
+
+ size_t mCurrNumIndexes;
+ size_t mNumCommonVertices;
+
+ // Internal classes
+ class PMTriangle;
+ class PMVertex;
+
+ public: // VC6 hack
+
+ /** A vertex as used by a face. This records the index of the actual vertex which is used
+ by the face, and a pointer to the common vertex used for surface evaluation. */
+ class _OgrePrivate PMFaceVertex {
+ public:
+ size_t realIndex;
+ PMVertex* commonVertex;
+ };
+
+ protected:
+
+ /** A triangle in the progressive mesh, holds extra info like face normal. */
+ class _OgrePrivate PMTriangle {
+ public:
+ PMTriangle();
+ void setDetails(size_t index, PMFaceVertex *v0, PMFaceVertex *v1, PMFaceVertex *v2);
+ void computeNormal(void);
+ void replaceVertex(PMFaceVertex *vold, PMFaceVertex *vnew);
+ bool hasCommonVertex(PMVertex *v) const;
+ bool hasFaceVertex(PMFaceVertex *v) const;
+ PMFaceVertex* getFaceVertexFromCommon(PMVertex* commonVert);
+ void notifyRemoved(void);
+
+ PMFaceVertex* vertex[3]; // the 3 points that make this tri
+ Vector3 normal; // unit vector othogonal to this face
+ bool removed; // true if this tri is now removed
+ size_t index;
+ };
+
+ /** A vertex in the progressive mesh, holds info like collapse cost etc.
+ This vertex can actually represent several vertices in the final model, because
+ vertices along texture seams etc will have been duplicated. In order to properly
+ evaluate the surface properties, a single common vertex is used for these duplicates,
+ and the faces hold the detail of the duplicated vertices.
+ */
+ class _OgrePrivate PMVertex {
+ public:
+ PMVertex();
+ void setDetails(const Vector3& v, size_t index);
+ void removeIfNonNeighbor(PMVertex *n);
+ bool isBorder(void);/// true if this vertex is on the edge of an open geometry patch
+ bool isManifoldEdgeWith(PMVertex* v); // is edge this->src a manifold edge?
+ void notifyRemoved(void);
+
+ Vector3 position; // location of point in euclidean space
+ size_t index; // place of vertex in original list
+ typedef std::set NeighborList;
+ typedef std::set DuplicateList;
+ NeighborList neighbor; // adjacent vertices
+ typedef std::set FaceList;
+ FaceList face; // adjacent triangles
+
+ Real collapseCost; // cached cost of collapsing edge
+ PMVertex * collapseTo; // candidate vertex for collapse
+ bool removed; // true if this vert is now removed
+ bool toBeRemoved; // denug
+
+ bool seam; /// true if this vertex is on a model seam where vertices are duplicated
+
+ };
+
+ typedef std::vector TriangleList;
+ typedef std::vector FaceVertexList;
+ typedef std::vector CommonVertexList;
+ typedef std::vector WorstCostList;
+
+ /// Data used to calculate the collapse costs
+ struct PMWorkingData
+ {
+ TriangleList mTriList; /// List of faces
+ FaceVertexList mFaceVertList; // The vertex details referenced by the triangles
+ CommonVertexList mVertList; // The master list of common vertices
+ };
+
+ typedef std::vector WorkingDataList;
+ /// Multiple copies, 1 per vertex buffer
+ WorkingDataList mWorkingData;
+
+ /// The worst collapse cost from all vertex buffers for each vertex
+ WorstCostList mWorstCosts;
+
+ /// Internal method for building PMWorkingData from geometry data
+ void addWorkingData(const VertexData* vertexData, const IndexData* indexData);
+
+ /// Internal method for initialising the edge collapse costs
+ void initialiseEdgeCollapseCosts(void);
+ /// Internal calculation method for deriving a collapse cost from u to v
+ Real computeEdgeCollapseCost(PMVertex *src, PMVertex *dest);
+ /// Internal method evaluates all collapse costs from this vertex and picks the lowest for a single buffer
+ Real computeEdgeCostAtVertexForBuffer(WorkingDataList::iterator idata, size_t vertIndex);
+ /// Internal method evaluates all collapse costs from this vertex for every buffer and returns the worst
+ void computeEdgeCostAtVertex(size_t vertIndex);
+ /// Internal method to compute edge collapse costs for all buffers /
+ void computeAllCosts(void);
+ /// Internal method for getting the index of next best vertex to collapse
+ size_t getNextCollapser(void);
+ /// Internal method builds an new LOD based on the current state
+ void bakeNewLOD(IndexData* pData);
+
+ /** Internal method, collapses vertex onto it's saved collapse target.
+ @remarks
+ This updates the working triangle list to drop a triangle and recalculates
+ the edge collapse costs around the collapse target.
+ This also updates all the working vertex lists for the relevant buffer.
+ */
+ void collapse(PMVertex *collapser);
+
+ /** Internal debugging method */
+ void dumpContents(const String& log);
+
+
+
+
+
+
+
+
+
+ };
+
+
+
+}
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreQuaternion.h b/school/informatik/verkerhssimulation/src/ogre/OgreQuaternion.h
new file mode 100644
index 00000000..872d1ff0
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreQuaternion.h
@@ -0,0 +1,277 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+// NOTE THAT THIS FILE IS BASED ON MATERIAL FROM:
+
+// Magic Software, Inc.
+// http://www.geometrictools.com/
+// Copyright (c) 2000, All Rights Reserved
+//
+// Source code from Magic Software is supplied under the terms of a license
+// agreement and may not be copied or disclosed except in accordance with the
+// terms of that agreement. The various license agreements may be found at
+// the Magic Software web site. This file is subject to the license
+//
+// FREE SOURCE CODE
+// http://www.geometrictools.com/License/WildMagic3License.pdf
+
+#ifndef __Quaternion_H__
+#define __Quaternion_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreMath.h"
+
+namespace Ogre {
+
+ /** Implementation of a Quaternion, i.e. a rotation around an axis.
+ */
+ class _OgreExport Quaternion
+ {
+ public:
+ inline Quaternion (
+ Real fW = 1.0,
+ Real fX = 0.0, Real fY = 0.0, Real fZ = 0.0)
+ {
+ w = fW;
+ x = fX;
+ y = fY;
+ z = fZ;
+ }
+ inline Quaternion (const Quaternion& rkQ)
+ {
+ w = rkQ.w;
+ x = rkQ.x;
+ y = rkQ.y;
+ z = rkQ.z;
+ }
+ /// Construct a quaternion from a rotation matrix
+ inline Quaternion(const Matrix3& rot)
+ {
+ this->FromRotationMatrix(rot);
+ }
+ /// Construct a quaternion from an angle/axis
+ inline Quaternion(const Radian& rfAngle, const Vector3& rkAxis)
+ {
+ this->FromAngleAxis(rfAngle, rkAxis);
+ }
+#ifndef OGRE_FORCE_ANGLE_TYPES
+ inline Quaternion(const Real& rfAngle, const Vector3& rkAxis)
+ {
+ this->FromAngleAxis(rfAngle, rkAxis);
+ }
+#endif//OGRE_FORCE_ANGLE_TYPES
+ /// Construct a quaternion from 3 orthonormal local axes
+ inline Quaternion(const Vector3& xaxis, const Vector3& yaxis, const Vector3& zaxis)
+ {
+ this->FromAxes(xaxis, yaxis, zaxis);
+ }
+ /// Construct a quaternion from 3 orthonormal local axes
+ inline Quaternion(const Vector3* akAxis)
+ {
+ this->FromAxes(akAxis);
+ }
+ /// Construct a quaternion from 4 manual w/x/y/z values
+ inline Quaternion(Real* valptr)
+ {
+ memcpy(&w, valptr, sizeof(Real)*4);
+ }
+
+ /// Array accessor operator
+ inline Real operator [] ( const size_t i ) const
+ {
+ assert( i < 4 );
+
+ return *(&w+i);
+ }
+
+ /// Array accessor operator
+ inline Real& operator [] ( const size_t i )
+ {
+ assert( i < 4 );
+
+ return *(&w+i);
+ }
+
+ /// Pointer accessor for direct copying
+ inline Real* ptr()
+ {
+ return &w;
+ }
+
+ /// Pointer accessor for direct copying
+ inline const Real* ptr() const
+ {
+ return &w;
+ }
+
+ void FromRotationMatrix (const Matrix3& kRot);
+ void ToRotationMatrix (Matrix3& kRot) const;
+ void FromAngleAxis (const Radian& rfAngle, const Vector3& rkAxis);
+ void ToAngleAxis (Radian& rfAngle, Vector3& rkAxis) const;
+ inline void ToAngleAxis (Degree& dAngle, Vector3& rkAxis) const {
+ Radian rAngle;
+ ToAngleAxis ( rAngle, rkAxis );
+ dAngle = rAngle;
+ }
+#ifndef OGRE_FORCE_ANGLE_TYPES
+ inline void FromAngleAxis (const Real& rfAngle, const Vector3& rkAxis) {
+ FromAngleAxis ( Angle(rfAngle), rkAxis );
+ }
+ inline void ToAngleAxis (Real& rfAngle, Vector3& rkAxis) const {
+ Radian r;
+ ToAngleAxis ( r, rkAxis );
+ rfAngle = r.valueAngleUnits();
+ }
+#endif//OGRE_FORCE_ANGLE_TYPES
+ void FromAxes (const Vector3* akAxis);
+ void FromAxes (const Vector3& xAxis, const Vector3& yAxis, const Vector3& zAxis);
+ void ToAxes (Vector3* akAxis) const;
+ void ToAxes (Vector3& xAxis, Vector3& yAxis, Vector3& zAxis) const;
+ /// Get the local x-axis
+ Vector3 xAxis(void) const;
+ /// Get the local y-axis
+ Vector3 yAxis(void) const;
+ /// Get the local z-axis
+ Vector3 zAxis(void) const;
+
+ inline Quaternion& operator= (const Quaternion& rkQ)
+ {
+ w = rkQ.w;
+ x = rkQ.x;
+ y = rkQ.y;
+ z = rkQ.z;
+ return *this;
+ }
+ Quaternion operator+ (const Quaternion& rkQ) const;
+ Quaternion operator- (const Quaternion& rkQ) const;
+ Quaternion operator* (const Quaternion& rkQ) const;
+ Quaternion operator* (Real fScalar) const;
+ _OgreExport friend Quaternion operator* (Real fScalar,
+ const Quaternion& rkQ);
+ Quaternion operator- () const;
+ inline bool operator== (const Quaternion& rhs) const
+ {
+ return (rhs.x == x) && (rhs.y == y) &&
+ (rhs.z == z) && (rhs.w == w);
+ }
+ inline bool operator!= (const Quaternion& rhs) const
+ {
+ return !operator==(rhs);
+ }
+ // functions of a quaternion
+ Real Dot (const Quaternion& rkQ) const; // dot product
+ Real Norm () const; // squared-length
+ /// Normalises this quaternion, and returns the previous length
+ Real normalise(void);
+ Quaternion Inverse () const; // apply to non-zero quaternion
+ Quaternion UnitInverse () const; // apply to unit-length quaternion
+ Quaternion Exp () const;
+ Quaternion Log () const;
+
+ // rotation of a vector by a quaternion
+ Vector3 operator* (const Vector3& rkVector) const;
+
+ /** Calculate the local roll element of this quaternion.
+ @param reprojectAxis By default the method returns the 'intuitive' result
+ that is, if you projected the local Y of the quaterion onto the X and
+ Y axes, the angle between them is returned. If set to false though, the
+ result is the actual yaw that will be used to implement the quaternion,
+ which is the shortest possible path to get to the same orientation and
+ may involve less axial rotation.
+ */
+ Radian getRoll(bool reprojectAxis = true) const;
+ /** Calculate the local pitch element of this quaternion
+ @param reprojectAxis By default the method returns the 'intuitive' result
+ that is, if you projected the local Z of the quaterion onto the X and
+ Y axes, the angle between them is returned. If set to true though, the
+ result is the actual yaw that will be used to implement the quaternion,
+ which is the shortest possible path to get to the same orientation and
+ may involve less axial rotation.
+ */
+ Radian getPitch(bool reprojectAxis = true) const;
+ /** Calculate the local yaw element of this quaternion
+ @param reprojectAxis By default the method returns the 'intuitive' result
+ that is, if you projected the local Z of the quaterion onto the X and
+ Z axes, the angle between them is returned. If set to true though, the
+ result is the actual yaw that will be used to implement the quaternion,
+ which is the shortest possible path to get to the same orientation and
+ may involve less axial rotation.
+ */
+ Radian getYaw(bool reprojectAxis = true) const;
+ /// Equality with tolerance (tolerance is max angle difference)
+ bool equals(const Quaternion& rhs, const Radian& tolerance) const;
+
+ // spherical linear interpolation
+ static Quaternion Slerp (Real fT, const Quaternion& rkP,
+ const Quaternion& rkQ, bool shortestPath = false);
+
+ static Quaternion SlerpExtraSpins (Real fT,
+ const Quaternion& rkP, const Quaternion& rkQ,
+ int iExtraSpins);
+
+ // setup for spherical quadratic interpolation
+ static void Intermediate (const Quaternion& rkQ0,
+ const Quaternion& rkQ1, const Quaternion& rkQ2,
+ Quaternion& rka, Quaternion& rkB);
+
+ // spherical quadratic interpolation
+ static Quaternion Squad (Real fT, const Quaternion& rkP,
+ const Quaternion& rkA, const Quaternion& rkB,
+ const Quaternion& rkQ, bool shortestPath = false);
+
+ // normalised linear interpolation - faster but less accurate (non-constant rotation velocity)
+ static Quaternion nlerp(Real fT, const Quaternion& rkP,
+ const Quaternion& rkQ, bool shortestPath = false);
+
+ // cutoff for sine near zero
+ static const Real ms_fEpsilon;
+
+ // special values
+ static const Quaternion ZERO;
+ static const Quaternion IDENTITY;
+
+ Real w, x, y, z;
+
+ /** Function for writing to a stream. Outputs "Quaternion(w, x, y, z)" with w,x,y,z
+ being the member values of the quaternion.
+ */
+ inline _OgreExport friend std::ostream& operator <<
+ ( std::ostream& o, const Quaternion& q )
+ {
+ o << "Quaternion(" << q.w << ", " << q.x << ", " << q.y << ", " << q.z << ")";
+ return o;
+ }
+
+ };
+
+}
+
+
+
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreRadixSort.h b/school/informatik/verkerhssimulation/src/ogre/OgreRadixSort.h
new file mode 100644
index 00000000..f9da2dff
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreRadixSort.h
@@ -0,0 +1,322 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __RadixSort_H__
+#define __RadixSort_H__
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre {
+
+ /** Class for performing a radix sort (fast comparison-less sort based on
+ byte value) on various standard STL containers.
+ @remarks
+ A radix sort is a very fast sort algorithm. It doesn't use comparisons
+ and thus is able to break the theoretical minimum O(N*logN) complexity.
+ Radix sort is complexity O(k*N), where k is a constant. Note that radix
+ sorting is not in-place, it requires additional storage, so it trades
+ memory for speed. The overhead of copying means that it is only faster
+ for fairly large datasets, so you are advised to only use it for collections
+ of at least a few hundred items.
+ @par
+ This is a template class to allow it to deal with a variety of containers,
+ and a variety of value types to sort on. In addition to providing the
+ container and value type on construction, you also need to supply a
+ functor object which will retrieve the value to compare on for each item
+ in the list. For example, if you had an std::vector of by-value instances
+ of an object of class 'Bibble', and you wanted to sort on
+ Bibble::getDoobrie(), you'd have to firstly create a functor
+ like this:
+ @code
+ struct BibbleSortFunctor
+ {
+ float operator()(const Bibble& val) const
+ {
+ return val.getDoobrie();
+ }
+ }
+ @endcode
+ Then, you need to declare a RadixSort class which names the container type,
+ the value type in the container, and the type of the value you want to
+ sort by. You can then call the sort function. E.g.
+ @code
+ RadixSort radixSorter;
+ BibbleSortFunctor functor;
+
+ radixSorter.sort(myBibbleList, functor);
+ @endcode
+ You should try to reuse RadixSort instances, since repeated allocation of the
+ internal storage is then avoided.
+ @note
+ Radix sorting is often associated with just unsigned integer values. Our
+ implementation can handle both unsigned and signed integers, as well as
+ floats (which are often not supported by other radix sorters). doubles
+ are not supported; you will need to implement your functor object to convert
+ to float if you wish to use this sort routine.
+ */
+ template
+ class RadixSort
+ {
+ public:
+ typedef typename TContainer::iterator ContainerIter;
+ protected:
+ /// Alpha-pass counters of values (histogram)
+ /// 4 of them so we can radix sort a maximum of a 32bit value
+ int mCounters[4][256];
+ /// Beta-pass offsets
+ int mOffsets[256];
+ /// Sort area size
+ int mSortSize;
+ /// Number of passes for this type
+ int mNumPasses;
+
+ struct SortEntry
+ {
+ TCompValueType key;
+ ContainerIter iter;
+ SortEntry() {}
+ SortEntry(TCompValueType k, ContainerIter it)
+ : key(k), iter(it) {}
+
+ };
+ /// Temp sort storage
+ std::vector mSortArea1;
+ std::vector mSortArea2;
+ std::vector* mSrc;
+ std::vector* mDest;
+ TContainer mTmpContainer; // initial copy
+
+
+ void sortPass(int byteIndex)
+ {
+ // Calculate offsets
+ // Basically this just leaves gaps for duplicate entries to fill
+ mOffsets[0] = 0;
+ for (int i = 1; i < 256; ++i)
+ {
+ mOffsets[i] = mOffsets[i-1] + mCounters[byteIndex][i-1];
+ }
+
+ // Sort pass
+ for (int i = 0; i < mSortSize; ++i)
+ {
+ unsigned char byteVal = getByte(byteIndex, (*mSrc)[i].key);
+ (*mDest)[mOffsets[byteVal]++] = (*mSrc)[i];
+ }
+
+ }
+ template
+ void finalPass(int byteIndex, T val)
+ {
+ // default is to do normal pass
+ sortPass(byteIndex);
+ }
+
+ // special case signed int
+ void finalPass(int byteIndex, int val)
+ {
+ int numNeg = 0;
+ // all negative values are in entries 128+ in most significant byte
+ for (int i = 128; i < 256; ++i)
+ {
+ numNeg += mCounters[byteIndex][i];
+ }
+ // Calculate offsets - positive ones start at the number of negatives
+ // do positive numbers
+ mOffsets[0] = numNeg;
+ for (int i = 1; i < 128; ++i)
+ {
+ mOffsets[i] = mOffsets[i-1] + mCounters[byteIndex][i-1];
+ }
+ // Do negative numbers (must start at zero)
+ // No need to invert ordering, already correct (-1 is highest number)
+ mOffsets[128] = 0;
+ for (int i = 129; i < 256; ++i)
+ {
+ mOffsets[i] = mOffsets[i-1] + mCounters[byteIndex][i-1];
+ }
+
+ // Sort pass
+ for (int i = 0; i < mSortSize; ++i)
+ {
+ unsigned char byteVal = getByte(byteIndex, (*mSrc)[i].key);
+ (*mDest)[mOffsets[byteVal]++] = (*mSrc)[i];
+ }
+ }
+
+
+ // special case float
+ void finalPass(int byteIndex, float val)
+ {
+ // floats need to be special cased since negative numbers will come
+ // after positives (high bit = sign) and will be in reverse order
+ // (no ones-complement of the +ve value)
+ int numNeg = 0;
+ // all negative values are in entries 128+ in most significant byte
+ for (int i = 128; i < 256; ++i)
+ {
+ numNeg += mCounters[byteIndex][i];
+ }
+ // Calculate offsets - positive ones start at the number of negatives
+ // do positive numbers normally
+ mOffsets[0] = numNeg;
+ for (int i = 1; i < 128; ++i)
+ {
+ mOffsets[i] = mOffsets[i-1] + mCounters[byteIndex][i-1];
+ }
+ // Do negative numbers (must start at zero)
+ // Also need to invert ordering
+ // In order to preserve the stability of the sort (essential since
+ // we rely on previous bytes already being sorted) we have to count
+ // backwards in our offsets from
+ mOffsets[255] = mCounters[byteIndex][255];
+ for (int i = 254; i > 127; --i)
+ {
+ mOffsets[i] = mOffsets[i+1] + mCounters[byteIndex][i];
+ }
+
+ // Sort pass
+ for (int i = 0; i < mSortSize; ++i)
+ {
+ unsigned char byteVal = getByte(byteIndex, (*mSrc)[i].key);
+ if (byteVal > 127)
+ {
+ // -ve; pre-decrement since offsets set to count
+ (*mDest)[--mOffsets[byteVal]] = (*mSrc)[i];
+ }
+ else
+ {
+ // +ve
+ (*mDest)[mOffsets[byteVal]++] = (*mSrc)[i];
+ }
+ }
+ }
+
+ inline unsigned char getByte(int byteIndex, TCompValueType val)
+ {
+#if OGRE_ENDIAN == OGRE_ENDIAN_LITTLE
+ return ((unsigned char*)(&val))[byteIndex];
+#else
+ return ((unsigned char*)(&val))[mNumPasses - byteIndex - 1];
+#endif
+ }
+
+ public:
+
+ RadixSort() {}
+ ~RadixSort() {}
+
+ /** Main sort function
+ @param container A container of the type you declared when declaring
+ @param func A functor which returns the value for comparison when given
+ a container value
+ */
+ template
+ void sort(TContainer& container, TFunction func)
+ {
+ if (container.empty())
+ return;
+
+ // Set up the sort areas
+ mSortSize = static_cast(container.size());
+ mSortArea1.resize(container.size());
+ mSortArea2.resize(container.size());
+
+ // Copy data now (we need constant iterators for sorting)
+ mTmpContainer = container;
+
+ mNumPasses = sizeof(TCompValueType);
+
+ // Counter pass
+ // Initialise the counts
+ int p;
+ for (p = 0; p < mNumPasses; ++p)
+ memset(mCounters[p], 0, sizeof(int) * 256);
+
+ // Perform alpha pass to count
+ ContainerIter i = mTmpContainer.begin();
+ TCompValueType prevValue = func.operator()(*i);
+ bool needsSorting = false;
+ for (int u = 0; i != mTmpContainer.end(); ++i, ++u)
+ {
+ // get sort value
+ TCompValueType val = func.operator()(*i);
+ // cheap check to see if needs sorting (temporal coherence)
+ if (!needsSorting && val < prevValue)
+ needsSorting = true;
+
+ // Create a sort entry
+ mSortArea1[u].key = val;
+ mSortArea1[u].iter = i;
+
+ // increase counters
+ for (p = 0; p < mNumPasses; ++p)
+ {
+ unsigned char byteVal = getByte(p, val);
+ mCounters[p][byteVal]++;
+ }
+
+ prevValue = val;
+
+ }
+
+ // early exit if already sorted
+ if (!needsSorting)
+ return;
+
+
+ // Sort passes
+ mSrc = &mSortArea1;
+ mDest = &mSortArea2;
+
+ for (p = 0; p < mNumPasses - 1; ++p)
+ {
+ sortPass(p);
+ // flip src/dst
+ std::vector* tmp = mSrc;
+ mSrc = mDest;
+ mDest = tmp;
+ }
+ // Final pass may differ, make polymorphic
+ finalPass(p, prevValue);
+
+ // Copy everything back
+ int c = 0;
+ for (i = container.begin();
+ i != container.end(); ++i, ++c)
+ {
+ *i = *((*mDest)[c].iter);
+ }
+ }
+
+ };
+
+
+}
+#endif
+
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreRay.h b/school/informatik/verkerhssimulation/src/ogre/OgreRay.h
new file mode 100644
index 00000000..2dcc7f77
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreRay.h
@@ -0,0 +1,115 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Ray_H_
+#define __Ray_H_
+
+// Precompiler options
+#include "OgrePrerequisites.h"
+
+#include "OgreVector3.h"
+#include "OgrePlaneBoundedVolume.h"
+
+namespace Ogre {
+
+ /** Representation of a ray in space, ie a line with an origin and direction. */
+ class _OgreExport Ray
+ {
+ protected:
+ Vector3 mOrigin;
+ Vector3 mDirection;
+ public:
+ Ray():mOrigin(Vector3::ZERO), mDirection(Vector3::UNIT_Z) {}
+ Ray(const Vector3& origin, const Vector3& direction)
+ :mOrigin(origin), mDirection(direction) {}
+
+ /** Sets the origin of the ray. */
+ void setOrigin(const Vector3& origin) {mOrigin = origin;}
+ /** Gets the origin of the ray. */
+ const Vector3& getOrigin(void) const {return mOrigin;}
+
+ /** Sets the direction of the ray. */
+ void setDirection(const Vector3& dir) {mDirection = dir;}
+ /** Gets the direction of the ray. */
+ const Vector3& getDirection(void) const {return mDirection;}
+
+ /** Gets the position of a point t units along the ray. */
+ Vector3 getPoint(Real t) const {
+ return Vector3(mOrigin + (mDirection * t));
+ }
+
+ /** Gets the position of a point t units along the ray. */
+ Vector3 operator*(Real t) const {
+ return getPoint(t);
+ };
+
+ /** Tests whether this ray intersects the given plane.
+ @returns A pair structure where the first element indicates whether
+ an intersection occurs, and if true, the second element will
+ indicate the distance along the ray at which it intersects.
+ This can be converted to a point in space by calling getPoint().
+ */
+ std::pair intersects(const Plane& p) const
+ {
+ return Math::intersects(*this, p);
+ }
+ /** Tests whether this ray intersects the given plane bounded volume.
+ @returns A pair structure where the first element indicates whether
+ an intersection occurs, and if true, the second element will
+ indicate the distance along the ray at which it intersects.
+ This can be converted to a point in space by calling getPoint().
+ */
+ std::pair intersects(const PlaneBoundedVolume& p) const
+ {
+ return Math::intersects(*this, p.planes, p.outside == Plane::POSITIVE_SIDE);
+ }
+ /** Tests whether this ray intersects the given sphere.
+ @returns A pair structure where the first element indicates whether
+ an intersection occurs, and if true, the second element will
+ indicate the distance along the ray at which it intersects.
+ This can be converted to a point in space by calling getPoint().
+ */
+ std::pair intersects(const Sphere& s) const
+ {
+ return Math::intersects(*this, s);
+ }
+ /** Tests whether this ray intersects the given box.
+ @returns A pair structure where the first element indicates whether
+ an intersection occurs, and if true, the second element will
+ indicate the distance along the ray at which it intersects.
+ This can be converted to a point in space by calling getPoint().
+ */
+ std::pair intersects(const AxisAlignedBox& box) const
+ {
+ return Math::intersects(*this, box);
+ }
+
+ };
+
+}
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreRectangle.h b/school/informatik/verkerhssimulation/src/ogre/OgreRectangle.h
new file mode 100644
index 00000000..25907948
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreRectangle.h
@@ -0,0 +1,69 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _Rectangle_H__
+#define _Rectangle_H__
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre {
+
+ struct _OgreExport Rectangle
+ {
+ Real left;
+ Real top;
+ Real right;
+ Real bottom;
+
+ inline bool inside(Real x, Real y) const { return x >= left && x <= right && y >= top && y <= bottom; }
+ };
+
+ /** Geometric intersection of two rectanglar regions.
+ *
+ * @remarks Calculates the geometric intersection of two rectangular
+ * regions. Rectangle coordinates must be ([0-N], [0-N]), such that
+ * (0,0) is in the upper left hand corner.
+ *
+ * If the two input rectangles do not intersect, then the result will be
+ * a degenerate rectangle, i.e. left >= right or top >= bottom, or both.
+ */
+ inline Rectangle intersect(const Rectangle& lhs, const Rectangle& rhs)
+ {
+ Rectangle r;
+
+ r.left = lhs.left > rhs.left ? lhs.left : rhs.left;
+ r.top = lhs.top > rhs.top ? lhs.top : rhs.top;
+ r.right = lhs.right < rhs.right ? lhs.right : rhs.right;
+ r.bottom = lhs.bottom < rhs.bottom ? lhs.bottom : rhs.bottom;
+
+ return r;
+ }
+
+}
+
+#endif // _Rectangle_H__
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreRectangle2D.h b/school/informatik/verkerhssimulation/src/ogre/OgreRectangle2D.h
new file mode 100644
index 00000000..f61021bf
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreRectangle2D.h
@@ -0,0 +1,79 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _Rectangle2D_H__
+#define _Rectangle2D_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreSimpleRenderable.h"
+
+namespace Ogre {
+
+ /** Allows the rendering of a simple 2D rectangle
+ This class renders a simple 2D rectangle; this rectangle has no depth and
+ therefore is best used with specific render queue and depth settings,
+ like RENDER_QUEUE_BACKGROUND and 'depth_write off' for backdrops, and
+ RENDER_QUEUE_OVERLAY and 'depth_check off' for fullscreen quads.
+ */
+ class _OgreExport Rectangle2D : public SimpleRenderable
+ {
+ protected:
+ /** Override this method to prevent parent transforms (rotation,translation,scale)
+ */
+ void getWorldTransforms( Matrix4* xform ) const;
+ /** @copydoc Renderable::getWorldOrientation */
+ const Quaternion& getWorldOrientation(void) const;
+ /** @copydoc Renderable::getWorldPosition */
+ const Vector3& getWorldPosition(void) const;
+
+ public:
+
+ Rectangle2D(bool includeTextureCoordinates = false);
+ ~Rectangle2D();
+
+ /** Sets the corners of the rectangle, in relative coordinates.
+ @param
+ left Left position in screen relative coordinates, -1 = left edge, 1.0 = right edge
+ top Top position in screen relative coordinates, 1 = top edge, -1 = bottom edge
+ right Right position in screen relative coordinates
+ bottom Bottom position in screen relative coordinates
+ */
+ void setCorners(Real left, Real top, Real right, Real bottom);
+
+ Real getSquaredViewDepth(const Camera* cam) const { return 0; }
+
+ Real getBoundingRadius(void) const { return 0; }
+
+ };
+
+}// namespace
+
+#endif
+
+
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreRenderOperation.h b/school/informatik/verkerhssimulation/src/ogre/OgreRenderOperation.h
new file mode 100644
index 00000000..832ad7b1
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreRenderOperation.h
@@ -0,0 +1,84 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _RenderOperation_H__
+#define _RenderOperation_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreVertexIndexData.h"
+
+namespace Ogre {
+
+
+ /** 'New' rendering operation using vertex buffers. */
+ class _OgrePrivate RenderOperation {
+ public:
+ /// The rendering operation type to perform
+ enum OperationType {
+ /// A list of points, 1 vertex per point
+ OT_POINT_LIST = 1,
+ /// A list of lines, 2 vertices per line
+ OT_LINE_LIST = 2,
+ /// A strip of connected lines, 1 vertex per line plus 1 start vertex
+ OT_LINE_STRIP = 3,
+ /// A list of triangles, 3 vertices per triangle
+ OT_TRIANGLE_LIST = 4,
+ /// A strip of triangles, 3 vertices for the first triangle, and 1 per triangle after that
+ OT_TRIANGLE_STRIP = 5,
+ /// A fan of triangles, 3 vertices for the first triangle, and 1 per triangle after that
+ OT_TRIANGLE_FAN = 6
+ };
+
+ /// Vertex source data
+ VertexData *vertexData;
+
+ /// The type of operation to perform
+ OperationType operationType;
+
+ /** Specifies whether to use indexes to determine the vertices to use as input. If false, the vertices are
+ simply read in sequence to define the primitives. If true, indexes are used instead to identify vertices
+ anywhere in the buffer, and allowing vertices to be used more than once.
+ If true, then the indexBuffer, indexStart and numIndexes properties must be valid. */
+ bool useIndexes;
+
+ /// Index data - only valid if useIndexes is true
+ IndexData *indexData;
+ /// Debug pointer back to renderable which created this
+ const Renderable* srcRenderable;
+
+
+ RenderOperation() :
+ vertexData(0), operationType(OT_TRIANGLE_LIST), useIndexes(true),
+ indexData(0) {}
+
+ };
+}
+
+
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreRenderQueue.h b/school/informatik/verkerhssimulation/src/ogre/OgreRenderQueue.h
new file mode 100644
index 00000000..8ee7c199
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreRenderQueue.h
@@ -0,0 +1,258 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __RenderQueue_H__
+#define __RenderQueue_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreIteratorWrappers.h"
+
+namespace Ogre {
+
+ /** Enumeration of queue groups, by which the application may group queued renderables
+ so that they are rendered together with events in between
+ @remarks
+ When passed into methods these are actually passed as a uint8 to allow you
+ to use values in between if you want to.
+ */
+ enum RenderQueueGroupID
+ {
+ /// Use this queue for objects which must be rendered first e.g. backgrounds
+ RENDER_QUEUE_BACKGROUND = 0,
+ /// First queue (after backgrounds), used for skyboxes if rendered first
+ RENDER_QUEUE_SKIES_EARLY = 5,
+ RENDER_QUEUE_1 = 10,
+ RENDER_QUEUE_2 = 20,
+ RENDER_QUEUE_WORLD_GEOMETRY_1 = 25,
+ RENDER_QUEUE_3 = 30,
+ RENDER_QUEUE_4 = 40,
+ /// The default render queue
+ RENDER_QUEUE_MAIN = 50,
+ RENDER_QUEUE_6 = 60,
+ RENDER_QUEUE_7 = 70,
+ RENDER_QUEUE_WORLD_GEOMETRY_2 = 75,
+ RENDER_QUEUE_8 = 80,
+ RENDER_QUEUE_9 = 90,
+ /// Penultimate queue(before overlays), used for skyboxes if rendered last
+ RENDER_QUEUE_SKIES_LATE = 95,
+ /// Use this queue for objects which must be rendered last e.g. overlays
+ RENDER_QUEUE_OVERLAY = 100,
+ /// Final possible render queue, don't exceed this
+ RENDER_QUEUE_MAX = 105
+ };
+
+ #define OGRE_RENDERABLE_DEFAULT_PRIORITY 100
+
+ /** Class to manage the scene object rendering queue.
+ @remarks
+ Objects are grouped by material to minimise rendering state changes. The map from
+ material to renderable object is wrapped in a class for ease of use.
+ @par
+ This class now includes the concept of 'queue groups' which allows the application
+ adding the renderable to specifically schedule it so that it is included in
+ a discrete group. Good for separating renderables into the main scene,
+ backgrounds and overlays, and also could be used in the future for more
+ complex multipass routines like stenciling.
+ */
+ class _OgreExport RenderQueue
+ {
+ public:
+ typedef std::map< uint8, RenderQueueGroup* > RenderQueueGroupMap;
+ /// Iterator over queue groups
+ typedef MapIterator QueueGroupIterator;
+ /** Class to listen in on items being added to the render queue.
+ @remarks
+ Use RenderQueue::setRenderableListener to get callbacks when an item
+ is added to the render queue.
+ */
+ class _OgreExport RenderableListener
+ {
+ public:
+ RenderableListener() {}
+ virtual ~RenderableListener() {}
+
+ /** Method called when a Renderable is added to the queue.
+ @remarks
+ You can use this event hook to alter the Technique used to
+ render a Renderable as the item is added to the queue. This is
+ a low-level way to override the material settings for a given
+ Renderable on the fly.
+ @param rend The Renderable being added to the queue
+ @param groupID The render queue group this Renderable is being added to
+ @param priority The priority the Renderable has been given
+ @param ppTech A pointer to the pointer to the Technique that is
+ intended to be used; you can alter this to an alternate Technique
+ if you so wish (the Technique doesn't have to be from the same
+ Material either).
+ @returns true to allow the Renderable to be added to the queue,
+ false if you want to prevent it being added
+ */
+ virtual bool renderableQueued(Renderable* rend, uint8 groupID,
+ ushort priority, Technique** ppTech) = 0;
+ };
+ protected:
+ RenderQueueGroupMap mGroups;
+ /// The current default queue group
+ uint8 mDefaultQueueGroup;
+ /// The default priority
+ ushort mDefaultRenderablePriority;
+
+ bool mSplitPassesByLightingType;
+ bool mSplitNoShadowPasses;
+ bool mShadowCastersCannotBeReceivers;
+
+ RenderableListener* mRenderableListener;
+ public:
+ RenderQueue();
+ virtual ~RenderQueue();
+
+ /** Empty the queue - should only be called by SceneManagers.
+ @param destroyPassMaps Set to true to destroy all pass maps so that
+ the queue is completely clean (useful when switching scene managers)
+ */
+ void clear(bool destroyPassMaps = false);
+
+ /** Get a render queue group.
+ @remarks
+ OGRE registers new queue groups as they are requested,
+ therefore this method will always return a valid group.
+ */
+ RenderQueueGroup* getQueueGroup(uint8 qid);
+
+ /** Add a renderable object to the queue.
+ @remarks
+ This methods adds a Renderable to the queue, which will be rendered later by
+ the SceneManager. This is the advanced version of the call which allows the renderable
+ to be added to any queue.
+ @note
+ Called by implementation of MovableObject::_updateRenderQueue.
+ @param
+ pRend Pointer to the Renderable to be added to the queue
+ @param
+ groupID The group the renderable is to be added to. This
+ can be used to schedule renderable objects in separate groups such that the SceneManager
+ respects the divisions between the groupings and does not reorder them outside these
+ boundaries. This can be handy for overlays where no matter what you want the overlay to
+ be rendered last.
+ @param
+ priority Controls the priority of the renderable within the queue group. If this number
+ is raised, the renderable will be rendered later in the group compared to it's peers.
+ Don't use this unless you really need to, manually ordering renderables prevents OGRE
+ from sorting them for best efficiency. However this could be useful for ordering 2D
+ elements manually for example.
+ */
+ void addRenderable(Renderable* pRend, uint8 groupID, ushort priority);
+
+ /** Add a renderable object to the queue.
+ @remarks
+ This methods adds a Renderable to the queue, which will be rendered later by
+ the SceneManager. This is the simplified version of the call which does not
+ require a priority to be specified. The queue priority is take from the
+ current default (see setDefaultRenderablePriority).
+ @note
+ Called by implementation of MovableObject::_updateRenderQueue.
+ @param
+ pRend Pointer to the Renderable to be added to the queue
+ @param
+ groupID The group the renderable is to be added to. This
+ can be used to schedule renderable objects in separate groups such that the SceneManager
+ respects the divisions between the groupings and does not reorder them outside these
+ boundaries. This can be handy for overlays where no matter what you want the overlay to
+ be rendered last.
+ */
+ void addRenderable(Renderable* pRend, uint8 groupId);
+
+ /** Add a renderable object to the queue.
+ @remarks
+ This methods adds a Renderable to the queue, which will be rendered later by
+ the SceneManager. This is the simplified version of the call which does not
+ require a queue or priority to be specified. The queue group is taken from the
+ current default (see setDefaultQueueGroup). The queue priority is take from the
+ current default (see setDefaultRenderablePriority).
+ @note
+ Called by implementation of MovableObject::_updateRenderQueue.
+ @param
+ pRend Pointer to the Renderable to be added to the queue
+ */
+ void addRenderable(Renderable* pRend);
+
+ /** Gets the current default queue group, which will be used for all renderable which do not
+ specify which group they wish to be on.
+ */
+ uint8 getDefaultQueueGroup(void) const;
+
+ /** Sets the current default renderable priority,
+ which will be used for all renderables which do not
+ specify which priority they wish to use.
+ */
+ void setDefaultRenderablePriority(ushort priority);
+
+ /** Gets the current default renderable priority, which will be used for all renderables which do not
+ specify which priority they wish to use.
+ */
+ ushort getDefaultRenderablePriority(void) const;
+
+ /** Sets the current default queue group, which will be used for all renderable which do not
+ specify which group they wish to be on.
+ */
+ void setDefaultQueueGroup(uint8 grp);
+
+ /** Internal method, returns an iterator for the queue groups. */
+ QueueGroupIterator _getQueueGroupIterator(void);
+ /** Sets whether or not the queue will split passes by their lighting type,
+ ie ambient, per-light and decal.
+ */
+ void setSplitPassesByLightingType(bool split);
+ /** Sets whether or not the queue will split passes which have shadow receive
+ turned off (in their parent material), which is needed when certain shadow
+ techniques are used.
+ */
+ void setSplitNoShadowPasses(bool split);
+ /** Sets whether or not objects which cast shadows should be treated as
+ never receiving shadows.
+ */
+ void setShadowCastersCannotBeReceivers(bool ind);
+
+ /** Set a renderable listener on the queue.
+ @remarks
+ There can only be a single renderable listener on the queue, since
+ that listener has complete control over the techniques in use.
+ */
+ void setRenderableListener(RenderableListener* listener)
+ { mRenderableListener = listener; }
+
+ RenderableListener* getRenderableListener(void) const
+ { return mRenderableListener; }
+
+ };
+
+
+}
+
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreRenderQueueInvocation.h b/school/informatik/verkerhssimulation/src/ogre/OgreRenderQueueInvocation.h
new file mode 100644
index 00000000..490b53ff
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreRenderQueueInvocation.h
@@ -0,0 +1,218 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2005 The OGRE Team
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __RenderQueueInvocation_H__
+#define __RenderQueueInvocation_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreRenderQueueSortingGrouping.h"
+#include "OgreIteratorWrappers.h"
+
+namespace Ogre {
+
+ /** Class representing the invocation of queue groups in a RenderQueue.
+ @remarks
+ The default behaviour for OGRE's render queue is to render each queue
+ group in turn, dealing with shadows automatically, and rendering solids
+ in grouped passes, followed by transparent objects in descending order.
+ This class, together with RenderQueueInvocationSequence and the ability
+ to associate one with a Viewport, allows you to change that behaviour
+ and render queue groups in arbitrary sequence, repeatedly, and to skip
+ shadows, change the ordering of solids, or even prevent OGRE controlling
+ the render state during a particular invocation for special effects.
+ @par
+ Note that whilst you can change the ordering of rendering solids, you
+ can't change the ordering on transparent objects, since to do this would
+ cause them to render incorrectly.
+ @par
+ As well as using this class directly and using the options it provides you
+ with, you can also provide subclasses of it to a
+ RenderQueueInvocationSequence instance if you want to gain ultimate control.
+ @note
+ Invocations will be skipped if there are scene-level options preventing
+ them being rendered - for example special-case render queues and
+ render queue listeners that dictate this.
+ */
+ class _OgreExport RenderQueueInvocation
+ {
+ protected:
+ /// Target queue group
+ uint8 mRenderQueueGroupID;
+ /// Invocation identifier - used in listeners
+ String mInvocationName;
+ /// Solids ordering mode
+ QueuedRenderableCollection::OrganisationMode mSolidsOrganisation;
+ /// Suppress shadows processing in this invocation?
+ bool mSuppressShadows;
+ /// Suppress OGRE's render state management?
+ bool mSuppressRenderStateChanges;
+ public:
+ /** Constructor
+ @param renderQueueGroupID ID of the queue this will target
+ @param invocationName Optional name to uniquely identify this
+ invocation from others in a RenderQueueListener
+ */
+ RenderQueueInvocation(uint8 renderQueueGroupID,
+ const String& invocationName = StringUtil::BLANK);
+ virtual ~RenderQueueInvocation();
+
+ /// Get the render queue group id
+ virtual uint8 getRenderQueueGroupID(void) const { return mRenderQueueGroupID; }
+
+ /// Get the invocation name (may be blank if not set by creator)
+ virtual const String& getInvocationName(void) const { return mInvocationName; }
+
+ /** Set the organisation mode being used for solids in this queue group
+ invocation.
+ */
+ virtual void setSolidsOrganisation(
+ QueuedRenderableCollection::OrganisationMode org)
+ { mSolidsOrganisation = org; }
+
+ /** Get the organisation mode being used for solids in this queue group
+ invocation.
+ */
+ virtual QueuedRenderableCollection::OrganisationMode
+ getSolidsOrganisation(void) const { return mSolidsOrganisation; }
+
+ /** Sets whether shadows are suppressed when invoking this queue.
+ @remarks
+ When doing effects you often will want to suppress shadow processing
+ if shadows will already have been done by a previous render.
+ */
+ virtual void setSuppressShadows(bool suppress)
+ { mSuppressShadows = suppress; }
+
+ /** Gets whether shadows are suppressed when invoking this queue.
+ */
+ virtual bool getSuppressShadows(void) const { return mSuppressShadows; }
+
+ /** Sets whether render state changes are suppressed when invoking this queue.
+ @remarks
+ When doing special effects you may want to set up render state yourself
+ and have it apply for the entire rendering of a queue. In that case,
+ you should call this method with a parameter of 'true', and use a
+ RenderQueueListener to set the render state directly on RenderSystem
+ yourself before the invocation.
+ @par
+ Suppressing render state changes is only intended for advanced use,
+ don't use it if you're unsure of the effect. The only RenderSystem
+ calls made are to set the world matrix for each object (note -
+ view an projection matrices are NOT SET - they are under your control)
+ and to render the object; it is up to the caller to do everything else,
+ including enabling any vertex / fragment programs and updating their
+ parameter state, and binding parameters to the RenderSystem.
+ We advise you use a RenderQueueListener in order to get a notification
+ when this invocation is going to happen (use an invocation name to
+ identify it if you like), at which point you can set the state you
+ need to apply before the objects are rendered.
+ */
+ virtual void setSuppressRenderStateChanges(bool suppress)
+ { mSuppressRenderStateChanges = suppress; }
+
+ /** Gets whether shadows are suppressed when invoking this queue.
+ */
+ virtual bool getSuppressRenderStateChanges(void) const { return mSuppressRenderStateChanges; }
+
+ /** Invoke this class on a concrete queue group.
+ @remarks
+ Implementation will send the queue group to the target scene manager
+ after doing what it needs to do.
+ */
+ virtual void invoke(RenderQueueGroup* group, SceneManager* targetSceneManager);
+
+ /// Invocation identifier for shadows
+ static String RENDER_QUEUE_INVOCATION_SHADOWS;
+ };
+
+
+ /// List of RenderQueueInvocations
+ typedef std::vector RenderQueueInvocationList;
+ typedef VectorIterator RenderQueueInvocationIterator;
+
+ /** Class to hold a linear sequence of RenderQueueInvocation objects.
+ @remarks
+ This is just a simple data holder class which contains a list of
+ RenderQueueInvocation objects representing the sequence of invocations
+ made for a viewport. It's only real purpose is to ensure that
+ RenderQueueInvocation instances are deleted on shudown, since you can
+ provide your own subclass instances on RenderQueueInvocation. Remember
+ that any invocation instances you give to this class will be deleted
+ by it when it is cleared / destroyed.
+ */
+ class _OgreExport RenderQueueInvocationSequence
+ {
+ protected:
+ String mName;
+ RenderQueueInvocationList mInvocations;
+ public:
+ RenderQueueInvocationSequence(const String& name);
+ virtual ~RenderQueueInvocationSequence();
+
+ /** Get the name of this sequence. */
+ const String& getName(void) const { return mName; }
+
+ /** Add a standard invocation to the sequence.
+ @param renderQueueGroupID The ID of the render queue group
+ @param invocationName Optional name to identify the invocation, useful
+ for listeners if a single queue group is invoked more than once
+ @returns A new RenderQueueInvocatin instance which you may customise
+ */
+ RenderQueueInvocation* add(uint8 renderQueueGroupID,
+ const String& invocationName);
+
+ /** Add a custom invocation to the sequence.
+ @remarks
+ Use this to add your own custom subclasses of RenderQueueInvocation
+ to the sequence; just remember that this class takes ownership of
+ deleting this pointer when it is cleared / destroyed.
+ */
+ void add(RenderQueueInvocation* i);
+
+ /** Get the number of invocations in this sequence. */
+ size_t size(void) const { return mInvocations.size(); }
+
+ /** Clear and delete all invocations in this sequence. */
+ void clear(void);
+
+ /** Gets the details of an invocation at a given index. */
+ RenderQueueInvocation* get(size_t index);
+
+ /** Removes (and deletes) an invocation by index. */
+ void remove(size_t index);
+
+ /** Get an iterator over the invocations. */
+ RenderQueueInvocationIterator iterator(void);
+
+
+ };
+
+}
+
+#endif
+
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreRenderQueueListener.h b/school/informatik/verkerhssimulation/src/ogre/OgreRenderQueueListener.h
new file mode 100644
index 00000000..972db082
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreRenderQueueListener.h
@@ -0,0 +1,89 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __RenderQueueListener_H__
+#define __RenderQueueListener_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreRenderQueue.h"
+
+namespace Ogre {
+
+ /** Abstract interface which classes must implement if they wish to receive
+ events from the render queue.
+ @remarks
+ The OGRE render queue is divided into several queue groups, as defined by
+ uint8. A class may implement this interface, and register itself
+ as a listener by calling SceneManager::addRenderQueueListener. After doing so,
+ the class will receive an event before and after each queue group is sent to
+ the rendering system.
+ @par
+ The event listeners have an option to make a queue either be skipped, or to repeat.
+ Note that if multiple listeners are registered, the one registered last has the final
+ say, although options set by previous listeners will not be changed if the latest
+ does not express a preference.
+ */
+ class _OgreExport RenderQueueListener
+ {
+ public:
+ virtual ~RenderQueueListener() {}
+ /** Event raised before a queue group is rendered.
+ @remarks
+ This method is called by the SceneManager before each queue group is
+ rendered.
+ @param queueGroupId The id of the queue group which is about to be rendered
+ @param invocation Name of the invocation which is causing this to be
+ called (@see RenderQueueInvocation)
+ @param skipThisInvocation A boolean passed by reference which is by default set to
+ false. If the event sets this to true, the queue will be skipped and not
+ rendered. Note that in this case the renderQueueEnded event will not be raised
+ for this queue group.
+ */
+ virtual void renderQueueStarted(uint8 queueGroupId, const String& invocation,
+ bool& skipThisInvocation) = 0;
+
+ /** Event raised after a queue group is rendered.
+ @remarks
+ This method is called by the SceneManager after each queue group is
+ rendered.
+ @param queueGroupId The id of the queue group which has just been rendered
+ @param invocation Name of the invocation which is causing this to be
+ called (@see RenderQueueInvocation)
+ @param repeatThisInvocation A boolean passed by reference which is by default set to
+ false. If the event sets this to true, the queue which has just been
+ rendered will be repeated, and the renderQueueStarted and renderQueueEnded
+ events will also be fired for it again.
+ */
+ virtual void renderQueueEnded(uint8 queueGroupId, const String& invocation,
+ bool& repeatThisInvocation) = 0;
+ };
+
+}
+
+#endif
+
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreRenderQueueSortingGrouping.h b/school/informatik/verkerhssimulation/src/ogre/OgreRenderQueueSortingGrouping.h
new file mode 100644
index 00000000..68d67715
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreRenderQueueSortingGrouping.h
@@ -0,0 +1,653 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __RenderQueueSortingGrouping_H__
+#define __RenderQueueSortingGrouping_H__
+
+// Precompiler options
+#include "OgrePrerequisites.h"
+#include "OgreIteratorWrappers.h"
+#include "OgreMaterial.h"
+#include "OgreTechnique.h"
+#include "OgrePass.h"
+#include "OgreRadixSort.h"
+
+namespace Ogre {
+
+ /** Struct associating a single Pass with a single Renderable.
+ This is used to for objects sorted by depth and thus not
+ grouped by pass.
+ */
+ struct RenderablePass
+ {
+ /// Pointer to the Renderable details
+ Renderable* renderable;
+ /// Pointer to the Pass
+ Pass* pass;
+
+ RenderablePass(Renderable* rend, Pass* p) :renderable(rend), pass(p) {}
+ };
+
+
+ /** Visitor interface for items in a QueuedRenderableCollection.
+ @remarks
+ Those wishing to iterate over the items in a
+ QueuedRenderableCollection should implement this visitor pattern,
+ since internal organisation of the collection depends on the
+ sorting method in use.
+ */
+ class _OgreExport QueuedRenderableVisitor
+ {
+ public:
+ QueuedRenderableVisitor() {}
+ virtual ~QueuedRenderableVisitor() {}
+
+ /** Called when visiting a RenderablePass, ie items in a
+ sorted collection where items are not grouped by pass.
+ @remarks
+ If this is called, neither of the other 2 visit methods
+ will be called.
+ */
+ virtual void visit(const RenderablePass* rp) = 0;
+
+ /* When visiting a collection grouped by pass, this is
+ called when the grouping pass changes.
+ @remarks
+ If this method is called, the RenderablePass visit
+ method will not be called for this collection. The
+ Renderable visit method will be called for each item
+ underneath the pass grouping level.
+ @returns True to continue, false to skip the Renderables underneath
+ */
+ virtual bool visit(const Pass* p) = 0;
+ /** Visit method called once per Renderable on a grouped
+ collection.
+ @remarks
+ If this method is called, the RenderablePass visit
+ method will not be called for this collection.
+ */
+ virtual void visit(const Renderable* r) = 0;
+
+
+ };
+
+ /** Lowest level collection of renderables.
+ @remarks
+ To iterate over items in this collection, you must call
+ the accept method and supply a QueuedRenderableVisitor.
+ The order of the iteration, and whether that iteration is
+ over a RenderablePass list or a 2-level grouped list which
+ causes a visit call at the Pass level, and a call for each
+ Renderable underneath.
+ */
+ class _OgreExport QueuedRenderableCollection
+ {
+ public:
+ /** Organisation modes required for this collection.
+ @remarks
+ This affects the internal placement of the items added to this collection;
+ if only one type of sorting / grouping is to be required, then renderables
+ can be stored only once, whilst if multiple types are going to be needed
+ then internally there will be multiple organisations. Changing the organisation
+ needs to be done when the collection is empty.
+ */
+ enum OrganisationMode
+ {
+ /// Group by pass
+ OM_PASS_GROUP = 1,
+ /// Sort descending camera distance
+ OM_SORT_DESCENDING = 2,
+ /** Sort ascending camera distance
+ Note value overlaps with descending since both use same sort
+ */
+ OM_SORT_ASCENDING = 6
+ };
+
+ protected:
+ /// Comparator to order pass groups
+ struct PassGroupLess
+ {
+ bool _OgreExport operator()(const Pass* a, const Pass* b) const
+ {
+ // Sort by passHash, which is pass, then texture unit changes
+ uint32 hasha = a->getHash();
+ uint32 hashb = b->getHash();
+ if (hasha == hashb)
+ {
+ // Must differentTransparentQueueItemLessiate by pointer incase 2 passes end up with the same hash
+ return a < b;
+ }
+ else
+ {
+ return hasha < hashb;
+ }
+ }
+ };
+ /// Comparator to order objects by descending camera distance
+ struct DepthSortDescendingLess
+ {
+ const Camera* camera;
+
+ DepthSortDescendingLess(const Camera* cam)
+ : camera(cam)
+ {
+ }
+
+ bool _OgreExport operator()(const RenderablePass& a, const RenderablePass& b) const
+ {
+ if (a.renderable == b.renderable)
+ {
+ // Same renderable, sort by pass hash
+ return a.pass->getHash() < b.pass->getHash();
+ }
+ else
+ {
+ // Different renderables, sort by depth
+ Real adepth = a.renderable->getSquaredViewDepth(camera);
+ Real bdepth = b.renderable->getSquaredViewDepth(camera);
+ if (adepth == bdepth)
+ {
+ // Must return deterministic result, doesn't matter what
+ return a.pass < b.pass;
+ }
+ else
+ {
+ // Sort DESCENDING by depth (ie far objects first)
+ return (adepth > bdepth);
+ }
+ }
+
+ }
+ };
+
+ /** Vector of RenderablePass objects, this is built on the assumption that
+ vectors only ever increase in size, so even if we do clear() the memory stays
+ allocated, ie fast */
+ typedef std::vector RenderablePassList;
+ typedef std::vector RenderableList;
+ /** Map of pass to renderable lists, this is a grouping by pass. */
+ typedef std::map PassGroupRenderableMap;
+
+ /// Functor for accessing sort value 1 for radix sort (Pass)
+ struct RadixSortFunctorPass
+ {
+ uint32 operator()(const RenderablePass& p) const
+ {
+ return p.pass->getHash();
+ }
+ };
+
+ /// Radix sorter for accessing sort value 1 (Pass)
+ static RadixSort msRadixSorter1;
+
+ /// Functor for descending sort value 2 for radix sort (distance)
+ struct RadixSortFunctorDistance
+ {
+ const Camera* camera;
+
+ RadixSortFunctorDistance(const Camera* cam)
+ : camera(cam)
+ {
+ }
+
+ float operator()(const RenderablePass& p) const
+ {
+ // Sort DESCENDING by depth (ie far objects first), use negative distance
+ // here because radix sorter always dealing with accessing sort
+ return static_cast(- p.renderable->getSquaredViewDepth(camera));
+ }
+ };
+
+ /// Radix sorter for sort value 2 (distance)
+ static RadixSort msRadixSorter2;
+
+ /// Bitmask of the organisation modes requested
+ uint8 mOrganisationMode;
+
+ /// Grouped
+ PassGroupRenderableMap mGrouped;
+ /// Sorted descending (can iterate backwards to get ascending)
+ RenderablePassList mSortedDescending;
+
+ /// Internal visitor implementation
+ void acceptVisitorGrouped(QueuedRenderableVisitor* visitor) const;
+ /// Internal visitor implementation
+ void acceptVisitorDescending(QueuedRenderableVisitor* visitor) const;
+ /// Internal visitor implementation
+ void acceptVisitorAscending(QueuedRenderableVisitor* visitor) const;
+
+ public:
+ QueuedRenderableCollection();
+ ~QueuedRenderableCollection();
+
+ /// Empty the collection
+ void clear(void);
+
+ /** Remove the group entry (if any) for a given Pass.
+ @remarks
+ To be used when a pass is destroyed, such that any
+ grouping level for it becomes useless.
+ */
+ void removePassGroup(Pass* p);
+
+ /** Reset the organisation modes required for this collection.
+ @remarks
+ You can only do this when the collection is empty.
+ @see OrganisationMode
+ */
+ void resetOrganisationModes(void)
+ {
+ mOrganisationMode = 0;
+ }
+
+ /** Add a required sorting / grouping mode to this collection when next used.
+ @remarks
+ You can only do this when the collection is empty.
+ @see OrganisationMode
+ */
+ void addOrganisationMode(OrganisationMode om)
+ {
+ mOrganisationMode |= om;
+ }
+
+ /// Add a renderable to the collection using a given pass
+ void addRenderable(Pass* pass, Renderable* rend);
+
+ /** Perform any sorting that is required on this collection.
+ @param cam The camera
+ */
+ void sort(const Camera* cam);
+
+ /** Accept a visitor over the collection contents.
+ @param visitor Visitor class which should be called back
+ @param om The organisation mode which you want to iterate over.
+ Note that this must have been included in an addOrganisationMode
+ call before any renderables were added.
+ */
+ void acceptVisitor(QueuedRenderableVisitor* visitor, OrganisationMode om) const;
+
+ };
+
+ /** Collection of renderables by priority.
+ @remarks
+ This class simply groups renderables for rendering. All the
+ renderables contained in this class are destined for the same
+ RenderQueueGroup (coarse groupings like those between the main
+ scene and overlays) and have the same priority (fine groupings
+ for detailed overlap control).
+ @par
+ This class can order solid renderables by a number of criteria;
+ it can optimise them into groups based on pass to reduce render
+ state changes, or can sort them by ascending or descending view
+ depth. Transparent objects are always ordered by descending depth.
+ @par
+ To iterate over items in the collections held by this object
+ you should retrieve the collection in use (e.g. solids, solids with
+ no shadows, transparents) and use the accept() method, providing
+ a class implementing QueuedRenderableVisitor.
+
+ */
+ class _OgreExport RenderPriorityGroup
+ {
+ protected:
+
+ /// Parent queue group
+ RenderQueueGroup* mParent;
+ bool mSplitPassesByLightingType;
+ bool mSplitNoShadowPasses;
+ bool mShadowCastersNotReceivers;
+ /// Solid pass list, used when no shadows, modulative shadows, or ambient passes for additive
+ QueuedRenderableCollection mSolidsBasic;
+ /// Solid per-light pass list, used with additive shadows
+ QueuedRenderableCollection mSolidsDiffuseSpecular;
+ /// Solid decal (texture) pass list, used with additive shadows
+ QueuedRenderableCollection mSolidsDecal;
+ /// Solid pass list, used when shadows are enabled but shadow receive is turned off for these passes
+ QueuedRenderableCollection mSolidsNoShadowReceive;
+ /// Transparent list
+ QueuedRenderableCollection mTransparents;
+
+ /// remove a pass entry from all collections
+ void removePassEntry(Pass* p);
+
+ /// Internal method for adding a solid renderable
+ void addSolidRenderable(Technique* pTech, Renderable* rend, bool toNoShadowMap);
+ /// Internal method for adding a solid renderable
+ void addSolidRenderableSplitByLightType(Technique* pTech, Renderable* rend);
+ /// Internal method for adding a transparent renderable
+ void addTransparentRenderable(Technique* pTech, Renderable* rend);
+
+ public:
+ RenderPriorityGroup(RenderQueueGroup* parent,
+ bool splitPassesByLightingType,
+ bool splitNoShadowPasses,
+ bool shadowCastersNotReceivers);
+
+ ~RenderPriorityGroup() { }
+
+ /** Get the collection of basic solids currently queued, this includes
+ all solids when there are no shadows, or all solids which have shadow
+ receiving enabled when using modulative shadows, or all ambient passes
+ of solids which have shadow receive enabled for additive shadows. */
+ const QueuedRenderableCollection& getSolidsBasic(void) const
+ { return mSolidsBasic; }
+ /** Get the collection of solids currently queued per light (only applicable in
+ additive shadow modes). */
+ const QueuedRenderableCollection& getSolidsDiffuseSpecular(void) const
+ { return mSolidsDiffuseSpecular; }
+ /** Get the collection of solids currently queued for decal passes (only
+ applicable in additive shadow modes). */
+ const QueuedRenderableCollection& getSolidsDecal(void) const
+ { return mSolidsDecal; }
+ /** Get the collection of solids for which shadow receipt is disabled (only
+ applicable when shadows are enabled). */
+ const QueuedRenderableCollection& getSolidsNoShadowReceive(void) const
+ { return mSolidsNoShadowReceive; }
+ /** Get the collection of transparent objects currently queued */
+ const QueuedRenderableCollection& getTransparents(void) const
+ { return mTransparents; }
+
+
+ /** Reset the organisation modes required for the solids in this group.
+ @remarks
+ You can only do this when the group is empty, ie after clearing the
+ queue.
+ @see QueuedRenderableCollection::OrganisationMode
+ */
+ void resetOrganisationModes(void);
+
+ /** Add a required sorting / grouping mode for the solids in this group.
+ @remarks
+ You can only do this when the group is empty, ie after clearing the
+ queue.
+ @see QueuedRenderableCollection::OrganisationMode
+ */
+ void addOrganisationMode(QueuedRenderableCollection::OrganisationMode om);
+
+ /** Set the sorting / grouping mode for the solids in this group to the default.
+ @remarks
+ You can only do this when the group is empty, ie after clearing the
+ queue.
+ @see QueuedRenderableCollection::OrganisationMode
+ */
+ void defaultOrganisationMode(void);
+
+ /** Add a renderable to this group. */
+ void addRenderable(Renderable* pRend, Technique* pTech);
+
+ /** Sorts the objects which have been added to the queue; transparent objects by their
+ depth in relation to the passed in Camera. */
+ void sort(const Camera* cam);
+
+ /** Clears this group of renderables.
+ */
+ void clear(void);
+
+ /** Sets whether or not the queue will split passes by their lighting type,
+ ie ambient, per-light and decal.
+ */
+ void setSplitPassesByLightingType(bool split)
+ {
+ mSplitPassesByLightingType = split;
+ }
+
+ /** Sets whether or not passes which have shadow receive disabled should
+ be separated.
+ */
+ void setSplitNoShadowPasses(bool split)
+ {
+ mSplitNoShadowPasses = split;
+ }
+
+ /** Sets whether or not objects which cast shadows should be treated as
+ never receiving shadows.
+ */
+ void setShadowCastersCannotBeReceivers(bool ind)
+ {
+ mShadowCastersNotReceivers = ind;
+ }
+
+
+
+ };
+
+
+ /** A grouping level underneath RenderQueue which groups renderables
+ to be issued at coarsely the same time to the renderer.
+ @remarks
+ Each instance of this class itself hold RenderPriorityGroup instances,
+ which are the groupings of renderables by priority for fine control
+ of ordering (not required for most instances).
+ */
+ class _OgreExport RenderQueueGroup
+ {
+ public:
+ typedef std::map > PriorityMap;
+ typedef MapIterator PriorityMapIterator;
+ protected:
+ RenderQueue* mParent;
+ bool mSplitPassesByLightingType;
+ bool mSplitNoShadowPasses;
+ bool mShadowCastersNotReceivers;
+ /// Map of RenderPriorityGroup objects
+ PriorityMap mPriorityGroups;
+ /// Whether shadows are enabled for this queue
+ bool mShadowsEnabled;
+
+
+ public:
+ RenderQueueGroup(RenderQueue* parent,
+ bool splitPassesByLightingType,
+ bool splitNoShadowPasses,
+ bool shadowCastersNotReceivers)
+ : mParent(parent)
+ , mSplitPassesByLightingType(splitPassesByLightingType)
+ , mSplitNoShadowPasses(splitNoShadowPasses)
+ , mShadowCastersNotReceivers(shadowCastersNotReceivers)
+ , mShadowsEnabled(true)
+ {
+ }
+
+ ~RenderQueueGroup() {
+ // destroy contents now
+ PriorityMap::iterator i;
+ for (i = mPriorityGroups.begin(); i != mPriorityGroups.end(); ++i)
+ {
+ delete i->second;
+ }
+ }
+
+ /** Get an iterator for browsing through child contents. */
+ PriorityMapIterator getIterator(void)
+ {
+ return PriorityMapIterator(mPriorityGroups.begin(), mPriorityGroups.end());
+ }
+
+ /** Add a renderable to this group, with the given priority. */
+ void addRenderable(Renderable* pRend, Technique* pTech, ushort priority)
+ {
+ // Check if priority group is there
+ PriorityMap::iterator i = mPriorityGroups.find(priority);
+ RenderPriorityGroup* pPriorityGrp;
+ if (i == mPriorityGroups.end())
+ {
+ // Missing, create
+ pPriorityGrp = new RenderPriorityGroup(this,
+ mSplitPassesByLightingType,
+ mSplitNoShadowPasses,
+ mShadowCastersNotReceivers);
+ mPriorityGroups.insert(PriorityMap::value_type(priority, pPriorityGrp));
+ }
+ else
+ {
+ pPriorityGrp = i->second;
+ }
+
+ // Add
+ pPriorityGrp->addRenderable(pRend, pTech);
+
+ }
+
+ /** Clears this group of renderables.
+ @param destroy
+ If false, doesn't delete any priority groups, just empties them. Saves on
+ memory deallocations since the chances are rougly the same kinds of
+ renderables are going to be sent to the queue again next time. If
+ true, completely destroys.
+ */
+ void clear(bool destroy = false)
+ {
+ PriorityMap::iterator i, iend;
+ iend = mPriorityGroups.end();
+ for (i = mPriorityGroups.begin(); i != iend; ++i)
+ {
+ if (destroy)
+ delete i->second;
+ else
+ i->second->clear();
+ }
+
+ if (destroy)
+ mPriorityGroups.clear();
+
+ }
+
+ /** Indicate whether a given queue group will be doing any
+ shadow setup.
+ @remarks
+ This method allows you to inform the queue about a queue group, and to
+ indicate whether this group will require shadow processing of any sort.
+ In order to preserve rendering order, OGRE has to treat queue groups
+ as very separate elements of the scene, and this can result in it
+ having to duplicate shadow setup for each group. Therefore, if you
+ know that a group which you are using will never need shadows, you
+ should preregister the group using this method in order to improve
+ the performance.
+ */
+ void setShadowsEnabled(bool enabled) { mShadowsEnabled = enabled; }
+
+ /** Are shadows enabled for this queue? */
+ bool getShadowsEnabled(void) const { return mShadowsEnabled; }
+
+ /** Sets whether or not the queue will split passes by their lighting type,
+ ie ambient, per-light and decal.
+ */
+ void setSplitPassesByLightingType(bool split)
+ {
+ mSplitPassesByLightingType = split;
+ PriorityMap::iterator i, iend;
+ iend = mPriorityGroups.end();
+ for (i = mPriorityGroups.begin(); i != iend; ++i)
+ {
+ i->second->setSplitPassesByLightingType(split);
+ }
+ }
+ /** Sets whether or not the queue will split passes which have shadow receive
+ turned off (in their parent material), which is needed when certain shadow
+ techniques are used.
+ */
+ void setSplitNoShadowPasses(bool split)
+ {
+ mSplitNoShadowPasses = split;
+ PriorityMap::iterator i, iend;
+ iend = mPriorityGroups.end();
+ for (i = mPriorityGroups.begin(); i != iend; ++i)
+ {
+ i->second->setSplitNoShadowPasses(split);
+ }
+ }
+ /** Sets whether or not objects which cast shadows should be treated as
+ never receiving shadows.
+ */
+ void setShadowCastersCannotBeReceivers(bool ind)
+ {
+ mShadowCastersNotReceivers = ind;
+ PriorityMap::iterator i, iend;
+ iend = mPriorityGroups.end();
+ for (i = mPriorityGroups.begin(); i != iend; ++i)
+ {
+ i->second->setShadowCastersCannotBeReceivers(ind);
+ }
+ }
+ /** Reset the organisation modes required for the solids in this group.
+ @remarks
+ You can only do this when the group is empty, ie after clearing the
+ queue.
+ @see QueuedRenderableCollection::OrganisationMode
+ */
+ void resetOrganisationModes(void)
+ {
+ PriorityMap::iterator i, iend;
+ iend = mPriorityGroups.end();
+ for (i = mPriorityGroups.begin(); i != iend; ++i)
+ {
+ i->second->resetOrganisationModes();
+ }
+ }
+
+ /** Add a required sorting / grouping mode for the solids in this group.
+ @remarks
+ You can only do this when the group is empty, ie after clearing the
+ queue.
+ @see QueuedRenderableCollection::OrganisationMode
+ */
+ void addOrganisationMode(QueuedRenderableCollection::OrganisationMode om)
+ {
+ PriorityMap::iterator i, iend;
+ iend = mPriorityGroups.end();
+ for (i = mPriorityGroups.begin(); i != iend; ++i)
+ {
+ i->second->addOrganisationMode(om);
+ }
+ }
+
+ /** Setthe sorting / grouping mode for the solids in this group to the default.
+ @remarks
+ You can only do this when the group is empty, ie after clearing the
+ queue.
+ @see QueuedRenderableCollection::OrganisationMode
+ */
+ void defaultOrganisationMode(void)
+ {
+ PriorityMap::iterator i, iend;
+ iend = mPriorityGroups.end();
+ for (i = mPriorityGroups.begin(); i != iend; ++i)
+ {
+ i->second->defaultOrganisationMode();
+ }
+ }
+
+ };
+
+
+
+}
+
+#endif
+
+
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreRenderSystem.h b/school/informatik/verkerhssimulation/src/ogre/OgreRenderSystem.h
new file mode 100644
index 00000000..3bce6931
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreRenderSystem.h
@@ -0,0 +1,1231 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __RenderSystem_H_
+#define __RenderSystem_H_
+
+// Precompiler options
+#include "OgrePrerequisites.h"
+
+#include "OgreString.h"
+
+#include "OgreTextureUnitState.h"
+#include "OgreCommon.h"
+
+#include "OgreRenderOperation.h"
+#include "OgreRenderSystemCapabilities.h"
+#include "OgreRenderTarget.h"
+#include "OgreRenderTexture.h"
+#include "OgreFrameListener.h"
+#include "OgreConfigOptionMap.h"
+#include "OgreGpuProgram.h"
+#include "OgrePlane.h"
+#include "OgreIteratorWrappers.h"
+
+namespace Ogre
+{
+ typedef std::map< String, RenderTarget * > RenderTargetMap;
+ typedef std::multimap RenderTargetPriorityMap;
+
+ class TextureManager;
+ /// Enum describing the ways to generate texture coordinates
+ enum TexCoordCalcMethod
+ {
+ /// No calculated texture coordinates
+ TEXCALC_NONE,
+ /// Environment map based on vertex normals
+ TEXCALC_ENVIRONMENT_MAP,
+ /// Environment map based on vertex positions
+ TEXCALC_ENVIRONMENT_MAP_PLANAR,
+ TEXCALC_ENVIRONMENT_MAP_REFLECTION,
+ TEXCALC_ENVIRONMENT_MAP_NORMAL,
+ /// Projective texture
+ TEXCALC_PROJECTIVE_TEXTURE
+ };
+ /// Enum describing the various actions which can be taken onthe stencil buffer
+ enum StencilOperation
+ {
+ /// Leave the stencil buffer unchanged
+ SOP_KEEP,
+ /// Set the stencil value to zero
+ SOP_ZERO,
+ /// Set the stencil value to the reference value
+ SOP_REPLACE,
+ /// Increase the stencil value by 1, clamping at the maximum value
+ SOP_INCREMENT,
+ /// Decrease the stencil value by 1, clamping at 0
+ SOP_DECREMENT,
+ /// Increase the stencil value by 1, wrapping back to 0 when incrementing the maximum value
+ SOP_INCREMENT_WRAP,
+ /// Decrease the stencil value by 1, wrapping when decrementing 0
+ SOP_DECREMENT_WRAP,
+ /// Invert the bits of the stencil buffer
+ SOP_INVERT
+ };
+
+ /** Defines the functionality of a 3D API
+ @remarks
+ The RenderSystem class provides a base interface
+ which abstracts the general functionality of the 3D API
+ e.g. Direct3D or OpenGL. Whilst a few of the general
+ methods have implementations, most of this class is
+ abstract, requiring a subclass based on a specific API
+ to be constructed to provide the full functionality.
+ Note there are 2 levels to the interface - one which
+ will be used often by the caller of the Ogre library,
+ and one which is at a lower level and will be used by the
+ other classes provided by Ogre. These lower level
+ methods are prefixed with '_' to differentiate them.
+ The advanced user of the library may use these lower
+ level methods to access the 3D API at a more fundamental
+ level (dealing direct with render states and rendering
+ primitives), but still benefitting from Ogre's abstraction
+ of exactly which 3D API is in use.
+ @author
+ Steven Streeting
+ @version
+ 1.0
+ */
+ class _OgreExport RenderSystem
+ {
+ public:
+ /** Default Constructor.
+ */
+ RenderSystem();
+
+ /** Destructor.
+ */
+ virtual ~RenderSystem();
+
+ /** Returns the name of the rendering system.
+ */
+ virtual const String& getName(void) const = 0;
+
+ /** Returns the details of this API's configuration options
+ @remarks
+ Each render system must be able to inform the world
+ of what options must/can be specified for it's
+ operation.
+ @par
+ These are passed as strings for portability, but
+ grouped into a structure (_ConfigOption) which includes
+ both options and current value.
+ @par
+ Note that the settings returned from this call are
+ affected by the options that have been set so far,
+ since some options are interdependent.
+ @par
+ This routine is called automatically by the default
+ configuration dialogue produced by Root::showConfigDialog
+ or may be used by the caller for custom settings dialogs
+ @returns
+ A 'map' of options, i.e. a list of options which is also
+ indexed by option name.
+ */
+ virtual ConfigOptionMap& getConfigOptions(void) = 0;
+
+ /** Sets an option for this API
+ @remarks
+ Used to confirm the settings (normally chosen by the user) in
+ order to make the renderer able to initialise with the settings as required.
+ This may be video mode, D3D driver, full screen / windowed etc.
+ Called automatically by the default configuration
+ dialog, and by the restoration of saved settings.
+ These settings are stored and only activated when
+ RenderSystem::initialise or RenderSystem::reinitialise
+ are called.
+ @par
+ If using a custom configuration dialog, it is advised that the
+ caller calls RenderSystem::getConfigOptions
+ again, since some options can alter resulting from a selection.
+ @param
+ name The name of the option to alter.
+ @param
+ value The value to set the option to.
+ */
+ virtual void setConfigOption(const String &name, const String &value) = 0;
+
+ /** Create an object for performing hardware occlusion queries.
+ */
+ virtual HardwareOcclusionQuery* createHardwareOcclusionQuery(void) = 0;
+
+ /** Destroy a hardware occlusion query object.
+ */
+ virtual void destroyHardwareOcclusionQuery(HardwareOcclusionQuery *hq);
+
+ /** Validates the options set for the rendering system, returning a message if there are problems.
+ @note
+ If the returned string is empty, there are no problems.
+ */
+ virtual String validateConfigOptions(void) = 0;
+
+ /** Start up the renderer using the settings selected (Or the defaults if none have been selected).
+ @remarks
+ Called by Root::setRenderSystem. Shouldn't really be called
+ directly, although this can be done if the app wants to.
+ @param
+ autoCreateWindow If true, creates a render window
+ automatically, based on settings chosen so far. This saves
+ an extra call to RenderSystem::createRenderWindow
+ for the main render window.
+ @par
+ If an application has more specific window requirements,
+ however (e.g. a level design app), it should specify false
+ for this parameter and do it manually.
+ @returns
+ A pointer to the automatically created window, if requested, otherwise null.
+ */
+ virtual RenderWindow* initialise(bool autoCreateWindow, const String& windowTitle = "OGRE Render Window");
+
+ /** Restart the renderer (normally following a change in settings).
+ */
+ virtual void reinitialise(void) = 0;
+
+ /** Shutdown the renderer and cleanup resources.
+ */
+ virtual void shutdown(void);
+
+
+ /** Sets the colour & strength of the ambient (global directionless) light in the world.
+ */
+ virtual void setAmbientLight(float r, float g, float b) = 0;
+
+ /** Sets the type of light shading required (default = Gouraud).
+ */
+ virtual void setShadingType(ShadeOptions so) = 0;
+
+ /** Sets whether or not dynamic lighting is enabled.
+ @param
+ enabled If true, dynamic lighting is performed on geometry with normals supplied, geometry without
+ normals will not be displayed. If false, no lighting is applied and all geometry will be full brightness.
+ */
+ virtual void setLightingEnabled(bool enabled) = 0;
+
+ /** Sets whether or not W-buffers are enabled if they are avalible for this renderer.
+ @param
+ enabled If true and the renderer supports them W-buffers will be used. If false
+ W-buffers will not be used even if avalible. W-buffers are enabled by default
+ for 16bit depth buffers and disabled for all other depths.
+ */
+ void setWBufferEnabled(bool enabled);
+
+ /** Returns true if the renderer will try to use W-buffers when avalible.
+ */
+ bool getWBufferEnabled(void) const;
+
+ /** Creates a new rendering window.
+ @remarks
+ This method creates a new rendering window as specified
+ by the paramteters. The rendering system could be
+ responible for only a single window (e.g. in the case
+ of a game), or could be in charge of multiple ones (in the
+ case of a level editor). The option to create the window
+ as a child of another is therefore given.
+ This method will create an appropriate subclass of
+ RenderWindow depending on the API and platform implementation.
+ @par
+ After creation, this window can be retrieved using getRenderTarget().
+ @param
+ name The name of the window. Used in other methods
+ later like setRenderTarget and getRenderWindow.
+ @param
+ width The width of the new window.
+ @param
+ height The height of the new window.
+ @param
+ fullScreen Specify true to make the window full screen
+ without borders, title bar or menu bar.
+ @param
+ miscParams A NameValuePairList describing the other parameters for the new rendering window.
+ Options are case sensitive. Unrecognised parameters will be ignored silently.
+ These values might be platform dependent, but these are present for all platorms unless
+ indicated otherwise:
+ **
+ Key: "title"
+ Description: The title of the window that will appear in the title bar
+ Values: string
+ Default: RenderTarget name
+ **
+ Key: "colourDepth"
+ Description: Colour depth of the resulting rendering window; only applies if fullScreen
+ is set.
+ Values: 16 or 32
+ Default: desktop depth
+ Notes: [W32 specific]
+ **
+ Key: "left"
+ Description: screen x coordinate from left
+ Values: positive integers
+ Default: 'center window on screen'
+ Notes: Ignored in case of full screen
+ **
+ Key: "top"
+ Description: screen y coordinate from top
+ Values: positive integers
+ Default: 'center window on screen'
+ Notes: Ignored in case of full screen
+ **
+ Key: "depthBuffer" [DX9 specific]
+ Description: Use depth buffer
+ Values: false or true
+ Default: true
+ **
+ Key: "externalWindowHandle" [API specific]
+ Description: External window handle, for embedding the OGRE context
+ Values: positive integer for W32 (HWND handle)
+ poslong:posint:poslong (display*:screen:windowHandle) or
+ poslong:posint:poslong:poslong (display*:screen:windowHandle:XVisualInfo*) for GLX
+ Default: 0 (None)
+ **
+ Key: "externalGLControl" [Win32 OpenGL specific]
+ Description: Let the external window control OpenGL i.e. don't select a pixel format for the window,
+ do not change v-sync and do not swap buffer. When set to true, the calling application
+ is responsible of OpenGL initialization and buffer swapping. It should also create an
+ OpenGL context for its own rendering, Ogre will create one for its use. Then the calling
+ application must also enable Ogre OpenGL context before calling any Ogre function and
+ restore its OpenGL context after these calls. The Ogre OpenGL context can be retrieved
+ after Ogre initialisation by calling wglGetCurrentDC() and wglGetCurrentContext().
+ It is only used when the externalWindowHandle parameter is used.
+ Values: true, false
+ Default: false
+ **
+ Key: "externalGLContext" [Win32 OpenGL specific]
+ Description: Use an externally created GL context
+ Values:
+ Default: 0 (create own context)
+ **
+ Key: "parentWindowHandle" [API specific]
+ Description: Parent window handle, for embedding the OGRE context
+ Values: positive integer for W32 (HWND handle)
+ poslong:posint:poslong for GLX (display*:screen:windowHandle)
+ Default: 0 (None)
+ **
+ Key: "FSAA"
+ Description: Full screen antialiasing factor
+ Values: 0,2,4,6,...
+ Default: 0
+ **
+ Key: "displayFrequency"
+ Description: Display frequency rate, for fullscreen mode
+ Values: 60...?
+ Default: Desktop vsync rate
+ **
+ Key: "vsync"
+ Description: Synchronize buffer swaps to vsync
+ Values: true, false
+ Default: 0
+ **
+ Key: "border"
+ Description: The type of window border (in windowed mode)
+ Values: none, fixed, resize
+ Default: resize
+ **
+ Key: "outerDimensions"
+ Description: Whether the width/height is expressed as the size of the
+ outer window, rather than the content area
+ Values: true, false
+ Default: false
+ **
+ Key: "useNVPerfHUD" [DX9 specific]
+ Description: Enable the use of nVidia NVPerfHUD
+ Values: true, false
+ Default: false
+ */
+ virtual RenderWindow* createRenderWindow(const String &name, unsigned int width, unsigned int height,
+ bool fullScreen, const NameValuePairList *miscParams = 0) = 0;
+
+ /** Creates and registers a render texture object.
+ @param name
+ The name for the new render texture. Note that names must be unique.
+ @param width
+ The requested width for the render texture. See Remarks for more info.
+ @param height
+ The requested width for the render texture. See Remarks for more info.
+ @param texType
+ The type of texture; defaults to TEX_TYPE_2D
+ @param internalFormat
+ The internal format of the texture; defaults to PF_X8R8G8B8
+ @param miscParams This parameter is ignored.
+ @returns
+ On succes, a pointer to a new platform-dependernt, RenderTexture-derived
+ class is returned. On failiure, NULL is returned.
+ @remarks
+ Because a render texture is basically a wrapper around a texture object,
+ the width and height parameters of this method just hint the preferred
+ size for the texture. Depending on the hardware driver or the underlying
+ API, these values might change when the texture is created. The same applies
+ to the internalFormat parameter.
+ @deprecated
+ This method is deprecated, and exists only for backward compatibility. You can create
+ arbitrary rendertextures with the TextureManager::createManual call with usage
+ TU_RENDERTARGET.
+ */
+ RenderTexture * createRenderTexture( const String & name, unsigned int width, unsigned int height,
+ TextureType texType = TEX_TYPE_2D, PixelFormat internalFormat = PF_X8R8G8B8,
+ const NameValuePairList *miscParams = 0 );
+
+ /** Create a MultiRenderTarget, which is a render target that renders to multiple RenderTextures
+ at once. Surfaces can be bound and unbound at will.
+ This fails if mCapabilities->numMultiRenderTargets() is smaller than 2.
+ */
+ virtual MultiRenderTarget * createMultiRenderTarget(const String & name) = 0;
+
+ /** Destroys a render window */
+ virtual void destroyRenderWindow(const String& name);
+ /** Destroys a render texture */
+ virtual void destroyRenderTexture(const String& name);
+ /** Destroys a render target of any sort */
+ virtual void destroyRenderTarget(const String& name);
+
+ /** Attaches the passed render target to the render system.
+ */
+ virtual void attachRenderTarget( RenderTarget &target );
+ /** Returns a pointer to the render target with the passed name, or NULL if that
+ render target cannot be found.
+ */
+ virtual RenderTarget * getRenderTarget( const String &name );
+ /** Detaches the render target with the passed name from the render system and
+ returns a pointer to it.
+ @note
+ If the render target cannot be found, NULL is returned.
+ */
+ virtual RenderTarget * detachRenderTarget( const String &name );
+
+ /// Iterator over RenderTargets
+ typedef MapIterator RenderTargetIterator;
+
+ /** Returns a specialised MapIterator over all render targets attached to the RenderSystem. */
+ virtual RenderTargetIterator getRenderTargetIterator(void) {
+ return RenderTargetIterator( mRenderTargets.begin(), mRenderTargets.end() );
+ }
+ /** Returns a description of an error code.
+ */
+ virtual String getErrorDescription(long errorNumber) const = 0;
+
+ /** Defines whether or now fullscreen render windows wait for the vertical blank before flipping buffers.
+ @remarks
+ By default, all rendering windows wait for a vertical blank (when the CRT beam turns off briefly to move
+ from the bottom right of the screen back to the top left) before flipping the screen buffers. This ensures
+ that the image you see on the screen is steady. However it restricts the frame rate to the refresh rate of
+ the monitor, and can slow the frame rate down. You can speed this up by not waiting for the blank, but
+ this has the downside of introducing 'tearing' artefacts where part of the previous frame is still displayed
+ as the buffers are switched. Speed vs quality, you choose.
+ @note
+ Has NO effect on windowed mode render targets. Only affects fullscreen mode.
+ @param
+ enabled If true, the system waits for vertical blanks - quality over speed. If false it doesn't - speed over quality.
+ */
+ void setWaitForVerticalBlank(bool enabled);
+
+ /** Returns true if the system is synchronising frames with the monitor vertical blank.
+ */
+ bool getWaitForVerticalBlank(void) const;
+
+ // ------------------------------------------------------------------------
+ // Internal Rendering Access
+ // All methods below here are normally only called by other OGRE classes
+ // They can be called by library user if required
+ // ------------------------------------------------------------------------
+
+
+ /** Tells the rendersystem to use the attached set of lights (and no others)
+ up to the number specified (this allows the same list to be used with different
+ count limits) */
+ virtual void _useLights(const LightList& lights, unsigned short limit) = 0;
+ /** Sets the world transform matrix. */
+ virtual void _setWorldMatrix(const Matrix4 &m) = 0;
+ /** Sets multiple world matrices (vertex blending). */
+ virtual void _setWorldMatrices(const Matrix4* m, unsigned short count);
+ /** Sets the view transform matrix */
+ virtual void _setViewMatrix(const Matrix4 &m) = 0;
+ /** Sets the projection transform matrix */
+ virtual void _setProjectionMatrix(const Matrix4 &m) = 0;
+ /** Utility function for setting all the properties of a texture unit at once.
+ This method is also worth using over the individual texture unit settings because it
+ only sets those settings which are different from the current settings for this
+ unit, thus minimising render state changes.
+ */
+ virtual void _setTextureUnitSettings(size_t texUnit, TextureUnitState& tl);
+ /** Turns off a texture unit. */
+ virtual void _disableTextureUnit(size_t texUnit);
+ /** Disables all texture units from the given unit upwards */
+ virtual void _disableTextureUnitsFrom(size_t texUnit);
+ /** Sets the surface properties to be used for future rendering.
+
+ This method sets the the properties of the surfaces of objects
+ to be rendered after it. In this context these surface properties
+ are the amount of each type of light the object reflects (determining
+ it's colour under different types of light), whether it emits light
+ itself, and how shiny it is. Textures are not dealt with here,
+ see the _setTetxure method for details.
+ This method is used by _setMaterial so does not need to be called
+ direct if that method is being used.
+
+ @param ambient The amount of ambient (sourceless and directionless)
+ light an object reflects. Affected by the colour/amount of ambient light in the scene.
+ @param diffuse The amount of light from directed sources that is
+ reflected (affected by colour/amount of point, directed and spot light sources)
+ @param specular The amount of specular light reflected. This is also
+ affected by directed light sources but represents the colour at the
+ highlights of the object.
+ @param emissive The colour of light emitted from the object. Note that
+ this will make an object seem brighter and not dependent on lights in
+ the scene, but it will not act as a light, so will not illuminate other
+ objects. Use a light attached to the same SceneNode as the object for this purpose.
+ @param shininess A value which only has an effect on specular highlights (so
+ specular must be non-black). The higher this value, the smaller and crisper the
+ specular highlights will be, imitating a more highly polished surface.
+ This value is not constrained to 0.0-1.0, in fact it is likely to
+ be more (10.0 gives a modest sheen to an object).
+ @param tracking A bit field that describes which of the ambient, diffuse, specular
+ and emissive colours follow the vertex colour of the primitive. When a bit in this field is set
+ its ColourValue is ignored. This is a combination of TVC_AMBIENT, TVC_DIFFUSE, TVC_SPECULAR(note that the shininess value is still
+ taken from shininess) and TVC_EMISSIVE. TVC_NONE means that there will be no material property
+ tracking the vertex colours.
+ */
+ virtual void _setSurfaceParams(const ColourValue &ambient,
+ const ColourValue &diffuse, const ColourValue &specular,
+ const ColourValue &emissive, Real shininess,
+ TrackVertexColourType tracking = TVC_NONE) = 0;
+
+ /** Sets whether or not rendering points using OT_POINT_LIST will
+ render point sprites (textured quads) or plain points.
+ @param enabled True enables point sprites, false returns to normal
+ point rendering.
+ */
+ virtual void _setPointSpritesEnabled(bool enabled) = 0;
+
+ /** Sets the size of points and how they are attenuated with distance.
+ @remarks
+ When performing point rendering or point sprite rendering,
+ point size can be attenuated with distance. The equation for
+ doing this is attenuation = 1 / (constant + linear * dist + quadratic * d^2) .
+ @par
+ For example, to disable distance attenuation (constant screensize)
+ you would set constant to 1, and linear and quadratic to 0. A
+ standard perspective attenuation would be 0, 1, 0 respectively.
+ */
+ virtual void _setPointParameters(Real size, bool attenuationEnabled,
+ Real constant, Real linear, Real quadratic, Real minSize, Real maxSize) = 0;
+
+
+ /**
+ Sets the texture to bind to a given texture unit.
+
+ User processes would not normally call this direct unless rendering
+ primitives themselves.
+
+ @param unit The index of the texture unit to modify. Multitexturing
+ hardware can support multiple units (see
+ RenderSystemCapabilites::getNumTextureUnits)
+ @param enabled Boolean to turn the unit on/off
+ @param texPtr Pointer to the texture to use.
+ */
+ virtual void _setTexture(size_t unit, bool enabled,
+ const TexturePtr &texPtr) = 0;
+ /**
+ Sets the texture to bind to a given texture unit.
+
+ User processes would not normally call this direct unless rendering
+ primitives themselves.
+
+ @param unit The index of the texture unit to modify. Multitexturing
+ hardware can support multiple units (see
+ RenderSystemCapabilites::getNumTextureUnits)
+ @param enabled Boolean to turn the unit on/off
+ @param texname The name of the texture to use - this should have
+ already been loaded with TextureManager::load.
+ */
+ virtual void _setTexture(size_t unit, bool enabled, const String &texname);
+
+ /** Binds a texture to a vertex sampler.
+ @remarks
+ Not all rendersystems support separate vertex samplers. For those that
+ do, you can set a texture for them, separate to the regular texture
+ samplers, using this method. For those that don't, you should use the
+ regular texture samplers which are shared between the vertex and
+ fragment units; calling this method will throw an exception.
+ @see RenderSystemCapabilites::getVertexTextureUnitsShared
+ */
+ virtual void _setVertexTexture(size_t unit, const TexturePtr& tex);
+
+ /**
+ Sets the texture coordinate set to use for a texture unit.
+
+ Meant for use internally - not generally used directly by apps - the Material and TextureUnitState
+ classes let you manage textures far more easily.
+
+ @param unit Texture unit as above
+ @param index The index of the texture coordinate set to use.
+ */
+ virtual void _setTextureCoordSet(size_t unit, size_t index) = 0;
+
+ /**
+ Sets a method for automatically calculating texture coordinates for a stage.
+ Should not be used by apps - for use by Ogre only.
+ @param unit Texture unit as above
+ @param m Calculation method to use
+ @param frustum Optional Frustum param, only used for projective effects
+ */
+ virtual void _setTextureCoordCalculation(size_t unit, TexCoordCalcMethod m,
+ const Frustum* frustum = 0) = 0;
+
+ /** Sets the texture blend modes from a TextureUnitState record.
+ Meant for use internally only - apps should use the Material
+ and TextureUnitState classes.
+ @param unit Texture unit as above
+ @param bm Details of the blending mode
+ */
+ virtual void _setTextureBlendMode(size_t unit, const LayerBlendModeEx& bm) = 0;
+
+ /** Sets the filtering options for a given texture unit.
+ @param unit The texture unit to set the filtering options for
+ @param minFilter The filter used when a texture is reduced in size
+ @param magFilter The filter used when a texture is magnified
+ @param mipFilter The filter used between mipmap levels, FO_NONE disables mipmapping
+ */
+ virtual void _setTextureUnitFiltering(size_t unit, FilterOptions minFilter,
+ FilterOptions magFilter, FilterOptions mipFilter);
+
+ /** Sets a single filter for a given texture unit.
+ @param unit The texture unit to set the filtering options for
+ @param ftype The filter type
+ @param filter The filter to be used
+ */
+ virtual void _setTextureUnitFiltering(size_t unit, FilterType ftype, FilterOptions filter) = 0;
+
+ /** Sets the maximal anisotropy for the specified texture unit.*/
+ virtual void _setTextureLayerAnisotropy(size_t unit, unsigned int maxAnisotropy) = 0;
+
+ /** Sets the texture addressing mode for a texture unit.*/
+ virtual void _setTextureAddressingMode(size_t unit, const TextureUnitState::UVWAddressingMode& uvw) = 0;
+
+ /** Sets the texture border colour for a texture unit.*/
+ virtual void _setTextureBorderColour(size_t unit, const ColourValue& colour) = 0;
+
+ /** Sets the mipmap bias value for a given texture unit.
+ @remarks
+ This allows you to adjust the mipmap calculation up or down for a
+ given texture unit. Negative values force a larger mipmap to be used,
+ positive values force a smaller mipmap to be used. Units are in numbers
+ of levels, so +1 forces the mipmaps to one smaller level.
+ @note Only does something if render system has capability RSC_MIPMAP_LOD_BIAS.
+ */
+ virtual void _setTextureMipmapBias(size_t unit, float bias) = 0;
+
+ /** Sets the texture coordinate transformation matrix for a texture unit.
+ @param unit Texture unit to affect
+ @param xform The 4x4 matrix
+ */
+ virtual void _setTextureMatrix(size_t unit, const Matrix4& xform) = 0;
+
+ /** Sets the global blending factors for combining subsequent renders with the existing frame contents.
+ The result of the blending operation is:
+ final = (texture * sourceFactor) + (pixel * destFactor)
+ Each of the factors is specified as one of a number of options, as specified in the SceneBlendFactor
+ enumerated type.
+ @param sourceFactor The source factor in the above calculation, i.e. multiplied by the texture colour components.
+ @param destFactor The destination factor in the above calculation, i.e. multiplied by the pixel colour components.
+ */
+ virtual void _setSceneBlending(SceneBlendFactor sourceFactor, SceneBlendFactor destFactor) = 0;
+
+ /** Sets the global alpha rejection approach for future renders.
+ By default images are rendered regardless of texture alpha. This method lets you change that.
+ @param func The comparison function which must pass for a pixel to be written.
+ @param val The value to compare each pixels alpha value to (0-255)
+ */
+ virtual void _setAlphaRejectSettings(CompareFunction func, unsigned char value) = 0;
+ /**
+ * Signifies the beginning of a frame, ie the start of rendering on a single viewport. Will occur
+ * several times per complete frame if multiple viewports exist.
+ */
+ virtual void _beginFrame(void) = 0;
+
+
+ /**
+ * Ends rendering of a frame to the current viewport.
+ */
+ virtual void _endFrame(void) = 0;
+ /**
+ Sets the provided viewport as the active one for future
+ rendering operations. This viewport is aware of it's own
+ camera and render target. Must be implemented by subclass.
+
+ @param target Pointer to the appropriate viewport.
+ */
+ virtual void _setViewport(Viewport *vp) = 0;
+ /** Get the current active viewport for rendering. */
+ virtual Viewport* _getViewport(void);
+
+ /** Sets the culling mode for the render system based on the 'vertex winding'.
+ A typical way for the rendering engine to cull triangles is based on the
+ 'vertex winding' of triangles. Vertex winding refers to the direction in
+ which the vertices are passed or indexed to in the rendering operation as viewed
+ from the camera, and will wither be clockwise or anticlockwise (that's 'counterclockwise' for
+ you Americans out there ;) The default is CULL_CLOCKWISE i.e. that only triangles whose vertices
+ are passed/indexed in anticlockwise order are rendered - this is a common approach and is used in 3D studio models
+ for example. You can alter this culling mode if you wish but it is not advised unless you know what you are doing.
+ You may wish to use the CULL_NONE option for mesh data that you cull yourself where the vertex
+ winding is uncertain.
+ */
+ virtual void _setCullingMode(CullingMode mode) = 0;
+
+ virtual CullingMode _getCullingMode(void) const;
+
+ /** Sets the mode of operation for depth buffer tests from this point onwards.
+ Sometimes you may wish to alter the behaviour of the depth buffer to achieve
+ special effects. Because it's unlikely that you'll set these options for an entire frame,
+ but rather use them to tweak settings between rendering objects, this is an internal
+ method (indicated by the '_' prefix) which will be used by a SceneManager implementation
+ rather than directly from the client application.
+ If this method is never called the settings are automatically the same as the default parameters.
+ @param depthTest If true, the depth buffer is tested for each pixel and the frame buffer is only updated
+ if the depth function test succeeds. If false, no test is performed and pixels are always written.
+ @param depthWrite If true, the depth buffer is updated with the depth of the new pixel if the depth test succeeds.
+ If false, the depth buffer is left unchanged even if a new pixel is written.
+ @param depthFunction Sets the function required for the depth test.
+ */
+ virtual void _setDepthBufferParams(bool depthTest = true, bool depthWrite = true, CompareFunction depthFunction = CMPF_LESS_EQUAL) = 0;
+
+ /** Sets whether or not the depth buffer check is performed before a pixel write.
+ @param enabled If true, the depth buffer is tested for each pixel and the frame buffer is only updated
+ if the depth function test succeeds. If false, no test is performed and pixels are always written.
+ */
+ virtual void _setDepthBufferCheckEnabled(bool enabled = true) = 0;
+ /** Sets whether or not the depth buffer is updated after a pixel write.
+ @param enabled If true, the depth buffer is updated with the depth of the new pixel if the depth test succeeds.
+ If false, the depth buffer is left unchanged even if a new pixel is written.
+ */
+ virtual void _setDepthBufferWriteEnabled(bool enabled = true) = 0;
+ /** Sets the comparison function for the depth buffer check.
+ Advanced use only - allows you to choose the function applied to compare the depth values of
+ new and existing pixels in the depth buffer. Only an issue if the deoth buffer check is enabled
+ (see _setDepthBufferCheckEnabled)
+ @param func The comparison between the new depth and the existing depth which must return true
+ for the new pixel to be written.
+ */
+ virtual void _setDepthBufferFunction(CompareFunction func = CMPF_LESS_EQUAL) = 0;
+ /** Sets whether or not colour buffer writing is enabled, and for which channels.
+ @remarks
+ For some advanced effects, you may wish to turn off the writing of certain colour
+ channels, or even all of the colour channels so that only the depth buffer is updated
+ in a rendering pass. However, the chances are that you really want to use this option
+ through the Material class.
+ @param red, green, blue, alpha Whether writing is enabled for each of the 4 colour channels. */
+ virtual void _setColourBufferWriteEnabled(bool red, bool green, bool blue, bool alpha) = 0;
+ /** Sets the depth bias, NB you should use the Material version of this.
+ @remarks
+ When polygons are coplanar, you can get problems with 'depth fighting' where
+ the pixels from the two polys compete for the same screen pixel. This is particularly
+ a problem for decals (polys attached to another surface to represent details such as
+ bulletholes etc.).
+ @par
+ A way to combat this problem is to use a depth bias to adjust the depth buffer value
+ used for the decal such that it is slightly higher than the true value, ensuring that
+ the decal appears on top.
+ @note
+ The final bias value is a combination of a constant bias and a bias proportional
+ to the maximum depth slope of the polygon being rendered. The final bias
+ is constantBias + slopeScaleBias * maxslope. Slope scale biasing is
+ generally preferable but is not available on older hardware.
+ @param constantBias The constant bias value, expressed as a value in
+ homogenous depth coordinates.
+ @param slopeScaleBias The bias value which is factored by the maximum slope
+ of the polygon, see the description above. This is not supported by all
+ cards.
+
+ */
+ virtual void _setDepthBias(float constantBias, float slopeScaleBias = 0.0f) = 0;
+ /** Sets the fogging mode for future geometry.
+ @param mode Set up the mode of fog as described in the FogMode enum, or set to FOG_NONE to turn off.
+ @param colour The colour of the fog. Either set this to the same as your viewport background colour,
+ or to blend in with a skydome or skybox.
+ @param expDensity The density of the fog in FOG_EXP or FOG_EXP2 mode, as a value between 0 and 1. The default is 1. i.e. completely opaque, lower values can mean
+ that fog never completely obscures the scene.
+ @param linearStart Distance at which linear fog starts to encroach. The distance must be passed
+ as a parametric value between 0 and 1, with 0 being the near clipping plane, and 1 being the far clipping plane. Only applicable if mode is FOG_LINEAR.
+ @param linearEnd Distance at which linear fog becomes completely opaque.The distance must be passed
+ as a parametric value between 0 and 1, with 0 being the near clipping plane, and 1 being the far clipping plane. Only applicable if mode is FOG_LINEAR.
+ */
+ virtual void _setFog(FogMode mode = FOG_NONE, const ColourValue& colour = ColourValue::White, Real expDensity = 1.0, Real linearStart = 0.0, Real linearEnd = 1.0) = 0;
+
+
+ /** The RenderSystem will keep a count of tris rendered, this resets the count. */
+ virtual void _beginGeometryCount(void);
+ /** Reports the number of tris rendered since the last _beginGeometryCount call. */
+ virtual unsigned int _getFaceCount(void) const;
+ /** Reports the number of batches rendered since the last _beginGeometryCount call. */
+ virtual unsigned int _getBatchCount(void) const;
+ /** Reports the number of vertices passed to the renderer since the last _beginGeometryCount call. */
+ virtual unsigned int _getVertexCount(void) const;
+
+ /** Generates a packed data version of the passed in ColourValue suitable for
+ use as with this RenderSystem.
+ @remarks
+ Since different render systems have different colour data formats (eg
+ RGBA for GL, ARGB for D3D) this method allows you to use 1 method for all.
+ @param colour The colour to convert
+ @param pDest Pointer to location to put the result.
+ */
+ virtual void convertColourValue(const ColourValue& colour, uint32* pDest);
+ /** Get the native VertexElementType for a compact 32-bit colour value
+ for this rendersystem.
+ */
+ virtual VertexElementType getColourVertexElementType(void) const = 0;
+
+ /** Converts a uniform projection matrix to suitable for this render system.
+ @remarks
+ Because different APIs have different requirements (some incompatible) for the
+ projection matrix, this method allows each to implement their own correctly and pass
+ back a generic OGRE matrix for storage in the engine.
+ */
+ virtual void _convertProjectionMatrix(const Matrix4& matrix,
+ Matrix4& dest, bool forGpuProgram = false) = 0;
+
+ /** Builds a perspective projection matrix suitable for this render system.
+ @remarks
+ Because different APIs have different requirements (some incompatible) for the
+ projection matrix, this method allows each to implement their own correctly and pass
+ back a generic OGRE matrix for storage in the engine.
+ */
+ virtual void _makeProjectionMatrix(const Radian& fovy, Real aspect, Real nearPlane, Real farPlane,
+ Matrix4& dest, bool forGpuProgram = false) = 0;
+
+ /** Builds a perspective projection matrix for the case when frustum is
+ not centered around camera.
+ @remarks
+ Viewport coordinates are in camera coordinate frame, i.e. camera is
+ at the origin.
+ */
+ virtual void _makeProjectionMatrix(Real left, Real right, Real bottom, Real top,
+ Real nearPlane, Real farPlane, Matrix4& dest, bool forGpuProgram = false) = 0;
+ /** Builds an orthographic projection matrix suitable for this render system.
+ @remarks
+ Because different APIs have different requirements (some incompatible) for the
+ projection matrix, this method allows each to implement their own correctly and pass
+ back a generic OGRE matrix for storage in the engine.
+ */
+ virtual void _makeOrthoMatrix(const Radian& fovy, Real aspect, Real nearPlane, Real farPlane,
+ Matrix4& dest, bool forGpuProgram = false) = 0;
+
+ /** Update a perspective projection matrix to use 'oblique depth projection'.
+ @remarks
+ This method can be used to change the nature of a perspective
+ transform in order to make the near plane not perpendicular to the
+ camera view direction, but to be at some different orientation.
+ This can be useful for performing arbitrary clipping (e.g. to a
+ reflection plane) which could otherwise only be done using user
+ clip planes, which are more expensive, and not necessarily supported
+ on all cards.
+ @param matrix The existing projection matrix. Note that this must be a
+ perspective transform (not orthographic), and must not have already
+ been altered by this method. The matrix will be altered in-place.
+ @param plane The plane which is to be used as the clipping plane. This
+ plane must be in CAMERA (view) space.
+ @param forGpuProgram Is this for use with a Gpu program or fixed-function
+ */
+ virtual void _applyObliqueDepthProjection(Matrix4& matrix, const Plane& plane,
+ bool forGpuProgram) = 0;
+
+ /** Sets how to rasterise triangles, as points, wireframe or solid polys. */
+ virtual void _setPolygonMode(PolygonMode level) = 0;
+
+ /** Turns stencil buffer checking on or off.
+ @remarks
+ Stencilling (masking off areas of the rendering target based on the stencil
+ buffer) canbe turned on or off using this method. By default, stencilling is
+ disabled.
+ */
+ virtual void setStencilCheckEnabled(bool enabled) = 0;
+ /** Determines if this system supports hardware accelerated stencil buffer.
+ @remarks
+ Note that the lack of this function doesn't mean you can't do stencilling, but
+ the stencilling operations will be provided in software, which will NOT be
+ fast.
+ @par
+ Generally hardware stencils are only supported in 32-bit colour modes, because
+ the stencil buffer shares the memory of the z-buffer, and in most cards the
+ z-buffer has to be the same depth as the colour buffer. This means that in 32-bit
+ mode, 24 bits of the z-buffer are depth and 8 bits are stencil. In 16-bit mode there
+ is no room for a stencil (although some cards support a 15:1 depth:stencil option,
+ this isn't useful for very much) so 8 bits of stencil are provided in software.
+ This can mean that if you use stencilling, your applications may be faster in
+ 32-but colour than in 16-bit, which may seem odd to some people.
+ */
+ /*virtual bool hasHardwareStencil(void) = 0;*/
+
+ /** This method allows you to set all the stencil buffer parameters in one call.
+ @remarks
+ The stencil buffer is used to mask out pixels in the render target, allowing
+ you to do effects like mirrors, cut-outs, stencil shadows and more. Each of
+ your batches of rendering is likely to ignore the stencil buffer,
+ update it with new values, or apply it to mask the output of the render.
+ The stencil test is:
+ (Reference Value & Mask) CompareFunction (Stencil Buffer Value & Mask)
+ The result of this will cause one of 3 actions depending on whether the test fails,
+ succeeds but with the depth buffer check still failing, or succeeds with the
+ depth buffer check passing too.
+ @par
+ Unlike other render states, stencilling is left for the application to turn
+ on and off when it requires. This is because you are likely to want to change
+ parameters between batches of arbitrary objects and control the ordering yourself.
+ In order to batch things this way, you'll want to use OGRE's separate render queue
+ groups (see RenderQueue) and register a RenderQueueListener to get notifications
+ between batches.
+ @par
+ There are individual state change methods for each of the parameters set using
+ this method.
+ Note that the default values in this method represent the defaults at system
+ start up too.
+ @param func The comparison function applied.
+ @param refValue The reference value used in the comparison
+ @param mask The bitmask applied to both the stencil value and the reference value
+ before comparison
+ @param stencilFailOp The action to perform when the stencil check fails
+ @param depthFailOp The action to perform when the stencil check passes, but the
+ depth buffer check still fails
+ @param passOp The action to take when both the stencil and depth check pass.
+ @param twoSidedOperation If set to true, then if you render both back and front faces
+ (you'll have to turn off culling) then these parameters will apply for front faces,
+ and the inverse of them will happen for back faces (keep remains the same).
+ */
+ virtual void setStencilBufferParams(CompareFunction func = CMPF_ALWAYS_PASS,
+ uint32 refValue = 0, uint32 mask = 0xFFFFFFFF,
+ StencilOperation stencilFailOp = SOP_KEEP,
+ StencilOperation depthFailOp = SOP_KEEP,
+ StencilOperation passOp = SOP_KEEP,
+ bool twoSidedOperation = false) = 0;
+
+
+
+ /** Sets the current vertex declaration, ie the source of vertex data. */
+ virtual void setVertexDeclaration(VertexDeclaration* decl) = 0;
+ /** Sets the current vertex buffer binding state. */
+ virtual void setVertexBufferBinding(VertexBufferBinding* binding) = 0;
+
+ /** Sets whether or not normals are to be automatically normalised.
+ @remarks
+ This is useful when, for example, you are scaling SceneNodes such that
+ normals may not be unit-length anymore. Note though that this has an
+ overhead so should not be turn on unless you really need it.
+ @par
+ You should not normally call this direct unless you are rendering
+ world geometry; set it on the Renderable because otherwise it will be
+ overridden by material settings.
+ */
+ virtual void setNormaliseNormals(bool normalise) = 0;
+
+ /**
+ Render something to the active viewport.
+
+ Low-level rendering interface to perform rendering
+ operations. Unlikely to be used directly by client
+ applications, since the SceneManager and various support
+ classes will be responsible for calling this method.
+ Can only be called between _beginScene and _endScene
+
+ @param op A rendering operation instance, which contains
+ details of the operation to be performed.
+ */
+ virtual void _render(const RenderOperation& op);
+
+ /** Gets the capabilities of the render system. */
+ const RenderSystemCapabilities* getCapabilities(void) const { return mCapabilities; }
+
+ /** Binds a given GpuProgram (but not the parameters).
+ @remarks Only one GpuProgram of each type can be bound at once, binding another
+ one will simply replace the exsiting one.
+ */
+ virtual void bindGpuProgram(GpuProgram* prg);
+
+ /** Bind Gpu program parameters.
+ */
+ virtual void bindGpuProgramParameters(GpuProgramType gptype, GpuProgramParametersSharedPtr params) = 0;
+ /** Only binds Gpu program parameters used for passes that have more than one iteration rendering
+ */
+ virtual void bindGpuProgramPassIterationParameters(GpuProgramType gptype) = 0;
+ /** Unbinds GpuPrograms of a given GpuProgramType.
+ @remarks
+ This returns the pipeline to fixed-function processing for this type.
+ */
+ virtual void unbindGpuProgram(GpuProgramType gptype);
+
+ /** Returns whether or not a Gpu program of the given type is currently bound. */
+ virtual bool isGpuProgramBound(GpuProgramType gptype);
+
+ /** sets the clipping region.
+ */
+ virtual void setClipPlanes(const PlaneList& clipPlanes) = 0;
+
+ /** Utility method for initialising all render targets attached to this rendering system. */
+ virtual void _initRenderTargets(void);
+
+ /** Utility method to notify all render targets that a camera has been removed,
+ incase they were referring to it as their viewer.
+ */
+ virtual void _notifyCameraRemoved(const Camera* cam);
+
+ /** Internal method for updating all render targets attached to this rendering system. */
+ virtual void _updateAllRenderTargets(void);
+
+ /** Set a clipping plane. */
+ virtual void setClipPlane (ushort index, const Plane &p);
+ /** Set a clipping plane. */
+ virtual void setClipPlane (ushort index, Real A, Real B, Real C, Real D) = 0;
+ /** Enable the clipping plane. */
+ virtual void enableClipPlane (ushort index, bool enable) = 0;
+
+ /** Sets whether or not vertex windings set should be inverted; this can be important
+ for rendering reflections. */
+ virtual void setInvertVertexWinding(bool invert);
+ /** Sets the 'scissor region' ie the region of the target in which rendering can take place.
+ @remarks
+ This method allows you to 'mask off' rendering in all but a given rectangular area
+ as identified by the parameters to this method.
+ @note
+ Not all systems support this method. Check the RenderSystemCapabilities for the
+ RSC_SCISSOR_TEST capability to see if it is supported.
+ @param enabled True to enable the scissor test, false to disable it.
+ @param left, top, right, bottom The location of the corners of the rectangle, expressed in
+ pixels.
+ */
+ virtual void setScissorTest(bool enabled, size_t left = 0, size_t top = 0,
+ size_t right = 800, size_t bottom = 600) = 0;
+
+ /** Clears one or more frame buffers on the active render target.
+ @param buffers Combination of one or more elements of FrameBufferType
+ denoting which buffers are to be cleared
+ @param colour The colour to clear the colour buffer with, if enabled
+ @param depth The value to initialise the depth buffer with, if enabled
+ @param stencil The value to initialise the stencil buffer with, if enabled.
+ */
+ virtual void clearFrameBuffer(unsigned int buffers,
+ const ColourValue& colour = ColourValue::Black,
+ Real depth = 1.0f, unsigned short stencil = 0) = 0;
+ /** Returns the horizontal texel offset value required for mapping
+ texel origins to pixel origins in this rendersystem.
+ @remarks
+ Since rendersystems sometimes disagree on the origin of a texel,
+ mapping from texels to pixels can sometimes be problematic to
+ implement generically. This method allows you to retrieve the offset
+ required to map the origin of a texel to the origin of a pixel in
+ the horizontal direction.
+ */
+ virtual Real getHorizontalTexelOffset(void) = 0;
+ /** Returns the vertical texel offset value required for mapping
+ texel origins to pixel origins in this rendersystem.
+ @remarks
+ Since rendersystems sometimes disagree on the origin of a texel,
+ mapping from texels to pixels can sometimes be problematic to
+ implement generically. This method allows you to retrieve the offset
+ required to map the origin of a texel to the origin of a pixel in
+ the vertical direction.
+ */
+ virtual Real getVerticalTexelOffset(void) = 0;
+
+ /** Gets the minimum (closest) depth value to be used when rendering
+ using identity transforms.
+ @remarks
+ When using identity transforms you can manually set the depth
+ of a vertex; however the input values required differ per
+ rendersystem. This method lets you retrieve the correct value.
+ @see Renderable::getUseIdentityView, Renderable::getUseIdentityProjection
+ */
+ virtual Real getMinimumDepthInputValue(void) = 0;
+ /** Gets the maximum (farthest) depth value to be used when rendering
+ using identity transforms.
+ @remarks
+ When using identity transforms you can manually set the depth
+ of a vertex; however the input values required differ per
+ rendersystem. This method lets you retrieve the correct value.
+ @see Renderable::getUseIdentityView, Renderable::getUseIdentityProjection
+ */
+ virtual Real getMaximumDepthInputValue(void) = 0;
+ /** set the current multi pass count value. This must be set prior to
+ calling _render() if multiple renderings of the same pass state are
+ required.
+ @param count Number of times to render the current state.
+ */
+ void setCurrentPassIterationCount(const size_t count) { mCurrentPassIterationCount = count; }
+
+ /** Defines a listener on the custom events that this render system
+ can raise.
+ @see RenderSystem::addListener
+ */
+ class _OgreExport Listener
+ {
+ public:
+ Listener() {}
+ virtual ~Listener() {}
+
+ /** A rendersystem-specific event occurred.
+ @param eventName The name of the event which has occurred
+ @param parameters A list of parameters that may belong to this event,
+ may be null if there are no parameters
+ */
+ virtual void eventOccurred(const String& eventName,
+ const NameValuePairList* parameters = 0) = 0;
+ };
+ /** Adds a listener to the custom events that this render system can raise.
+ @remarks
+ Some render systems have quite specific, internally generated events
+ that the application may wish to be notified of. Many applications
+ don't have to worry about these events, and can just trust OGRE to
+ handle them, but if you want to know, you can add a listener here.
+ @par
+ Events are raised very generically by string name. Perhaps the most
+ common example of a render system specific event is the loss and
+ restoration of a device in DirectX; which OGRE deals with, but you
+ may wish to know when it happens.
+ @see RenderSystem::getRenderSystemEvents
+ */
+ virtual void addListener(Listener* l);
+ /** Remove a listener to the custom events that this render system can raise.
+ */
+ virtual void removeListener(Listener* l);
+
+ /** Gets a list of the rendersystem specific events that this rendersystem
+ can raise.
+ @see RenderSystem::addListener
+ */
+ virtual const StringVector& getRenderSystemEvents(void) const { return mEventNames; }
+
+ /** Tell the rendersystem to perform any prep tasks it needs to directly
+ before other threads which might access the rendering API are registered.
+ @remarks
+ Call this from your main thread before starting your other threads
+ (which themselves should call registerThread()). Note that if you
+ start your own threads, there is a specific startup sequence which
+ must be respected and requires synchronisation between the threads:
+
+ - [Main thread]Call preExtraThreadsStarted
+ - [Main thread]Start other thread, wait
+ - [Other thread]Call registerThread, notify main thread & continue
+ - [Main thread]Wake up & call postExtraThreadsStarted
+
+ Once this init sequence is completed the threads are independent but
+ this startup sequence must be respected.
+ */
+ virtual void preExtraThreadsStarted() = 0;
+
+ /* Tell the rendersystem to perform any tasks it needs to directly
+ after other threads which might access the rendering API are registered.
+ @see RenderSystem::preExtraThreadsStarted
+ */
+ virtual void postExtraThreadsStarted() = 0;
+
+ /** Register the an additional thread which may make calls to rendersystem-related
+ objects.
+ @remarks
+ This method should only be called by additional threads during their
+ initialisation. If they intend to use hardware rendering system resources
+ they should call this method before doing anything related to the render system.
+ Some rendering APIs require a per-thread setup and this method will sort that
+ out. It is also necessary to call unregisterThread before the thread shuts down.
+ @note
+ This method takes no parameters - it must be called from the thread being
+ registered and that context is enough.
+ */
+ virtual void registerThread() = 0;
+
+ /** Unregister an additional thread which may make calls to rendersystem-related objects.
+ @see RenderSystem::registerThread
+ */
+ virtual void unregisterThread() = 0;
+ protected:
+
+
+ /** The render targets. */
+ RenderTargetMap mRenderTargets;
+ /** The render targets, ordered by priority. */
+ RenderTargetPriorityMap mPrioritisedRenderTargets;
+ /** The Active render target. */
+ RenderTarget * mActiveRenderTarget;
+ /** The Active GPU programs and gpu program parameters*/
+ GpuProgramParametersSharedPtr mActiveVertexGpuProgramParameters;
+ GpuProgramParametersSharedPtr mActiveFragmentGpuProgramParameters;
+
+ // Texture manager
+ // A concrete class of this will be created and
+ // made available under the TextureManager singleton,
+ // managed by the RenderSystem
+ TextureManager* mTextureManager;
+
+ /// Used to store the capabilities of the graphics card
+ RenderSystemCapabilities* mCapabilities;
+
+ // Active viewport (dest for future rendering operations)
+ Viewport* mActiveViewport;
+
+ CullingMode mCullingMode;
+
+ bool mVSync;
+ bool mWBuffer;
+
+ size_t mBatchCount;
+ size_t mFaceCount;
+ size_t mVertexCount;
+
+ /// Saved manual colour blends
+ ColourValue mManualBlendColours[OGRE_MAX_TEXTURE_LAYERS][2];
+
+ bool mInvertVertexWinding;
+
+ /// Texture units from this upwards are disabled
+ size_t mDisabledTexUnitsFrom;
+
+ /// number of times to render the current state
+ size_t mCurrentPassIterationCount;
+
+ /** updates pass iteration rendering state including bound gpu program parameter
+ pass iteration auto constant entry
+ @returns True if more iterations are required
+ */
+ bool updatePassIterationRenderState(void);
+
+ /// List of names of events this rendersystem may raise
+ StringVector mEventNames;
+
+ /// Internal method for firing a rendersystem event
+ virtual void fireEvent(const String& name, const NameValuePairList* params = 0);
+
+ typedef std::list ListenerList;
+ ListenerList mEventListeners;
+
+ typedef std::list HardwareOcclusionQueryList;
+ HardwareOcclusionQueryList mHwOcclusionQueries;
+
+ bool mVertexProgramBound;
+ bool mFragmentProgramBound;
+
+
+
+ };
+}
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreRenderSystemCapabilities.h b/school/informatik/verkerhssimulation/src/ogre/OgreRenderSystemCapabilities.h
new file mode 100644
index 00000000..aae42d36
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreRenderSystemCapabilities.h
@@ -0,0 +1,382 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __RenderSystemCapabilities__
+#define __RenderSystemCapabilities__ 1
+
+// Precompiler options
+#include "OgrePrerequisites.h"
+#include "OgreString.h"
+
+namespace Ogre {
+
+ /// Enum describing the different hardware capabilities we want to check for
+ enum Capabilities
+ {
+ //RSC_MULTITEXTURE = 0x00000001,
+ /// Supporta generating mipmaps in hardware
+ RSC_AUTOMIPMAP = 0x00000002,
+ RSC_BLENDING = 0x00000004,
+ /// Supports anisotropic texture filtering
+ RSC_ANISOTROPY = 0x00000008,
+ /// Supports fixed-function DOT3 texture blend
+ RSC_DOT3 = 0x00000010,
+ /// Supports cube mapping
+ RSC_CUBEMAPPING = 0x00000020,
+ /// Supports hardware stencil buffer
+ RSC_HWSTENCIL = 0x00000040,
+ /// Supports hardware vertex and index buffers
+ RSC_VBO = 0x00000080,
+ /// Supports vertex programs (vertex shaders)
+ RSC_VERTEX_PROGRAM = 0x00000200,
+ /// Supports fragment programs (pixel shaders)
+ RSC_FRAGMENT_PROGRAM = 0x00000400,
+ /// Supports compressed textures
+ RSC_TEXTURE_COMPRESSION = 0x00000800,
+ /// Supports compressed textures in the DXT/ST3C formats
+ RSC_TEXTURE_COMPRESSION_DXT = 0x00001000,
+ /// Supports compressed textures in the VTC format
+ RSC_TEXTURE_COMPRESSION_VTC = 0x00002000,
+ /// Supports performing a scissor test to exclude areas of the screen
+ RSC_SCISSOR_TEST = 0x00004000,
+ /// Supports separate stencil updates for both front and back faces
+ RSC_TWO_SIDED_STENCIL = 0x00008000,
+ /// Supports wrapping the stencil value at the range extremeties
+ RSC_STENCIL_WRAP = 0x00010000,
+ /// Supports hardware occlusion queries
+ RSC_HWOCCLUSION = 0x00020000,
+ /// Supports user clipping planes
+ RSC_USER_CLIP_PLANES = 0x00040000,
+ /// Supports the VET_UBYTE4 vertex element type
+ RSC_VERTEX_FORMAT_UBYTE4 = 0x00080000,
+ /// Supports infinite far plane projection
+ RSC_INFINITE_FAR_PLANE = 0x00100000,
+ /// Supports hardware render-to-texture (bigger than framebuffer)
+ RSC_HWRENDER_TO_TEXTURE = 0x00200000,
+ /// Supports float textures and render targets
+ RSC_TEXTURE_FLOAT = 0x00400000,
+ /// Supports non-power of two textures
+ RSC_NON_POWER_OF_2_TEXTURES = 0x00800000,
+ /// Supports 3d (volume) textures
+ RSC_TEXTURE_3D = 0x01000000,
+ /// Supports basic point sprite rendering
+ RSC_POINT_SPRITES = 0x02000000,
+ /// Supports extra point parameters (minsize, maxsize, attenuation)
+ RSC_POINT_EXTENDED_PARAMETERS = 0x04000000,
+ /// Supports vertex texture fetch
+ RSC_VERTEX_TEXTURE_FETCH = 0x08000000,
+ /// Supports mipmap LOD biasing
+ RSC_MIPMAP_LOD_BIAS = 0x10000000
+
+ };
+
+ /** singleton class for storing the capabilities of the graphics card.
+ @remarks
+ This class stores the capabilities of the graphics card. This
+ information is set by the individual render systems.
+ */
+ class _OgreExport RenderSystemCapabilities
+ {
+ private:
+ /// The number of world matricies available
+ ushort mNumWorldMatrices;
+ /// The number of texture units available
+ ushort mNumTextureUnits;
+ /// The stencil buffer bit depth
+ ushort mStencilBufferBitDepth;
+ /// The number of matrices available for hardware blending
+ ushort mNumVertexBlendMatrices;
+ /// Stores the capabilities flags.
+ int mCapabilities;
+ /// The best vertex program that this card / rendersystem supports
+ String mMaxVertexProgramVersion;
+ /// The best fragment program that this card / rendersystem supports
+ String mMaxFragmentProgramVersion;
+ /// The number of floating-point constants vertex programs support
+ ushort mVertexProgramConstantFloatCount;
+ /// The number of integer constants vertex programs support
+ ushort mVertexProgramConstantIntCount;
+ /// The number of boolean constants vertex programs support
+ ushort mVertexProgramConstantBoolCount;
+ /// The number of floating-point constants fragment programs support
+ ushort mFragmentProgramConstantFloatCount;
+ /// The number of integer constants fragment programs support
+ ushort mFragmentProgramConstantIntCount;
+ /// The number of boolean constants fragment programs support
+ ushort mFragmentProgramConstantBoolCount;
+ /// The number of simultaneous render targets supported
+ ushort mNumMultiRenderTargets;
+ /// The maximum point size
+ Real mMaxPointSize;
+ /// Are non-POW2 textures feature-limited?
+ bool mNonPOW2TexturesLimited;
+ /// The number of vertex texture units supported
+ ushort mNumVertexTextureUnits;
+ /// Are vertex texture units shared with fragment processor?
+ bool mVertexTextureUnitsShared;
+
+ public:
+ RenderSystemCapabilities ();
+ ~RenderSystemCapabilities ();
+
+ void setNumWorldMatricies(ushort num)
+ {
+ mNumWorldMatrices = num;
+ }
+
+ void setNumTextureUnits(ushort num)
+ {
+ mNumTextureUnits = num;
+ }
+
+ void setStencilBufferBitDepth(ushort num)
+ {
+ mStencilBufferBitDepth = num;
+ }
+
+ void setNumVertexBlendMatrices(ushort num)
+ {
+ mNumVertexBlendMatrices = num;
+ }
+
+ /// The number of simultaneous render targets supported
+ void setNumMultiRenderTargets(ushort num)
+ {
+ mNumMultiRenderTargets = num;
+ }
+
+ ushort getNumWorldMatricies(void) const
+ {
+ return mNumWorldMatrices;
+ }
+
+ /** Returns the number of texture units the current output hardware
+ supports.
+
+ For use in rendering, this determines how many texture units the
+ are available for multitexturing (i.e. rendering multiple
+ textures in a single pass). Where a Material has multiple
+ texture layers, it will try to use multitexturing where
+ available, and where it is not available, will perform multipass
+ rendering to achieve the same effect. This property only applies
+ to the fixed-function pipeline, the number available to the
+ programmable pipeline depends on the shader model in use.
+ */
+ ushort getNumTextureUnits(void) const
+ {
+ return mNumTextureUnits;
+ }
+
+ /** Determines the bit depth of the hardware accelerated stencil
+ buffer, if supported.
+ @remarks
+ If hardware stencilling is not supported, the software will
+ provide an 8-bit software stencil.
+ */
+ ushort getStencilBufferBitDepth(void) const
+ {
+ return mStencilBufferBitDepth;
+ }
+
+ /** Returns the number of matrices available to hardware vertex
+ blending for this rendering system. */
+ ushort numVertexBlendMatrices(void) const
+ {
+ return mNumVertexBlendMatrices;
+ }
+
+ /// The number of simultaneous render targets supported
+ ushort numMultiRenderTargets(void) const
+ {
+ return mNumMultiRenderTargets;
+ }
+
+ /** Adds a capability flag to mCapabilities
+ */
+ void setCapability(const Capabilities c)
+ {
+ mCapabilities |= c;
+ }
+
+ /** Checks for a capability
+ */
+ bool hasCapability(const Capabilities c) const
+ {
+ if(mCapabilities & c)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ /// Gets the best low-level vertex program version supported
+ const String& getMaxVertexProgramVersion(void) const
+ {
+ return mMaxVertexProgramVersion;
+ }
+ /// Gets the best fragment program that this card / rendersystem supports
+ const String& getMaxFragmentProgramVersion(void) const
+ {
+ return mMaxFragmentProgramVersion;
+ }
+ /// The number of floating-point constants vertex programs support
+ ushort getVertexProgramConstantFloatCount(void) const
+ {
+ return mVertexProgramConstantFloatCount;
+ }
+ /// The number of integer constants vertex programs support
+ ushort getVertexProgramConstantIntCount(void) const
+ {
+ return mVertexProgramConstantIntCount;
+ }
+ /// The number of boolean constants vertex programs support
+ ushort getVertexProgramConstantBoolCount(void) const
+ {
+ return mVertexProgramConstantBoolCount;
+ }
+ /// The number of floating-point constants fragment programs support
+ ushort getFragmentProgramConstantFloatCount(void) const
+ {
+ return mFragmentProgramConstantFloatCount;
+ }
+ /// The number of integer constants fragment programs support
+ ushort getFragmentProgramConstantIntCount(void) const
+ {
+ return mFragmentProgramConstantIntCount;
+ }
+ /// The number of boolean constants fragment programs support
+ ushort getFragmentProgramConstantBoolCount(void) const
+ {
+ return mFragmentProgramConstantBoolCount;
+ }
+
+
+
+ /// sets the best low-level vertex program version supported
+ void setMaxVertexProgramVersion(const String& ver)
+ {
+ mMaxVertexProgramVersion = ver;
+ }
+ /// sets the best fragment program that this card / rendersystem supports
+ void setMaxFragmentProgramVersion(const String& ver)
+ {
+ mMaxFragmentProgramVersion = ver;
+ }
+ /// The number of floating-point constants vertex programs support
+ void setVertexProgramConstantFloatCount(ushort c)
+ {
+ mVertexProgramConstantFloatCount = c;
+ }
+ /// The number of integer constants vertex programs support
+ void setVertexProgramConstantIntCount(ushort c)
+ {
+ mVertexProgramConstantIntCount = c;
+ }
+ /// The number of boolean constants vertex programs support
+ void setVertexProgramConstantBoolCount(ushort c)
+ {
+ mVertexProgramConstantBoolCount = c;
+ }
+ /// The number of floating-point constants fragment programs support
+ void setFragmentProgramConstantFloatCount(ushort c)
+ {
+ mFragmentProgramConstantFloatCount = c;
+ }
+ /// The number of integer constants fragment programs support
+ void setFragmentProgramConstantIntCount(ushort c)
+ {
+ mFragmentProgramConstantIntCount = c;
+ }
+ /// The number of boolean constants fragment programs support
+ void setFragmentProgramConstantBoolCount(ushort c)
+ {
+ mFragmentProgramConstantBoolCount = c;
+ }
+ /// Maximum point screen size in pixels
+ void setMaxPointSize(Real s)
+ {
+ mMaxPointSize = s;
+ }
+ /// Maximum point screen size in pixels
+ Real getMaxPointSize(void) const
+ {
+ return mMaxPointSize;
+ }
+ /// Non-POW2 textures limited
+ void setNonPOW2TexturesLimited(bool l)
+ {
+ mNonPOW2TexturesLimited = l;
+ }
+ /** Are non-power of two textures limited in features?
+ @remarks
+ If the RSC_NON_POWER_OF_2_TEXTURES capability is set, but this
+ method returns true, you can use non power of 2 textures only if:
+ - You load them explicitly with no mip maps
+ - You don't use DXT texture compression
+ - You use clamp texture addressing
+ */
+ bool getNonPOW2TexturesLimited(void) const
+ {
+ return mNonPOW2TexturesLimited;
+ }
+
+ /// Set the number of vertex texture units supported
+ void setNumVertexTextureUnits(ushort n)
+ {
+ mNumVertexTextureUnits = n;
+ }
+ /// Get the number of vertex texture units supported
+ ushort getNumVertexTextureUnits(void) const
+ {
+ return mNumVertexTextureUnits;
+ }
+ /// Set whether the vertex texture units are shared with the fragment processor
+ void setVertexTextureUnitsShared(bool shared)
+ {
+ mVertexTextureUnitsShared = shared;
+ }
+ /// Get whether the vertex texture units are shared with the fragment processor
+ bool getVertexTextureUnitsShared(void) const
+ {
+ return mVertexTextureUnitsShared;
+ }
+
+
+ /** Write the capabilities to the pass in Log */
+ void log(Log* pLog);
+
+
+
+
+ };
+}
+
+#endif // __RenderSystemCapabilities__
+
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreRenderTarget.h b/school/informatik/verkerhssimulation/src/ogre/OgreRenderTarget.h
new file mode 100644
index 00000000..da6470bd
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreRenderTarget.h
@@ -0,0 +1,359 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __RenderTarget_H__
+#define __RenderTarget_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreString.h"
+#include "OgreTextureManager.h"
+#include "OgreViewport.h"
+#include "OgreTimer.h"
+
+/* Define the number of priority groups for the render system's render targets. */
+#ifndef OGRE_NUM_RENDERTARGET_GROUPS
+ #define OGRE_NUM_RENDERTARGET_GROUPS 10
+ #define OGRE_DEFAULT_RT_GROUP 4
+ #define OGRE_REND_TO_TEX_RT_GROUP 2
+#endif
+
+namespace Ogre {
+
+ /** A 'canvas' which can receive the results of a rendering
+ operation.
+ @remarks
+ This abstract class defines a common root to all targets of rendering operations. A
+ render target could be a window on a screen, or another
+ offscreen surface like a texture or bump map etc.
+ @author
+ Steven Streeting
+ @version
+ 1.0
+ */
+ class _OgreExport RenderTarget
+ {
+ public:
+ enum StatFlags
+ {
+ SF_NONE = 0,
+ SF_FPS = 1,
+ SF_AVG_FPS = 2,
+ SF_BEST_FPS = 4,
+ SF_WORST_FPS = 8,
+ SF_TRIANGLE_COUNT = 16,
+ SF_ALL = 0xFFFF
+ };
+
+ struct FrameStats
+ {
+ float lastFPS;
+ float avgFPS;
+ float bestFPS;
+ float worstFPS;
+ unsigned long bestFrameTime;
+ unsigned long worstFrameTime;
+ size_t triangleCount;
+ size_t batchCount;
+ };
+
+ RenderTarget();
+ virtual ~RenderTarget();
+
+ /// Retrieve target's name.
+ virtual const String& getName(void) const;
+
+ /// Retrieve information about the render target.
+ virtual void getMetrics(unsigned int& width, unsigned int& height, unsigned int& colourDepth);
+
+ virtual unsigned int getWidth(void) const;
+ virtual unsigned int getHeight(void) const;
+ virtual unsigned int getColourDepth(void) const;
+
+ /** Tells the target to update it's contents.
+ @remarks
+ If OGRE is not running in an automatic rendering loop
+ (started using Root::startRendering),
+ the user of the library is responsible for asking each render
+ target to refresh. This is the method used to do this. It automatically
+ re-renders the contents of the target using whatever cameras have been
+ pointed at it (using Camera::setRenderTarget).
+ @par
+ This allows OGRE to be used in multi-windowed utilities
+ and for contents to be refreshed only when required, rather than
+ constantly as with the automatic rendering loop.
+ */
+ virtual void update(void);
+
+ /** Adds a viewport to the rendering target.
+ @remarks
+ A viewport is the rectangle into which redering output is sent. This method adds
+ a viewport to the render target, rendering from the supplied camera. The
+ rest of the parameters are only required if you wish to add more than one viewport
+ to a single rendering target. Note that size information passed to this method is
+ passed as a parametric, i.e. it is relative rather than absolute. This is to allow
+ viewports to automatically resize along with the target.
+ @param
+ cam The camera from which the viewport contents will be rendered (mandatory)
+ @param
+ ZOrder The relative order of the viewport with others on the target (allows overlapping
+ viewports i.e. picture-in-picture). Higher ZOrders are on top of lower ones. The actual number
+ is irrelevant, only the relative ZOrder matters (you can leave gaps in the numbering)
+ @param
+ left The relative position of the left of the viewport on the target, as a value between 0 and 1.
+ @param
+ top The relative position of the top of the viewport on the target, as a value between 0 and 1.
+ @param
+ width The relative width of the viewport on the target, as a value between 0 and 1.
+ @param
+ height The relative height of the viewport on the target, as a value between 0 and 1.
+ */
+ virtual Viewport* addViewport(Camera* cam, int ZOrder = 0, float left = 0.0f, float top = 0.0f ,
+ float width = 1.0f, float height = 1.0f);
+
+ /** Returns the number of viewports attached to this target.*/
+ virtual unsigned short getNumViewports(void) const;
+
+ /** Retrieves a pointer to the viewport with the given index. */
+ virtual Viewport* getViewport(unsigned short index);
+
+ /** Removes a viewport at a given ZOrder.
+ */
+ virtual void removeViewport(int ZOrder);
+
+ /** Removes all viewports on this target.
+ */
+ virtual void removeAllViewports(void);
+
+ /** Retieves details of current rendering performance.
+ @remarks
+ If the user application wishes to do it's own performance
+ display, or use performance for some other means, this
+ method allows it to retrieve the statistics.
+ @param
+ lastFPS Pointer to a float to receive the number of frames per second (FPS)
+ based on the last frame rendered.
+ @param
+ avgFPS Pointer to a float to receive the FPS rating based on an average of all
+ the frames rendered since rendering began (the call to
+ Root::startRendering).
+ @param
+ bestFPS Pointer to a float to receive the best FPS rating that has been achieved
+ since rendering began.
+ @param
+ worstFPS Pointer to a float to receive the worst FPS rating seen so far.
+ */
+ virtual void getStatistics(float& lastFPS, float& avgFPS,
+ float& bestFPS, float& worstFPS) const; // Access to stats
+
+ virtual const FrameStats& getStatistics(void) const;
+
+ /** Individual stats access - gets the number of frames per second (FPS) based on the last frame rendered.
+ */
+ virtual float getLastFPS() const;
+
+ /** Individual stats access - gets the average frames per second (FPS) since call to Root::startRendering.
+ */
+ virtual float getAverageFPS() const;
+
+ /** Individual stats access - gets the best frames per second (FPS) since call to Root::startRendering.
+ */
+ virtual float getBestFPS() const;
+
+ /** Individual stats access - gets the worst frames per second (FPS) since call to Root::startRendering.
+ */
+ virtual float getWorstFPS() const;
+
+ /** Individual stats access - gets the best frame time
+ */
+ virtual float getBestFrameTime() const;
+
+ /** Individual stats access - gets the worst frame time
+ */
+ virtual float getWorstFrameTime() const;
+
+ /** Resets saved frame-rate statistices.
+ */
+ virtual void resetStatistics(void);
+
+ /** Gets a custom (maybe platform-specific) attribute.
+ @remarks
+ This is a nasty way of satisfying any API's need to see platform-specific details.
+ It horrid, but D3D needs this kind of info. At least it's abstracted.
+ @param
+ name The name of the attribute.
+ @param
+ pData Pointer to memory of the right kind of structure to receive the info.
+ */
+ virtual void getCustomAttribute(const String& name, void* pData);
+
+ /** Add a listener to this RenderTarget which will be called back before & after rendering.
+ @remarks
+ If you want notifications before and after a target is updated by the system, use
+ this method to register your own custom RenderTargetListener class. This is useful
+ for potentially adding your own manual rendering commands before and after the
+ 'normal' system rendering.
+ @par NB this should not be used for frame-based scene updates, use Root::addFrameListener for that.
+ */
+ virtual void addListener(RenderTargetListener* listener);
+ /** Removes a RenderTargetListener previously registered using addListener. */
+ virtual void removeListener(RenderTargetListener* listener);
+ /** Removes all listeners from this instance. */
+ virtual void removeAllListeners(void);
+
+ /** Sets the priority of this render target in relation to the others.
+ @remarks
+ This can be used in order to schedule render target updates. Lower
+ priorities will be rendered first. Note that the priority must be set
+ at the time the render target is attached to the render system, changes
+ afterwards will not affect the ordering.
+ */
+ virtual void setPriority( uchar priority ) { mPriority = priority; }
+ /** Gets the priority of a render target. */
+ virtual uchar getPriority() const { return mPriority; }
+
+ /** Used to retrieve or set the active state of the render target.
+ */
+ virtual bool isActive() const;
+
+ /** Used to set the active state of the render target.
+ */
+ virtual void setActive( bool state );
+
+ /** Sets whether this target should be automatically updated if Ogre's rendering
+ loop or Root::_updateAllRenderTargets is being used.
+ @remarks
+ By default, if you use Ogre's own rendering loop (Root::startRendering)
+ or call Root::_updateAllRenderTargets, all render targets are updated
+ automatically. This method allows you to control that behaviour, if
+ for example you have a render target which you only want to update periodically.
+ @param autoupdate If true, the render target is updated during the automatic render
+ loop or when Root::_updateAllRenderTargets is called. If false, the
+ target is only updated when its update() method is called explicitly.
+ */
+ virtual void setAutoUpdated(bool autoupdate);
+ /** Gets whether this target is automatically updated if Ogre's rendering
+ loop or Root::_updateAllRenderTargets is being used.
+ */
+ virtual bool isAutoUpdated(void) const;
+
+ /** Writes the current contents of the render target to the named file. */
+ virtual void writeContentsToFile(const String& filename) = 0;
+
+ /** Writes the current contents of the render target to the (PREFIX)(time-stamp)(SUFFIX) file.
+ @returns the name of the file used.*/
+ virtual String writeContentsToTimestampedFile(const String& filenamePrefix, const String& filenameSuffix);
+
+ virtual bool requiresTextureFlipping() const = 0;
+
+ /** Gets the number of triangles rendered in the last update() call. */
+ virtual size_t getTriangleCount(void) const;
+ /** Gets the number of batches rendered in the last update() call. */
+ virtual size_t getBatchCount(void) const;
+ /** Utility method to notify a render target that a camera has been removed,
+ incase it was referring to it as a viewer.
+ */
+ virtual void _notifyCameraRemoved(const Camera* cam);
+
+ /** Indicates whether this target is the primary window. The
+ primary window is special in that it is destroyed when
+ ogre is shut down, and cannot be destroyed directly.
+ This is the case because it holds the context for vertex,
+ index buffers and textures.
+ */
+ virtual bool isPrimary(void) const;
+
+
+ /** RenderSystem specific interface for a RenderTarget;
+ this should be subclassed by RenderSystems.
+ */
+ class Impl
+ {
+ protected:
+ /** Declared protected as interface is never used for destruction.
+ gcc will issue a warning here: `class Impl' has virtual functions
+ but non-virtual destructor. This is no problem because this interface
+ is never used to delete an object.
+ */
+ ~Impl() { };
+ };
+ /** Get rendersystem specific interface for this RenderTarget.
+ This is used by the RenderSystem to (un)bind this target,
+ and to get specific information like surfaces
+ and framebuffer objects.
+ */
+ virtual Impl *_getImpl();
+ protected:
+ /// The name of this target.
+ String mName;
+ /// The priority of the render target.
+ uchar mPriority;
+
+ unsigned int mWidth;
+ unsigned int mHeight;
+ unsigned int mColourDepth;
+ bool mIsDepthBuffered;
+
+ // Stats
+ FrameStats mStats;
+
+ Timer* mTimer ;
+ unsigned long mLastSecond;
+ unsigned long mLastTime;
+ size_t mFrameCount;
+
+ bool mActive;
+ bool mAutoUpdate;
+
+ void updateStats(void);
+
+ typedef std::map > ViewportList;
+ /// List of viewports, map on Z-order
+ ViewportList mViewportList;
+
+ typedef std::vector RenderTargetListenerList;
+ RenderTargetListenerList mListeners;
+
+
+ /// internal method for firing events
+ virtual void firePreUpdate(void);
+ /// internal method for firing events
+ virtual void firePostUpdate(void);
+ /// internal method for firing events
+ virtual void fireViewportPreUpdate(Viewport* vp);
+ /// internal method for firing events
+ virtual void fireViewportPostUpdate(Viewport* vp);
+ /// internal method for firing events
+ virtual void fireViewportAdded(Viewport* vp);
+ /// internal method for firing events
+ virtual void fireViewportRemoved(Viewport* vp);
+ };
+
+} // Namespace
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreRenderTargetListener.h b/school/informatik/verkerhssimulation/src/ogre/OgreRenderTargetListener.h
new file mode 100644
index 00000000..8db10421
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreRenderTargetListener.h
@@ -0,0 +1,132 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __RenderTargetListener_H__
+#define __RenderTargetListener_H__
+
+
+#include "OgrePrerequisites.h"
+
+namespace Ogre {
+
+ /** Struct containing information about a RenderTarget event.
+ */
+ struct RenderTargetEvent
+ {
+ /// The source of the event being raised
+ RenderTarget* source;
+ };
+
+ /** Struct containing information about a RenderTarget Viewport-specific event.
+ */
+ struct RenderTargetViewportEvent
+ {
+ /// The source of the event being raised
+ Viewport* source;
+ };
+
+ /** A interface class defining a listener which can be used to receive
+ notifications of RenderTarget events.
+ @remarks
+ A 'listener' is an interface designed to be called back when
+ particular events are called. This class defines the
+ interface relating to RenderTarget events. In order to receive
+ notifications of RenderTarget events, you should create a subclass of
+ RenderTargetListener and override the methods for which you would like
+ to customise the resulting processing. You should then call
+ RenderTarget::addListener passing an instance of this class.
+ There is no limit to the number of RenderTarget listeners you can register,
+ allowing you to register multiple listeners for different purposes.
+
+ RenderTarget events occur before and after the target is updated as a whole,
+ and before and after each viewport on that target is updated. Each RenderTarget
+ holds it's own set of listeners, but you can register the same listener on
+ multiple render targets if you like since the event contains details of the
+ originating RenderTarget.
+ */
+ class _OgreExport RenderTargetListener
+ {
+ /*
+ Note that this could have been an abstract class, but I made
+ the explicit choice not to do this, because I wanted to give
+ people the option of only implementing the methods they wanted,
+ rather than having to create 'do nothing' implementations for
+ those they weren't interested in. As such this class follows
+ the 'Adapter' classes in Java rather than pure interfaces.
+ */
+ public:
+ virtual ~RenderTargetListener() {}
+ /** Called just before a RenderTarget is about to be rendered into.
+ @remarks
+ This event is raised just before any of the viewports on the target
+ are rendered to. You can perform manual rendering operations here if
+ you want, but please note that if the Viewport objects attached to this
+ target are set up to clear the background, you will lose whatever you
+ render. If you want some kind of backdrop in this event
+ you should turn off background clearing off on the viewports, and either
+ clear the viewports yourself in this event handler before doing your rendering
+ or just render over the top if you don't need to.
+ */
+ virtual void preRenderTargetUpdate(const RenderTargetEvent& evt) { }
+ /** Called just after a RenderTarget has been rendered to.
+ @remarks
+ This event is called just after all the viewports attached to the target
+ in question have been rendered to. You can perform your own manual rendering
+ commands in this event handler if you like, these will be composited with
+ the contents of the target already there (depending on the material settings
+ you use etc).
+ */
+ virtual void postRenderTargetUpdate(const RenderTargetEvent& evt) { }
+
+ /* Called just before a Viewport on a RenderTarget is to be updated.
+ @remarks
+ This method is called before each viewport on the RenderTarget is
+ rendered to. You can use this to perform per-viewport settings changes,
+ such as showing / hiding particular overlays.
+ */
+ virtual void preViewportUpdate(const RenderTargetViewportEvent& evt) { }
+
+ /* Called just after a Viewport on a RenderTarget is to be updated.
+ @remarks
+ This method is called after each viewport on the RenderTarget is
+ rendered to.
+ */
+ virtual void postViewportUpdate(const RenderTargetViewportEvent& evt) { }
+
+ /** Called to notify listener that a Viewport has been added to the
+ target in question.
+ */
+ virtual void viewportAdded(const RenderTargetViewportEvent& evt) {}
+ /** Called to notify listener that a Viewport has been removed from the
+ target in question.
+ */
+ virtual void viewportRemoved(const RenderTargetViewportEvent& evt) {}
+ };
+}
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreRenderTexture.h b/school/informatik/verkerhssimulation/src/ogre/OgreRenderTexture.h
new file mode 100644
index 00000000..5556408f
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreRenderTexture.h
@@ -0,0 +1,100 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __RenderTexture_H__
+#define __RenderTexture_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreRenderTarget.h"
+
+namespace Ogre
+{
+ /** This class represents a RenderTarget that renders to a Texture. There is no 1 on 1
+ relation between Textures and RenderTextures, as there can be multiple
+ RenderTargets rendering to different mipmaps, faces (for cubemaps) or slices (for 3D textures)
+ of the same Texture.
+ */
+ class _OgreExport RenderTexture: public RenderTarget
+ {
+ public:
+ RenderTexture(HardwarePixelBuffer *buffer, size_t zoffset);
+ virtual ~RenderTexture();
+
+ void writeContentsToFile( const String & filename );
+ protected:
+ HardwarePixelBuffer *mBuffer;
+ size_t mZOffset;
+ };
+
+ /** This class represents a render target that renders to multiple RenderTextures
+ at once. Surfaces can be bound and unbound at will, as long as the following constraints
+ are met:
+ - All bound surfaces have the same size
+ - All bound surfaces have the same bit depth
+ - Target 0 is bound
+ */
+ class _OgreExport MultiRenderTarget: public RenderTarget
+ {
+ public:
+ MultiRenderTarget(const String &name);
+
+ /** Bind a surface to a certain attachment point.
+
+ @param attachment 0 .. mCapabilities->numMultiRenderTargets()-1
+
+ @param target RenderTexture to bind.
+
+
+
+ It does not bind the surface and fails with an exception (ERR_INVALIDPARAMS) if:
+
+ - Not all bound surfaces have the same size
+
+ - Not all bound surfaces have the same internal format
+
+ */
+
+ virtual void bindSurface(size_t attachment, RenderTexture *target)=0;
+
+
+
+ /** Unbind attachment.
+
+ */
+
+ virtual void unbindSurface(size_t attachment)=0;
+
+ /** Error throwing implementation, it's not possible to write a MultiRenderTarget
+ to disk.
+ */
+ virtual void writeContentsToFile( const String & filename );
+ };
+}
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreRenderWindow.h b/school/informatik/verkerhssimulation/src/ogre/OgreRenderWindow.h
new file mode 100644
index 00000000..fef20350
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreRenderWindow.h
@@ -0,0 +1,213 @@
+/*-------------------------------------------------------------------------
+This source file is a part of OGRE
+(Object-oriented Graphics Rendering Engine)
+
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This library is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License (LGPL) as
+published by the Free Software Foundation; either version 2.1 of the
+License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this library; if not, write to the Free Software Foundation,
+Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA or go to
+http://www.gnu.org/copyleft/lesser.txt
+-------------------------------------------------------------------------*/
+#ifndef __RenderWindow_H__
+#define __RenderWindow_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreRenderTarget.h"
+
+namespace Ogre
+{
+ /** Manages the target rendering window.
+ @remarks
+ This class handles a window into which the contents
+ of a scene are rendered. There is a many-to-1 relationship
+ between instances of this class an instance of RenderSystem
+ which controls the rendering of the scene. There may be
+ more than one window in the case of level editor tools etc.
+ This class is abstract since there may be
+ different implementations for different windowing systems.
+ @remarks
+ Instances are created and communicated with by the render system
+ although client programs can get a reference to it from
+ the render system if required for resizing or moving.
+ Note that you can have multiple viewpoints
+ in the window for effects like rear-view mirrors and
+ picture-in-picture views (see Viewport and Camera).
+ @author
+ Steven Streeting
+ @version
+ 1.0
+ */
+ class _OgreExport RenderWindow : public RenderTarget
+ {
+
+ public:
+ /** Default constructor.
+ */
+ RenderWindow();
+
+ /** Creates & displays the new window.
+ @param
+ width The width of the window in pixels.
+ @param
+ height The height of the window in pixels.
+ @param
+ colourDepth The colour depth in bits. Ignored if
+ fullScreen is false since the desktop depth is used.
+ @param
+ fullScreen If true, the window fills the screen,
+ with no title bar or border.
+ @param
+ left The x-position of the window. Ignored if
+ fullScreen = true.
+ @param
+ top The y-position of the window. Ignored if
+ fullScreen = true.
+ @param
+ depthBuffer Specify true to include a depth-buffer.
+ @param
+ miscParam A variable number of pointers to platform-specific arguments. The
+ actual requirements must be defined by the implementing subclasses.
+ */
+ virtual void create(const String& name, unsigned int width, unsigned int height,
+ bool fullScreen, const NameValuePairList *miscParams) = 0;
+
+ /** Alter fullscreen mode options.
+ @note Nothing will happen unless the settings here are different from the
+ current settings.
+ @param fullScreen Whether to use fullscreen mode or not.
+ @param width The new width to use
+ @param height The new height to use
+ */
+ virtual void setFullscreen(bool fullScreen, unsigned int width, unsigned int height) {}
+
+ /** Destroys the window.
+ */
+ virtual void destroy(void) = 0;
+
+ /** Alter the size of the window.
+ */
+ virtual void resize(unsigned int width, unsigned int height) = 0;
+
+ /** Notify that the window has been resized
+ @remarks
+ You don't need to call this unless you created the window externally.
+ */
+ virtual void windowMovedOrResized() {}
+
+ /** Reposition the window.
+ */
+ virtual void reposition(int left, int top) = 0;
+
+ /** Indicates whether the window is visible (not minimized or obscured)
+ */
+ virtual bool isVisible(void) const { return true; }
+
+ /** Set the visibility state
+ */
+ virtual void setVisible(bool visible) {}
+
+ /** Overridden from RenderTarget, flags invisible windows as inactive
+ */
+ virtual bool isActive(void) const { return mActive && isVisible(); }
+
+ /** Indicates whether the window has been closed by the user.
+ */
+ virtual bool isClosed(void) const = 0;
+
+ /** Indicates wether the window is the primary window. The
+ primary window is special in that it is destroyed when
+ ogre is shut down, and cannot be destroyed directly.
+ This is the case because it holds the context for vertex,
+ index buffers and textures.
+ */
+ virtual bool isPrimary(void) const;
+
+ /** Swaps the frame buffers to display the next frame.
+ @remarks
+ All render windows are double-buffered so that no
+ 'in-progress' versions of the scene are displayed
+ during rendering. Once rendering has completed (to
+ an off-screen version of the window) the buffers
+ are swapped to display the new frame.
+
+ @param
+ waitForVSync If true, the system waits for the
+ next vertical blank period (when the CRT beam turns off
+ as it travels from bottom-right to top-left at the
+ end of the pass) before flipping. If false, flipping
+ occurs no matter what the beam position. Waiting for
+ a vertical blank can be slower (and limits the
+ framerate to the monitor refresh rate) but results
+ in a steadier image with no 'tearing' (a flicker
+ resulting from flipping buffers when the beam is
+ in the progress of drawing the last frame).
+ */
+ virtual void swapBuffers(bool waitForVSync = true) = 0;
+
+ /// @copydoc RenderTarget::update
+ virtual void update(void);
+ /** Updates the window contents.
+ @remarks
+ The window is updated by telling each camera which is supposed
+ to render into this window to render it's view, and then
+ the window buffers are swapped via swapBuffers() if requested
+ @param swapBuffers If set to true, the window will immediately
+ swap it's buffers after update. Otherwise, the buffers are
+ not swapped, and you have to call swapBuffers yourself sometime
+ later. You might want to do this on some rendersystems which
+ pause for queued rendering commands to complete before accepting
+ swap buffers calls - so you could do other CPU tasks whilst the
+ queued commands complete. Or, you might do this if you want custom
+ control over your windows, such as for externally created windows.
+ */
+ virtual void update(bool swapBuffers);
+
+ /** Returns true if window is running in fullscreen mode.
+ */
+ virtual bool isFullScreen(void) const;
+
+ /** Overloaded version of getMetrics from RenderTarget, including extra details
+ specific to windowing systems.
+ */
+ virtual void getMetrics(unsigned int& width, unsigned int& height, unsigned int& colourDepth,
+ int& left, int& top);
+
+ protected:
+ bool mIsFullScreen;
+ bool mIsPrimary;
+ int mLeft;
+ int mTop;
+
+ /** Indicates that this is the primary window. Only to be called by
+ Ogre::Root
+ */
+ void _setPrimary() { mIsPrimary = true; }
+
+ friend class Root;
+ };
+
+ /** Defines the interface a DLL implemeting a platform-specific version must implement.
+ @remarks
+ Any library (.dll, .so) wishing to implement a platform-specific version of this
+ dialog must export the symbol 'createRenderWindow' with the signature
+ void createPlatformRenderWindow(RenderWindow** ppDlg)
+ */
+ typedef void (*DLL_CREATERENDERWINDOW)(RenderWindow** ppWindow);
+
+} // Namespace
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreRenderable.h b/school/informatik/verkerhssimulation/src/ogre/OgreRenderable.h
new file mode 100644
index 00000000..d806cfc5
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreRenderable.h
@@ -0,0 +1,296 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __Renderable_H__
+#define __Renderable_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreCommon.h"
+
+#include "OgreRenderOperation.h"
+#include "OgreMatrix4.h"
+#include "OgreMaterial.h"
+#include "OgrePlane.h"
+#include "OgreGpuProgram.h"
+#include "OgreVector4.h"
+#include "OgreException.h"
+
+namespace Ogre {
+
+ /** Abstract class defining the interface all renderable objects must implement.
+ @remarks
+ This interface abstracts renderable discrete objects which will be queued in the render pipeline,
+ grouped by material. Classes implementing this interface must be based on a single material, a single
+ world matrix (or a collection of world matrices which are blended by weights), and must be
+ renderable via a single render operation.
+ @par
+ Note that deciding whether to put these objects in the rendering pipeline is done from the more specific
+ classes e.g. entities. Only once it is decided that the specific class is to be rendered is the abstract version
+ created (could be more than one per visible object) and pushed onto the rendering queue.
+ */
+ class _OgreExport Renderable
+ {
+ public:
+ Renderable() : mPolygonModeOverrideable(true), mUseIdentityProjection(false), mUseIdentityView(false) {}
+ /** Virtual destructor needed as class has virtual methods. */
+ virtual ~Renderable() { }
+ /** Retrieves a weak reference to the material this renderable object uses.
+ @remarks
+ Note that the Renderable also has the option to override the getTechnique method
+ to specify a particular Technique to use instead of the best one available.
+ */
+ virtual const MaterialPtr& getMaterial(void) const = 0;
+ /** Retrieves a pointer to the Material Technique this renderable object uses.
+ @remarks
+ This is to allow Renderables to use a chosen Technique if they wish, otherwise
+ they will use the best Technique available for the Material they are using.
+ */
+ virtual Technique* getTechnique(void) const { return getMaterial()->getBestTechnique(); }
+ /** Gets the render operation required to send this object to the frame buffer.
+ */
+ virtual void getRenderOperation(RenderOperation& op) = 0;
+ /** Gets the world transform matrix / matrices for this renderable object.
+ @remarks
+ If the object has any derived transforms, these are expected to be up to date as long as
+ all the SceneNode structures have been updated before this is called.
+ @par
+ This method will populate xform with 1 matrix if it does not use vertex blending. If it
+ does use vertex blending it will fill the passed in pointer with an array of matrices,
+ the length being the value returned from getNumWorldTransforms.
+ @note
+ Internal Ogre never supports non-affine matrix for world transform matrix/matrices,
+ the behavior is undefined if returns non-affine matrix here. @see Matrix4::isAffine.
+ */
+ virtual void getWorldTransforms(Matrix4* xform) const = 0;
+ /** Gets the worldspace orientation of this renderable; this is used in order to
+ more efficiently update parameters to vertex & fragment programs, since inverting Quaterion
+ and Vector in order to derive object-space positions / directions for cameras and
+ lights is much more efficient than inverting a complete 4x4 matrix, and also
+ eliminates problems introduced by scaling. */
+ virtual const Quaternion& getWorldOrientation(void) const = 0;
+ /** Gets the worldspace position of this renderable; this is used in order to
+ more efficiently update parameters to vertex & fragment programs, since inverting Quaterion
+ and Vector in order to derive object-space positions / directions for cameras and
+ lights is much more efficient than inverting a complete 4x4 matrix, and also
+ eliminates problems introduced by scaling. */
+ virtual const Vector3& getWorldPosition(void) const = 0;
+
+ /** Returns the number of world transform matrices this renderable requires.
+ @remarks
+ When a renderable uses vertex blending, it uses multiple world matrices instead of a single
+ one. Each vertex sent to the pipeline can reference one or more matrices in this list
+ with given weights.
+ If a renderable does not use vertex blending this method returns 1, which is the default for
+ simplicity.
+ */
+ virtual unsigned short getNumWorldTransforms(void) const { return 1; }
+
+ /** Sets whether or not to use an 'identity' projection.
+ @remarks
+ Usually Renderable objects will use a projection matrix as determined
+ by the active camera. However, if they want they can cancel this out
+ and use an identity projection, which effectively projects in 2D using
+ a {-1, 1} view space. Useful for overlay rendering. Normal renderables
+ need not change this. The default is false.
+ @see Renderable::getUseIdentityProjection
+ */
+ void setUseIdentityProjection(bool useIdentityProjection)
+ {
+ mUseIdentityProjection = useIdentityProjection;
+ }
+
+ /** Returns whether or not to use an 'identity' projection.
+ @remarks
+ Usually Renderable objects will use a projection matrix as determined
+ by the active camera. However, if they want they can cancel this out
+ and use an identity projection, which effectively projects in 2D using
+ a {-1, 1} view space. Useful for overlay rendering. Normal renderables
+ need not change this.
+ @see Renderable::setUseIdentityProjection
+ */
+ bool getUseIdentityProjection(void) const { return mUseIdentityProjection; }
+
+ /** Sets whether or not to use an 'identity' view.
+ @remarks
+ Usually Renderable objects will use a view matrix as determined
+ by the active camera. However, if they want they can cancel this out
+ and use an identity matrix, which means all geometry is assumed
+ to be relative to camera space already. Useful for overlay rendering.
+ Normal renderables need not change this. The default is false.
+ @see Renderable::getUseIdentityView
+ */
+ void setUseIdentityView(bool useIdentityView)
+ {
+ mUseIdentityView = useIdentityView;
+ }
+
+ /** Returns whether or not to use an 'identity' view.
+ @remarks
+ Usually Renderable objects will use a view matrix as determined
+ by the active camera. However, if they want they can cancel this out
+ and use an identity matrix, which means all geometry is assumed
+ to be relative to camera space already. Useful for overlay rendering.
+ Normal renderables need not change this.
+ @see Renderable::setUseIdentityView
+ */
+ bool getUseIdentityView(void) const { return mUseIdentityView; }
+
+ /** Returns the camera-relative squared depth of this renderable.
+ @remarks
+ Used to sort transparent objects. Squared depth is used rather than
+ actual depth to avoid having to perform a square root on the result.
+ */
+ virtual Real getSquaredViewDepth(const Camera* cam) const = 0;
+
+ /** Returns whether or not this Renderable wishes the hardware to normalise normals. */
+ virtual bool getNormaliseNormals(void) const { return false; }
+
+ /** Gets a list of lights, ordered relative to how close they are to this renderable.
+ @remarks
+ Directional lights, which have no position, will always be first on this list.
+ */
+ virtual const LightList& getLights(void) const = 0;
+
+ virtual const PlaneList& getClipPlanes() const { return msDummyPlaneList; };
+
+ /** Method which reports whether this renderable would normally cast a
+ shadow.
+ @remarks
+ Subclasses should override this if they could have been used to
+ generate a shadow.
+ */
+ virtual bool getCastsShadows(void) const { return false; }
+
+ /** Sets a custom parameter for this Renderable, which may be used to
+ drive calculations for this specific Renderable, like GPU program parameters.
+ @remarks
+ Calling this method simply associates a numeric index with a 4-dimensional
+ value for this specific Renderable. This is most useful if the material
+ which this Renderable uses a vertex or fragment program, and has an
+ ACT_CUSTOM parameter entry. This parameter entry can refer to the
+ index you specify as part of this call, thereby mapping a custom
+ parameter for this renderable to a program parameter.
+ @param index The index with which to associate the value. Note that this
+ does not have to start at 0, and can include gaps. It also has no direct
+ correlation with a GPU program parameter index - the mapping between the
+ two is performed by the ACT_CUSTOM entry, if that is used.
+ @param value The value to associate.
+ */
+ void setCustomParameter(size_t index, const Vector4& value)
+ {
+ mCustomParameters[index] = value;
+ }
+
+ /** Gets the custom value associated with this Renderable at the given index.
+ @param
+ @see setCustomParaemter for full details.
+ */
+ const Vector4& getCustomParameter(size_t index) const
+ {
+ CustomParameterMap::const_iterator i = mCustomParameters.find(index);
+ if (i != mCustomParameters.end())
+ {
+ return i->second;
+ }
+ else
+ {
+ OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
+ "Parameter at the given index was not found.",
+ "Renderable::getCustomParameter");
+ }
+ }
+
+ /** Update a custom GpuProgramParameters constant which is derived from
+ information only this Renderable knows.
+ @remarks
+ This method allows a Renderable to map in a custom GPU program parameter
+ based on it's own data. This is represented by a GPU auto parameter
+ of ACT_CUSTOM, and to allow there to be more than one of these per
+ Renderable, the 'data' field on the auto parameter will identify
+ which parameter is being updated. The implementation of this method
+ must identify the parameter being updated, and call a 'setConstant'
+ method on the passed in GpuProgramParameters object, using the details
+ provided in the incoming auto constant setting to identify the index
+ at which to set the parameter.
+ @par
+ You do not need to override this method if you're using the standard
+ sets of data associated with the Renderable as provided by setCustomParameter
+ and getCustomParameter. By default, the implementation will map from the
+ value indexed by the 'constantEntry.data' parameter to a value previously
+ set by setCustomParameter. But custom Renderables are free to override
+ this if they want, in any case.
+ @param constantEntry The auto constant entry referring to the parameter
+ being updated
+ @param params The parameters object which this method should call to
+ set the updated parameters.
+ */
+ virtual void _updateCustomGpuParameter(
+ const GpuProgramParameters::AutoConstantEntry& constantEntry,
+ GpuProgramParameters* params) const
+ {
+ CustomParameterMap::const_iterator i = mCustomParameters.find(constantEntry.data);
+ if (i != mCustomParameters.end())
+ {
+ params->_writeRawConstant(constantEntry.physicalIndex, i->second,
+ constantEntry.elementCount);
+ }
+ }
+
+ /** Sets whether this renderable's chosen detail level can be
+ overridden (downgraded) by the camera setting.
+ @param override true means that a lower camera detail will override this
+ renderables detail level, false means it won't.
+ */
+ virtual void setPolygonModeOverrideable(bool override)
+ {
+ mPolygonModeOverrideable = override;
+ }
+
+ /** Gets whether this renderable's chosen detail level can be
+ overridden (downgraded) by the camera setting.
+ */
+ virtual bool getPolygonModeOverrideable(void) const
+ {
+ return mPolygonModeOverrideable;
+ }
+
+
+ protected:
+ static const PlaneList msDummyPlaneList;
+ typedef std::map CustomParameterMap;
+ CustomParameterMap mCustomParameters;
+ bool mPolygonModeOverrideable;
+ bool mUseIdentityProjection;
+ bool mUseIdentityView;
+ };
+
+
+
+}
+
+#endif //__Renderable_H__
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreResource.h b/school/informatik/verkerhssimulation/src/ogre/OgreResource.h
new file mode 100644
index 00000000..4e4c496f
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreResource.h
@@ -0,0 +1,415 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef _Resource_H__
+#define _Resource_H__
+
+#include "OgrePrerequisites.h"
+#include "OgreString.h"
+#include "OgreSharedPtr.h"
+#include "OgreStringInterface.h"
+
+namespace Ogre {
+
+ typedef unsigned long ResourceHandle;
+
+
+ // Forward declaration
+ class ManualResourceLoader;
+
+ /** Abstract class reprensenting a loadable resource (e.g. textures, sounds etc)
+ @remarks
+ Resources are data objects that must be loaded and managed throughout
+ an application. A resource might be a mesh, a texture, or any other
+ piece of data - the key thing is that they must be identified by
+ a name which is unique, must be loaded only once,
+ must be managed efficiently in terms of retrieval, and they may
+ also be unloadable to free memory up when they have not been used for
+ a while and the memory budget is under stress.
+ @par
+ All Resource instances must be a member of a resource group; see
+ ResourceGroupManager for full details.
+ @par
+ Subclasses must implement:
+
+ - A constructor, overriding the same parameters as the constructor
+ defined by this class. Subclasses are not allowed to define
+ constructors with other parameters; other settings must be
+ settable through accessor methods before loading.
+ - The loadImpl() and unloadImpl() methods - mSize must be set
+ after loadImpl()
+ - StringInterface ParamCommand and ParamDictionary setups
+ in order to allow setting of core parameters (prior to load)
+ through a generic interface.
+
+ */
+ class _OgreExport Resource : public StringInterface
+ {
+ public:
+ OGRE_AUTO_MUTEX // public to allow external locking
+ class Listener
+ {
+ public:
+ Listener() {}
+ virtual ~Listener() {}
+
+ /** Callback to indicate that background loading has completed.
+ @remarks
+ This callback is only relevant when a Resource has been
+ marked as background loaded (@see Resource::setBackgroundLoaded)
+ , and occurs when that loading has completed. The call itself
+ does not itself occur in the thread which is doing the loading;
+ when loading is complete a response indicator is placed with the
+ ResourceGroupManager, which will then be sent back to the
+ listener as part of the application's primary frame loop thread.
+ */
+ virtual void backgroundLoadingComplete(Resource*) {}
+
+ };
+
+ /// Enum identifying the loading state of the resource
+ enum LoadingState
+ {
+ /// Not loaded
+ LOADSTATE_UNLOADED,
+ /// Loading is in progress
+ LOADSTATE_LOADING,
+ /// Fully loaded
+ LOADSTATE_LOADED,
+ /// Currently unloading
+ LOADSTATE_UNLOADING
+ };
+ protected:
+ /// Creator
+ ResourceManager* mCreator;
+ /// Unique name of the resource
+ String mName;
+ /// The name of the resource group
+ String mGroup;
+ /// Numeric handle for more efficient look up than name
+ ResourceHandle mHandle;
+ /// Is the resource currently loaded?
+ volatile LoadingState mLoadingState;
+ /// Is this resource going to be background loaded? Only applicable for multithreaded
+ volatile bool mIsBackgroundLoaded;
+ /// Mutex to cover the status of loading
+ OGRE_MUTEX(mLoadingStatusMutex)
+ /// The size of the resource in bytes
+ size_t mSize;
+ /// Is this file manually loaded?
+ bool mIsManual;
+ /// Origin of this resource (e.g. script name) - optional
+ String mOrigin;
+ /// Optional manual loader; if provided, data is loaded from here instead of a file
+ ManualResourceLoader* mLoader;
+
+ typedef std::list ListenerList;
+ ListenerList mListenerList;
+
+ /** Protected unnamed constructor to prevent default construction.
+ */
+ Resource()
+ : mCreator(0), mHandle(0), mLoadingState(LOADSTATE_UNLOADED),
+ mIsBackgroundLoaded(false), mSize(0), mIsManual(0), mLoader(0)
+ {
+ }
+
+ /** Internal hook to perform actions before the load process, but
+ after the resource has been marked as 'loading'.
+ @note Mutex will have already been acquired by the loading thread.
+ Also, this call will occur even when using a ManualResourceLoader
+ (when loadImpl is not actually called)
+ */
+ virtual void preLoadImpl(void) {}
+ /** Internal hook to perform actions after the load process, but
+ before the resource has been marked as fully loaded.
+ @note Mutex will have already been acquired by the loading thread.
+ Also, this call will occur even when using a ManualResourceLoader
+ (when loadImpl is not actually called)
+ */
+ virtual void postLoadImpl(void) {}
+
+ /** Internal hook to perform actions before the unload process.
+ @note Mutex will have already been acquired by the unloading thread.
+ */
+ virtual void preUnloadImpl(void) {}
+ /** Internal hook to perform actions after the unload process, but
+ before the resource has been marked as fully unloaded.
+ @note Mutex will have already been acquired by the unloading thread.
+ */
+ virtual void postUnloadImpl(void) {}
+
+ /** Internal implementation of the meat of the 'load' action, only called if this
+ resource is not being loaded from a ManualResourceLoader.
+ */
+ virtual void loadImpl(void) = 0;
+ /** Internal implementation of the 'unload' action; called regardless of
+ whether this resource is being loaded from a ManualResourceLoader.
+ */
+ virtual void unloadImpl(void) = 0;
+ /** Calculate the size of a resource; this will only be called after 'load' */
+ virtual size_t calculateSize(void) const = 0;
+
+ /// Queue the firing of background loading complete event
+ virtual void queueFireBackgroundLoadingComplete(void);
+
+ public:
+ /** Standard constructor.
+ @param creator Pointer to the ResourceManager that is creating this resource
+ @param name The unique name of the resource
+ @param group The name of the resource group to which this resource belongs
+ @param isManual Is this resource manually loaded? If so, you should really
+ populate the loader parameter in order that the load process
+ can call the loader back when loading is required.
+ @param loader Pointer to a ManualResourceLoader implementation which will be called
+ when the Resource wishes to load (should be supplied if you set
+ isManual to true). You can in fact leave this parameter null
+ if you wish, but the Resource will never be able to reload if
+ anything ever causes it to unload. Therefore provision of a proper
+ ManualResourceLoader instance is strongly recommended.
+ */
+ Resource(ResourceManager* creator, const String& name, ResourceHandle handle,
+ const String& group, bool isManual = false, ManualResourceLoader* loader = 0);
+
+ /** Virtual destructor. Shouldn't need to be overloaded, as the resource
+ deallocation code should reside in unload()
+ @see
+ Resource::unload()
+ */
+ virtual ~Resource();
+
+ /** Loads the resource, if it is not already.
+ @remarks
+ If the resource is loaded from a file, loading is automatic. If not,
+ if for example this resource gained it's data from procedural calls
+ rather than loading from a file, then this resource will not reload
+ on it's own.
+ @param backgroundThread Indicates whether the caller of this method is
+ the background resource loading thread.
+
+ */
+ virtual void load(bool backgroundThread = false);
+
+ /** Reloads the resource, if it is already loaded.
+ @remarks
+ Calls unload() and then load() again, if the resource is already
+ loaded. If it is not loaded already, then nothing happens.
+ */
+ virtual void reload(void);
+
+ /** Returns true if the Resource is reloadable, false otherwise.
+ */
+ bool isReloadable(void) const
+ {
+ return !mIsManual || mLoader;
+ }
+
+ /** Is this resource manually loaded?
+ */
+ bool isManuallyLoaded(void) const
+ {
+ return mIsManual;
+ }
+
+ /** Unloads the resource; this is not permanent, the resource can be
+ reloaded later if required.
+ */
+ virtual void unload(void);
+
+ /** Retrieves info about the size of the resource.
+ */
+ size_t getSize(void) const
+ {
+ return mSize;
+ }
+
+ /** 'Touches' the resource to indicate it has been used.
+ */
+ virtual void touch(void);
+
+ /** Gets resource name.
+ */
+ const String& getName(void) const
+ {
+ return mName;
+ }
+
+ ResourceHandle getHandle(void) const
+ {
+ return mHandle;
+ }
+
+ /** Returns true if the Resource has been loaded, false otherwise.
+ */
+ bool isLoaded(void) const
+ {
+ // No lock required to read this state since no modify
+ return (mLoadingState == LOADSTATE_LOADED);
+ }
+
+ /** Returns whether the resource is currently in the process of
+ background loading.
+ */
+ LoadingState isLoading() const
+ {
+ return mLoadingState;
+ }
+
+ /** Returns the current loading state.
+ */
+ LoadingState getLoadingState() const
+ {
+ return mLoadingState;
+ }
+
+
+
+ /** Returns whether this Resource has been earmarked for background loading.
+ @remarks
+ This option only makes sense when you have built Ogre with
+ thread support (OGRE_THREAD_SUPPORT). If a resource has been marked
+ for background loading, then it won't load on demand like normal
+ when load() is called. Instead, it will ignore request to load()
+ except if the caller indicates it is the background loader. Any
+ other users of this resource should check isLoaded(), and if that
+ returns false, don't use the resource and come back later.
+ */
+ bool isBackgroundLoaded(void) const { return mIsBackgroundLoaded; }
+
+ /** Tells the resource whether it is background loaded or not.
+ @remarks
+ @see Resource::isBackgroundLoaded . Note that calling this only
+ defers the normal on-demand loading behaviour of a resource, it
+ does not actually set up a thread to make sure the resource gets
+ loaded in the background. You should use ResourceBackgroundLoadingQueue
+ to manage the actual loading (which will call this method itself).
+ */
+ void setBackgroundLoaded(bool bl) { mIsBackgroundLoaded = bl; }
+
+ /** Escalates the loading of a background loaded resource.
+ @remarks
+ If a resource is set to load in the background, but something needs
+ it before it's been loaded, there could be a problem. If the user
+ of this resource really can't wait, they can escalate the loading
+ which basically pulls the loading into the current thread immediately.
+ If the resource is already being loaded but just hasn't quite finished
+ then this method will simply wait until the background load is complete.
+ */
+ void escalateLoading();
+
+ /** Register a listener on this resource.
+ @see Resource::Listener
+ */
+ void addListener(Listener* lis);
+
+ /** Remove a listener on this resource.
+ @see Resource::Listener
+ */
+ void removeListener(Listener* lis);
+
+ /// Gets the group which this resource is a member of
+ const String& getGroup(void) { return mGroup; }
+
+ /** Change the resource group ownership of a Resource.
+ @remarks
+ This method is generally reserved for internal use, although
+ if you really know what you're doing you can use it to move
+ this resource from one group to another.
+ @param newGroup Name of the new group
+ */
+ void changeGroupOwnership(const String& newGroup);
+
+ /// Gets the manager which created this resource
+ ResourceManager* getCreator(void) { return mCreator; }
+ /** Get the origin of this resource, e.g. a script file name.
+ @remarks
+ This property will only contain something if the creator of
+ this resource chose to populate it. Script loaders are advised
+ to populate it.
+ */
+ const String& getOrigin(void) const { return mOrigin; }
+ /// Notify this resource of it's origin
+ void _notifyOrigin(const String& origin) { mOrigin = origin; }
+
+ };
+
+ /** Shared pointer to a Resource.
+ @remarks
+ This shared pointer allows many references to a resource to be held, and
+ when the final reference is removed, the resource will be destroyed.
+ Note that the ResourceManager which created this Resource will be holding
+ at least one reference, so this resource will not get destroyed until
+ someone removes the resource from the manager - this at least gives you
+ strong control over when resources are freed. But the nature of the
+ shared pointer means that if anyone refers to the removed resource in the
+ meantime, the resource will remain valid.
+ @par
+ You may well see references to ResourcePtr (i.e. ResourcePtr&) being passed
+ around internally within Ogre. These are 'weak references' ie they do
+ not increment the reference count on the Resource. This is done for
+ efficiency in temporary operations that shouldn't need to incur the
+ overhead of maintaining the reference count; however we don't recommend
+ you do it yourself since these references are not guaranteed to remain valid.
+ */
+ typedef SharedPtr ResourcePtr;
+
+ /** Interface describing a manual resource loader.
+ @remarks
+ Resources are usually loaded from files; however in some cases you
+ want to be able to set the data up manually instead. This provides
+ some problems, such as how to reload a Resource if it becomes
+ unloaded for some reason, either because of memory constraints, or
+ because a device fails and some or all of the data is lost.
+ @par
+ This interface should be implemented by all classes which wish to
+ provide manual data to a resource. They provide a pointer to themselves
+ when defining the resource (via the appropriate ResourceManager),
+ and will be called when the Resource tries to load.
+ They should implement the loadResource method such that the Resource
+ is in the end set up exactly as if it had loaded from a file,
+ although the implementations will likely differ between subclasses
+ of Resource, which is why no generic algorithm can be stated here.
+ @note
+ The loader must remain valid for the entire life of the resource,
+ so that if need be it can be called upon to re-load the resource
+ at any time.
+ */
+ class _OgreExport ManualResourceLoader
+ {
+ public:
+ ManualResourceLoader() {}
+ virtual ~ManualResourceLoader() {}
+
+ /** Called when a resource wishes to load.
+ @param resource The resource which wishes to load
+ */
+ virtual void loadResource(Resource* resource) = 0;
+ };
+}
+
+#endif
diff --git a/school/informatik/verkerhssimulation/src/ogre/OgreResourceBackgroundQueue.h b/school/informatik/verkerhssimulation/src/ogre/OgreResourceBackgroundQueue.h
new file mode 100644
index 00000000..f9dc0a31
--- /dev/null
+++ b/school/informatik/verkerhssimulation/src/ogre/OgreResourceBackgroundQueue.h
@@ -0,0 +1,456 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+ (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+#ifndef __ResourceBackgroundQueue_H__
+#define __ResourceBackgroundQueue_H__
+
+
+#include "OgrePrerequisites.h"
+#include "OgreCommon.h"
+#include "OgreSingleton.h"
+#include "OgreResource.h"
+
+#if OGRE_THREAD_SUPPORT
+# include
+# include
+#endif
+
+namespace Ogre {
+
+ /// Identifier of a background process
+ typedef unsigned long BackgroundProcessTicket;
+
+ /** This class is used to perform Resource operations in a
+ background thread.
+ @remarks
+ If threading is enabled, Ogre will create a single background thread
+ which can be used to load / unload resources in parallel. Only one
+ resource will be processed at once in this background thread, but it
+ will be in parallel with the main thread.
+ @par
+ The general approach here is that on requesting a background resource
+ process, your request is placed on a queue ready for the background
+ thread to be picked up, and you will get a 'ticket' back, identifying
+ the request. Your call will then return and your thread can
+ proceed, knowing that at some point in the background the operation wil
+ be performed. In it's own thread, the resource operation will be
+ performed, and once finished the ticket will be marked as complete.
+ You can check the status of tickets by calling isProcessComplete()
+ from your queueing thread. It is also possible to get immediate
+ callbacks on completion, but these callbacks happen in the background
+ loading thread (not your calling thread), so should only be used if you
+ really understand multithreading.
+ @par
+ By default, when threading is enabled this class will start its own
+ separate thread to perform the actual loading. However, if you would
+ prefer to use your own existing thread to perform the background load,
+ then be sure to call setStartBackgroundThread(false) before initialise() is
+ called by Root::initialise. Your own thread should call _initThread
+ immediately on startup, before any resources are loaded at all, and
+ _doNextQueuedBackgroundProcess to process background requests.
+ @note
+ This class will only perform tasks in a background thread if
+ OGRE_THREAD_SUPPORT is defined to be 1. Otherwise, all methods will
+ call their exact equivalents in ResourceGroupManager synchronously.
+ */
+ class _OgreExport ResourceBackgroundQueue : public Singleton
+ {
+ public:
+ /** This abstract listener interface lets you get notifications of
+ completed background processes instead of having to poll ticket
+ statuses.
+ @note
+ For simplicity, these callbacks are not issued direct from the background
+ loading thread, they are queued themselves to be sent from the main thread
+ so that you don't have to be concerned about thread safety.
+ */
+ class _OgreExport Listener
+ {
+ public:
+ /** Called when a requested operation completes, queued into main thread.
+ @note
+ For simplicity, this callback is not issued direct from the background
+ loading thread, it is queued to be sent from the main thread
+ so that you don't have to be concerned about thread safety.
+ */
+ virtual void operationCompleted(BackgroundProcessTicket ticket) = 0;
+ /** Called when a requested operation completes, immediate in background thread.
+ @note
+ This is the advanced version of the background operation notification,
+ it happens immediately when the background operation is completed, and
+ your callback is executed in the