#include <lilith3d.h>
Textures and Models are generally created before the Lilith3D engine.
Public Types | |
| enum | { INFO_VERSION = 0x01, INFO_TIME = 0x02, INFO_INTERSECT = 0x04, INFO_MINIMAP = 0x08 } |
Public Member Functions | |
| Lilith3D (U32 msecPerDay=DEFAULT_MSEC_PER_DAY, U32 msecStart=DEFUALT_MSEC_DAY_START) | |
| virtual void | BeginDraw () |
| void | AddSequence (ISequence *orphanSequence) |
| QuadTree * | GetQuadTree () |
| Query the quad tree - adding Mesh's to the tree will cause them to render. | |
| Weather * | GetTargetWeather () |
| Query the target weather state. This object is non-const, and can be changed. | |
| const Weather & | CurrentWeather () |
| Query the current weather state. | |
| void | SetRenderMode (int r) |
| int | RenderMode () |
| Query the render mode. | |
| void | SetRenderFoliage (bool foliage) |
| Turn on/off foliage rendering. | |
| bool | RenderFoliage () |
| Query foliage rendering. | |
| void | SetRenderShadows (bool shadows) |
| Turn on/off shadow rendering. | |
| bool | RenderShadows () |
| Query shadow rendering. | |
| void | SetPerfDataDisplay (bool perfData) |
| Turn on/off performance data display. | |
| bool | PerfDataDisplay () |
| Quecy performance display. | |
| void | SetMapSize (float size) |
| void | SetInfoDisplay (int flags) |
| void | ScreenCapture (const char *baseFilename) |
| void | IntersectRayFromScreen (int x, int y, int flags, LilithObjectList *vec) |
| int | IntersectMapFromScreen (int x, int y, grinliz::Vector3F *vertex) |
| void | IntersectRay (const grinliz::Ray &ray, int flags, LilithObjectList *vec) |
| void | RegisterParticleSystem (ParticleSystem *system) |
| ParticleSystem * | FindParticleSystem (const char *name) |
| Search for a particle system by name. | |
| GravParticles * | GetGravParticles () |
| Fast access to the gravity particles. | |
| Camera * | GetCamera () |
| Get the camera for the world. | |
| bool | InFrustum (const grinliz::Rectangle3F &aabb) |
| int | IntersectFrustum (const grinliz::Rectangle3F &aabb) |
| Mesh * | GetMesh (int id) |
| Get the mesh from it's id, 0 if deleted. | |
Static Public Member Functions | |
| static Lilith3D * | Instance () |
| Return a pointer to the engine - this will *not* create the engine if it does not exist. | |
| static SDL_Surface * | SetSDLVideoMode (int width, int height, int multisample, bool fullscreen) |
| static TerrainMesh * | GetTerrainMesh () |
| Get the TerrainMesh pointer (will return null if Lilith3D is not initialized.). | |
| static TerrainDecor * | GetTerrainDecor () |
| Get the Decor pointer (will return null if Lilith3D is not initialized.). | |
| static TimeClock * | GetTimeClock () |
| Get the Decor pointer (will return null if Lilith3D is not initialized.). | |
| static void | CreateOpenGLToLilith (grinliz::Matrix4 *matrix) |
| Create a matrix to convert from OpenGL coordinates to Lilith coordinates. | |
| anonymous enum |
| lilith3d::Lilith3D::Lilith3D | ( | U32 | msecPerDay = DEFAULT_MSEC_PER_DAY, |
|
| U32 | msecStart = DEFUALT_MSEC_DAY_START | |||
| ) |
Construct the engine, with the width and height of the SDL_Surface. The timer is started with the engine.
| msecPerDay | Milliseconds (real time) in one day in Lilith3D time. | |
| msecStart | Time of day (msec real time) to start. |
| virtual void lilith3d::Lilith3D::BeginDraw | ( | ) | [virtual] |
Draw is split up into stages:
All methods are virtual, so that any stage can be overridden by a client application. (Athough make sure to also call the method you are overriding!)
| static SDL_Surface* lilith3d::Lilith3D::SetSDLVideoMode | ( | int | width, | |
| int | height, | |||
| int | multisample, | |||
| bool | fullscreen | |||
| ) | [static] |
Set the video mode, using SDL, to an OpenGL surface that can be used by lilith. You need to call SDL_Init, with at least these flags:
SDL_Init( SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE | SDL_INIT_TIMER )
before calling SetSDLVideoMode.
| width | Width of the screen surface | |
| height | Height of the screen surface | |
| multisample | 0: use the default, else the # of samples per pixel | |
| fullscreen | Set 'true' to run fullscreen, 'false' in a window. Windowed is much easier to debug. |
| void lilith3d::Lilith3D::AddSequence | ( | ISequence * | orphanSequence | ) |
Add a Sequence to the engine. A sequence plays until it is done and is then deleted by the engine.
| orphanSequence | The sequence to play. Ownership is passed to the engine, and lilith will delete it. |
| void lilith3d::Lilith3D::SetRenderMode | ( | int | r | ) |
Set the rendering mode.
| void lilith3d::Lilith3D::SetMapSize | ( | float | size | ) | [inline] |
Set the size of the mini-map. 0.0 is smallest, 1.0 largest.
| void lilith3d::Lilith3D::SetInfoDisplay | ( | int | flags | ) | [inline] |
Set what information to display on the screen (version, fps, etc.). Setting to 0 will result in nothing being displayed, and INFO_DEFAULT will display the default, and verbase, read-out.
| void lilith3d::Lilith3D::ScreenCapture | ( | const char * | baseFilename | ) |
Save the current screen as a bmp file. The baseFilename is the prefix, so choosing 'demo' will save the first file at 'demo00.bmp'. The engine will scan for a free filename from 00-99.
| void lilith3d::Lilith3D::IntersectRayFromScreen | ( | int | x, | |
| int | y, | |||
| int | flags, | |||
| LilithObjectList * | vec | |||
| ) |
This method is used to get objects in screen coordinates - very useful to know what is under the mouse. The flags are what should be tested: TEST_TERRAIN, TEST_PSI, etc. You should not test for more than you need.
| int lilith3d::Lilith3D::IntersectMapFromScreen | ( | int | x, | |
| int | y, | |||
| grinliz::Vector3F * | vertex | |||
| ) |
A special check for checking the coordinates of a map click.
| void lilith3d::Lilith3D::IntersectRay | ( | const grinliz::Ray & | ray, | |
| int | flags, | |||
| LilithObjectList * | vec | |||
| ) |
Intersect an arbitrary ray with the world. The flags are what should be tested: TEST_TERRAIN, TEST_PSI, etc. You should not test for more than you need.
| void lilith3d::Lilith3D::RegisterParticleSystem | ( | ParticleSystem * | system | ) |
Installs a particle system to the engine. GenParticles, RainDropParticles, RainSplashParticles are provided by default.
| bool lilith3d::Lilith3D::InFrustum | ( | const grinliz::Rectangle3F & | aabb | ) |
Returns true if the aabb intersects or is inside the frustum. See CullingPlane notes for when this is valid. Very useful for culling. Less informative than IntersectFrustum() but a little faster.
| int lilith3d::Lilith3D::IntersectFrustum | ( | const grinliz::Rectangle3F & | aabb | ) |
More sophisticated take on InFrustum(), and also a little slower. Returns:
1.5.1-p1