![]() |
Public API Reference |
![]() |
This interface is the main interface to the 3D engine. More...
#include <iengine/engine.h>
Public Member Functions | |
virtual void | ClearRenderPriorities ()=0 |
Clear all render priorities. | |
virtual void | FireStartFrame (iRenderView *rview)=0 |
Fire all frame callbacks. | |
virtual CS::Graphics::RenderPriority | GetAlphaRenderPriority ()=0 |
Get the render priority for alpha objects (attached to 'alpha' name). | |
virtual CS::Graphics::RenderPriority | GetObjectRenderPriority ()=0 |
Get the render priority for general objects (attached to 'object' name). | |
virtual CS::Graphics::RenderPriority | GetPortalRenderPriority ()=0 |
Get the render priority for portal objects (attached to 'portal' name). | |
virtual size_t | GetRenderPriorityCount () const =0 |
Get the number of render priorities. | |
virtual const char * | GetRenderPriorityName (CS::Graphics::RenderPriority priority) const =0 |
Get the name of the render priority or 0 if it's not valid or registered. | |
virtual CS::Graphics::RenderPriority | GetSkyRenderPriority ()=0 |
Get the render priority for sky objects (attached to 'sky' name). | |
virtual CS::Graphics::RenderPriority | GetWallRenderPriority ()=0 |
Get the render priority for wall objects (attached to 'wall' name). | |
virtual iObject * | QueryObject ()=0 |
Get the iObject for the engine. | |
Preparation and relighting methods | |
virtual bool | Prepare (iProgressMeter *meter=0)=0 |
Prepare the engine. | |
virtual void | PrepareTextures ()=0 |
Prepare the textures. | |
virtual void | PrepareMeshes ()=0 |
Calls UpdateMove for all meshes to initialise bounding boxes. | |
virtual void | SetCacheManager (iCacheManager *cache_mgr)=0 |
Set the cache manager that the engine will use. | |
virtual void | SetVFSCacheManager (const char *vfspath=0)=0 |
Set the cache manager to the default VFS based cache manager. | |
virtual iCacheManager * | GetCacheManager ()=0 |
Get the cache manager that the engine is currently using. | |
Render priority functions | |
virtual void | RegisterRenderPriority (const char *name, uint priority, csRenderPrioritySorting rendsort=CS_RENDPRI_SORT_NONE, CS::RenderPriorityGrouping grouping=CS::rpgByLayer)=0 |
Register a new render priority. | |
virtual void | RegisterDefaultRenderPriorities ()=0 |
Register default render priorities. | |
virtual CS::Graphics::RenderPriority | GetRenderPriority (const char *name) const =0 |
Get a render priority by name. | |
virtual csRenderPrioritySorting | GetRenderPrioritySorting (const char *name) const =0 |
Get the render priority sorting flag. | |
virtual csRenderPrioritySorting | GetRenderPrioritySorting (CS::Graphics::RenderPriority priority) const =0 |
Get the render priority sorting flag. | |
virtual CS::RenderPriorityGrouping | GetRenderPriorityGrouping (const char *name) const =0 |
Get the render priority grouping flag. | |
virtual CS::RenderPriorityGrouping | GetRenderPriorityGrouping (CS::Graphics::RenderPriority priority) const =0 |
Register a new render priority. | |
Material handling | |
virtual csPtr< iMaterial > | CreateBaseMaterial (iTextureWrapper *txt)=0 |
Create a base material that can be used to give to the texture manager. | |
virtual iMaterialWrapper * | CreateMaterial (const char *name, iTextureWrapper *texture)=0 |
Register a material to be loaded during Prepare() | |
virtual iMaterialList * | GetMaterialList () const =0 |
Get the list of all materials. | |
virtual iMaterialWrapper * | FindMaterial (const char *name, iCollection *collection=0)=0 |
Find the given material. | |
Texture handling | |
virtual iTextureWrapper * | CreateTexture (const char *name, const char *fileName, csColor *transp, int flags)=0 |
Create a texture from a file. | |
virtual iTextureWrapper * | CreateBlackTexture (const char *name, int w, int h, csColor *transp, int flags)=0 |
Create a black texture. | |
virtual int | GetTextureFormat () const =0 |
Query the format to load textures (usually this depends on texture manager) | |
virtual iTextureList * | GetTextureList () const =0 |
Get the list of all textures. | |
virtual iTextureWrapper * | FindTexture (const char *name, iCollection *collection=0)=0 |
Find the given texture. | |
Light handling | |
virtual csPtr< iLight > | CreateLight (const char *name, const csVector3 &pos, float radius, const csColor &color, csLightDynamicType dyntype=CS_LIGHT_DYNAMICTYPE_STATIC)=0 |
Create a static/pseudo-dynamic light. | |
virtual iLight * | FindLight (const char *Name, bool RegionOnly=false) const =0 |
Find a static/pseudo-dynamic light by name. | |
virtual iLight * | FindLightID (const char *light_id) const =0 |
Find a static/pseudo-dynamic light by id. | |
virtual csPtr< iLightIterator > | GetLightIterator (iCollection *collection=0)=0 |
Create an iterator to iterate over all static lights of the engine. | |
virtual void | RemoveLight (iLight *light)=0 |
Remove a light and update all lightmaps. | |
virtual void | SetAmbientLight (const csColor &)=0 |
Set the amount of ambient light. | |
virtual void | GetAmbientLight (csColor &) const =0 |
Return the amount of ambient light. | |
virtual void | GetDefaultAmbientLight (csColor &c) const =0 |
Return the default amount of ambient light. | |
virtual int | GetNearbyLights (iSector *sector, const csVector3 &pos, iLight **lights, int max_num_lights)=0 |
This routine returns all lights which might affect an object at some position. | |
virtual int | GetNearbyLights (iSector *sector, const csBox3 &box, iLight **lights, int max_num_lights)=0 |
This routine returns all lights which might affect an object with some bounding box. | |
Sector handling | |
virtual iSector * | CreateSector (const char *name, bool addToList=true)=0 |
Create a empty sector with given name. | |
virtual iSectorList * | GetSectors ()=0 |
Get the list of sectors. | |
virtual iSector * | FindSector (const char *name, iCollection *collection=0)=0 |
Find the given sector. | |
virtual csPtr< iSectorIterator > | GetNearbySectors (iSector *sector, const csVector3 &pos, float radius)=0 |
This routine returns an iterator to iterate over all nearby sectors. | |
virtual csPtr< iSectorIterator > | GetNearbySectors (iSector *sector, const csBox3 &box)=0 |
This routine returns an iterator to iterate over all nearby sectors. | |
virtual void | AddEngineFrameCallback (iEngineFrameCallback *cb)=0 |
Add a frame callback. | |
virtual void | RemoveEngineFrameCallback (iEngineFrameCallback *cb)=0 |
Remove a frame callback. | |
virtual void | AddEngineSectorCallback (iEngineSectorCallback *cb)=0 |
Add a sector callback. | |
virtual void | RemoveEngineSectorCallback (iEngineSectorCallback *cb)=0 |
Remove a sector callback. | |
Mesh handling | |
virtual csPtr< iMeshWrapper > | CreateMeshWrapper (iMeshFactoryWrapper *factory, const char *name, iSector *sector=0, const csVector3 &pos=csVector3(0, 0, 0), bool addToList=true)=0 |
Convenience function to create a mesh object for a given factory. | |
virtual csPtr< iMeshWrapper > | CreateMeshWrapper (iMeshObject *meshobj, const char *name, iSector *sector=0, const csVector3 &pos=csVector3(0, 0, 0), bool addToList=true)=0 |
Create a mesh wrapper for an existing mesh object. | |
virtual csPtr< iMeshWrapper > | CreateMeshWrapper (const char *classid, const char *name, iSector *sector=0, const csVector3 &pos=csVector3(0, 0, 0), bool addToList=true)=0 |
Create a mesh wrapper from a class id. | |
virtual csPtr< iMeshWrapper > | CreateMeshWrapper (const char *name, bool addToList=true)=0 |
Create an uninitialized mesh wrapper Assign to a csRef. | |
virtual csPtr< iMeshWrapper > | LoadMeshWrapper (const char *name, const char *loaderClassId, iDataBuffer *input, iSector *sector, const csVector3 &pos)=0 |
Convenience function to load a mesh object from a given loader plugin. | |
THREADED_INTERFACE1 (AddMeshAndChildren, iMeshWrapper *mesh) | |
Convenience function to add a mesh and all children of that mesh to the engine. | |
virtual csPtr < iMeshWrapperIterator > | GetNearbyMeshes (iSector *sector, const csVector3 &pos, float radius, bool crossPortals=true)=0 |
This routine returns an iterator to iterate over all meshes that are within a radius of a given position. | |
virtual csPtr < iMeshWrapperIterator > | GetNearbyMeshes (iSector *sector, const csBox3 &box, bool crossPortals=true)=0 |
This routine returns an iterator to iterate over all meshes that are in a box. | |
virtual csPtr < iMeshWrapperIterator > | GetNearbyMeshes (iSector *sector, const csVector3 &start, const csVector3 &end, bool crossPortals=true)=0 |
This routine returns an iterator to iterate over all meshes that intersect with a beam. | |
virtual iMeshList * | GetMeshes ()=0 |
Get the list of meshes. | |
virtual iMeshWrapper * | FindMeshObject (const char *name, iCollection *collection=0)=0 |
Find the given mesh object. | |
virtual void | WantToDie (iMeshWrapper *mesh)=0 |
Sometimes a mesh wants to destruct itself (for example a particle system that has only limited lifetime). | |
Mesh factory handling | |
virtual csPtr < iMeshFactoryWrapper > | CreateMeshFactory (const char *classId, const char *name, bool addToList=true)=0 |
Convenience function to create a mesh factory from a given type. | |
virtual csPtr < iMeshFactoryWrapper > | CreateMeshFactory (iMeshObjectFactory *factory, const char *name, bool addToList=true)=0 |
Create a mesh factory wrapper for an existing mesh factory Assign to a csRef. | |
virtual csPtr < iMeshFactoryWrapper > | CreateMeshFactory (const char *name, bool addToList=true)=0 |
Create an uninitialized mesh factory wrapper Assign to a csRef. | |
virtual csPtr < iMeshFactoryWrapper > | LoadMeshFactory (const char *name, const char *loaderClassId, iDataBuffer *input, bool addToList=true)=0 |
Convenience function to load a mesh factory from a given loader plugin. | |
virtual iMeshFactoryWrapper * | FindMeshFactory (const char *name, iCollection *collection=0)=0 |
Find the given mesh factory. | |
virtual iMeshFactoryList * | GetMeshFactories ()=0 |
Get the list of mesh factories. | |
Collection handling | |
virtual iCollection * | CreateCollection (const char *name)=0 |
Create a new collection with the given name. | |
virtual iCollection * | GetCollection (const char *name) const =0 |
Get the collection of the given name. | |
virtual csPtr< iCollectionArray > | GetCollections ()=0 |
Return all collections created. | |
virtual void | RemoveCollection (iCollection *collect)=0 |
Remove the given collection from the list of collections. | |
virtual void | RemoveCollection (const char *name)=0 |
Remove the collection of the given name. | |
virtual void | RemoveAllCollections ()=0 |
Remove all the collections. | |
Camera handling | |
virtual csPtr< iCamera > | CreateCamera ()=0 |
Create a new camera. | |
virtual iCameraPosition * | FindCameraPosition (const char *name, iCollection *collection=0)=0 |
Find the given camera position. | |
virtual iCameraPositionList * | GetCameraPositions ()=0 |
Get the list of camera positions. | |
virtual csPtr< iPerspectiveCamera > | CreatePerspectiveCamera ()=0 |
Create a new perspective projection camera. | |
virtual csPtr < iCustomMatrixCamera > | CreateCustomMatrixCamera (iCamera *copyFrom=0)=0 |
Create a new custom projection camera. | |
Portal handling | |
virtual csPtr< iMeshWrapper > | CreatePortal (const char *name, iMeshWrapper *parentMesh, iSector *destSector, csVector3 *vertices, int num_vertices, iPortal *&portal)=0 |
Convenience function to create a portal from one sector to another and make this portal a child mesh of another mesh. | |
virtual csPtr< iMeshWrapper > | CreatePortal (const char *name, iSector *sourceSector, const csVector3 &pos, iSector *destSector, csVector3 *vertices, int num_vertices, iPortal *&portal)=0 |
Convenience function to create a portal from one sector to another. | |
virtual csPtr< iMeshWrapper > | CreatePortalContainer (const char *name, iSector *sector=0, const csVector3 &pos=csVector3(0, 0, 0))=0 |
Create an empty portal container in some sector. | |
Drawing related | |
virtual void | SetClearZBuf (bool yesno)=0 |
Require that the Z-buffer is cleared every frame. | |
virtual bool | GetClearZBuf () const =0 |
Get the value of the clear Z-buffer flag set with SetClearZBuf(). | |
virtual bool | GetDefaultClearZBuf () const =0 |
Get default clear z-buffer flag. | |
virtual void | SetClearScreen (bool yesno)=0 |
Require that the screen is cleared every frame. | |
virtual bool | GetClearScreen () const =0 |
Get the value of the clear screen flag set with SetClearScreen(). | |
virtual bool | GetDefaultClearScreen () const =0 |
Get default clear screen flag. | |
virtual int | GetBeginDrawFlags () const =0 |
Get the required flags for 3D->BeginDraw() which should be called from the application. | |
virtual iRenderView * | GetTopLevelClipper () const =0 |
Get the top-level clipper. | |
virtual void | PrecacheMesh (iMeshWrapper *s)=0 |
Precache a single mesh. | |
virtual void | PrecacheDraw (iCollection *collection=0)=0 |
This function precaches all meshes by calling GetRenderMeshes() on them. | |
virtual void | Draw (iCamera *c, iClipper2D *clipper, iMeshWrapper *mesh=0)=0 |
Draw the 3D world given a camera and a clipper. | |
virtual void | SetContext (iTextureHandle *ctxt)=0 |
Set the drawing context. | |
virtual iTextureHandle * | GetContext () const =0 |
Return the current drawing context. | |
virtual iRenderLoopManager * | GetRenderLoopManager ()=0 |
Retrieve the render loop manager. | |
virtual iRenderLoop * | GetCurrentDefaultRenderloop ()=0 |
Returns the current render loop. | |
virtual bool | SetCurrentDefaultRenderloop (iRenderLoop *loop)=0 |
Set the current render loop. | |
virtual uint | GetCurrentFrameNumber () const =0 |
Get the current framenumber. | |
virtual void | UpdateNewFrame ()=0 |
Update the engine and animations etc for a new frame. | |
Adaptive progressive LODs | |
virtual void | EnableAdaptiveLODs (bool enable, float target_fps)=0 |
Enable adaptive LODs. | |
virtual void | UpdateAdaptiveLODs ()=0 |
Must be called once per frame if you use adaptive LODs. | |
virtual float | GetAdaptiveLODsMultiplier () const =0 |
Get a multiplier based on the average elapsed time for the last n frames. | |
Saving/loading | |
virtual void | SetSaveableFlag (bool enable)=0 |
Set whether saving should be possible (default OFF). | |
virtual bool | GetSaveableFlag ()=0 |
Get whether saving should be possible (default OFF). | |
virtual csPtr< iLoaderContext > | CreateLoaderContext (iCollection *collection=0, bool searchCollectionOnly=true)=0 |
Create a loader context that you can give to loader plugins. | |
virtual void | SetDefaultKeepImage (bool enable)=0 |
Set the default value for the "keep image" flag of texture wrappers. | |
virtual bool | GetDefaultKeepImage ()=0 |
Get the default value for the "keep image" flag of texture wrappers (default OFF). | |
Other | |
virtual csPtr< iObjectIterator > | GetNearbyObjects (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. | |
virtual csPtr< iObjectIterator > | GetVisibleObjects (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. | |
virtual csPtr < iMeshWrapperIterator > | GetVisibleMeshes (iSector *sector, const csVector3 &pos)=0 |
This routine returns an iterator to iterate over all meshes that are potentially visible as seen from a given position. | |
virtual csPtr< iObjectIterator > | GetVisibleObjects (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. | |
virtual csPtr < iMeshWrapperIterator > | GetVisibleMeshes (iSector *sector, const csFrustum &frustum)=0 |
This routine returns an iterator to iterate over all meshes that are potentially visible as seen from a given position. | |
virtual csPtr< iObjectWatcher > | CreateObjectWatcher ()=0 |
Create an object watcher instance that you can use to watch other objects. | |
virtual iSharedVariableList * | GetVariableList () const =0 |
Get the list of all shared variables. | |
virtual bool | RemoveObject (iBase *object)=0 |
Convenience function to 'remove' a CS object from the engine. | |
virtual void | DelayedRemoveObject (csTicks delay, iBase *object)=0 |
This function can be used to remove an object after a specific amount of time. | |
virtual void | RemoveDelayedRemoves (bool remove=false)=0 |
Clear all delayed removals. | |
THREADED_INTERFACE (DeleteAll) | |
Delete everything in the engine. | |
virtual void | ResetWorldSpecificSettings ()=0 |
Reset a subset of flags/settings (which may differ from one world/map to another) to its defaults. | |
Render manager | |
virtual iRenderManager * | GetRenderManager ()=0 |
Get the default render manager. | |
virtual void | SetRenderManager (iRenderManager *)=0 |
Set the default render manager. | |
virtual void | ReloadRenderManager ()=0 |
Reload the default render manager given the current configuration settings. | |
THREADED_INTERFACE1 (SyncEngineLists, csRef< iThreadedLoader > loader) | |
Loader List Sync. | |
virtual void | SyncEngineListsNow (csRef< iThreadedLoader > loader)=0 |
Loader List Sync. | |
Camera default properties | |
virtual float | GetDefaultNearClipDistance () const =0 |
Retrieve default near plane clipping distance for perspective cameras. | |
virtual void | SetDefaultNearClipDistance (float dist)=0 |
Set default near plane clipping distance for perspective cameras. |
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.
Main creators of instances implementing this interface:
Main ways to get pointers to this interface:
Main users of this interface:
virtual void iEngine::AddEngineFrameCallback | ( | iEngineFrameCallback * | cb | ) | [pure virtual] |
virtual void iEngine::AddEngineSectorCallback | ( | iEngineSectorCallback * | cb | ) | [pure virtual] |
virtual void iEngine::ClearRenderPriorities | ( | ) | [pure virtual] |
Clear all render priorities.
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.
txt | The texture map this material will use. Note that this can be 0 in which case a base material without texture will be created. |
virtual iTextureWrapper* iEngine::CreateBlackTexture | ( | const char * | name, |
int | w, | ||
int | h, | ||
csColor * | transp, | ||
int | flags | ||
) | [pure virtual] |
Create a black texture.
This is mostly useful for procedural textures.
name | The name to use for this texture in the engine |
w | the texture width (must be a power of 2, eg 64, 128, 256, 512...) |
h | the texture height (must be a power of 2, eg 64, 128, 256, 512...) |
transp | pixels in the image with this key color will be considered transparent instead of being drawn |
flags | see CreateTexture() |
virtual csPtr<iCamera> iEngine::CreateCamera | ( | ) | [pure virtual] |
Create a new camera.
Assign to a csRef.
virtual iCollection* iEngine::CreateCollection | ( | const char * | name | ) | [pure virtual] |
Create a new collection with the given name.
virtual csPtr<iCustomMatrixCamera> iEngine::CreateCustomMatrixCamera | ( | iCamera * | copyFrom = 0 | ) | [pure virtual] |
Create a new custom projection camera.
copyFrom | If given, the new camera's initial tranform, settings and projection matrix are copied from that camera. |
virtual csPtr<iLight> iEngine::CreateLight | ( | const char * | name, |
const csVector3 & | pos, | ||
float | radius, | ||
const csColor & | color, | ||
csLightDynamicType | dyntype = CS_LIGHT_DYNAMICTYPE_STATIC |
||
) | [pure virtual] |
Create a static/pseudo-dynamic light.
Assign to a csRef.
name | the engine name for this light (may be 0) |
pos | the position of this light in world coordinates |
radius | the maximum distance at which this light will affect objects |
color | the color of this light (also affects light intensity) |
dyntype | is the type of the light. This can be CS_LIGHT_DYNAMICTYPE_DYNAMIC, CS_LIGHT_DYNAMICTYPE_PSEUDO, or CS_LIGHT_DYNAMICTYPE_STATIC. Note that after creating a light you must add it to a sector by calling sector->GetLights ()->Add (light); If the light is dynamic you also must call Setup() to calculate lighting. Otherwise you must use engine->ForceRelight() if you create a light after calling engine->Prepare(). Otherwise you can let engine->Prepare() do it. |
Note! If you are using a system with hardware accelerated lighting (i.e. no lightmaps) then the discussion above is not relevant.
virtual csPtr<iLoaderContext> iEngine::CreateLoaderContext | ( | iCollection * | collection = 0 , |
bool | searchCollectionOnly = true |
||
) | [pure virtual] |
Create a loader context that you can give to loader plugins.
It will basically allow loader plugins to find materials.
collection | optional loader collection |
searchCollectionOnly | if collection is valid and searchCollectionOnly is true then only that collection will be searched. Assign to a csRef. |
virtual iMaterialWrapper* iEngine::CreateMaterial | ( | const char * | name, |
iTextureWrapper * | texture | ||
) | [pure virtual] |
Register a material to be loaded during Prepare()
name | engine name for this material |
texture | texture to use for this material |
virtual csPtr<iMeshFactoryWrapper> iEngine::CreateMeshFactory | ( | const char * | classId, |
const char * | name, | ||
bool | addToList = true |
||
) | [pure virtual] |
Convenience function to create a mesh factory from a given type.
classId | the SCF name of the plugin (like 'crystalspace.mesh.object.ball'). The type plugin will only be loaded if needed. |
name | 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 0 then no name will be set and no check will happen if the factory already exists. |
virtual csPtr<iMeshFactoryWrapper> iEngine::CreateMeshFactory | ( | iMeshObjectFactory * | factory, |
const char * | name, | ||
bool | addToList = true |
||
) | [pure virtual] |
Create a mesh factory wrapper for an existing mesh factory Assign to a csRef.
factory | the mesh factory to be wrapped, the engine doesn't "know" about a mesh factory until associated with a FactoryWrapper |
name | the engine name for the factory wrapper |
virtual csPtr<iMeshFactoryWrapper> iEngine::CreateMeshFactory | ( | const char * | name, |
bool | addToList = true |
||
) | [pure virtual] |
Create an uninitialized mesh factory wrapper Assign to a csRef.
name | the engine name for the factory wrapper |
virtual csPtr<iMeshWrapper> iEngine::CreateMeshWrapper | ( | iMeshFactoryWrapper * | factory, |
const char * | name, | ||
iSector * | sector = 0 , |
||
const csVector3 & | pos = csVector3(0, 0, 0) , |
||
bool | addToList = true |
||
) | [pure virtual] |
Convenience function to create a mesh object for a given factory.
factory | the factory that will produce this mesh |
name | The engine name for the mesh wrapper; may be null. Different mesh objects can have the same name (in contrast with factory objects). |
sector | the sector to initially place this mesh in If 'sector' is 0 then the mesh object will not be set to a position. |
pos | the position in the sector |
virtual csPtr<iMeshWrapper> iEngine::CreateMeshWrapper | ( | iMeshObject * | meshobj, |
const char * | name, | ||
iSector * | sector = 0 , |
||
const csVector3 & | pos = csVector3(0, 0, 0) , |
||
bool | addToList = true |
||
) | [pure virtual] |
Create a mesh wrapper for an existing mesh object.
meshobj | the mesh object |
name | The engine name for the mesh wrapper; may be null. Different mesh objects can have the same name (in contrast with factory objects). |
sector | the sector to initially place this mesh in If 'sector' is 0 then the mesh object will not be set to a position. |
pos | the position in the sector |
virtual csPtr<iMeshWrapper> iEngine::CreateMeshWrapper | ( | const char * | classid, |
const char * | name, | ||
iSector * | sector = 0 , |
||
const csVector3 & | pos = csVector3(0, 0, 0) , |
||
bool | addToList = true |
||
) | [pure virtual] |
Create a mesh wrapper from a class id.
This function will first make a factory from the plugin and then see if that factory itself implements iMeshObject too. If that fails this function will call NewInstance() on the factory and return that object then.
classid | The SCF name of the plugin (like 'crystalspace.mesh.object.ball'). The type plugin will only be loaded if needed. |
name | The engine name for the mesh wrapper; may be null. Different mesh objects can have the same name (in contrast with factory objects). |
sector | the sector to initially place this mesh in If 'sector' is 0 then the mesh object will not be set to a position. |
pos | the position in the sector |
virtual csPtr<iMeshWrapper> iEngine::CreateMeshWrapper | ( | const char * | name, |
bool | addToList = true |
||
) | [pure virtual] |
Create an uninitialized mesh wrapper Assign to a csRef.
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.
virtual csPtr<iPerspectiveCamera> iEngine::CreatePerspectiveCamera | ( | ) | [pure virtual] |
Create a new perspective projection camera.
virtual csPtr<iMeshWrapper> iEngine::CreatePortal | ( | const char * | name, |
iMeshWrapper * | parentMesh, | ||
iSector * | destSector, | ||
csVector3 * | vertices, | ||
int | num_vertices, | ||
iPortal *& | portal | ||
) | [pure virtual] |
Convenience function to create a portal from one sector to another and make this portal a child mesh of another mesh.
Use scfQueryInterface< iPortalContainer> on the returned mesh for more control over the portal(s) in the portal object.
name | is the name of the portal container mesh to create the portal in. If the parentMesh already has a mesh with that name then that will be used. If there is already a mesh with that name but it is not a portal container then a new mesh will be created. |
parentMesh | is the mesh where the portal container will be placed as a child. |
destSector | is the sector where the single portal that is created inside the portal object will point too. |
vertices | list of vertices comprising the portal. |
num_vertices | number of elements in 'vertices'. |
portal | is a return value for the created portal. |
virtual csPtr<iMeshWrapper> iEngine::CreatePortal | ( | const char * | name, |
iSector * | sourceSector, | ||
const csVector3 & | pos, | ||
iSector * | destSector, | ||
csVector3 * | vertices, | ||
int | num_vertices, | ||
iPortal *& | portal | ||
) | [pure virtual] |
Convenience function to create a portal from one sector to another.
Use scfQueryInterface<iPortalContainer> on the returned mesh for more control over the portal(s) in the portal object.
name | is the name of the portal container mesh to create the portal in. If the sourceSector already has a mesh with that name then that will be used. If there is already a mesh with that name but it is not a portal container then a new mesh will be created. |
sourceSector | is the sector where the portal container will be placed. |
pos | the position inside that sector. |
destSector | the sector where the single portal that is created inside the portal object will point too. |
vertices | list of vertices comprising the portal. |
num_vertices | number of elements in 'vertices'. |
portal | return value for the created portal. |
virtual csPtr<iMeshWrapper> iEngine::CreatePortalContainer | ( | const char * | name, |
iSector * | sector = 0 , |
||
const csVector3 & | pos = csVector3(0, 0, 0) |
||
) | [pure virtual] |
Create an empty portal container in some sector.
Use this portal container to create portals to other sectors. Use scfQueryInterface< iPortalContainer> on the mesh object inside the returned mesh to control the portals.
name | of the portal mesh. |
sector | is the location of the portal object and not the sector the portals will point too. If not given then the portal container is not put in any mesh. |
pos | is an optional position inside the sector (if given). |
virtual iSector* iEngine::CreateSector | ( | const char * | name, |
bool | addToList = true |
||
) | [pure virtual] |
Create a empty sector with given name.
name | the sector name |
virtual iTextureWrapper* iEngine::CreateTexture | ( | const char * | name, |
const char * | fileName, | ||
csColor * | transp, | ||
int | flags | ||
) | [pure virtual] |
Create a texture from a file.
name | The name to use for this texture in the engine |
fileName | the filename (on the VFS!) of the texture to load |
transp | pixels in the image with this key color will be considered transparent instead of being drawn |
flags | One or more texturing flags OR'd together, flag include
|
virtual void iEngine::DelayedRemoveObject | ( | csTicks | delay, |
iBase * | object | ||
) | [pure virtual] |
This function can be used to remove an object after a specific amount of time.
This is mostly useful for particle systems (like explosions) that you want to live for a specific time before they are automatically cleaned up by the engine. Note that calling this function will cause the engine to keep an additional reference until it is time to delete the object.
virtual void iEngine::Draw | ( | iCamera * | c, |
iClipper2D * | clipper, | ||
iMeshWrapper * | mesh = 0 |
||
) | [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.
If a mesh is given then only that single mesh is rendered. Note that in that case the mesh will only be rendered if it is in the same sector as the camera!
virtual void iEngine::EnableAdaptiveLODs | ( | bool | enable, |
float | target_fps | ||
) | [pure virtual] |
Enable adaptive LODs.
virtual iCameraPosition* iEngine::FindCameraPosition | ( | const char * | name, |
iCollection * | collection = 0 |
||
) | [pure virtual] |
Find the given camera position.
The name can be a normal name. In that case this function will look in all collection except if collection is not 0 in which case it will only look in that collection. If the name is specified as 'collectionname/objectname' then this function will only look in the specified collection and return 0 if that collection doesn't contain the object or the collection doesn't exist. In this case the collection parameter is ignored.
name | the engine name of the desired camera position |
collection | if specified, search only this collection (also see note above) |
virtual iLight* iEngine::FindLight | ( | const char * | Name, |
bool | RegionOnly = false |
||
) | const [pure virtual] |
Find a static/pseudo-dynamic light by name.
Name | the engine name of the desired light |
RegionOnly | (parameter presently unused) |
virtual iLight* iEngine::FindLightID | ( | const char * | light_id | ) | const [pure virtual] |
Find a static/pseudo-dynamic light by id.
light_id | a 16-byte MD5 checksum for the light. |
virtual iMaterialWrapper* iEngine::FindMaterial | ( | const char * | name, |
iCollection * | collection = 0 |
||
) | [pure virtual] |
Find the given material.
The name can be a normal name. In that case this function will look in all collection except if collection is not 0 in which case it will only look in that collection. If the name is specified as 'collectionname/objectname' then this function will only look in the specified collection and return 0 if that collection doesn't contain the object or the collection doesn't exist. In this case the collection parameter is ignored.
name | the engine name of the desired material |
collection | if specified, search only this collection (also see note above) |
virtual iMeshFactoryWrapper* iEngine::FindMeshFactory | ( | const char * | name, |
iCollection * | collection = 0 |
||
) | [pure virtual] |
Find the given mesh factory.
The name can be a normal name. In that case this function will look in all collections except if collection is not 0 in which case it will only look in that collection. If the name is specified as 'collectionname/objectname' then this function will only look in the specified collection and return 0 if that collection doesn't contain the object or the collection doesn't exist. In this case the collection parameter is ignored.
name | the engine name of the desired mesh factory |
collection | if specified, search only this collection (also see note above) |
virtual iMeshWrapper* iEngine::FindMeshObject | ( | const char * | name, |
iCollection * | collection = 0 |
||
) | [pure virtual] |
Find the given mesh object.
The name can be a normal name. In that case this function will look in all collections except if collection is not 0 in which case it will only look in that collection. If the name is specified as 'collectionname/objectname' then this function will only look in the specified collection and return 0 if that collection doesn't contain the object or the collection doesn't exist. In this case the collection parameter is ignored.
name | the engine name of the desired mesh |
collection | if specified, search only this collection (also see note above) |
virtual iSector* iEngine::FindSector | ( | const char * | name, |
iCollection * | collection = 0 |
||
) | [pure virtual] |
Find the given sector.
The name can be a normal name. In that case this function will look in all collection except if collection is not 0 in which case it will only look in that collection. If the name is specified as 'collectionname/objectname' then this function will only look in the specified region and return 0 if that region doesn't contain the object or the collection doesn't exist. In this case the collection parameter is ignored.
name | the engine name of the desired sector |
collection | if specified, search only this collection (also see note above) |
virtual iTextureWrapper* iEngine::FindTexture | ( | const char * | name, |
iCollection * | collection = 0 |
||
) | [pure virtual] |
Find the given texture.
The name can be a normal name. In that case this function will look in all collections except if collection is not 0 in which case it will only look in that collection. If the name is specified as 'collectionname/objectname' then this function will only look in the specified collection and return 0 if that collection doesn't contain the object or the collection doesn't exist. In this case the collection parameter is ignored.
name | the engine name of the desired texture |
collection | if specified, search only this collection (also see note above) |
virtual void iEngine::FireStartFrame | ( | iRenderView * | rview | ) | [pure virtual] |
Fire all frame callbacks.
virtual float iEngine::GetAdaptiveLODsMultiplier | ( | ) | const [pure virtual] |
Get a multiplier based on the average elapsed time for the last n frames.
virtual CS::Graphics::RenderPriority iEngine::GetAlphaRenderPriority | ( | ) | [pure virtual] |
Get the render priority for alpha objects (attached to 'alpha' name).
virtual void iEngine::GetAmbientLight | ( | csColor & | ) | const [pure virtual] |
Return the amount of ambient light.
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.
virtual iCacheManager* iEngine::GetCacheManager | ( | ) | [pure virtual] |
Get the cache manager that the engine is currently using.
virtual iCameraPositionList* iEngine::GetCameraPositions | ( | ) | [pure virtual] |
Get the list of camera positions.
virtual bool iEngine::GetClearScreen | ( | ) | const [pure virtual] |
Get the value of the clear screen flag set with SetClearScreen().
virtual bool iEngine::GetClearZBuf | ( | ) | const [pure virtual] |
Get the value of the clear Z-buffer flag set with SetClearZBuf().
virtual iCollection* iEngine::GetCollection | ( | const char * | name | ) | const [pure virtual] |
Get the collection of the given name.
virtual csPtr<iCollectionArray> iEngine::GetCollections | ( | ) | [pure virtual] |
Return all collections created.
virtual iTextureHandle* iEngine::GetContext | ( | ) | const [pure virtual] |
Return the current drawing context.
virtual iRenderLoop* iEngine::GetCurrentDefaultRenderloop | ( | ) | [pure virtual] |
Returns the current render loop.
virtual uint iEngine::GetCurrentFrameNumber | ( | ) | const [pure virtual] |
Get the current framenumber.
This should be incremented once every Draw
virtual void iEngine::GetDefaultAmbientLight | ( | csColor & | c | ) | const [pure virtual] |
Return the default amount of ambient light.
virtual bool iEngine::GetDefaultClearScreen | ( | ) | const [pure virtual] |
Get default clear screen flag.
virtual bool iEngine::GetDefaultClearZBuf | ( | ) | const [pure virtual] |
Get default clear z-buffer flag.
virtual bool iEngine::GetDefaultKeepImage | ( | ) | [pure virtual] |
Get the default value for the "keep image" flag of texture wrappers (default OFF).
virtual float iEngine::GetDefaultNearClipDistance | ( | ) | const [pure virtual] |
Retrieve default near plane clipping distance for perspective cameras.
virtual csPtr<iLightIterator> iEngine::GetLightIterator | ( | iCollection * | collection = 0 | ) | [pure virtual] |
Create an iterator to iterate over all static lights of the engine.
Assign to a csRef.
collection | only iterate over the lights in this collection (otherwise iterate over all lights) |
virtual iMaterialList* iEngine::GetMaterialList | ( | ) | const [pure virtual] |
Get the list of all materials.
virtual iMeshList* iEngine::GetMeshes | ( | ) | [pure virtual] |
Get the list of meshes.
virtual iMeshFactoryList* iEngine::GetMeshFactories | ( | ) | [pure virtual] |
Get the list of mesh factories.
virtual int iEngine::GetNearbyLights | ( | iSector * | sector, |
const csVector3 & | pos, | ||
iLight ** | lights, | ||
int | max_num_lights | ||
) | [pure virtual] |
This routine returns all lights which might affect an object at some position.
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.
virtual int iEngine::GetNearbyLights | ( | iSector * | sector, |
const csBox3 & | box, | ||
iLight ** | lights, | ||
int | max_num_lights | ||
) | [pure virtual] |
This routine returns all lights which might affect an object with some bounding box.
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.
virtual csPtr<iMeshWrapperIterator> iEngine::GetNearbyMeshes | ( | iSector * | sector, |
const csVector3 & | pos, | ||
float | radius, | ||
bool | crossPortals = true |
||
) | [pure virtual] |
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.
virtual csPtr<iMeshWrapperIterator> iEngine::GetNearbyMeshes | ( | iSector * | sector, |
const csBox3 & | box, | ||
bool | crossPortals = true |
||
) | [pure virtual] |
This routine returns an iterator to iterate over all meshes that are in a box.
If crossPortals is true it will search through portals. Otherwise it will limit the search to the sector passed in. Portal visibility is tested with the center of the box.
virtual csPtr<iMeshWrapperIterator> iEngine::GetNearbyMeshes | ( | iSector * | sector, |
const csVector3 & | start, | ||
const csVector3 & | end, | ||
bool | crossPortals = true |
||
) | [pure virtual] |
This routine returns an iterator to iterate over all meshes that intersect with a beam.
If crossPortals is true it will search through portals. Otherwise it will limit the search to the sector passed in. Portal visibility is tested fromt the start of the beam.
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.
The current implementation only does meshes but in future lights will also be supported. You can use scfQueryInterface 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 scfQueryInterface.
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. In the iterator you can also fetch the position for every sector. Normally that position will be equal to the given input position here (pos) but if there are space warping portals involved then the position returned by the iterator is the warped position relative to the sector returned by the iterator.
virtual csPtr<iSectorIterator> iEngine::GetNearbySectors | ( | iSector * | sector, |
const csBox3 & | box | ||
) | [pure virtual] |
This routine returns an iterator to iterate over all nearby sectors.
Assign to a csRef. In the iterator you can also fetch the position for every sector. Normally that position will be equal to the given input position here (pos) but if there are space warping portals involved then the position returned by the iterator is the warped position relative to the sector returned by the iterator.
virtual CS::Graphics::RenderPriority iEngine::GetObjectRenderPriority | ( | ) | [pure virtual] |
Get the render priority for general objects (attached to 'object' name).
virtual CS::Graphics::RenderPriority iEngine::GetPortalRenderPriority | ( | ) | [pure virtual] |
Get the render priority for portal objects (attached to 'portal' name).
virtual iRenderLoopManager* iEngine::GetRenderLoopManager | ( | ) | [pure virtual] |
Retrieve the render loop manager.
virtual iRenderManager* iEngine::GetRenderManager | ( | ) | [pure virtual] |
Get the default render manager.
virtual CS::Graphics::RenderPriority iEngine::GetRenderPriority | ( | const char * | name | ) | const [pure virtual] |
Get a render priority by name.
name | is the name you want (one of the standard names or your own if you have defined your own render priorities). |
virtual size_t iEngine::GetRenderPriorityCount | ( | ) | const [pure virtual] |
Get the number of render priorities.
virtual CS::RenderPriorityGrouping iEngine::GetRenderPriorityGrouping | ( | const char * | name | ) | const [pure virtual] |
Get the render priority grouping flag.
virtual CS::RenderPriorityGrouping iEngine::GetRenderPriorityGrouping | ( | CS::Graphics::RenderPriority | priority | ) | const [pure virtual] |
Register a new render priority.
Render priorities are assigned to objects and controls the order in which objects are rendered by the engine.
name | a name to refer to this render priority |
priority | a numerical priority; this is used to order the render priorities where lower numbers are rendered before higher numbers. |
rendsort | One of the CS_RENDPRI_... flags. By default this is CS_RENDPRI_SORT_NONE. The following values are possible:
|
Priorities are identified by their number, not their name: If you call RegisterRenderPriority() twice, with the same priority number, but different names, the second call will change the name.
virtual const char* iEngine::GetRenderPriorityName | ( | CS::Graphics::RenderPriority | priority | ) | const [pure virtual] |
Get the name of the render priority or 0 if it's not valid or registered.
virtual csRenderPrioritySorting iEngine::GetRenderPrioritySorting | ( | const char * | name | ) | const [pure virtual] |
Get the render priority sorting flag.
virtual csRenderPrioritySorting iEngine::GetRenderPrioritySorting | ( | CS::Graphics::RenderPriority | priority | ) | const [pure virtual] |
Get the render priority sorting flag.
virtual bool iEngine::GetSaveableFlag | ( | ) | [pure virtual] |
Get whether saving should be possible (default OFF).
virtual iSectorList* iEngine::GetSectors | ( | ) | [pure virtual] |
Get the list of sectors.
virtual CS::Graphics::RenderPriority iEngine::GetSkyRenderPriority | ( | ) | [pure virtual] |
Get the render priority for sky objects (attached to 'sky' name).
virtual int iEngine::GetTextureFormat | ( | ) | const [pure virtual] |
Query the format to load textures (usually this depends on texture manager)
virtual iTextureList* iEngine::GetTextureList | ( | ) | const [pure virtual] |
Get the list of all textures.
virtual iRenderView* iEngine::GetTopLevelClipper | ( | ) | const [pure virtual] |
Get the top-level clipper.
virtual iSharedVariableList* iEngine::GetVariableList | ( | ) | const [pure virtual] |
Get the list of all shared variables.
virtual csPtr<iMeshWrapperIterator> iEngine::GetVisibleMeshes | ( | iSector * | sector, |
const csVector3 & | pos | ||
) | [pure virtual] |
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!
virtual csPtr<iMeshWrapperIterator> iEngine::GetVisibleMeshes | ( | iSector * | sector, |
const csFrustum & | frustum | ||
) | [pure virtual] |
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!
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 scfQueryInterface to get any interface from the returned objects.
If you only want meshes then use GetVisibleMeshes(). CURRENTLY NOT IMPLEMENTED!
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 scfQueryInterface to get any interface from the returned objects.
If you only want meshes then use GetVisibleMeshes(). CURRENTLY NOT IMPLEMENTED!
virtual CS::Graphics::RenderPriority iEngine::GetWallRenderPriority | ( | ) | [pure virtual] |
Get the render priority for wall objects (attached to 'wall' name).
virtual csPtr<iMeshFactoryWrapper> iEngine::LoadMeshFactory | ( | const char * | name, |
const char * | loaderClassId, | ||
iDataBuffer * | input, | ||
bool | addToList = true |
||
) | [pure virtual] |
Convenience function to load a mesh factory from a given loader plugin.
name | engine name for the mesh factory |
loaderClassId | the SCF class name of the desired mesh factory plugin |
input | data to initialize the mesh factory (plugin-specific) Assign to a csRef. |
virtual csPtr<iMeshWrapper> iEngine::LoadMeshWrapper | ( | const char * | name, |
const char * | loaderClassId, | ||
iDataBuffer * | input, | ||
iSector * | sector, | ||
const csVector3 & | pos | ||
) | [pure virtual] |
Convenience function to load a mesh object from a given loader plugin.
name | The engine name for the mesh wrapper; may be null. Different mesh objects can have the same name (in contrast with factory objects). |
loaderClassId | the SCF class of the loader to use to create the meshwrapper |
input | data passed to the loader to generate the mesh |
sector | the sector to initially place this mesh in If 'sector' is 0 then the mesh object will not be set to a position. |
pos | the position in the sector |
virtual void iEngine::PrecacheDraw | ( | iCollection * | collection = 0 | ) | [pure virtual] |
This function precaches all meshes by calling GetRenderMeshes() on them.
By doing this the level will run smoother if you walk through it because all meshes will have had a chance to update caches and stuff.
collection | is an optional collection. If given then only objects in that collection will be precached. |
virtual void iEngine::PrecacheMesh | ( | iMeshWrapper * | s | ) | [pure virtual] |
Precache a single mesh.
virtual bool iEngine::Prepare | ( | iProgressMeter * | meter = 0 | ) | [pure virtual] |
Prepare the engine.
This function must be called after you loaded/created the world and before it is rendered.
Actions include:
The behaviour regarding cached lighting depends on the flag you can set with the SetLightingCacheMode() function. The default behaviour is to read the lightmap cache when present but don't calculate lighting if cache is not present.
meter | If supplied, the meter object will be called back periodically to report the progress of engine preparation. |
virtual void iEngine::PrepareMeshes | ( | ) | [pure virtual] |
Calls UpdateMove for all meshes to initialise bounding boxes.
Prepare() will call this function automatically so you normally don't have to call it.
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.
virtual iObject* iEngine::QueryObject | ( | ) | [pure virtual] |
Get the iObject for the engine.
virtual void iEngine::RegisterDefaultRenderPriorities | ( | ) | [pure virtual] |
Register default render priorities.
virtual void iEngine::RegisterRenderPriority | ( | const char * | name, |
uint | priority, | ||
csRenderPrioritySorting | rendsort = CS_RENDPRI_SORT_NONE , |
||
CS::RenderPriorityGrouping | grouping = CS::rpgByLayer |
||
) | [pure virtual] |
Register a new render priority.
Render priorities are assigned to objects and controls the order in which objects are rendered by the engine.
name | a name to refer to this render priority |
priority | a numerical priority; this is used to order the render priorities where lower numbers are rendered before higher numbers. |
rendsort | One of the CS_RENDPRI_... flags. By default this is CS_RENDPRI_SORT_NONE. The following values are possible:
|
Priorities are identified by their number, not their name: If you call RegisterRenderPriority() twice, with the same priority number, but different names, the second call will change the name.
virtual void iEngine::ReloadRenderManager | ( | ) | [pure virtual] |
Reload the default render manager given the current configuration settings.
virtual void iEngine::RemoveAllCollections | ( | ) | [pure virtual] |
Remove all the collections.
virtual void iEngine::RemoveCollection | ( | iCollection * | collect | ) | [pure virtual] |
Remove the given collection from the list of collections.
virtual void iEngine::RemoveCollection | ( | const char * | name | ) | [pure virtual] |
Remove the collection of the given name.
virtual void iEngine::RemoveDelayedRemoves | ( | bool | remove = false | ) | [pure virtual] |
Clear all delayed removals.
remove | if true then the objects will also be removed from engine. Otherwise they are simply removed from this list. |
virtual void iEngine::RemoveEngineFrameCallback | ( | iEngineFrameCallback * | cb | ) | [pure virtual] |
Remove a frame callback.
virtual void iEngine::RemoveEngineSectorCallback | ( | iEngineSectorCallback * | cb | ) | [pure virtual] |
Remove a sector callback.
virtual void iEngine::RemoveLight | ( | iLight * | light | ) | [pure virtual] |
Remove a light and update all lightmaps.
This function only works correctly for dynamic or 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.
light | the light to remove |
virtual bool iEngine::RemoveObject | ( | iBase * | object | ) | [pure virtual] |
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: iCameraPosition, iLight, iMaterialWrapper, iMeshFactoryWrapper,iMeshWrapper, iSector 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.
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:
virtual void iEngine::SetAmbientLight | ( | const csColor & | ) | [pure virtual] |
Set the amount of ambient light.
This has no effect until you recalculate the lightmaps.
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. To set the cache manager to the default VFS based cache manager for a given VFS directory you can use the following code:
engine->SetVFSCacheManager ("/bla/bla");
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.
yesno | true to clear the screen before each frame, false to leave the screen as-is (which may leave garbage on the screen) |
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.
yesno | true to clear the Z buffer after each frame, false to leave the zbuffer as-is |
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 0 then the screen is assumed.
virtual bool iEngine::SetCurrentDefaultRenderloop | ( | iRenderLoop * | loop | ) | [pure virtual] |
Set the current render loop.
loop | The loop to be made the current render loop. |
will
let the method fail.) virtual void iEngine::SetDefaultKeepImage | ( | bool | enable | ) | [pure virtual] |
Set the default value for the "keep image" flag of texture wrappers.
virtual void iEngine::SetDefaultNearClipDistance | ( | float | dist | ) | [pure virtual] |
Set default near plane clipping distance for perspective cameras.
virtual void iEngine::SetRenderManager | ( | iRenderManager * | ) | [pure virtual] |
Set the default render manager.
virtual void iEngine::SetSaveableFlag | ( | bool | enable | ) | [pure virtual] |
Set whether saving should be possible (default OFF).
To allow saving of a world after it has been loaded, some objects may need to keep track of extra data that would otherwise not be needed if the world will never be written out again. The 'saveable' flag informs those objects about whether to keep that information or not. Saving a world with this flag disables is still possible, but the result might incomplete.
virtual void iEngine::SetVFSCacheManager | ( | const char * | vfspath = 0 | ) | [pure virtual] |
Set the cache manager to the default VFS based cache manager.
Note that this function will not change the VFS current directory.
vfspath | is the path that will be used for the cache manager. If 0 then the current VFS directory will be used instead. |
virtual void iEngine::SyncEngineListsNow | ( | csRef< iThreadedLoader > | loader | ) | [pure virtual] |
Loader List Sync.
iEngine::THREADED_INTERFACE | ( | DeleteAll | ) |
Delete everything in the engine.
iEngine::THREADED_INTERFACE1 | ( | AddMeshAndChildren | , |
iMeshWrapper * | mesh | ||
) |
Convenience function to add a mesh and all children of that mesh to the engine.
iEngine::THREADED_INTERFACE1 | ( | SyncEngineLists | , |
csRef< iThreadedLoader > | loader | ||
) |
Loader List Sync.
virtual void iEngine::UpdateAdaptiveLODs | ( | ) | [pure virtual] |
Must be called once per frame if you use adaptive LODs.
virtual void iEngine::UpdateNewFrame | ( | ) | [pure virtual] |
Update the engine and animations etc for a new frame.
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.