![]() |
Public API Reference |
#include <engine.h>
Inheritance diagram for csEngine:
Public Methods | |
iEngineSequenceManager * | GetEngineSequenceManager () |
Get/create the engine sequence manager. More... | |
csEngine (iBase *iParent) | |
Initialize an empty engine. More... | |
virtual | ~csEngine () |
Delete the engine and all entities it contains. More... | |
void | Report (const char *description,...) |
Report a notification message. More... | |
void | Warn (const char *description,...) |
Report a warning. More... | |
void | ReportBug (const char *description,...) |
Report a bug. More... | |
bool | CheckConsistency () |
Check consistency of the loaded elements which comprise the world. More... | |
virtual void | PrepareTextures () |
Prepare the textures. More... | |
virtual void | PrepareMeshes () |
Calls UpdateMove for all meshes to initialise bsp bounding boxes. More... | |
virtual void | ShineLights (iRegion *region=0, iProgressMeter *meter=0) |
Calculate all lighting information. More... | |
virtual iObject * | QueryObject () |
Query the iObject for the engine. More... | |
csObject * | QueryCsObject () |
Query the csObject for the engine. More... | |
virtual bool | Prepare (iProgressMeter *meter=0) |
Prepare the engine. More... | |
virtual void | ForceRelight (iRegion *region, iProgressMeter *meter) |
Force a relight of all lighting. More... | |
virtual void | ForceRelight (iStatLight *light, iRegion *region) |
Force a relight for the given light. More... | |
virtual void | RemoveLight (iStatLight *light) |
Remove a light and update all lightmaps. More... | |
void | InvalidateLightmaps () |
Invalidate all lightmaps. More... | |
virtual int | GetBeginDrawFlags () const |
Get the required flags for 3D->BeginDraw() which should be called from the application. More... | |
csTicks | GetLastAnimationTime () const |
Get the last animation time. More... | |
virtual void | SetLightingCacheMode (int mode) |
Set the mode for the lighting cache. More... | |
virtual int | GetLightingCacheMode () |
Get the mode for the lighting cache. More... | |
virtual void | SetFastMeshThresshold (int th) |
Set the fastmesh thresshold. More... | |
virtual int | GetFastMeshThresshold () const |
Get the fastmesh thresshold. More... | |
virtual void | SetClearZBuf (bool yesno) |
Set clear z buffer flag. More... | |
virtual bool | GetClearZBuf () const |
Get clear z buffer flag. More... | |
virtual bool | GetDefaultClearZBuf () const |
Get default clear z-buffer flag. More... | |
virtual void | SetClearScreen (bool yesno) |
Set clear screen flag. More... | |
virtual bool | GetClearScreen () const |
Get clear screen flag. More... | |
virtual bool | GetDefaultClearScreen () const |
Get default clear screen flag. More... | |
virtual void | SetMaxLightmapSize (int w, int h) |
Set the maximum lightmap dimensions. More... | |
virtual void | GetMaxLightmapSize (int &w, int &h) |
Retrieve maximum lightmap size. More... | |
virtual void | GetDefaultMaxLightmapSize (int &w, int &h) |
Retrieve default maximum lightmap size. More... | |
virtual void | GetDefaultAmbientLight (csColor &c) const |
Return the default amount of ambient light. More... | |
virtual bool | GetLightmapsRequirePO2 () const |
Get a boolean which indicates if power of two lightmaps are required. More... | |
virtual int | GetMaxLightmapAspectRatio () const |
Get the maximum aspect ratio for lightmaps. More... | |
virtual csPtr< iFrustumView > | CreateFrustumView () |
Create a iFrustumView instance that you can give to iVisibilityCuller->CastShadows(). More... | |
virtual csPtr< iObjectWatcher > | CreateObjectWatcher () |
Create an object watcher instance that you can use to watch other objects. More... | |
virtual void | WantToDie (iMeshWrapper *mesh) |
Sometimes a mesh wants to destruct itself (for example a particle system that has only limited lifetime). More... | |
virtual void | ResetWorldSpecificSettings () |
Reset a subset of flags/settings (which may differ from one world/map to another) to its defaults. More... | |
void | ReadConfig (iConfigFile *) |
Read configuration file (using the system driver) for all engine specific values. More... | |
void | StartEngine () |
Prepare for creation of a world. More... | |
csTextureList * | GetTextures () const |
Return the object managing all loaded textures. More... | |
csMaterialList * | GetMaterials () const |
Return the object managing all loaded materials. More... | |
csSharedVariableList * | GetVariables () const |
Return the object managing all shared variables. More... | |
virtual csPtr< iMaterial > | CreateBaseMaterial (iTextureWrapper *txt) |
Create a base material. More... | |
virtual csPtr< iMaterial > | CreateBaseMaterial (iTextureWrapper *txt, int num_layers, iTextureWrapper **wrappers, csTextureLayer *layers) |
Create a base material that can be used to give to the texture manager. More... | |
virtual iSharedVariableList * | GetVariableList () const |
Get the list of all shared variables. More... | |
virtual iMaterialList * | GetMaterialList () const |
Get the list of all materials. More... | |
virtual iTextureList * | GetTextureList () const |
Get the list of all textures. More... | |
virtual iRegion * | CreateRegion (const char *name) |
Create a new region and add it to the region list. More... | |
virtual iRegionList * | GetRegions () |
Get the list of all regions. More... | |
virtual csPtr< iMeshWrapper > | CreateSectorWallsMesh (iSector *sector, const char *name) |
Convenience function to create the thing containing the convex outline of a sector. More... | |
virtual csPtr< iMeshWrapper > | CreateThingMesh (iSector *sector, const char *name) |
Convenience function to create a thing mesh in a sector. More... | |
void | AddDynLight (csDynLight *dyn) |
Add a dynamic light to the engine. More... | |
void | RemoveDynLight (csDynLight *dyn) |
Remove a dynamic light from the engine. More... | |
virtual iDynLight * | GetFirstDynLight () const |
Return the first dynamic light in this engine. More... | |
virtual int | GetNearbyLights (iSector *sector, const csVector3 &pos, uint32 flags, iLight **lights, int max_num_lights) |
Get all nearby lights. More... | |
virtual int | GetNearbyLights (iSector *sector, const csBox3 &box, uint32 flags, iLight **lights, int max_num_lights) |
Get all nearby lights. More... | |
virtual csPtr< iSectorIterator > | GetNearbySectors (iSector *sector, const csVector3 &pos, float radius) |
This routine returns an iterator to iterate over all nearby sectors. More... | |
virtual csPtr< iObjectIterator > | GetNearbyObjects (iSector *sector, const csVector3 &pos, float radius, bool crossPortals=true) |
This routine returns an iterator to iterate over all objects that are within a radius of a given position. More... | |
virtual csPtr< iObjectIterator > | GetVisibleObjects (iSector *sector, const csVector3 &pos) |
This routine returns an iterator to iterate over all objects that are potentially visible as seen from a given position. More... | |
virtual csPtr< iObjectIterator > | GetVisibleObjects (iSector *sector, const csFrustum &frustum) |
This routine returns an iterator to iterate over all objects that are potentially visible as seen from a given position. More... | |
virtual csPtr< iMeshWrapperIterator > | GetNearbyMeshes (iSector *sector, const csVector3 &pos, float radius, bool crossPortals=true) |
This routine returns an iterator to iterate over all meshes that are within a radius of a given position. More... | |
virtual csPtr< iMeshWrapperIterator > | GetVisibleMeshes (iSector *sector, const csVector3 &pos) |
This routine returns an iterator to iterate over all meshes that are potentially visible as seen from a given position. More... | |
virtual csPtr< iMeshWrapperIterator > | GetVisibleMeshes (iSector *sector, const csFrustum &frustum) |
This routine returns an iterator to iterate over all meshes that are potentially visible as seen from a given position. More... | |
virtual bool | RemoveObject (iBase *object) |
Convenience function to 'remove' a CS object from the engine. More... | |
void | AddHalo (csLight *Light) |
Add a halo attached to given light to the engine. More... | |
void | RemoveHalo (csLight *Light) |
Remove halo attached to given light from the engine. More... | |
virtual void | Draw (iCamera *c, iClipper2D *clipper) |
Draw the 3D world given a camera and a clipper. More... | |
virtual csPtr< iLightIterator > | GetLightIterator (iRegion *region=0) |
Create an iterator to iterate over all static lights of the engine. More... | |
virtual void | RegisterRenderPriority (const char *name, long priority, int rendsort=CS_RENDPRI_NONE, bool do_camera=false) |
Register a new render priority. More... | |
virtual long | GetRenderPriority (const char *name) const |
Get a render priority by name. More... | |
virtual void | SetRenderPriorityCamera (long priority, bool do_camera) |
Set the render priority camera flag. More... | |
virtual bool | GetRenderPriorityCamera (const char *name) const |
Get the render priority camera flag. More... | |
virtual bool | GetRenderPriorityCamera (long priority) const |
Get the render priority camera flag. More... | |
virtual int | GetRenderPrioritySorting (const char *name) const |
Get the render priority sorting flag. More... | |
virtual int | GetRenderPrioritySorting (long priority) const |
Get the render priority sorting flag. More... | |
virtual long | GetSkyRenderPriority () const |
Get the render priority for sky objects (attached to 'sky' name). More... | |
virtual long | GetWallRenderPriority () const |
Get the render priority for wall objects (attached to 'wall' name). More... | |
virtual long | GetObjectRenderPriority () const |
Get the render priority for general objects (attached to 'object' name). More... | |
virtual long | GetAlphaRenderPriority () const |
Get the render priority for alpha objects (attached to 'alpha' name). More... | |
virtual void | ClearRenderPriorities () |
Clear all render priorities. More... | |
virtual int | GetRenderPriorityCount () const |
Get the number of render priorities. More... | |
virtual const char * | GetRenderPriorityName (long priority) const |
Get the name of the render priority. More... | |
virtual bool | Initialize (iObjectRegistry *object_reg) |
Initialize the engine. More... | |
virtual bool | HandleEvent (iEvent &Event) |
We need to handle some events. More... | |
virtual int | GetTextureFormat () const |
Query the format to load textures (usually this depends on texture manager). More... | |
virtual void | DeleteAll () |
Clear the entire engine. More... | |
virtual iTextureWrapper * | CreateTexture (const char *iName, const char *iFileName, csColor *iTransp, int iFlags) |
Register a texture to be loaded during Prepare(). More... | |
virtual iTextureWrapper * | CreateBlackTexture (const char *name, int w, int h, csColor *iTransp, int iFlags) |
Create a black texture. More... | |
virtual iMaterialWrapper * | CreateMaterial (const char *iName, iTextureWrapper *texture) |
Register a material to be loaded during Prepare(). More... | |
virtual iSector * | CreateSector (const char *iName) |
Create a empty sector with given name. More... | |
virtual iSectorList * | GetSectors () |
Return the list of sectors. More... | |
virtual iMeshFactoryList * | GetMeshFactories () |
Return the list of mesh factories. More... | |
virtual iMeshList * | GetMeshes () |
Return the list of meshes. More... | |
virtual iCollectionList * | GetCollections () |
Return the list of collections. More... | |
virtual iCameraPositionList * | GetCameraPositions () |
Return the list of camera positions. More... | |
virtual csPtr< iCamera > | CreateCamera () |
Create a new camera. More... | |
virtual csPtr< iStatLight > | CreateLight (const char *name, const csVector3 &pos, float radius, const csColor &color, bool pseudoDyn) |
Create a static/pseudo-dynamic light. More... | |
virtual iStatLight * | FindLightID (const char *light_id) const |
Find a static/pseudo-dynamic light by ID. More... | |
virtual iStatLight * | FindLight (const char *Name, bool RegionOnly=false) const |
Find a static/pseudo-dynamic light by name. More... | |
virtual csPtr< iDynLight > | CreateDynLight (const csVector3 &pos, float radius, const csColor &color) |
Create a dynamic light. More... | |
virtual void | RemoveDynLight (iDynLight *) |
Remove a dynamic light. More... | |
virtual csPtr< iMeshFactoryWrapper > | CreateMeshFactory (const char *classId, const char *name) |
Create a mesh factory wrapper from a mesh plugin. More... | |
virtual csPtr< iMeshFactoryWrapper > | CreateMeshFactory (iMeshObjectFactory *, const char *name) |
Create a mesh factory wrapper for an existing mesh factory. More... | |
virtual csPtr< iMeshFactoryWrapper > | CreateMeshFactory (const char *name) |
Create an uninitialized mesh factory wrapper. More... | |
virtual csPtr< iLoaderContext > | CreateLoaderContext (iRegion *region, bool curRegOnly) |
Create a loader context that you can give to loader plugins. More... | |
virtual csPtr< iMeshFactoryWrapper > | LoadMeshFactory (const char *name, const char *loaderClassId, iDataBuffer *input) |
Load mesh factory. More... | |
virtual csPtr< iMeshWrapper > | CreateMeshWrapper (iMeshFactoryWrapper *factory, const char *name, iSector *sector=0, const csVector3 &pos=csVector3(0, 0, 0)) |
Create a mesh wrapper from a mesh factory wrapper. More... | |
virtual csPtr< iMeshWrapper > | CreateMeshWrapper (iMeshObject *, const char *name, iSector *sector=0, const csVector3 &pos=csVector3(0, 0, 0)) |
Create a mesh wrapper for an existing mesh object. More... | |
virtual csPtr< iMeshWrapper > | CreateMeshWrapper (const char *classid, const char *name, iSector *sector=0, const csVector3 &pos=csVector3(0, 0, 0)) |
Create a mesh wrapper from a class id. More... | |
virtual csPtr< iMeshWrapper > | CreateMeshWrapper (const char *name) |
Create an uninitialized mesh wrapper. More... | |
virtual csPtr< iMeshWrapper > | LoadMeshWrapper (const char *name, const char *loaderClassId, iDataBuffer *input, iSector *sector, const csVector3 &pos) |
Load mesh object. More... | |
virtual iClipper2D * | GetTopLevelClipper () const |
Get the top-level clipper. More... | |
virtual void | SetAmbientLight (const csColor &c) |
Set the amount of ambient light. More... | |
virtual void | GetAmbientLight (csColor &c) const |
Return the amount of ambient light. More... | |
virtual iMaterialWrapper * | FindMaterial (const char *name, iRegion *region=0) |
Find the given material. More... | |
virtual iTextureWrapper * | FindTexture (const char *name, iRegion *region=0) |
Find the given texture. More... | |
virtual iSector * | FindSector (const char *name, iRegion *region=0) |
Find the given sector. More... | |
virtual iMeshWrapper * | FindMeshObject (const char *name, iRegion *region=0) |
Find the given mesh object. More... | |
virtual iMeshFactoryWrapper * | FindMeshFactory (const char *name, iRegion *region=0) |
Find the given mesh factory. More... | |
virtual iCameraPosition * | FindCameraPosition (const char *name, iRegion *region=0) |
Find the given camera position. More... | |
virtual iCollection * | FindCollection (const char *name, iRegion *region=0) |
Find the given collection. More... | |
virtual void | SetCacheManager (iCacheManager *cache_mgr) |
Set the cache manager that the engine will use. More... | |
virtual iCacheManager * | GetCacheManager () |
Get the cache manager that the engine is currently using. More... | |
virtual void | SetContext (iTextureHandle *txt) |
Point engine to rendering context (for procedural textures). More... | |
virtual iTextureHandle * | GetContext () const |
Return the current drawing context. More... | |
virtual iRenderLoopManager * | GetRenderLoopManager () |
For NR: Retrieve the render loop manager. More... | |
virtual iRenderLoop * | GetCurrentDefaultRenderloop () |
For NR: Returns the current render loop. More... | |
virtual bool | SetCurrentDefaultRenderloop (iRenderLoop *loop) |
Set the current render loop. More... | |
Static Public Methods | |
void | SetMaxProcessPolygons (int m) |
Set the maximum number of polygons to process in one frame. More... | |
int | GetMaxProcessPolygons () |
Get the maximum number of polygons to process in one frame. More... | |
bool | ProcessPolygon () |
Indicate that we will process another polygon. More... | |
bool | ProcessLastPolygon () |
Return true if we are processing the last polygon. More... | |
Public Attributes | |
csRef< iVFS > | VFS |
This is the Virtual File System object where all the files used by the engine live. More... | |
csRef< iEngineSequenceManager > | eseqmgr |
Pointer to the engine sequence manager. More... | |
csRef< iReporter > | Reporter |
Pointer to an optional reporter that will be used for notification and warning messages. More... | |
csRefArray< iBase > | cleanup |
This is a vector which holds objects of type 'csCleanable'. More... | |
csSectorList | sectors |
List of sectors in the engine. More... | |
csCollectionList | collections |
List of all collections in the engine. More... | |
csMeshFactoryList | mesh_factories |
List of mesh object factories. More... | |
csEngineMeshList | meshes |
List of all meshes in the engine. More... | |
csCameraPositionList | camera_positions |
The list of all camera position objects. More... | |
csRef< iGraphics3D > | G3D |
The 3D driver. More... | |
csRef< iGraphics2D > | G2D |
The 2D driver. More... | |
csRef< iImageIO > | ImageLoader |
The graphics loader. More... | |
csRef< iStringSet > | Strings |
For NR: @ Document me! More... | |
csRef< iShaderManager > | ShaderManager |
For NR: @ Document me! More... | |
csRef< iCacheManager > | cache_mgr |
The following variable is only set if the engine had to create its own cache manager. More... | |
G3D_FOGMETHOD | fogmethod |
The fog mode this G3D implements. More... | |
bool | NeedPO2Maps |
Does the 3D driver require power-of-two lightmaps? More... | |
int | MaxAspectRatio |
Maximum texture aspect ratio. More... | |
csRegionList | regions |
The list of all regions currently loaded. More... | |
csStringArray | render_priorities |
The list of all named render priorities. More... | |
csArray< int > | render_priority_sortflags |
Sorting flags for the render priorities. More... | |
csArray< bool > | render_priority_cameraflags |
Do_camera flags for the render priorities. More... | |
long | render_priority_sky |
The engine knows about the following render priorities and keeps them here:. More... | |
csRef< iRenderLoop > | defaultRenderLoop |
Default render loop. More... | |
csRenderLoopManager * | renderLoopManager |
Render loop manager. More... | |
iCamera * | current_camera |
The current camera for drawing the world. More... | |
iClipper2D * | top_clipper |
The top-level clipper we are currently using for drawing. More... | |
csEngine::eiComponent | scfiComponent |
iComponent implementation. More... | |
csEngine::EventHandler * | scfiEventHandler |
iEventHandler implementation. More... | |
Static Public Attributes | |
int | frame_width |
Remember dimensions of display. More... | |
int | frame_height |
Remember dimensions of display. More... | |
iObjectRegistry * | object_reg |
Remember iObjectRegistry. More... | |
csEngine * | current_engine |
The shared engine instance. More... | |
iEngine * | current_iengine |
The shared engine instance. More... | |
bool | use_new_radiosity |
Need to render using newradiosity? More... | |
int | lightcache_mode |
Option variable: force lightmap recalculation? More... | |
int | lightmap_quality |
Option variable: quality for lightmap calculation. More... | |
bool | do_force_revis |
Option variable: force visibility recalculation? More... | |
bool | do_rad_debug |
Option variable: radiosity debugging (step by step)? More... | |
int | max_lightmap_w |
Maximum lightmap dimensions. More... |
This class manages all components which comprise a 3D world including sectors, polygons, curves, mesh objects, etc.
Definition at line 222 of file csengine/engine.h.
|
Initialize an empty engine. The only thing that is valid just after creating the engine is the configurator object which you can use to configure the engine before continuing (see GetEngineConfig()). |
|
Delete the engine and all entities it contains. All objects added to this engine by the user (like Things, Sectors, ...) will be deleted as well. If you don't want this then you should unlink them manually before destroying the engine. |
|
Add a dynamic light to the engine.
|
|
Add a halo attached to given light to the engine.
|
|
Check consistency of the loaded elements which comprise the world. Currently this function only checks if polygons have three or more vertices and if the vertices are coplanar (if more than three). This function prints out warnings for all found errors. Returns true if everything is in order. |
|
Clear all render priorities.
Implements iEngine. |
|
Create a base material that can be used to give to the texture manager. This version also supports texture layers. Assign to a csRef or use DecRef().
Implements iEngine. |
|
Create a base material.
Implements iEngine. |
|
Create a black texture. This is mostly useful for procedural textures.
Implements iEngine. |
|
Create a new camera.
Implements iEngine. |
|
Create a dynamic light.
Implements iEngine. |
|
Create a iFrustumView instance that you can give to iVisibilityCuller->CastShadows(). You can initialize that instance so that your own function is called for every object that is being visited. Implements iEngine. |
|
Create a static/pseudo-dynamic light.
Implements iEngine. |
|
Create a loader context that you can give to loader plugins. It will basically allow loader plugins to find materials.
Implements iEngine. |
|
Register a material to be loaded during Prepare().
Implements iEngine. |
|
Create an uninitialized mesh factory wrapper.
Implements iEngine. |
|
Create a mesh factory wrapper for an existing mesh factory.
Implements iEngine. |
|
Create a mesh factory wrapper from a mesh plugin.
Implements iEngine. |
|
Create an uninitialized mesh wrapper.
Implements iEngine. |
|
Create a mesh wrapper from a class id.
Implements iEngine. |
|
Create a mesh wrapper for an existing mesh object.
Implements iEngine. |
|
Create a mesh wrapper from a mesh factory wrapper.
Implements iEngine. |
|
Create an object watcher instance that you can use to watch other objects. The engine will not keep a reference to this object. Implements iEngine. |
|
Create a new region and add it to the region list. If the region already exists then this function will just return the pointer to that region.
Implements iEngine. |
|
Create a empty sector with given name.
Implements iEngine. |
|
Convenience function to create the thing containing the convex outline of a sector. The thing will be empty but it will have CS_ZBUF_FILL set (so that the Z-buffer will be filled by the polygons of this object) and have 'wall' as render priority. This version creates a mesh wrapper. Assign to a csRef or use DecRef().
Implements iEngine. |
|
Register a texture to be loaded during Prepare().
Implements iEngine. |
|
Convenience function to create a thing mesh in a sector. This mesh will have CS_ZBUF_USE set (use Z-buffer fully) and have 'object' as render priority. This means this function is useful for general objects. Assign to a csRef or use DecRef().
Implements iEngine. |
|
Clear the entire engine.
Implements iEngine. |
|
Draw the 3D world given a camera and a clipper. Note that in order to be able to draw using the given 3D driver all textures must have been registered to that driver (using Prepare()). Note that you need to call Prepare() again if you switch to another 3D driver. Implements iEngine. |
|
Find the given camera position. The name can be a normal name. In that case this function will look in all regions except if region is not 0 in which case it will only look in that region. If the name is specified as 'regionname/objectname' then this function will only look in the specified region and return 0 if that region doesn't contain the object or the region doesn't exist. In this case the region parameter is ignored.
Implements iEngine. |
|
Find the given collection. The name can be a normal name. In that case this function will look in all regions except if region is not 0 in which case it will only look in that region. If the name is specified as 'regionname/objectname' then this function will only look in the specified region and return 0 if that region doesn't contain the object or the region doesn't exist. In this case the region parameter is ignored.
Implements iEngine. |
|
Find a static/pseudo-dynamic light by name.
Implements iEngine. |
|
Find a static/pseudo-dynamic light by ID.
Implements iEngine. |
|
Find the given material. The name can be a normal name. In that case this function will look in all regions except if region is not 0 in which case it will only look in that region. If the name is specified as 'regionname/objectname' then this function will only look in the specified region and return 0 if that region doesn't contain the object or the region doesn't exist. In this case the region parameter is ignored.
Implements iEngine. |
|
Find the given mesh factory. The name can be a normal name. In that case this function will look in all regions except if region is not 0 in which case it will only look in that region. If the name is specified as 'regionname/objectname' then this function will only look in the specified region and return 0 if that region doesn't contain the object or the region doesn't exist. In this case the region parameter is ignored.
Implements iEngine. |
|
Find the given mesh object. The name can be a normal name. In that case this function will look in all regions except if region is not 0 in which case it will only look in that region. If the name is specified as 'regionname/objectname' then this function will only look in the specified region and return 0 if that region doesn't contain the object or the region doesn't exist. In this case the region parameter is ignored.
Implements iEngine. |
|
Find the given sector. The name can be a normal name. In that case this function will look in all regions except if region is not 0 in which case it will only look in that region. If the name is specified as 'regionname/objectname' then this function will only look in the specified region and return 0 if that region doesn't contain the object or the region doesn't exist. In this case the region parameter is ignored.
Implements iEngine. |
|
Find the given texture. The name can be a normal name. In that case this function will look in all regions except if region is not 0 in which case it will only look in that region. If the name is specified as 'regionname/objectname' then this function will only look in the specified region and return 0 if that region doesn't contain the object or the region doesn't exist. In this case the region parameter is ignored.
Implements iEngine. |
|
Force a relight for the given light. This is useful to update the lightmaps after a static or pseudo-dynamic light has been added (don't use this for dynamic lights). If there are a lot of objects this function can be slow. The optional region can be given to limit calculation to objects in the region. The current flags set with SetLightingCacheMode() controls if the lightmaps will be cached or not. Implements iEngine. |
|
Force a relight of all lighting. It is better to call this instead of calling engine->Prepare() again as engine->Prepare() will also do other stuff (like registering textures). Warning! This function can be very slow (depending on the number of lights and objects in the world). The optional region can be given to limit calculation to objects in the region. The current flags set with SetLightingCacheMode() controls if the lightmaps will be cached or not. Implements iEngine. |
|
Get the render priority for alpha objects (attached to 'alpha' name).
Implements iEngine. Definition at line 872 of file csengine/engine.h. |
|
Return the amount of ambient light.
Implements iEngine. |
|
Get the required flags for 3D->BeginDraw() which should be called from the application. These flags must be or-ed with optional other flags that the application might be interested in. Implements iEngine. Definition at line 651 of file csengine/engine.h. References CSDRAW_CLEARSCREEN, and CSDRAW_CLEARZBUFFER. |
|
Get the cache manager that the engine is currently using.
Implements iEngine. |
|
Return the list of camera positions.
Implements iEngine. Definition at line 955 of file csengine/engine.h. References csCameraPositionList::scfiCameraPositionList. |
|
Get clear screen flag.
Implements iEngine. Definition at line 695 of file csengine/engine.h. |
|
Get clear z buffer flag.
Implements iEngine. Definition at line 683 of file csengine/engine.h. |
|
Return the list of collections.
Implements iEngine. Definition at line 952 of file csengine/engine.h. References csCollectionList::scfiCollectionList. |
|
Return the current drawing context.
Implements iEngine. |
|
For NR: Returns the current render loop.
Implements iEngine. |
|
Return the default amount of ambient light.
Implements iEngine. |
|
Get default clear screen flag.
Implements iEngine. Definition at line 698 of file csengine/engine.h. |
|
Get default clear z-buffer flag.
Implements iEngine. Definition at line 686 of file csengine/engine.h. |
|
Retrieve default maximum lightmap size.
Implements iEngine. Definition at line 710 of file csengine/engine.h. |
|
Get/create the engine sequence manager.
|
|
Get the fastmesh thresshold.
Implements iEngine. Definition at line 674 of file csengine/engine.h. |
|
Return the first dynamic light in this engine.
Implements iEngine. |
|
Get the last animation time.
Definition at line 664 of file csengine/engine.h. References csTicks. |
|
Get the mode for the lighting cache.
Implements iEngine. Definition at line 669 of file csengine/engine.h. References lightcache_mode. |
|
Create an iterator to iterate over all static lights of the engine.
Implements iEngine. Definition at line 843 of file csengine/engine.h. |
|
Get a boolean which indicates if power of two lightmaps are required.
Implements iEngine. Definition at line 715 of file csengine/engine.h. References NeedPO2Maps. |
|
Get the list of all materials.
Implements iEngine. |
|
Return the object managing all loaded materials.
Definition at line 754 of file csengine/engine.h. |
|
Get the maximum aspect ratio for lightmaps.
Implements iEngine. Definition at line 716 of file csengine/engine.h. References MaxAspectRatio. |
|
Retrieve maximum lightmap size.
Implements iEngine. Definition at line 707 of file csengine/engine.h. References max_lightmap_w. |
|
Get the maximum number of polygons to process in one frame.
Definition at line 612 of file csengine/engine.h. |
|
Return the list of meshes.
Implements iEngine. Definition at line 949 of file csengine/engine.h. |
|
Return the list of mesh factories.
Implements iEngine. Definition at line 946 of file csengine/engine.h. |
|
Get all nearby lights.
Implements iEngine. |
|
Get all nearby lights.
Implements iEngine. |
|
This routine returns an iterator to iterate over all meshes that are within a radius of a given position. If crossPortals is true it will search through portals. Otherwise it will limit the search to the sector passed in. Implements iEngine. |
|
This routine returns an iterator to iterate over all objects that are within a radius of a given position. The current implementation only does meshes but in future lights will also be supported. You can use SCF_QUERY_INTERFACE to get any interface from the returned objects. If crossPortals is true it will search through portals. Otherwise it will limit the search to the sector passed in. If you only want to have meshes then it is more efficient to call GetNearbyMeshes() as you can then avoid the call to SCF_QUERY_INTERFACE. Implements iEngine. |
|
This routine returns an iterator to iterate over all nearby sectors. Assign to a csRef or use DecRef(). Implements iEngine. |
|
Get the render priority for general objects (attached to 'object' name).
Implements iEngine. Definition at line 870 of file csengine/engine.h. |
|
Get the list of all regions.
Implements iEngine. |
|
For NR: Retrieve the render loop manager.
Implements iEngine. |
|
Get a render priority by name.
Implements iEngine. |
|
Get the render priority camera flag.
Implements iEngine. |
|
Get the render priority camera flag.
Implements iEngine. |
|
Get the number of render priorities.
Implements iEngine. |
|
Get the name of the render priority.
Implements iEngine. |
|
Get the render priority sorting flag.
Implements iEngine. |
|
Get the render priority sorting flag.
Implements iEngine. |
|
Return the list of sectors.
Implements iEngine. Definition at line 943 of file csengine/engine.h. |
|
Get the render priority for sky objects (attached to 'sky' name).
Implements iEngine. Definition at line 866 of file csengine/engine.h. References render_priority_sky. |
|
Query the format to load textures (usually this depends on texture manager).
Implements iEngine. |
|
Get the list of all textures.
Implements iEngine. |
|
Return the object managing all loaded textures.
Definition at line 749 of file csengine/engine.h. |
|
Get the top-level clipper.
Implements iEngine. |
|
Get the list of all shared variables.
Implements iEngine. |
|
Return the object managing all shared variables.
Definition at line 759 of file csengine/engine.h. |
|
This routine returns an iterator to iterate over all meshes that are potentially visible as seen from a given position. This routine has a frustum restricting the view. CURRENTLY NOT IMPLEMENTED! Implements iEngine. |
|
This routine returns an iterator to iterate over all meshes that are potentially visible as seen from a given position. This routine assumes full 360 degree visibility. CURRENTLY NOT IMPLEMENTED! Implements iEngine. |
|
This routine returns an iterator to iterate over all objects that are potentially visible as seen from a given position. This routine has a frustum restricting the view. You can use SCF_QUERY_INTERFACE to get any interface from the returned objects. If you only want meshes then use GetVisibleMeshes(). CURRENTLY NOT IMPLEMENTED! Implements iEngine. |
|
This routine returns an iterator to iterate over all objects that are potentially visible as seen from a given position. This routine assumes full 360 degree visibility. You can use SCF_QUERY_INTERFACE to get any interface from the returned objects. If you only want meshes then use GetVisibleMeshes(). CURRENTLY NOT IMPLEMENTED! Implements iEngine. |
|
Get the render priority for wall objects (attached to 'wall' name).
Implements iEngine. Definition at line 868 of file csengine/engine.h. |
|
We need to handle some events.
Referenced by csEngine::EventHandler::HandleEvent. |
|
Initialize the engine. This is automatically called by system driver at startup so that plugin can do basic initialization stuff, register with the system driver and so on. |
|
Invalidate all lightmaps. This can be called after doing a significant change on the static lightmaps (i.e. after doing a radiosity debug function). |
|
Load mesh factory.
Implements iEngine. |
|
Load mesh object.
Implements iEngine. |
|
Prepare the engine. This function must be called after you loaded/created the world. It will prepare all lightmaps for use and also free all images that were loaded for the texture manager (the texture manager should have them locally now). The optional progress meter will be used to report progress. Implements iEngine. |
|
Calls UpdateMove for all meshes to initialise bsp bounding boxes. Call this after creating a BSP tree. csEngine::Prepare() will call this function automatically so you normally don't have to call it. Implements iEngine. |
|
Prepare the textures. It will initialise all loaded textures for the texture manager. (Normally you shouldn't call this function directly, because it will be called by Prepare() for you. This function will also prepare all loaded materials after preparing the textures. Implements iEngine. |
|
Return true if we are processing the last polygon.
Definition at line 628 of file csengine/engine.h. |
|
Indicate that we will process another polygon. Returns false if we need to stop. Definition at line 618 of file csengine/engine.h. |
|
Query the csObject for the engine.
Definition at line 555 of file csengine/engine.h. |
|
Query the iObject for the engine.
Implements iEngine. |
|
Read configuration file (using the system driver) for all engine specific values. This function is called by Initialize() so you normally do not need to call it yourselves. |
|
Register a new render priority.
Implements iEngine. |
|
Remove a dynamic light.
Implements iEngine. |
|
Remove a dynamic light from the engine.
|
|
Remove halo attached to given light from the engine.
|
|
Remove a light and update all lightmaps. This function only works correctly for pseudo-dynamic static lights. If you give a normal static light then the light will be removed but lightmaps will not be affected. You can call ForceRelight() to force relighting then. The current flags set with SetLightingCacheMode() controls if the lightmaps will be cached or not. Implements iEngine. |
|
Convenience function to 'remove' a CS object from the engine. This will not clear the object but it will remove all references to that object that the engine itself keeps. This function works for: iSector, iCollection, iMeshWrapper, iMeshFactoryWrapper, iCameraPosition, iDynLight, iMaterialWrapper, and iTextureWrapper. Note that the object is only removed if the resulting ref count will become zero. So basically this function only releases the references that the engine holds. This function returns true if the engine recognized the object as one on which it can operate. This function will also remove the object from the region it may be in. Implements iEngine. |
|
Report a notification message.
|
|
Report a bug.
|
|
Reset a subset of flags/settings (which may differ from one world/map to another) to its defaults. This currently includes:
Implements iEngine. |
|
Set the amount of ambient light.
Implements iEngine. |
|
Set the cache manager that the engine will use. If this is not done then the engine will use its own cache manager based on VFS. This will do an incref on the given cache manager and a decref on the old one. The engine will release the cache manager at destruction time. Implements iEngine. |
|
Set clear screen flag.
Implements iEngine. Definition at line 689 of file csengine/engine.h. |
|
Set clear z buffer flag.
Implements iEngine. Definition at line 677 of file csengine/engine.h. |
|
Point engine to rendering context (for procedural textures).
Implements iEngine. |
|
Set the current render loop.
Implements iEngine. |
|
Set the fastmesh thresshold.
Implements iEngine. Definition at line 672 of file csengine/engine.h. |
|
Set the mode for the lighting cache.
Implements iEngine. Definition at line 667 of file csengine/engine.h. References lightcache_mode. |
|
Set the maximum lightmap dimensions. Polys with lightmaps larger than this are not lit. Implements iEngine. Definition at line 704 of file csengine/engine.h. References max_lightmap_w. |
|
Set the maximum number of polygons to process in one frame. This is mainly useful for debugging. Definition at line 607 of file csengine/engine.h. |
|
Set the render priority camera flag.
Implements iEngine. |
|
Calculate all lighting information. Normally you shouldn't call this function directly, because it will be called by Prepare(). If the optional 'region' parameter is given then only lights will be recalculated for the given region. Implements iEngine. |
|
Prepare for creation of a world. This function is called by Initialize() so you normally do not need to call it yourselves. |
|
Sometimes a mesh wants to destruct itself (for example a particle system that has only limited lifetime). It can do that by calling this function on itself. The engine will then remove the object before the next frame. Implements iEngine. |
|
Report a warning.
|
|
The following variable is only set if the engine had to create its own cache manager. In that case the engine is also responsible for cleaning this up. Definition at line 319 of file csengine/engine.h. |
|
The list of all camera position objects.
Definition at line 292 of file csengine/engine.h. |
|
This is a vector which holds objects of type 'csCleanable'. They will be destroyed when the engine is destroyed. That's the only special thing. This is useful for holding memory which you allocate locally in a function but you want to reuse accross function invocations. There is no general way to make sure that the memory will be freed it only exists as a static pointer in your function code. Adding a class encapsulating that memory to this array will ensure that the memory is removed once the engine is destroyed. Definition at line 259 of file csengine/engine.h. |
|
List of all collections in the engine. This vector contains objects of type iCollection*. Definition at line 272 of file csengine/engine.h. |
|
The current camera for drawing the world.
Definition at line 475 of file csengine/engine.h. |
|
The shared engine instance.
Definition at line 299 of file csengine/engine.h. |
|
The shared engine instance.
Definition at line 301 of file csengine/engine.h. |
|
Default render loop.
Definition at line 351 of file csengine/engine.h. |
|
Option variable: force visibility recalculation?
Definition at line 363 of file csengine/engine.h. |
|
Option variable: radiosity debugging (step by step)?
Definition at line 365 of file csengine/engine.h. |
|
Pointer to the engine sequence manager.
Definition at line 240 of file csengine/engine.h. |
|
The fog mode this G3D implements.
Definition at line 321 of file csengine/engine.h. |
|
Remember dimensions of display.
Definition at line 295 of file csengine/engine.h. |
|
Remember dimensions of display.
Definition at line 295 of file csengine/engine.h. |
|
The 2D driver.
Definition at line 307 of file csengine/engine.h. |
|
The 3D driver.
Definition at line 305 of file csengine/engine.h. |
|
The graphics loader.
Definition at line 309 of file csengine/engine.h. |
|
Option variable: force lightmap recalculation?
Definition at line 359 of file csengine/engine.h. Referenced by GetLightingCacheMode, and SetLightingCacheMode. |
|
Option variable: quality for lightmap calculation.
Definition at line 361 of file csengine/engine.h. |
|
Maximum lightmap dimensions.
Definition at line 367 of file csengine/engine.h. Referenced by GetMaxLightmapSize, and SetMaxLightmapSize. |
|
Maximum texture aspect ratio.
Definition at line 325 of file csengine/engine.h. Referenced by GetMaxLightmapAspectRatio. |
|
List of mesh object factories. This vector contains objects of type csMeshFactoryWrapper*. Definition at line 278 of file csengine/engine.h. |
|
List of all meshes in the engine. This vector contains objects of type csMeshWrapper*. Use RemoveMesh() to remove meshes from this list. This function will take care of correctly removing the meshes from all sectors as well. Note that after you add a mesh to the list you still need to add it to all sectors that you want it to be visible in. Definition at line 287 of file csengine/engine.h. |
|
Does the 3D driver require power-of-two lightmaps?
Definition at line 323 of file csengine/engine.h. Referenced by GetLightmapsRequirePO2. |
|
Remember iObjectRegistry.
Definition at line 297 of file csengine/engine.h. |
|
The list of all regions currently loaded.
Definition at line 327 of file csengine/engine.h. |
|
The list of all named render priorities.
Definition at line 330 of file csengine/engine.h. |
|
Do_camera flags for the render priorities.
Definition at line 334 of file csengine/engine.h. |
|
The engine knows about the following render priorities and keeps them here:.
Definition at line 345 of file csengine/engine.h. Referenced by GetSkyRenderPriority. |
|
Sorting flags for the render priorities.
Definition at line 332 of file csengine/engine.h. |
|
Render loop manager.
Definition at line 353 of file csengine/engine.h. |
|
Pointer to an optional reporter that will be used for notification and warning messages.
Definition at line 246 of file csengine/engine.h. |
|
iComponent implementation.
|
|
iEventHandler implementation.
|
|
List of sectors in the engine. This vector contains objects of type iSector*. Use CreateSector() to add sectors to the engine. Definition at line 266 of file csengine/engine.h. |
|
For NR: @ Document me! @ Definition at line 313 of file csengine/engine.h. |
|
For NR: @ Document me! @ Definition at line 311 of file csengine/engine.h. |
|
The top-level clipper we are currently using for drawing.
Definition at line 480 of file csengine/engine.h. |
|
Need to render using newradiosity?
Definition at line 303 of file csengine/engine.h. |
|
This is the Virtual File System object where all the files used by the engine live. Textures, models, data, everything - reside on this virtual disk volume. You should avoid using the standard file functions (such as fopen(), fread() and so on) since they are highly system-dependent (for example, DOS uses '\' as path separator, Mac uses ':' and Unix uses '/'). Definition at line 235 of file csengine/engine.h. |