CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

iEngine Struct Reference
[Crystal Space 3D Engine]

This interface is the main interface to the 3D engine. More...

#include <engine.h>

Inheritance diagram for iEngine:

iBase csEngine List of all members.

Public Methods

virtual iObjectQueryObject ()=0
 Get the iObject for the engine. More...

virtual bool Prepare (iProgressMeter *meter=NULL)=0
 Prepare the engine. More...

virtual void PrepareTextures ()=0
 Prepare the textures. More...

virtual void PrepareMeshes ()=0
 Calls UpdateMove for all meshes to initialise bsp bounding boxes. More...

virtual void ShineLights (iRegion *region=NULL, iProgressMeter *meter=NULL)=0
 Calculate all lighting information. More...

virtual int GetTextureFormat () const=0
 Query the format to load textures (usually this depends on texture manager). More...

virtual void SelectRegion (const char *name)=0
 Create or select a new region (name can be NULL for the default main region). More...

virtual void SelectRegion (iRegion *region)=0
 Create or select a new region (region can be NULL for the default main region). More...

virtual iRegionGetCurrentRegion () const=0
 Get a reference to the current region (or NULL if the default main region is selected). More...

virtual void AddToCurrentRegion (iObject *obj)=0
 Add an object to the current region. More...

virtual void DeleteAll ()=0
 Delete everything in the engine. More...

virtual void RegisterRenderPriority (const char *name, long priority, int rendsort=CS_RENDPRI_NONE, bool do_camera=false)=0
 Register a new render priority. More...

virtual long GetRenderPriority (const char *name) const=0
 Get a render priority by name. More...

virtual void SetRenderPriorityCamera (long priority, bool do_camera)=0
 Set the render priority camera flag. More...

virtual bool GetRenderPriorityCamera (const char *name) const=0
 Get the render priority camera flag. More...

virtual bool GetRenderPriorityCamera (long priority) const=0
 Get the render priority camera flag. More...

virtual int GetRenderPrioritySorting (const char *name) const=0
 Get the render priority sorting flag. More...

virtual int GetRenderPrioritySorting (long priority) const=0
 Get the render priority sorting flag. More...

virtual long GetSkyRenderPriority () const=0
 Get the render priority for sky objects (attached to 'sky' name). More...

virtual long GetWallRenderPriority () const=0
 Get the render priority for wall objects (attached to 'wall' name). More...

virtual long GetObjectRenderPriority () const=0
 Get the render priority for general objects (attached to 'object' name). More...

virtual long GetAlphaRenderPriority () const=0
 Get the render priority for alpha objects (attached to 'alpha' name). More...

virtual void ClearRenderPriorities ()=0
 Clear all render priorities. More...

virtual int GetRenderPriorityCount () const=0
 Get the number of render priorities. More...

virtual const char * GetRenderPriorityName (long priority) const=0
 Get the name of the render priority or NULL if none existant. More...

virtual csPtr< iMaterialCreateBaseMaterial (iTextureWrapper *txt)=0
 Create a base material that can be used to give to the texture manager. More...

virtual csPtr< iMaterialCreateBaseMaterial (iTextureWrapper *txt, int num_layers, iTextureWrapper **wrappers, csTextureLayer *layers)=0
 Create a base material that can be used to give to the texture manager. More...

virtual iTextureWrapperCreateTexture (const char *name, const char *fileName, csColor *transp, int flags)=0
 Create a texture from a file. More...

virtual iTextureWrapperCreateBlackTexture (const char *name, int w, int h, csColor *iTransp, int iFlags)=0
 Create a black texture. This is mostly useful for procedural textures. More...

virtual iMaterialWrapperCreateMaterial (const char *name, iTextureWrapper *texture)=0
 Register a material to be loaded during Prepare(). More...

virtual iSectorCreateSector (const char *name)=0
 Create a empty sector with given name. More...

virtual csPtr< iMeshWrapperCreateSectorWallsMesh (iSector *sector, const char *name)=0
 Conveniance function to create the thing containing the convex outline of a sector. More...

virtual csPtr< iMeshWrapperCreateThingMesh (iSector *sector, const char *name)=0
 Conveniance function to create a thing mesh in a sector. More...

virtual iSectorListGetSectors ()=0
 Get the list of sectors. More...

virtual iMeshFactoryListGetMeshFactories ()=0
 Get the list of mesh factories. More...

virtual iMeshListGetMeshes ()=0
 Get the list of meshes. More...

virtual iCollectionListGetCollections ()=0
 Get the list of collections. More...

virtual iCameraPositionListGetCameraPositions ()=0
 Get the list of camera positions. More...

virtual iTextureListGetTextureList () const=0
 Get the list of all textures. More...

virtual iMaterialListGetMaterialList () const=0
 Get the list of all materials. More...

virtual iSharedVariableListGetVariableList () const=0
 Get the list of all shared variables. More...

virtual iRegionListGetRegions ()=0
 Get the list of all regions. More...

virtual iMaterialWrapperFindMaterial (const char *name, iRegion *region=NULL)=0
 Find the given material. More...

virtual iTextureWrapperFindTexture (const char *name, iRegion *region=NULL)=0
 Find the given texture. More...

virtual iSectorFindSector (const char *name, iRegion *region=NULL)=0
 Find the given sector. More...

virtual iMeshWrapperFindMeshObject (const char *name, iRegion *region=NULL)=0
 Find the given mesh object. More...

virtual iMeshFactoryWrapperFindMeshFactory (const char *name, iRegion *region=NULL)=0
 Find the given mesh factory. More...

virtual iCameraPositionFindCameraPosition (const char *name, iRegion *region=NULL)=0
 Find the given camera position. More...

virtual iCollectionFindCollection (const char *name, iRegion *region=NULL)=0
 Find the given collection. More...

virtual void SetLightingCacheMode (int mode)=0
 Set the mode for the lighting cache (combination of CS_ENGINE_CACHE_???). More...

virtual int GetLightingCacheMode ()=0
 Get the mode for the lighting cache. More...

virtual void SetFastMeshThresshold (int th)=0
 Set the thresshold (in number of polygons) after which the thing mesh plugin will automatically switch to FASTMESH mode. More...

virtual int GetFastMeshThresshold () const=0
 Get the fastmesh thresshold. More...

virtual void SetClearZBuf (bool yesno)=0
 Require that the Z-buffer is cleared every frame. More...

virtual bool GetClearZBuf () const=0
 Get the value of the clear Z-buffer flag set with SetClearZBuf(). More...

virtual bool GetDefaultClearZBuf () const=0
 Get default clear z-buffer flag. More...

virtual void SetClearScreen (bool yesno)=0
 Require that the screen is cleared every frame. More...

virtual bool GetClearScreen () const=0
 Get the value of the clear screen flag set with SetClearScreen(). More...

virtual bool GetDefaultClearScreen () const=0
 Get default clear screen flag. More...

virtual void SetMaxLightmapSize (int w, int h)=0
 Set the maximum lightmap dimensions. More...

virtual void GetMaxLightmapSize (int &w, int &h)=0
 Retrieve maximum lightmap size. More...

virtual void GetDefaultMaxLightmapSize (int &w, int &h)=0
 Retrieve default maximum lightmap size. More...

virtual bool GetLightmapsRequirePO2 () const=0
 Get a boolean which indicates if power of two lightmaps are required. More...

virtual int GetMaxLightmapAspectRatio () const=0
 Get the maximum aspect ratio for lightmaps. More...

virtual void ResetWorldSpecificSettings ()=0
 Reset a subset of flags/settings (which may differ from one world/map to another) to its defaults. More...

virtual csPtr< iCameraCreateCamera ()=0
 Create a new camera. More...

virtual csPtr< iStatLightCreateLight (const char *name, const csVector3 &pos, float radius, const csColor &color, bool pseudoDyn)=0
 Create a static/pseudo-dynamic light. More...

virtual iStatLightFindLight (const char *Name, bool RegionOnly=false) const=0
 Find a static/pseudo-dynamic light by name. More...

virtual iStatLightFindLightID (const char *light_id) const=0
 Find a static/pseudo-dynamic light by id. More...

virtual csPtr< iLightIteratorGetLightIterator (iRegion *region=NULL)=0
 Create an iterator to iterate over all static lights of the engine. More...

virtual csPtr< iDynLightCreateDynLight (const csVector3 &pos, float radius, const csColor &color)=0
 Create a dynamic light. More...

virtual void RemoveDynLight (iDynLight *)=0
 Remove a dynamic light. More...

virtual iDynLightGetFirstDynLight () const=0
 Return the first dynamic light in this engine. More...

virtual int GetBeginDrawFlags () const=0
 Get the required flags for 3D->BeginDraw() which should be called from the application. More...

virtual iClipper2DGetTopLevelClipper () const=0
 Get the top-level clipper. More...

virtual csPtr< iMeshFactoryWrapperCreateMeshFactory (const char *classId, const char *name)=0
 Conveniance function to create a mesh factory from a given type. More...

virtual csPtr< iMeshFactoryWrapperCreateMeshFactory (iMeshObjectFactory *, const char *name)=0
 Create a mesh factory wrapper for an existing mesh factory Assign to a csRef or use DecRef(). More...

virtual csPtr< iMeshFactoryWrapperCreateMeshFactory (const char *name)=0
 Create an uninitialized mesh factory wrapper Assign to a csRef or use DecRef(). More...

virtual csPtr< iLoaderContextCreateLoaderContext (iRegion *region=NULL)=0
 Create a loader context that you can give to loader plugins. More...

virtual csPtr< iMeshFactoryWrapperLoadMeshFactory (const char *name, const char *loaderClassId, iDataBuffer *input)=0
 Conveniance function to load a mesh factory from a given loader plugin. More...

virtual csPtr< iMeshWrapperCreateMeshWrapper (iMeshFactoryWrapper *factory, const char *name, iSector *sector=NULL, const csVector3 &pos=csVector3(0, 0, 0))=0
 Conveniance function to create a mesh object for a given factory. More...

virtual csPtr< iMeshWrapperCreateMeshWrapper (iMeshObject *, const char *name, iSector *sector=NULL, const csVector3 &pos=csVector3(0, 0, 0))=0
 Create a mesh wrapper for an existing mesh object. More...

virtual csPtr< iMeshWrapperCreateMeshWrapper (const char *classid, const char *name, iSector *sector=NULL, const csVector3 &pos=csVector3(0, 0, 0))=0
 Create a mesh wrapper from a class id. More...

virtual csPtr< iMeshWrapperCreateMeshWrapper (const char *name)=0
 Create an uninitialized mesh wrapper Assign to a csRef or use DecRef(). More...

virtual csPtr< iMeshWrapperLoadMeshWrapper (const char *name, const char *loaderClassId, iDataBuffer *input, iSector *sector, const csVector3 &pos)=0
 Conveniance function to load a mesh object from a given loader plugin. More...

virtual void Draw (iCamera *c, iClipper2D *clipper)=0
 Draw the 3D world given a camera and a clipper. More...

virtual void SetContext (iTextureHandle *ctxt)=0
 Set the drawing context. More...

virtual iTextureHandleGetContext () const=0
 Return the current drawing context. More...

virtual void SetAmbientLight (const csColor &)=0
 Set the amount of ambient light. More...

virtual void GetAmbientLight (csColor &) const=0
 Return the amount of ambient light. More...

virtual int GetNearbyLights (iSector *sector, const csVector3 &pos, uint32 flags, iLight **lights, int max_num_lights)=0
 This routine returns all lights which might affect an object at some position according to the following flags:
.
More...


virtual int GetNearbyLights (iSector *sector, const csBox3 &box, uint32 flags, iLight **lights, int max_num_lights)=0
 This routine returns all lights which might affect an object with some bounding box according to the following flags:
.
More...


virtual csPtr< iSectorIteratorGetNearbySectors (iSector *sector, const csVector3 &pos, float radius)=0
 This routine returns an iterator to iterate over all nearby sectors. More...

virtual csPtr< iObjectIteratorGetNearbyObjects (iSector *sector, const csVector3 &pos, float radius, bool crossPortals=true)=0
 This routine returns an iterator to iterate over all objects that are within a radius of a given position. More...

virtual csPtr< iObjectIteratorGetVisibleObjects (iSector *sector, const csVector3 &pos)=0
 This routine returns an iterator to iterate over all objects that are potentially visible as seen from a given position. More...

virtual csPtr< iObjectIteratorGetVisibleObjects (iSector *sector, const csFrustum &frustum)=0
 This routine returns an iterator to iterate over all objects that are potentially visible as seen from a given position. More...

virtual bool RemoveObject (iBase *object)=0
 Conveniance function to 'remove' a CS object from the engine. More...

virtual void SetCacheManager (iCacheManager *cache_mgr)=0
 Set the cache manager that the engine will use. More...

virtual iCacheManagerGetCacheManager ()=0
 Get the cache manager that the engine is currently using. More...

virtual void GetDefaultAmbientLight (csColor &c) const=0
 Return the default amount of ambient light. More...

virtual csPtr< iFrustumViewCreateFrustumView ()=0
 Create a iFrustumView instance that you can give to iVisibilityCuller->CastShadows(). More...

virtual csPtr< iObjectWatcherCreateObjectWatcher ()=0
 Create an object watcher instance that you can use to watch other objects. More...

virtual void WantToDie (iMeshWrapper *mesh)=0
 Sometimes a mesh wants to destruct itself (for example a particle system that has only limited lifetime). More...


Detailed Description

This interface is the main interface to the 3D engine.

The engine is responsible for creating new engine-specific objects such as sectors, mesh objects, mesh object factories, lights, and so on.

Definition at line 150 of file iengine/engine.h.


Member Function Documentation

virtual void iEngine::AddToCurrentRegion iObject   obj [pure virtual]
 

Add an object to the current region.

Normally you don't need to call this function as CS objects already do this automatically.

Implemented in csEngine.

virtual void iEngine::ClearRenderPriorities   [pure virtual]
 

Clear all render priorities.

Implemented in csEngine.

virtual csPtr<iMaterial> iEngine::CreateBaseMaterial iTextureWrapper   txt,
int    num_layers,
iTextureWrapper **    wrappers,
csTextureLayer   layers
[pure virtual]
 

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().

Implemented in csEngine.

virtual csPtr<iMaterial> iEngine::CreateBaseMaterial iTextureWrapper   txt [pure virtual]
 

Create a base material that can be used to give to the texture manager.

Assign to a csRef or use DecRef().

Implemented in csEngine.

virtual iTextureWrapper* iEngine::CreateBlackTexture const char *    name,
int    w,
int    h,
csColor   iTransp,
int    iFlags
[pure virtual]
 

Create a black texture. This is mostly useful for procedural textures.

Implemented in csEngine.

virtual csPtr<iCamera> iEngine::CreateCamera   [pure virtual]
 

Create a new camera.

Assign to a csRef or use DecRef().

Implemented in csEngine.

virtual csPtr<iDynLight> iEngine::CreateDynLight const csVector3   pos,
float    radius,
const csColor   color
[pure virtual]
 

Create a dynamic light.

After creating a dynamic light you have to call SetSector() on it. Do NOT add the light to the list of lights in a sector. That list is only for static or pseudo-dynamic lights. You also have to call Setup() on the dynamic light to actually calculate the lighting. This must be redone everytime the radius or the position changes (but not the color).

Implemented in csEngine.

virtual csPtr<iFrustumView> iEngine::CreateFrustumView   [pure virtual]
 

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.

Implemented in csEngine.

virtual csPtr<iStatLight> iEngine::CreateLight const char *    name,
const csVector3   pos,
float    radius,
const csColor   color,
bool    pseudoDyn
[pure virtual]
 

Create a static/pseudo-dynamic light.

name can be NULL. Assign to a csRef or use DecRef().

Implemented in csEngine.

virtual csPtr<iLoaderContext> iEngine::CreateLoaderContext iRegion   region = NULL [pure virtual]
 

Create a loader context that you can give to loader plugins.

It will basically allow loader plugins to find materials, ... If region != NULL then only that region will be searched. Assign to a csRef or use DecRef().

Implemented in csEngine.

virtual iMaterialWrapper* iEngine::CreateMaterial const char *    name,
iTextureWrapper   texture
[pure virtual]
 

Register a material to be loaded during Prepare().

Implemented in csEngine.

virtual csPtr<iMeshFactoryWrapper> iEngine::CreateMeshFactory const char *    name [pure virtual]
 

Create an uninitialized mesh factory wrapper Assign to a csRef or use DecRef().

Implemented in csEngine.

virtual csPtr<iMeshFactoryWrapper> iEngine::CreateMeshFactory iMeshObjectFactory  ,
const char *    name
[pure virtual]
 

Create a mesh factory wrapper for an existing mesh factory Assign to a csRef or use DecRef().

Implemented in csEngine.

virtual csPtr<iMeshFactoryWrapper> iEngine::CreateMeshFactory const char *    classId,
const char *    name
[pure virtual]
 

Conveniance function to create a mesh factory from a given type.

The type plugin will only be loaded if needed. 'classId' is the SCF name of the plugin (like 'crystalspace.mesh.object.cube'). Returns NULL on failure. The factory will be registered with the engine under the given name. If there is already a factory with that name no new factory will be created but the found one is returned instead. If the name is NULL then no name will be set and no check will happen if the factory already exists. Assign to a csRef or use DecRef().

Implemented in csEngine.

virtual csPtr<iMeshWrapper> iEngine::CreateMeshWrapper const char *    name [pure virtual]
 

Create an uninitialized mesh wrapper Assign to a csRef or use DecRef().

Implemented in csEngine.

virtual csPtr<iMeshWrapper> iEngine::CreateMeshWrapper const char *    classid,
const char *    name,
iSector   sector = NULL,
const csVector3   pos = csVector3(0, 0, 0)
[pure virtual]
 

Create a mesh wrapper from a class id.

The type plugin will only be loaded if needed. 'classId' is the SCF name of the plugin (like 'crystalspace.mesh.object.cube'). This function will first make a factory from the plugin and then see if that factory itself implements iMeshObject too. This means this function is useful to create thing mesh objects (which are both factory and object at the same time). If that fails this function will call NewInstance() on the factory and return that object then. Assign to a csRef or use DecRef().

Implemented in csEngine.

virtual csPtr<iMeshWrapper> iEngine::CreateMeshWrapper iMeshObject  ,
const char *    name,
iSector   sector = NULL,
const csVector3   pos = csVector3(0, 0, 0)
[pure virtual]
 

Create a mesh wrapper for an existing mesh object.

Assign to a csRef or use DecRef().

Implemented in csEngine.

virtual csPtr<iMeshWrapper> iEngine::CreateMeshWrapper iMeshFactoryWrapper   factory,
const char *    name,
iSector   sector = NULL,
const csVector3   pos = csVector3(0, 0, 0)
[pure virtual]
 

Conveniance function to create a mesh object for a given factory.

If 'sector' is NULL then the mesh object will not be set to a position. Returns NULL on failure. The object will be given the specified name. 'name' can be NULL if no name is wanted. Different mesh objects can have the same name (in contrast with factory objects). Assign to a csRef or use DecRef().

Implemented in csEngine.

virtual csPtr<iObjectWatcher> iEngine::CreateObjectWatcher   [pure virtual]
 

Create an object watcher instance that you can use to watch other objects.

The engine will not keep a reference to this object.

Implemented in csEngine.

virtual iSector* iEngine::CreateSector const char *    name [pure virtual]
 

Create a empty sector with given name.

Implemented in csEngine.

virtual csPtr<iMeshWrapper> iEngine::CreateSectorWallsMesh iSector   sector,
const char *    name
[pure virtual]
 

Conveniance 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().

Implemented in csEngine.

virtual iTextureWrapper* iEngine::CreateTexture const char *    name,
const char *    fileName,
csColor   transp,
int    flags
[pure virtual]
 

Create a texture from a file.

Implemented in csEngine.

virtual csPtr<iMeshWrapper> iEngine::CreateThingMesh iSector   sector,
const char *    name
[pure virtual]
 

Conveniance 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().

Implemented in csEngine.

virtual void iEngine::DeleteAll   [pure virtual]
 

Delete everything in the engine.

Implemented in csEngine.

virtual void iEngine::Draw iCamera   c,
iClipper2D   clipper
[pure virtual]
 

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.

Implemented in csEngine.

virtual iCameraPosition* iEngine::FindCameraPosition const char *    name,
iRegion   region = NULL
[pure virtual]
 

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 NULL 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 NULL if that region doesn't contain the object or the region doesn't exist. In this case the region parameter is ignored.

Implemented in csEngine.

virtual iCollection* iEngine::FindCollection const char *    name,
iRegion   region = NULL
[pure virtual]
 

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 NULL 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 NULL if that region doesn't contain the object or the region doesn't exist. In this case the region parameter is ignored.

Implemented in csEngine.

virtual iStatLight* iEngine::FindLight const char *    Name,
bool    RegionOnly = false
const [pure virtual]
 

Find a static/pseudo-dynamic light by name.

Implemented in csEngine.

virtual iStatLight* iEngine::FindLightID const char *    light_id const [pure virtual]
 

Find a static/pseudo-dynamic light by id.

An ID is a 16-byte MD5 checksum for the light.

Implemented in csEngine.

virtual iMaterialWrapper* iEngine::FindMaterial const char *    name,
iRegion   region = NULL
[pure virtual]
 

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 NULL 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 NULL if that region doesn't contain the object or the region doesn't exist. In this case the region parameter is ignored.

Implemented in csEngine.

virtual iMeshFactoryWrapper* iEngine::FindMeshFactory const char *    name,
iRegion   region = NULL
[pure virtual]
 

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 NULL 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 NULL if that region doesn't contain the object or the region doesn't exist. In this case the region parameter is ignored.

Implemented in csEngine.

virtual iMeshWrapper* iEngine::FindMeshObject const char *    name,
iRegion   region = NULL
[pure virtual]
 

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 NULL 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 NULL if that region doesn't contain the object or the region doesn't exist. In this case the region parameter is ignored.

Implemented in csEngine.

virtual iSector* iEngine::FindSector const char *    name,
iRegion   region = NULL
[pure virtual]
 

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 NULL 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 NULL if that region doesn't contain the object or the region doesn't exist. In this case the region parameter is ignored.

Implemented in csEngine.

virtual iTextureWrapper* iEngine::FindTexture const char *    name,
iRegion   region = NULL
[pure virtual]
 

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 NULL 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 NULL if that region doesn't contain the object or the region doesn't exist. In this case the region parameter is ignored.

Implemented in csEngine.

virtual long iEngine::GetAlphaRenderPriority   const [pure virtual]
 

Get the render priority for alpha objects (attached to 'alpha' name).

Implemented in csEngine.

virtual void iEngine::GetAmbientLight csColor   const [pure virtual]
 

Return the amount of ambient light.

Implemented in csEngine.

virtual int iEngine::GetBeginDrawFlags   const [pure virtual]
 

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. Use SetClearZBuf() to let this function return that the Z-buffer must be cleared.

Implemented in csEngine.

virtual iCacheManager* iEngine::GetCacheManager   [pure virtual]
 

Get the cache manager that the engine is currently using.

Implemented in csEngine.

virtual iCameraPositionList* iEngine::GetCameraPositions   [pure virtual]
 

Get the list of camera positions.

Implemented in csEngine.

virtual bool iEngine::GetClearScreen   const [pure virtual]
 

Get the value of the clear screen flag set with SetClearScreen().

Implemented in csEngine.

virtual bool iEngine::GetClearZBuf   const [pure virtual]
 

Get the value of the clear Z-buffer flag set with SetClearZBuf().

Implemented in csEngine.

virtual iCollectionList* iEngine::GetCollections   [pure virtual]
 

Get the list of collections.

Implemented in csEngine.

virtual iTextureHandle* iEngine::GetContext   const [pure virtual]
 

Return the current drawing context.

Implemented in csEngine.

virtual iRegion* iEngine::GetCurrentRegion   const [pure virtual]
 

Get a reference to the current region (or NULL if the default main region is selected).

Implemented in csEngine.

virtual void iEngine::GetDefaultAmbientLight csColor   c const [pure virtual]
 

Return the default amount of ambient light.

Implemented in csEngine.

virtual bool iEngine::GetDefaultClearScreen   const [pure virtual]
 

Get default clear screen flag.

Implemented in csEngine.

virtual bool iEngine::GetDefaultClearZBuf   const [pure virtual]
 

Get default clear z-buffer flag.

Implemented in csEngine.

virtual void iEngine::GetDefaultMaxLightmapSize int &    w,
int &    h
[pure virtual]
 

Retrieve default maximum lightmap size.

Implemented in csEngine.

virtual int iEngine::GetFastMeshThresshold   const [pure virtual]
 

Get the fastmesh thresshold.

Implemented in csEngine.

virtual iDynLight* iEngine::GetFirstDynLight   const [pure virtual]
 

Return the first dynamic light in this engine.

Implemented in csEngine.

virtual int iEngine::GetLightingCacheMode   [pure virtual]
 

Get the mode for the lighting cache.

Implemented in csEngine.

virtual csPtr<iLightIterator> iEngine::GetLightIterator iRegion   region = NULL [pure virtual]
 

Create an iterator to iterate over all static lights of the engine.

Assign to a csRef or use DecRef().

Implemented in csEngine.

virtual bool iEngine::GetLightmapsRequirePO2   const [pure virtual]
 

Get a boolean which indicates if power of two lightmaps are required.

Implemented in csEngine.

virtual iMaterialList* iEngine::GetMaterialList   const [pure virtual]
 

Get the list of all materials.

Implemented in csEngine.

virtual int iEngine::GetMaxLightmapAspectRatio   const [pure virtual]
 

Get the maximum aspect ratio for lightmaps.

Implemented in csEngine.

virtual void iEngine::GetMaxLightmapSize int &    w,
int &    h
[pure virtual]
 

Retrieve maximum lightmap size.

Implemented in csEngine.

virtual iMeshList* iEngine::GetMeshes   [pure virtual]
 

Get the list of meshes.

Implemented in csEngine.

virtual iMeshFactoryList* iEngine::GetMeshFactories   [pure virtual]
 

Get the list of mesh factories.

Implemented in csEngine.

virtual int iEngine::GetNearbyLights iSector   sector,
const csBox3   box,
uint32    flags,
iLight **    lights,
int    max_num_lights
[pure virtual]
 

This routine returns all lights which might affect an object with some bounding box according to the following flags:
.


It will only return as many lights as the size that you specified for the light array. The returned lights are not guaranteed to be sorted but they are guaranteed to be the specified number of lights closest to the given position.
This function returns the actual number of lights added to the 'lights' array.

Implemented in csEngine.

virtual int iEngine::GetNearbyLights iSector   sector,
const csVector3   pos,
uint32    flags,
iLight **    lights,
int    max_num_lights
[pure virtual]
 

This routine returns all lights which might affect an object at some position according to the following flags:
.


It will only return as many lights as the size that you specified for the light array. The returned lights are not guaranteed to be sorted but they are guaranteed to be the specified number of lights closest to the given position.
This function returns the actual number of lights added to the 'lights' array.

Implemented in csEngine.

virtual csPtr<iObjectIterator> iEngine::GetNearbyObjects iSector   sector,
const csVector3   pos,
float    radius,
bool    crossPortals = true
[pure virtual]
 

This routine returns an iterator to iterate over all objects that are within a radius of a given position.

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.

Assign to a csRef or use DecRef().

Implemented in csEngine.

virtual csPtr<iSectorIterator> iEngine::GetNearbySectors iSector   sector,
const csVector3   pos,
float    radius
[pure virtual]
 

This routine returns an iterator to iterate over all nearby sectors.

Assign to a csRef or use DecRef().

Implemented in csEngine.

virtual long iEngine::GetObjectRenderPriority   const [pure virtual]
 

Get the render priority for general objects (attached to 'object' name).

Implemented in csEngine.

virtual iRegionList* iEngine::GetRegions   [pure virtual]
 

Get the list of all regions.

Implemented in csEngine.

virtual long iEngine::GetRenderPriority const char *    name const [pure virtual]
 

Get a render priority by name.

Implemented in csEngine.

virtual bool iEngine::GetRenderPriorityCamera long    priority const [pure virtual]
 

Get the render priority camera flag.

Implemented in csEngine.

virtual bool iEngine::GetRenderPriorityCamera const char *    name const [pure virtual]
 

Get the render priority camera flag.

Implemented in csEngine.

virtual int iEngine::GetRenderPriorityCount   const [pure virtual]
 

Get the number of render priorities.

Implemented in csEngine.

virtual const char* iEngine::GetRenderPriorityName long    priority const [pure virtual]
 

Get the name of the render priority or NULL if none existant.

Implemented in csEngine.

virtual int iEngine::GetRenderPrioritySorting long    priority const [pure virtual]
 

Get the render priority sorting flag.

Implemented in csEngine.

virtual int iEngine::GetRenderPrioritySorting const char *    name const [pure virtual]
 

Get the render priority sorting flag.

Implemented in csEngine.

virtual iSectorList* iEngine::GetSectors   [pure virtual]
 

Get the list of sectors.

Implemented in csEngine.

virtual long iEngine::GetSkyRenderPriority   const [pure virtual]
 

Get the render priority for sky objects (attached to 'sky' name).

Implemented in csEngine.

virtual int iEngine::GetTextureFormat   const [pure virtual]
 

Query the format to load textures (usually this depends on texture manager).

Implemented in csEngine.

virtual iTextureList* iEngine::GetTextureList   const [pure virtual]
 

Get the list of all textures.

Implemented in csEngine.

virtual iClipper2D* iEngine::GetTopLevelClipper   const [pure virtual]
 

Get the top-level clipper.

Implemented in csEngine.

virtual iSharedVariableList* iEngine::GetVariableList   const [pure virtual]
 

Get the list of all shared variables.

Implemented in csEngine.

virtual csPtr<iObjectIterator> iEngine::GetVisibleObjects iSector   sector,
const csFrustum   frustum
[pure virtual]
 

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.

Assign to a csRef or use DecRef().

Implemented in csEngine.

virtual csPtr<iObjectIterator> iEngine::GetVisibleObjects iSector   sector,
const csVector3   pos
[pure virtual]
 

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.

Assign to a csRef or use DecRef().

Implemented in csEngine.

virtual long iEngine::GetWallRenderPriority   const [pure virtual]
 

Get the render priority for wall objects (attached to 'wall' name).

Implemented in csEngine.

virtual csPtr<iMeshFactoryWrapper> iEngine::LoadMeshFactory const char *    name,
const char *    loaderClassId,
iDataBuffer   input
[pure virtual]
 

Conveniance function to load a mesh factory from a given loader plugin.

Assign to a csRef or use DecRef().

Implemented in csEngine.

virtual csPtr<iMeshWrapper> iEngine::LoadMeshWrapper const char *    name,
const char *    loaderClassId,
iDataBuffer   input,
iSector   sector,
const csVector3   pos
[pure virtual]
 

Conveniance function to load a mesh object from a given loader plugin.

If sector == NULL the object will not be placed in a sector. Assign to a csRef or use DecRef().

Implemented in csEngine.

virtual bool iEngine::Prepare iProgressMeter   meter = NULL [pure virtual]
 

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.

Implemented in csEngine.

virtual void iEngine::PrepareMeshes   [pure virtual]
 

Calls UpdateMove for all meshes to initialise bsp bounding boxes.

Call this after creating a BSP tree. Prepare() will call this function automatically so you normally don't have to call it.

Implemented in csEngine.

virtual void iEngine::PrepareTextures   [pure virtual]
 

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.

Implemented in csEngine.

virtual iObject* iEngine::QueryObject   [pure virtual]
 

Get the iObject for the engine.

Implemented in csEngine.

virtual void iEngine::RegisterRenderPriority const char *    name,
long    priority,
int    rendsort = CS_RENDPRI_NONE,
bool    do_camera = false
[pure virtual]
 

Register a new render priority.

The parameter rendsort is one of the CS_RENDPRI_... flags. By default this is CS_RENDPRI_NONE. The following values are possible:

If 'do_camera' is true then this render priority will be scanned for objects that have CS_ENTITY_CAMERA flag set.

Implemented in csEngine.

virtual void iEngine::RemoveDynLight iDynLight   [pure virtual]
 

Remove a dynamic light.

Implemented in csEngine.

virtual bool iEngine::RemoveObject iBase   object [pure virtual]
 

Conveniance 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.

Implemented in csEngine.

virtual void iEngine::ResetWorldSpecificSettings   [pure virtual]
 

Reset a subset of flags/settings (which may differ from one world/map to another) to its defaults.

This currently includes:

  • clear z buffer flag
  • lightmap cell size
  • maximum lighmap size

Implemented in csEngine.

virtual void iEngine::SelectRegion iRegion   region [pure virtual]
 

Create or select a new region (region can be NULL for the default main region).

All new objects will be marked as belonging to this region.

Implemented in csEngine.

virtual void iEngine::SelectRegion const char *    name [pure virtual]
 

Create or select a new region (name can be NULL for the default main region).

All new objects will be marked as belonging to this region.

Implemented in csEngine.

virtual void iEngine::SetAmbientLight const csColor   [pure virtual]
 

Set the amount of ambient light.

This has no effect until you recalculate the lightmaps.

Implemented in csEngine.

virtual void iEngine::SetCacheManager iCacheManager   cache_mgr [pure virtual]
 

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.

Implemented in csEngine.

virtual void iEngine::SetClearScreen bool    yesno [pure virtual]
 

Require that the screen is cleared every frame.

The engine itself will not use this setting but will only return the correct flag in GetBeginDrawFlags() so that the screen is actually cleared. Note that this requires that the application actually uses GetBeginDrawFlags() in the call to g3d->BeginDraw() (which it should). By default this flag is false. It is useful to set this flag to true if you have a level that doesn't itself have another way to initialize the screen.

Implemented in csEngine.

virtual void iEngine::SetClearZBuf bool    yesno [pure virtual]
 

Require that the Z-buffer is cleared every frame.

The engine itself will not use this setting but will only return the correct flag in GetBeginDrawFlags() so that the Z-buffer is actually cleared. Note that this requires that the application actually uses GetBeginDrawFlags() in the call to g3d->BeginDraw() (which it should). By default this flag is false. It is useful to set this flag to true if you have a level that doesn't itself have another way to initialize the Z-buffer.

Implemented in csEngine.

virtual void iEngine::SetContext iTextureHandle   ctxt [pure virtual]
 

Set the drawing context.

This is a texture handle that is used as the procedural texture to render on. If this is NULL then the screen is assumed.

Implemented in csEngine.

virtual void iEngine::SetFastMeshThresshold int    th [pure virtual]
 

Set the thresshold (in number of polygons) after which the thing mesh plugin will automatically switch to FASTMESH mode.

If the number of polygons is greater or equal compared to this thresshold then CS_THING_FASTMESH will be made default. 500 is the default.

Implemented in csEngine.

virtual void iEngine::SetLightingCacheMode int    mode [pure virtual]
 

Set the mode for the lighting cache (combination of CS_ENGINE_CACHE_???).

Default is CS_ENGINE_CACHE_READ | CS_ENGINE_CACHE_NOUPDATE.

  • CS_ENGINE_CACHE_READ: Read the cache.
  • CS_ENGINE_CACHE_WRITE: Write the cache.
  • CS_ENGINE_CACHE_NOUPDATE: Don't update lighting automatically if it is not up-to-date. This is on by default. If you disable this then lighting will be calculated even if CS_ENGINE_CACHE_WRITE is not set which means that the resulting calculation is not written to the cache.

Implemented in csEngine.

virtual void iEngine::SetMaxLightmapSize int    w,
int    h
[pure virtual]
 

Set the maximum lightmap dimensions.

Polys with lightmaps larger than this are not lit.

Implemented in csEngine.

virtual void iEngine::SetRenderPriorityCamera long    priority,
bool    do_camera
[pure virtual]
 

Set the render priority camera flag.

Implemented in csEngine.

virtual void iEngine::ShineLights iRegion   region = NULL,
iProgressMeter   meter = NULL
[pure virtual]
 

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.

Implemented in csEngine.

virtual void iEngine::WantToDie iMeshWrapper   mesh [pure virtual]
 

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.

Implemented in csEngine.


The documentation for this struct was generated from the following file:
Generated for Crystal Space by doxygen 1.2.14