lilith3d::Lilith3D Class Reference

#include <lilith3d.h>

List of all members.


Detailed Description

The main class of the Lilith3D system. Creating this object creates the world, and allows the client to interact with it. Likewise, when this objects is deleted, the game engine is cleaned up and the memory free'd. (With the exception of models and textures.)

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)
QuadTreeGetQuadTree ()
 Query the quad tree - adding Mesh's to the tree will cause them to render.
WeatherGetTargetWeather ()
 Query the target weather state. This object is non-const, and can be changed.
const WeatherCurrentWeather ()
 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)
ParticleSystemFindParticleSystem (const char *name)
 Search for a particle system by name.
GravParticlesGetGravParticles ()
 Fast access to the gravity particles.
CameraGetCamera ()
 Get the camera for the world.
bool InFrustum (const grinliz::Rectangle3F &aabb)
int IntersectFrustum (const grinliz::Rectangle3F &aabb)
MeshGetMesh (int id)
 Get the mesh from it's id, 0 if deleted.

Static Public Member Functions

static Lilith3DInstance ()
 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 TerrainMeshGetTerrainMesh ()
 Get the TerrainMesh pointer (will return null if Lilith3D is not initialized.).
static TerrainDecorGetTerrainDecor ()
 Get the Decor pointer (will return null if Lilith3D is not initialized.).
static TimeClockGetTimeClock ()
 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.


Member Enumeration Documentation

anonymous enum

Enumerator:
INFO_VERSION  displays the version number of the engine and the web page
INFO_TIME  displays the framerate and current game calendar time
INFO_INTERSECT  displays the objects under the mouse
INFO_MINIMAP  display the mini-map


Constructor & Destructor Documentation

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.

Parameters:
msecPerDay Milliseconds (real time) in one day in Lilith3D time.
msecStart Time of day (msec real time) to start.


Member Function Documentation

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.

Parameters:
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.

Parameters:
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.

Returns:
INTERSECT if the map was clicked on, REJECT otherwise.

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:


The documentation for this class was generated from the following file:
Generated on Fri Mar 23 19:36:26 2007 for Lilith3D by  doxygen 1.5.1-p1