crystalspace.jbind.interfaces.iengine.engine
Interface iEngine

All Superinterfaces:
iBase, iPointer
All Known Implementing Classes:
csEngine

public interface iEngine
extends iBase

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.

Author:
java wrapper - Quentin Anciaux, c++ version - http://crystal.sourceforge.net/docs/online/pubapi/structiEngine.php

Method Summary
 void clearRenderPriorities()
          Clear all render priorities.
 iMaterial createBaseMaterial(iTextureWrapper txt)
          Create a base material that can be used to give to the texture manager.
 iMaterial createBaseMaterial(iTextureWrapper txt, int num_layers, iTextureWrapper[] wrappers, csTextureLayer[] layers)
          Create a base material that can be used to give to the texture manager.
 iTextureWrapper createBlackTexture(java.lang.String name, int w, int h, csColor iTransp, int iFlags)
          Create a black texture.
 iCamera createCamera()
          Create a new camera.
 iFrustumView createFrustumView()
          Create a iFrustumView instance that you can give to iVisibilityCuller->CastShadows().
 iLight createLight(java.lang.String name, csVector3 pos, float radius, csColor color, boolean pseudoDyn)
          Create a static/pseudo-dynamic light.
 iLoaderContext createLoaderContext()
          Create a loader context that you can give to loader plugins.
 iLoaderContext createLoaderContext(iRegion region)
          Create a loader context that you can give to loader plugins.
 iLoaderContext createLoaderContext(iRegion region, boolean curRegOnly)
          Create a loader context that you can give to loader plugins.
 iMaterialWrapper createMaterial(java.lang.String name, iTextureWrapper texture)
          Register a material to be loaded during Prepare().
 iMeshFactoryWrapper createMeshFactory(iMeshObjectFactory factory, java.lang.String name)
          Create a mesh factory wrapper for an existing mesh factory
 iMeshFactoryWrapper createMeshFactory(java.lang.String name)
          Create an uninitialized mesh factory wrapper.
 iMeshFactoryWrapper createMeshFactory(java.lang.String classId, java.lang.String name)
          Convenience function to create a mesh factory from a given type.
 iMeshWrapper createMeshWrapper(iMeshFactoryWrapper factory, java.lang.String name)
          Convenience function to create a mesh object for a given factory.
 iMeshWrapper createMeshWrapper(iMeshFactoryWrapper factory, java.lang.String name, iSector sector)
          Convenience function to create a mesh object for a given factory.
 iMeshWrapper createMeshWrapper(iMeshFactoryWrapper factory, java.lang.String name, iSector sector, csVector3 pos)
          Convenience function to create a mesh object for a given factory.
 iMeshWrapper createMeshWrapper(iMeshObject meshobj, java.lang.String name)
          Create a mesh wrapper for an existing mesh object.
 iMeshWrapper createMeshWrapper(iMeshObject meshobj, java.lang.String name, iSector sector)
          Create a mesh wrapper for an existing mesh object.
 iMeshWrapper createMeshWrapper(iMeshObject meshobj, java.lang.String name, iSector sector, csVector3 pos)
          Create a mesh wrapper for an existing mesh object.
 iMeshWrapper createMeshWrapper(java.lang.String name)
          Create an uninitialized mesh wrapper
 iMeshWrapper createMeshWrapper(java.lang.String classid, java.lang.String name)
          Create a mesh wrapper from a class id.
 iMeshWrapper createMeshWrapper(java.lang.String classid, java.lang.String name, iSector sector)
          Create a mesh wrapper from a class id.
 iMeshWrapper createMeshWrapper(java.lang.String classid, java.lang.String name, iSector sector, csVector3 pos)
          Create a mesh wrapper from a class id.
 iObjectWatcher createObjectWatcher()
          Create an object watcher instance that you can use to watch other objects.
 iMeshWrapper createPortal(java.lang.String name, iMeshWrapper parentMesh, iSector destSector, csVector3 vertices, int num_vertices, iPortal portal)
          Conveniance function to create a portal from one sector to another and make this portal a child mesh of another mesh.
 iMeshWrapper createPortal(java.lang.String name, iSector sourceSector, csVector3 pos, iSector destSector, csVector3 vertices, int num_vertices, iPortal portal)
          Conveniance function to create a portal from one sector to another.
 iMeshWrapper createPortalContainer(java.lang.String name)
          Create an empty portal container in some sector.
 iMeshWrapper createPortalContainer(java.lang.String name, iSector sector)
          Create an empty portal container in some sector.
 iMeshWrapper createPortalContainer(java.lang.String name, iSector sector, csVector3 pos)
          Create an empty portal container in some sector.
 iRegion createRegion(java.lang.String name)
          Create a new region and add it to the region list.
 iSector createSector(java.lang.String name)
          Create a empty sector with given name.
 iMeshWrapper createSectorWallsMesh(iSector sector, java.lang.String name)
          Convenience function to create the thing containing the convex outline of a sector.
 iTextureWrapper createTexture(java.lang.String name, java.lang.String fileName, csColor transp, int flags)
          Create a texture from a file.
 iMeshWrapper createThingMesh(iSector sector, java.lang.String name)
          Convenience function to create a thing mesh in a sector.
 void deleteAll()
          Delete everything in the engine.
 void draw(iCamera c, iClipper2D clipper)
          Draw the 3D world given a camera and a clipper.
 iCameraPosition findCameraPosition(java.lang.String name)
          Find the given camera position.
 iCameraPosition findCameraPosition(java.lang.String name, iRegion region)
          Find the given camera position.
 iCollection findCollection(java.lang.String name)
          Find the given collection.
 iCollection findCollection(java.lang.String name, iRegion region)
          Find the given collection.
 iLight findLight(java.lang.String Name)
          Find a static/pseudo-dynamic light by name.
 iLight findLight(java.lang.String Name, boolean RegionOnly)
          Find a static/pseudo-dynamic light by name.
 iLight findLightID(java.lang.String light_id)
          Find a static/pseudo-dynamic light by id.
 iMaterialWrapper findMaterial(java.lang.String name)
          Find the given material.
 iMaterialWrapper findMaterial(java.lang.String name, iRegion region)
          Find the given material.
 iMeshFactoryWrapper findMeshFactory(java.lang.String name)
          Find the given mesh factory.
 iMeshFactoryWrapper findMeshFactory(java.lang.String name, iRegion region)
          Find the given mesh factory.
 iMeshWrapper findMeshObject(java.lang.String name)
          Find the given mesh object.
 iMeshWrapper findMeshObject(java.lang.String name, iRegion region)
          Find the given mesh object.
 iSector findSector(java.lang.String name)
          Find the given sector.
 iSector findSector(java.lang.String name, iRegion region)
          Find the given sector.
 iTextureWrapper findTexture(java.lang.String name)
          Find the given texture.
 iTextureWrapper findTexture(java.lang.String name, iRegion region)
          Find the given texture.
 void forceRelight()
          Force a relight of all lighting.
 void forceRelight(iLight light)
          Force a relight for the given light.
 void forceRelight(iLight light, iRegion region)
          Force a relight for the given light.
 void forceRelight(iRegion region)
          Force a relight of all lighting.
 void forceRelight(iRegion region, iProgressMeter meter)
          Force a relight of all lighting.
 long getAlphaRenderPriority()
          Get the render priority for alpha objects (attached to 'alpha' name).
 csColor getAmbientLight()
          Return the amount of ambient light.
 int getBeginDrawFlags()
          Get the required flags for 3D->BeginDraw() which should be called from the application.
 iCacheManager getCacheManager()
          Get the cache manager that the engine is currently using.
 iCameraPositionList getCameraPositions()
          Get the list of camera positions.
 boolean getClearScreen()
          Get the value of the clear screen flag set with SetClearScreen().
 boolean getClearZBuf()
          Get the value of the clear Z-buffer flag set with SetClearZBuf().
 iCollectionList getCollections()
          Get the list of collections.
 iTextureHandle getContext()
          Return the current drawing context.
 iRenderLoop getCurrentDefaultRenderloop()
          For NR: Returns the current render loop.
 int getCurrentFrameNumber()
          Get the current framenumber.
 void getDefaultAmbientLight(csColor c)
          Return the default amount of ambient light.
 boolean getDefaultClearScreen()
          Get default clear screen flag.
 boolean getDefaultClearZBuf()
          Get default clear z-buffer flag.
 int[] getDefaultMaxLightmapSize()
          Retrieve default maximum lightmap size.
 int getLightingCacheMode()
          Get the mode for the lighting cache.
 iLightIterator getLightIterator()
          Create an iterator to iterate over all static lights of the engine.
 iLightIterator getLightIterator(iRegion region)
          Create an iterator to iterate over all static lights of the engine.
 iMaterialList getMaterialList()
          Get the list of all materials.
 int getMaxLightmapAspectRatio()
          Get the maximum aspect ratio for lightmaps.
 int[] getMaxLightmapSize()
          Retrieve maximum lightmap size.
 iMeshList getMeshes()
          Get the list of meshes.
 iMeshFactoryList getMeshFactories()
          Get the list of mesh factories.
 int getNearbyLights(iSector sector, csBox3 box, int flags, iLight[] lights, int max_num_lights)
          This routine returns all lights which might affect an object with some bounding box according to the following flags:
 int getNearbyLights(iSector sector, csVector3 pos, int flags, iLight[] lights, int max_num_lights)
          This routine returns all lights which might affect an object at some position according to the following flags:
 iMeshWrapperIterator getNearbyMeshes(iSector sector, csVector3 pos, float radius)
          This routine returns an iterator to iterate over all meshes that are within a radius of a given position.
 iMeshWrapperIterator getNearbyMeshes(iSector sector, csVector3 pos, float radius, boolean crossPortals)
          This routine returns an iterator to iterate over all meshes that are within a radius of a given position.
 iObjectIterator getNearbyObjects(iSector sector, csVector3 pos, float radius)
          This routine returns an iterator to iterate over all objects that are within a radius of a given position.
 iObjectIterator getNearbyObjects(iSector sector, csVector3 pos, float radius, boolean crossPortals)
          This routine returns an iterator to iterate over all objects that are within a radius of a given position.
 iSectorIterator getNearbySectors(iSector sector, csVector3 pos, float radius)
          This routine returns an iterator to iterate over all nearby sectors.
 long getObjectRenderPriority()
          Get the render priority for general objects (attached to 'object' name).
 long getPortalRenderPriority()
          Get the render priority for portal objects (attached to 'portal' name).
 iRegionList getRegions()
          Get the list of all regions.
 iRenderLoopManager getRenderLoopManager()
          For NR: Retrieve the render loop manager.
 long getRenderPriority(java.lang.String name)
          Get a render priority by name.
 boolean getRenderPriorityCamera(long priority)
          Get the render priority camera flag.
 boolean getRenderPriorityCamera(java.lang.String name)
          Get the render priority camera flag.
 int getRenderPriorityCount()
          Get the number of render priorities.
 java.lang.String getRenderPriorityName(long priority)
          Get the name of the render priority or 0 if none existant.
 int getRenderPrioritySorting(long priority)
          Get the render priority sorting flag.
 int getRenderPrioritySorting(java.lang.String name)
          Get the render priority sorting flag.
 iSectorList getSectors()
          Get the list of sectors.
 long getSkyRenderPriority()
          Get the render priority for sky objects (attached to 'sky' name).
 int getTextureFormat()
          Query the format to load textures (usually this depends on texture manager).
 iTextureList getTextureList()
          Get the list of all textures.
 iClipper2D getTopLevelClipper()
          Get the top-level clipper.
 iSharedVariableList getVariableList()
          Get the list of all shared variables.
 iMeshWrapperIterator getVisibleMeshes(iSector sector, csFrustum frustum)
          This routine returns an iterator to iterate over all meshes that are potentially visible as seen from a given position.
 iMeshWrapperIterator getVisibleMeshes(iSector sector, csVector3 pos)
          This routine returns an iterator to iterate over all meshes that are potentially visible as seen from a given position.
 iObjectIterator getVisibleObjects(iSector sector, csFrustum frustum)
          This routine returns an iterator to iterate over all objects that are potentially visible as seen from a given position.
 iObjectIterator getVisibleObjects(iSector sector, csVector3 pos)
          This routine returns an iterator to iterate over all objects that are potentially visible as seen from a given position.
 long getWallRenderPriority()
          Get the render priority for wall objects (attached to 'wall' name).
 iMeshFactoryWrapper loadMeshFactory(java.lang.String name, java.lang.String loaderClassId, iDataBuffer input)
          Convenience function to load a mesh factory from a given loader plugin.
 iMeshWrapper loadMeshWrapper(java.lang.String name, java.lang.String loaderClassId, iDataBuffer input, iSector sector, csVector3 pos)
          Convenience function to load a mesh object from a given loader plugin.
 boolean prepare()
          Prepare the engine.
 boolean prepare(iProgressMeter meter)
          Prepare the engine.
 void prepareMeshes()
          Calls UpdateMove for all meshes to initialise bsp bounding boxes.
 void prepareTextures()
          Prepare the textures.
 iObject queryObject()
          Get the iObject for the engine.
 void registerRenderPriority(java.lang.String name, long priority)
          Register a new render priority.
 void registerRenderPriority(java.lang.String name, long priority, int rendsort)
          Register a new render priority.
 void registerRenderPriority(java.lang.String name, long priority, int rendsort, boolean do_camera)
          Register a new render priority.
 void removeLight(iLight light)
          Remove a light and update all lightmaps.
 boolean removeObject(iBase object)
          Convenience function to 'remove' a CS object from the engine.
 void resetWorldSpecificSettings()
          Reset a subset of flags/settings (which may differ from one world/map to another) to its defaults.
 void setAmbientLight(csColor color)
          Set the amount of ambient light.
 void setCacheManager(iCacheManager cache_mgr)
          Set the cache manager that the engine will use.
 void setClearScreen(boolean yesno)
          Require that the screen is cleared every frame.
 void setClearZBuf(boolean yesno)
          Require that the Z-buffer is cleared every frame.
 void setContext(iTextureHandle ctxt)
          Set the drawing context.
 boolean setCurrentDefaultRenderloop(iRenderLoop loop)
          Set the current render loop.
 void setLightingCacheMode(int mode)
          Set the mode for the lighting cache (combination of CS_ENGINE_CACHE_???).
 void setMaxLightmapSize(int w, int h)
          Set the maximum lightmap dimensions.
 void setRenderPriorityCamera(long priority, boolean do_camera)
          Set the render priority camera flag.
 void shineLights()
          Calculate all lighting information.
 void shineLights(iRegion region)
          Calculate all lighting information.
 void shineLights(iRegion region, iProgressMeter meter)
          Calculate all lighting information.
 void wantToDie(iMeshWrapper mesh)
          Sometimes a mesh wants to destruct itself (for example a particle system that has only limited lifetime).
 
Methods inherited from interface crystalspace.jbind.interfaces.iutil.scf.iBase
decRef, getName, getRefCount, getVersion, incRef, queryInterface, queryInterfaceSafe
 
Methods inherited from interface crystalspace.jbind.interfaces.iPointer
changePointer, getPointer, isMemoryOwner, setMemoryOwner
 

Method Detail

queryObject

public iObject queryObject()
Get the iObject for the engine.


prepare

public boolean prepare()
Prepare the engine.

Returns:

prepare

public boolean prepare(iProgressMeter meter)
Prepare the engine.

Parameters:
meter -
Returns:

forceRelight

public void forceRelight()
Force a relight of all lighting.


forceRelight

public void forceRelight(iRegion region)
Force a relight of all lighting.

Parameters:
region -

forceRelight

public void forceRelight(iRegion region,
                         iProgressMeter meter)
Force a relight of all lighting.

Parameters:
region -
meter -

forceRelight

public void forceRelight(iLight light)
Force a relight for the given light.

Parameters:
light -

forceRelight

public void forceRelight(iLight light,
                         iRegion region)
Force a relight for the given light.

Parameters:
light -
region -

removeLight

public void removeLight(iLight light)
Remove a light and update all lightmaps.

Parameters:
light -

prepareTextures

public void prepareTextures()
Prepare the textures.


prepareMeshes

public void prepareMeshes()
Calls UpdateMove for all meshes to initialise bsp bounding boxes.


shineLights

public void shineLights()
Calculate all lighting information.


shineLights

public void shineLights(iRegion region)
Calculate all lighting information.

Parameters:
region -

shineLights

public void shineLights(iRegion region,
                        iProgressMeter meter)
Calculate all lighting information.

Parameters:
region -
meter -

getTextureFormat

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

Returns:

deleteAll

public void deleteAll()
Delete everything in the engine.


registerRenderPriority

public void registerRenderPriority(java.lang.String name,
                                   long priority)
Register a new render priority.

Parameters:
name -
priority -

registerRenderPriority

public void registerRenderPriority(java.lang.String name,
                                   long priority,
                                   int rendsort)
Register a new render priority.

Parameters:
name -
priority -
rendsort -

registerRenderPriority

public void registerRenderPriority(java.lang.String name,
                                   long priority,
                                   int rendsort,
                                   boolean do_camera)
Register a new render priority.

Parameters:
name -
priority -
rendsort -
do_camera -

getRenderPriority

public long getRenderPriority(java.lang.String name)
Get a render priority by name.

Parameters:
name -
Returns:

setRenderPriorityCamera

public void setRenderPriorityCamera(long priority,
                                    boolean do_camera)
Set the render priority camera flag.

Parameters:
priority -
do_camera -

getRenderPriorityCamera

public boolean getRenderPriorityCamera(java.lang.String name)
Get the render priority camera flag.

Parameters:
name -
Returns:

getRenderPriorityCamera

public boolean getRenderPriorityCamera(long priority)
Get the render priority camera flag.

Parameters:
priority -
Returns:

getRenderPrioritySorting

public int getRenderPrioritySorting(java.lang.String name)
Get the render priority sorting flag.

Parameters:
name -
Returns:

getRenderPrioritySorting

public int getRenderPrioritySorting(long priority)
Get the render priority sorting flag.

Parameters:
priority -
Returns:

getSkyRenderPriority

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

Returns:

getPortalRenderPriority

public long getPortalRenderPriority()
Get the render priority for portal objects (attached to 'portal' name).

Returns:

getWallRenderPriority

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

Returns:

getObjectRenderPriority

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

Returns:

getAlphaRenderPriority

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

Returns:

clearRenderPriorities

public void clearRenderPriorities()
Clear all render priorities.


getRenderPriorityCount

public int getRenderPriorityCount()
Get the number of render priorities.

Returns:

getRenderPriorityName

public java.lang.String getRenderPriorityName(long priority)
Get the name of the render priority or 0 if none existant.

Parameters:
priority -
Returns:

createBaseMaterial

public iMaterial createBaseMaterial(iTextureWrapper txt)
Create a base material that can be used to give to the texture manager. Note: You will need to call iMaterialWrapper::Register() and iMaterialWrapper::GetMaterialHandler()->Prepare() on you new material if you load the material after iEngine::Prepare() has been called.

Parameters:
txt - The texture map this material will use.
Returns:

createBaseMaterial

public iMaterial createBaseMaterial(iTextureWrapper txt,
                                    int num_layers,
                                    iTextureWrapper[] wrappers,
                                    csTextureLayer[] layers)
Create a base material that can be used to give to the texture manager. This version also supports texture layers.

Parameters:
txt - the base texture (lowermost texture layer)
num_layers - the number of texture layers supplid in the next parameter
wrappers - an array of pointers to iTextureWrapper objects, supplying the texture to use for each texture layer
layers - an array of csTextureLayer structures cooresponding to each texture layer and describing how the layer is aligned and blended with the layers beneath it.
Returns:
See Also:
CreateBaseMaterial(iTextureWrapper* txt) note about registering/preparing materials.

createTexture

public iTextureWrapper createTexture(java.lang.String name,
                                     java.lang.String fileName,
                                     csColor transp,
                                     int flags)
Create a texture from a file.

Parameters:
name -
fileName -
transp -
flags -
Returns:

createBlackTexture

public iTextureWrapper createBlackTexture(java.lang.String name,
                                          int w,
                                          int h,
                                          csColor iTransp,
                                          int iFlags)
Create a black texture. This is mostly useful for procedural textures.

Parameters:
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...)
iTransp - pixels in the image with this key color will be considered transparent instead of being drawn
iFlags - @see createTexture()
Returns:
See Also:
note about registering/preparing textures.

createMaterial

public iMaterialWrapper createMaterial(java.lang.String name,
                                       iTextureWrapper texture)
Register a material to be loaded during Prepare().

Parameters:
name - the engine name for this material
texture - texture to use for this material
Returns:

createSector

public iSector createSector(java.lang.String name)
Create a empty sector with given name.

Parameters:
name -
Returns:

createSectorWallsMesh

public iMeshWrapper createSectorWallsMesh(iSector sector,
                                          java.lang.String name)
Convenience function to create the thing containing the convex outline of a sector.

Parameters:
sector -
name -
Returns:

createThingMesh

public iMeshWrapper createThingMesh(iSector sector,
                                    java.lang.String name)
Convenience function to create a thing mesh in a sector.

Parameters:
sector -
name -
Returns:

getSectors

public iSectorList getSectors()
Get the list of sectors.

Returns:

getMeshFactories

public iMeshFactoryList getMeshFactories()
Get the list of mesh factories.

Returns:

getMeshes

public iMeshList getMeshes()
Get the list of meshes.

Returns:

getCollections

public iCollectionList getCollections()
Get the list of collections.

Returns:

getCameraPositions

public iCameraPositionList getCameraPositions()
Get the list of camera positions.

Returns:

getTextureList

public iTextureList getTextureList()
Get the list of all textures.

Returns:

getMaterialList

public iMaterialList getMaterialList()
Get the list of all materials.

Returns:

getVariableList

public iSharedVariableList getVariableList()
Get the list of all shared variables.

Returns:

createRegion

public iRegion createRegion(java.lang.String name)
Create a new region and add it to the region list.

Parameters:
name -
Returns:

getRegions

public iRegionList getRegions()
Get the list of all regions.

Returns:

findMaterial

public iMaterialWrapper findMaterial(java.lang.String name)
Find the given material.

Parameters:
name -
Returns:

findMaterial

public iMaterialWrapper findMaterial(java.lang.String name,
                                     iRegion region)
Find the given material.

Parameters:
name -
region -
Returns:

findTexture

public iTextureWrapper findTexture(java.lang.String name)
Find the given texture.

Parameters:
name -
Returns:

findTexture

public iTextureWrapper findTexture(java.lang.String name,
                                   iRegion region)
Find the given texture.

Parameters:
name -
region -
Returns:

findSector

public iSector findSector(java.lang.String name)
Find the given sector.

Parameters:
name -
Returns:

findSector

public iSector findSector(java.lang.String name,
                          iRegion region)
Find the given sector.

Parameters:
name -
region -
Returns:

findMeshObject

public iMeshWrapper findMeshObject(java.lang.String name)
Find the given mesh object.

Parameters:
name -
Returns:

findMeshObject

public iMeshWrapper findMeshObject(java.lang.String name,
                                   iRegion region)
Find the given mesh object.

Parameters:
name -
region -
Returns:

findMeshFactory

public iMeshFactoryWrapper findMeshFactory(java.lang.String name)
Find the given mesh factory.

Parameters:
name -
Returns:

findMeshFactory

public iMeshFactoryWrapper findMeshFactory(java.lang.String name,
                                           iRegion region)
Find the given mesh factory.

Parameters:
name -
region -
Returns:

findCameraPosition

public iCameraPosition findCameraPosition(java.lang.String name)
Find the given camera position.

Parameters:
name -
Returns:

findCameraPosition

public iCameraPosition findCameraPosition(java.lang.String name,
                                          iRegion region)
Find the given camera position.

Parameters:
name -
region -
Returns:

findCollection

public iCollection findCollection(java.lang.String name)
Find the given collection.

Parameters:
name -
Returns:

findCollection

public iCollection findCollection(java.lang.String name,
                                  iRegion region)
Find the given collection.

Parameters:
name -
region -
Returns:

setLightingCacheMode

public void setLightingCacheMode(int mode)
Set the mode for the lighting cache (combination of CS_ENGINE_CACHE_???).

Parameters:
mode -

getLightingCacheMode

public int getLightingCacheMode()
Get the mode for the lighting cache.

Returns:

setClearZBuf

public void setClearZBuf(boolean yesno)
Require that the Z-buffer is cleared every frame.

Parameters:
yesno -

getClearZBuf

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

Returns:

getDefaultClearZBuf

public boolean getDefaultClearZBuf()
Get default clear z-buffer flag.

Returns:

setClearScreen

public void setClearScreen(boolean yesno)
Require that the screen is cleared every frame.

Parameters:
yesno -

getClearScreen

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

Returns:

getDefaultClearScreen

public boolean getDefaultClearScreen()
Get default clear screen flag.

Returns:

setMaxLightmapSize

public void setMaxLightmapSize(int w,
                               int h)
Set the maximum lightmap dimensions.

Parameters:
w -
h -

getMaxLightmapSize

public int[] getMaxLightmapSize()
Retrieve maximum lightmap size.

Returns:

getDefaultMaxLightmapSize

public int[] getDefaultMaxLightmapSize()
Retrieve default maximum lightmap size.

Returns:

getMaxLightmapAspectRatio

public int getMaxLightmapAspectRatio()
Get the maximum aspect ratio for lightmaps.

Returns:

resetWorldSpecificSettings

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


createCamera

public iCamera createCamera()
Create a new camera.

Returns:

createLight

public iLight createLight(java.lang.String name,
                          csVector3 pos,
                          float radius,
                          csColor color,
                          boolean pseudoDyn)
Create a static/pseudo-dynamic light.

Parameters:
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)
pseudoDyn - create a pseudo-dynamic light (an unmoving light which can efficiently change intensity or color)
Returns:

findLight

public iLight findLight(java.lang.String Name)
Find a static/pseudo-dynamic light by name.

Parameters:
Name -
Returns:

findLight

public iLight findLight(java.lang.String Name,
                        boolean RegionOnly)
Find a static/pseudo-dynamic light by name.

Parameters:
Name -
RegionOnly -
Returns:

findLightID

public iLight findLightID(java.lang.String light_id)
Find a static/pseudo-dynamic light by id.

Parameters:
light_id -
Returns:

getLightIterator

public iLightIterator getLightIterator()
Create an iterator to iterate over all static lights of the engine.

Returns:

getLightIterator

public iLightIterator getLightIterator(iRegion region)
Create an iterator to iterate over all static lights of the engine.

Parameters:
region -
Returns:

getBeginDrawFlags

public int getBeginDrawFlags()
Get the required flags for 3D->BeginDraw() which should be called from the application.

Returns:

getTopLevelClipper

public iClipper2D getTopLevelClipper()
Get the top-level clipper.

Returns:

createMeshFactory

public iMeshFactoryWrapper createMeshFactory(java.lang.String classId,
                                             java.lang.String name)
Convenience function to create a mesh factory from a given type.

Parameters:
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.
Returns:
null on failure

createMeshFactory

public iMeshFactoryWrapper createMeshFactory(iMeshObjectFactory factory,
                                             java.lang.String name)
Create a mesh factory wrapper for an existing mesh factory

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

createMeshFactory

public iMeshFactoryWrapper createMeshFactory(java.lang.String name)
Create an uninitialized mesh factory wrapper.

Parameters:
name - the engine name for the factory wrapper
Returns:

createLoaderContext

public iLoaderContext createLoaderContext()
Create a loader context that you can give to loader plugins.

Returns:

createLoaderContext

public iLoaderContext createLoaderContext(iRegion region)
Create a loader context that you can give to loader plugins. It will basically allow loader plugins to find materials

Parameters:
region - optional loader region
Returns:

createLoaderContext

public iLoaderContext createLoaderContext(iRegion region,
                                          boolean curRegOnly)
Create a loader context that you can give to loader plugins. It will basically allow loader plugins to find materials.

Parameters:
region - optional loader region
curRegOnly - if region is valid and and curRegOnly is true then only that region will be searched.
Returns:

loadMeshFactory

public iMeshFactoryWrapper loadMeshFactory(java.lang.String name,
                                           java.lang.String loaderClassId,
                                           iDataBuffer input)
Convenience function to load a mesh factory from a given loader plugin.

Parameters:
name -
loaderClassId -
input -
Returns:

createMeshWrapper

public iMeshWrapper createMeshWrapper(iMeshFactoryWrapper factory,
                                      java.lang.String name)
Convenience function to create a mesh object for a given factory.

Parameters:
factory -
name -
Returns:

createMeshWrapper

public iMeshWrapper createMeshWrapper(iMeshFactoryWrapper factory,
                                      java.lang.String name,
                                      iSector sector)
Convenience function to create a mesh object for a given factory.

Parameters:
factory -
name -
sector -
Returns:

createMeshWrapper

public iMeshWrapper createMeshWrapper(iMeshFactoryWrapper factory,
                                      java.lang.String name,
                                      iSector sector,
                                      csVector3 pos)
Convenience function to create a mesh object for a given factory.

Parameters:
factory -
name -
sector -
pos -
Returns:

createMeshWrapper

public iMeshWrapper createMeshWrapper(iMeshObject meshobj,
                                      java.lang.String name)
Create a mesh wrapper for an existing mesh object.

Parameters:
meshobj -
name -
Returns:

createMeshWrapper

public iMeshWrapper createMeshWrapper(iMeshObject meshobj,
                                      java.lang.String name,
                                      iSector sector)
Create a mesh wrapper for an existing mesh object.

Parameters:
meshobj -
name -
sector -
Returns:

createMeshWrapper

public iMeshWrapper createMeshWrapper(iMeshObject meshobj,
                                      java.lang.String name,
                                      iSector sector,
                                      csVector3 pos)
Create a mesh wrapper for an existing mesh object.

Parameters:
meshobj -
name -
sector -
pos -
Returns:

createMeshWrapper

public iMeshWrapper createMeshWrapper(java.lang.String classid,
                                      java.lang.String name)
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. 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.

Parameters:
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).
Returns:
The meshwrapper on success, or null on failure.

createMeshWrapper

public iMeshWrapper createMeshWrapper(java.lang.String classid,
                                      java.lang.String name,
                                      iSector sector)
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. 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.

Parameters:
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.
Returns:
The meshwrapper on success, or null on failure.

createMeshWrapper

public iMeshWrapper createMeshWrapper(java.lang.String classid,
                                      java.lang.String name,
                                      iSector sector,
                                      csVector3 pos)
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. 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.

Parameters:
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
Returns:
The meshwrapper on success, or null on failure.

createMeshWrapper

public iMeshWrapper createMeshWrapper(java.lang.String name)
Create an uninitialized mesh wrapper

Parameters:
name -
Returns:

loadMeshWrapper

public iMeshWrapper loadMeshWrapper(java.lang.String name,
                                    java.lang.String loaderClassId,
                                    iDataBuffer input,
                                    iSector sector,
                                    csVector3 pos)
Convenience function to load a mesh object from a given loader plugin.

Parameters:
name -
loaderClassId -
input -
sector -
pos -
Returns:

createPortalContainer

public iMeshWrapper createPortalContainer(java.lang.String name)
Create an empty portal container in some sector.

Parameters:
name -
Returns:

createPortalContainer

public iMeshWrapper createPortalContainer(java.lang.String name,
                                          iSector sector)
Create an empty portal container in some sector.

Parameters:
name -
sector -
Returns:

createPortalContainer

public iMeshWrapper createPortalContainer(java.lang.String name,
                                          iSector sector,
                                          csVector3 pos)
Create an empty portal container in some sector.

Parameters:
name -
sector -
pos -
Returns:

createPortal

public iMeshWrapper createPortal(java.lang.String name,
                                 iMeshWrapper parentMesh,
                                 iSector destSector,
                                 csVector3 vertices,
                                 int num_vertices,
                                 iPortal portal)
Conveniance function to create a portal from one sector to another and make this portal a child mesh of another mesh.

Parameters:
name -
parentMesh -
destSector -
vertices -
num_vertices -
portal -
Returns:

createPortal

public iMeshWrapper createPortal(java.lang.String name,
                                 iSector sourceSector,
                                 csVector3 pos,
                                 iSector destSector,
                                 csVector3 vertices,
                                 int num_vertices,
                                 iPortal portal)
Conveniance function to create a portal from one sector to another.

Parameters:
name -
sourceSector -
pos -
destSector -
vertices -
num_vertices -
portal -
Returns:

draw

public void draw(iCamera c,
                 iClipper2D clipper)
Draw the 3D world given a camera and a clipper.

Parameters:
c -
clipper -

setContext

public void setContext(iTextureHandle ctxt)
Set the drawing context.

Parameters:
ctxt -

getContext

public iTextureHandle getContext()
Return the current drawing context.

Returns:

setAmbientLight

public void setAmbientLight(csColor color)
Set the amount of ambient light.

Parameters:
color -

getAmbientLight

public csColor getAmbientLight()
Return the amount of ambient light.


getNearbyLights

public int getNearbyLights(iSector sector,
                           csVector3 pos,
                           int flags,
                           iLight[] lights,
                           int max_num_lights)
This routine returns all lights which might affect an object at some position according to the following flags:

Parameters:
sector -
pos -
flags -
lights -
max_num_lights -
Returns:

getNearbyLights

public int getNearbyLights(iSector sector,
                           csBox3 box,
                           int flags,
                           iLight[] lights,
                           int max_num_lights)
This routine returns all lights which might affect an object with some bounding box according to the following flags:

Parameters:
sector -
box -
flags -
lights -
max_num_lights -
Returns:

getNearbySectors

public iSectorIterator getNearbySectors(iSector sector,
                                        csVector3 pos,
                                        float radius)
This routine returns an iterator to iterate over all nearby sectors.

Parameters:
sector -
pos -
radius -
Returns:

getNearbyObjects

public iObjectIterator getNearbyObjects(iSector sector,
                                        csVector3 pos,
                                        float radius)
This routine returns an iterator to iterate over all objects that are within a radius of a given position.

Parameters:
sector -
pos -
radius -
Returns:

getNearbyObjects

public iObjectIterator getNearbyObjects(iSector sector,
                                        csVector3 pos,
                                        float radius,
                                        boolean crossPortals)
This routine returns an iterator to iterate over all objects that are within a radius of a given position.

Parameters:
sector -
pos -
radius -
crossPortals -
Returns:

getNearbyMeshes

public iMeshWrapperIterator getNearbyMeshes(iSector sector,
                                            csVector3 pos,
                                            float radius)
This routine returns an iterator to iterate over all meshes that are within a radius of a given position.

Parameters:
sector -
pos -
radius -
Returns:

getNearbyMeshes

public iMeshWrapperIterator getNearbyMeshes(iSector sector,
                                            csVector3 pos,
                                            float radius,
                                            boolean crossPortals)
This routine returns an iterator to iterate over all meshes that are within a radius of a given position.

Parameters:
sector -
pos -
radius -
crossPortals -
Returns:

getVisibleObjects

public iObjectIterator getVisibleObjects(iSector sector,
                                         csVector3 pos)
This routine returns an iterator to iterate over all objects that are potentially visible as seen from a given position.

Parameters:
sector -
pos -
Returns:

getVisibleMeshes

public iMeshWrapperIterator getVisibleMeshes(iSector sector,
                                             csVector3 pos)
This routine returns an iterator to iterate over all meshes that are potentially visible as seen from a given position.

Parameters:
sector -
pos -
Returns:

getVisibleObjects

public iObjectIterator getVisibleObjects(iSector sector,
                                         csFrustum frustum)
This routine returns an iterator to iterate over all objects that are potentially visible as seen from a given position.

Parameters:
sector -
frustum -
Returns:

getVisibleMeshes

public iMeshWrapperIterator getVisibleMeshes(iSector sector,
                                             csFrustum frustum)
This routine returns an iterator to iterate over all meshes that are potentially visible as seen from a given position.

Parameters:
sector -
frustum -
Returns:

removeObject

public boolean removeObject(iBase object)
Convenience function to 'remove' a CS object from the engine.

Parameters:
object -
Returns:

setCacheManager

public void setCacheManager(iCacheManager cache_mgr)
Set the cache manager that the engine will use.

Parameters:
cache_mgr -

getCacheManager

public iCacheManager getCacheManager()
Get the cache manager that the engine is currently using.

Returns:

getDefaultAmbientLight

public void getDefaultAmbientLight(csColor c)
Return the default amount of ambient light.

Parameters:
c -

createFrustumView

public iFrustumView createFrustumView()
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.

Returns:

createObjectWatcher

public iObjectWatcher createObjectWatcher()
Create an object watcher instance that you can use to watch other objects.

Returns:

wantToDie

public void wantToDie(iMeshWrapper mesh)
Sometimes a mesh wants to destruct itself (for example a particle system that has only limited lifetime).

Parameters:
mesh -

getRenderLoopManager

public iRenderLoopManager getRenderLoopManager()
For NR: Retrieve the render loop manager.

Returns:

getCurrentDefaultRenderloop

public iRenderLoop getCurrentDefaultRenderloop()
For NR: Returns the current render loop.

Returns:

setCurrentDefaultRenderloop

public boolean setCurrentDefaultRenderloop(iRenderLoop loop)
Set the current render loop.

Parameters:
loop -
Returns:

getCurrentFrameNumber

public int getCurrentFrameNumber()
Get the current framenumber.

Returns: