org.ogre4j
Class Root

java.lang.Object
  extended by org.xbig.base.NativeObject
      extended by org.ogre4j.Root
All Implemented Interfaces:
IAllocatedObject<IGeneralAllocPolicy>, IGeneralAllocatedObject, IRoot, ISingleton<IRoot>, INativeObject

public class Root
extends NativeObject
implements IRoot


Nested Class Summary
protected static class Root.FrameEventTimeType
           
static class Root.MovableObjectFactoryIterator
           
protected static class Root.MovableObjectFactoryMap
           
static class Root.PluginInstanceList
           
static class Root.PluginLibList
           
protected static class Root.RenderQueueInvocationSequenceMap
           
 
Nested classes/interfaces inherited from interface org.ogre4j.IRoot
IRoot.IMovableObjectFactoryIterator, IRoot.IMovableObjectFactoryMap, IRoot.IPluginInstanceList, IRoot.IPluginLibList, IRoot.IRenderQueueInvocationSequenceMap
 
Field Summary
 
Fields inherited from class org.xbig.base.NativeObject
deleted, object, remote
 
Constructor Summary
  Root(InstancePointer p)
          This constructor is public for internal useage only!
protected Root(InstancePointer p, boolean remote)
          Creates a Java wrapper object for an existing C++ object.
  Root(java.lang.String pluginFileName, java.lang.String configFileName, java.lang.String logFileName)
          Constructor
  Root(WithoutNativeObject val)
          Allows creation of Java objects without C++ objects.
 
Method Summary
 long _allocateNextMovableObjectTypeFlag()
          Allocate the next type flag.
 boolean _fireFrameEnded()
          Method for raising frame ended events.
 boolean _fireFrameEnded(IFrameEvent evt)
          Method for raising frame ended events.
 boolean _fireFrameRenderingQueued()
          Method for raising frame rendering queued events.
 boolean _fireFrameRenderingQueued(IFrameEvent evt)
          Method for raising frame rendering queued events.
 boolean _fireFrameStarted()
          Method for raising frame started events.
 boolean _fireFrameStarted(IFrameEvent evt)
          Method for raising frame started events.
 ISceneManager _getCurrentSceneManager()
          Returns the scene manager currently being used to render a frame.
 void _setCurrentSceneManager(ISceneManager sm)
          Sets the scene manager currently being used to render a frame.
 boolean _updateAllRenderTargets()
          Internal method used for updating all objects (windows, renderable textures etc) which are set to auto-update.
 void addFrameListener(IFrameListener newListener)
          Registers a which will be called back every frame.
 void addMovableObjectFactory(IMovableObjectFactory fact, boolean overrideExisting)
          Register a new which will create new instances of a particular type, as identified by the getType() method.
 void addRenderSystem(IRenderSystem newRend)
          Adds a new rendering subsystem to the list of available renderers.
 void addResourceLocation(java.lang.String name, java.lang.String locType, java.lang.String groupName, boolean recursive)
          Adds a location to the list of searchable locations for a type.
 void addSceneManagerFactory(ISceneManagerFactory fact)
          Register a new , a factory object for creating instances of specific SceneManagers.
 void clearEventTimes()
          Clears the history of all event times.
 void convertColourValue(IColourValue colour, LongPointer pDest)
          Generates a packed data version of the passed in suitable for use with the current .
 IRenderQueueInvocationSequence createRenderQueueInvocationSequence(java.lang.String name)
          Create a new , useful for linking to instances to perform custom rendering.
 IRenderWindow createRenderWindow(java.lang.String name, long width, long height, boolean fullScreen, INameValuePairList miscParams)
           
 ISceneManager createSceneManager(int typeMask, java.lang.String instanceName)
          Create a instance based on scene type support.
 ISceneManager createSceneManager(java.lang.String typeName, java.lang.String instanceName)
          Create a instance of a given type.
 void delete()
          Deletes the corresponding C++ object.
 void destroyAllRenderQueueInvocationSequences()
          Destroy all RenderQueueInvocationSequences.
 void destroyRenderQueueInvocationSequence(java.lang.String name)
          Destroy a .
 void destroySceneManager(ISceneManager sm)
          Destroy an instance of a .
 void detachRenderTarget(IRenderTarget pWin)
          Destroys a rendering window.
 void detachRenderTarget(java.lang.String name)
          Destroys a named rendering window.
 void finalize()
           
 IRenderWindow getAutoCreatedWindow()
          Retrieves a pointer to the window that was created automatically
 IRenderSystemList getAvailableRenderers()
          Retrieve a list of the available render systems.
 java.lang.String getErrorDescription(long errorNumber)
          Utility function for getting a better description of an error code.
 float getFrameSmoothingPeriod()
          Gets the period over which OGRE smooths out fluctuations in frame times.
 IRoot.IPluginInstanceList getInstalledPlugins()
          Gets a read-only list of the currently installed plugins.
 IMeshManager getMeshManager()
          Retrieves a reference to the current .
 IMovableObjectFactory getMovableObjectFactory(java.lang.String typeName)
           
 void getMovableObjectFactoryIterator(IRoot.IMovableObjectFactoryIterator returnValue)
          Return an iterator over all the instances currently registered.
 long getNextFrameNumber()
          Gets the number of the next frame to be rendered.
 IRenderQueueInvocationSequence getRenderQueueInvocationSequence(java.lang.String name)
          Get a .
 IRenderSystem getRenderSystem()
          Retrieve a pointer to the currently selected render system.
 IRenderSystem getRenderSystemByName(java.lang.String name)
          Retrieve a pointer to the render system by the given name
 IRenderTarget getRenderTarget(java.lang.String name)
          Retrieves a pointer to the a named render window.
 ISceneManager getSceneManager(java.lang.String instanceName)
          Get an existing instance that has already been created, identified by the instance name.
 void getSceneManagerIterator(ISceneManagerEnumerator.ISceneManagerIterator returnValue)
          Get an iterator over all the existing instances.
 ISceneManagerMetaData getSceneManagerMetaData(java.lang.String typeName)
          Get more information about a given type of .
 void getSceneManagerMetaDataIterator(ISceneManagerEnumerator.IMetaDataIterator returnValue)
          Iterate over all types of available for construction, providing some information about each one.
static IRoot getSingleton()
          Override standard retrieval.
static IRoot getSingletonPtr()
          Override standard retrieval.
 ITextureManager getTextureManager()
          Retrieves a reference to the current .
 ITimer getTimer()
          Gets a pointer to the central timer used for all OGRE timings
 boolean hasMovableObjectFactory(java.lang.String typeName)
           
 IRenderWindow initialise(boolean autoCreateWindow, java.lang.String windowTitle, java.lang.String customCapabilitiesConfig)
          Initialises the renderer.
 void installPlugin(IPlugin plugin)
          Install a new plugin.
 boolean isInitialised()
          Returns whether the system is initialised or not.
 void loadPlugin(java.lang.String pluginName)
          Manually load a contained in a DLL / DSO.
 void queueEndRendering()
          Queues the end of rendering.
 void removeFrameListener(IFrameListener oldListener)
          Removes a from the list of listening classes.
 void removeMovableObjectFactory(IMovableObjectFactory fact)
          Removes a previously registered .
 void removeResourceLocation(java.lang.String name, java.lang.String groupName)
          Removes a resource location from the list.
 void removeSceneManagerFactory(ISceneManagerFactory fact)
          Unregister a .
 boolean renderOneFrame()
          Render one frame.
 boolean restoreConfig()
          Checks for saved video/sound/etc settings
 void saveConfig()
          Saves the details of the current configuration
 void setFrameSmoothingPeriod(float period)
          Sets the period over which OGRE smooths out fluctuations in frame times.
 void setRenderSystem(IRenderSystem system)
          Sets the rendering subsystem to be used.
 boolean showConfigDialog()
          Displays a dialog asking the user to choose system settings.
 void shutdown()
          Shuts down the system manually.
 void startRendering()
          Starts / restarts the automatic rendering cycle.
 void uninstallPlugin(IPlugin plugin)
          Uninstall an existing plugin.
 void unloadPlugin(java.lang.String pluginName)
          Manually unloads a contained in a DLL / DSO.
 void useCustomRenderSystemCapabilities(IRenderSystemCapabilities capabilities)
          Requests active to use custom
 
Methods inherited from class org.xbig.base.NativeObject
disconnectFromNativeObject, equals, getInstancePointer, hashCode, setInstancePointer, setInstancePointer, setInstancePointer, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.xbig.base.INativeObject
disconnectFromNativeObject, getInstancePointer, setInstancePointer, setInstancePointer, setInstancePointer
 

Constructor Detail

Root

public Root(InstancePointer p)
This constructor is public for internal useage only! Do not use it!


Root

protected Root(InstancePointer p,
               boolean remote)
Creates a Java wrapper object for an existing C++ object. If remote is set to 'true' this object cannot be deleted in Java.


Root

public Root(WithoutNativeObject val)
Allows creation of Java objects without C++ objects.

See Also:
WithoutNativeObject, INativeObject.disconnectFromNativeObject()

Root

public Root(java.lang.String pluginFileName,
            java.lang.String configFileName,
            java.lang.String logFileName)
Constructor

Method Detail

delete

public void delete()
Description copied from interface: INativeObject
Deletes the corresponding C++ object.

Subclasses must implement this but if the native instance was created by the underlying library the native call to dispose must not happen!

Specified by:
delete in interface INativeObject
Specified by:
delete in class NativeObject
See Also:
#remote

finalize

public void finalize()
Overrides:
finalize in class NativeObject

saveConfig

public void saveConfig()
Saves the details of the current configuration

Specified by:
saveConfig in interface IRoot

restoreConfig

public boolean restoreConfig()
Checks for saved video/sound/etc settings

Specified by:
restoreConfig in interface IRoot

showConfigDialog

public boolean showConfigDialog()
Displays a dialog asking the user to choose system settings.

Specified by:
showConfigDialog in interface IRoot

addRenderSystem

public void addRenderSystem(IRenderSystem newRend)
Adds a new rendering subsystem to the list of available renderers.

Specified by:
addRenderSystem in interface IRoot

getAvailableRenderers

public IRenderSystemList getAvailableRenderers()
Retrieve a list of the available render systems.

Specified by:
getAvailableRenderers in interface IRoot

getRenderSystemByName

public IRenderSystem getRenderSystemByName(java.lang.String name)
Retrieve a pointer to the render system by the given name

Specified by:
getRenderSystemByName in interface IRoot

setRenderSystem

public void setRenderSystem(IRenderSystem system)
Sets the rendering subsystem to be used.

Specified by:
setRenderSystem in interface IRoot

getRenderSystem

public IRenderSystem getRenderSystem()
Retrieve a pointer to the currently selected render system.

Specified by:
getRenderSystem in interface IRoot

initialise

public IRenderWindow initialise(boolean autoCreateWindow,
                                java.lang.String windowTitle,
                                java.lang.String customCapabilitiesConfig)
Initialises the renderer.

Specified by:
initialise in interface IRoot

isInitialised

public boolean isInitialised()
Returns whether the system is initialised or not.

Specified by:
isInitialised in interface IRoot

useCustomRenderSystemCapabilities

public void useCustomRenderSystemCapabilities(IRenderSystemCapabilities capabilities)
Requests active to use custom

Specified by:
useCustomRenderSystemCapabilities in interface IRoot

addSceneManagerFactory

public void addSceneManagerFactory(ISceneManagerFactory fact)
Register a new , a factory object for creating instances of specific SceneManagers.

Specified by:
addSceneManagerFactory in interface IRoot

removeSceneManagerFactory

public void removeSceneManagerFactory(ISceneManagerFactory fact)
Unregister a .

Specified by:
removeSceneManagerFactory in interface IRoot

getSceneManagerMetaData

public ISceneManagerMetaData getSceneManagerMetaData(java.lang.String typeName)
Get more information about a given type of .

Specified by:
getSceneManagerMetaData in interface IRoot

getSceneManagerMetaDataIterator

public void getSceneManagerMetaDataIterator(ISceneManagerEnumerator.IMetaDataIterator returnValue)
Iterate over all types of available for construction, providing some information about each one.

Specified by:
getSceneManagerMetaDataIterator in interface IRoot

createSceneManager

public ISceneManager createSceneManager(java.lang.String typeName,
                                        java.lang.String instanceName)
Create a instance of a given type.

Specified by:
createSceneManager in interface IRoot

createSceneManager

public ISceneManager createSceneManager(int typeMask,
                                        java.lang.String instanceName)
Create a instance based on scene type support.

Specified by:
createSceneManager in interface IRoot

destroySceneManager

public void destroySceneManager(ISceneManager sm)
Destroy an instance of a .

Specified by:
destroySceneManager in interface IRoot

getSceneManager

public ISceneManager getSceneManager(java.lang.String instanceName)
Get an existing instance that has already been created, identified by the instance name.

Specified by:
getSceneManager in interface IRoot

getSceneManagerIterator

public void getSceneManagerIterator(ISceneManagerEnumerator.ISceneManagerIterator returnValue)
Get an iterator over all the existing instances.

Specified by:
getSceneManagerIterator in interface IRoot

getTextureManager

public ITextureManager getTextureManager()
Retrieves a reference to the current .

Specified by:
getTextureManager in interface IRoot

getMeshManager

public IMeshManager getMeshManager()
Retrieves a reference to the current .

Specified by:
getMeshManager in interface IRoot

getErrorDescription

public java.lang.String getErrorDescription(long errorNumber)
Utility function for getting a better description of an error code.

Specified by:
getErrorDescription in interface IRoot

addFrameListener

public void addFrameListener(IFrameListener newListener)
Registers a which will be called back every frame.

Specified by:
addFrameListener in interface IRoot

removeFrameListener

public void removeFrameListener(IFrameListener oldListener)
Removes a from the list of listening classes.

Specified by:
removeFrameListener in interface IRoot

queueEndRendering

public void queueEndRendering()
Queues the end of rendering.

Specified by:
queueEndRendering in interface IRoot

startRendering

public void startRendering()
Starts / restarts the automatic rendering cycle.

Specified by:
startRendering in interface IRoot

renderOneFrame

public boolean renderOneFrame()
Render one frame.

Specified by:
renderOneFrame in interface IRoot

shutdown

public void shutdown()
Shuts down the system manually.

Specified by:
shutdown in interface IRoot

addResourceLocation

public void addResourceLocation(java.lang.String name,
                                java.lang.String locType,
                                java.lang.String groupName,
                                boolean recursive)
Adds a location to the list of searchable locations for a type.

Specified by:
addResourceLocation in interface IRoot

removeResourceLocation

public void removeResourceLocation(java.lang.String name,
                                   java.lang.String groupName)
Removes a resource location from the list.

Specified by:
removeResourceLocation in interface IRoot

convertColourValue

public void convertColourValue(IColourValue colour,
                               LongPointer pDest)
Generates a packed data version of the passed in suitable for use with the current .

Specified by:
convertColourValue in interface IRoot

getAutoCreatedWindow

public IRenderWindow getAutoCreatedWindow()
Retrieves a pointer to the window that was created automatically

Specified by:
getAutoCreatedWindow in interface IRoot

createRenderWindow

public IRenderWindow createRenderWindow(java.lang.String name,
                                        long width,
                                        long height,
                                        boolean fullScreen,
                                        INameValuePairList miscParams)
Specified by:
createRenderWindow in interface IRoot

detachRenderTarget

public void detachRenderTarget(IRenderTarget pWin)
Destroys a rendering window.

Specified by:
detachRenderTarget in interface IRoot

detachRenderTarget

public void detachRenderTarget(java.lang.String name)
Destroys a named rendering window.

Specified by:
detachRenderTarget in interface IRoot

getRenderTarget

public IRenderTarget getRenderTarget(java.lang.String name)
Retrieves a pointer to the a named render window.

Specified by:
getRenderTarget in interface IRoot

loadPlugin

public void loadPlugin(java.lang.String pluginName)
Manually load a contained in a DLL / DSO.

Specified by:
loadPlugin in interface IRoot

unloadPlugin

public void unloadPlugin(java.lang.String pluginName)
Manually unloads a contained in a DLL / DSO.

Specified by:
unloadPlugin in interface IRoot

installPlugin

public void installPlugin(IPlugin plugin)
Install a new plugin.

Specified by:
installPlugin in interface IRoot

uninstallPlugin

public void uninstallPlugin(IPlugin plugin)
Uninstall an existing plugin.

Specified by:
uninstallPlugin in interface IRoot

getInstalledPlugins

public IRoot.IPluginInstanceList getInstalledPlugins()
Gets a read-only list of the currently installed plugins.

Specified by:
getInstalledPlugins in interface IRoot

getTimer

public ITimer getTimer()
Gets a pointer to the central timer used for all OGRE timings

Specified by:
getTimer in interface IRoot

_fireFrameStarted

public boolean _fireFrameStarted(IFrameEvent evt)
Method for raising frame started events.

Specified by:
_fireFrameStarted in interface IRoot

_fireFrameRenderingQueued

public boolean _fireFrameRenderingQueued(IFrameEvent evt)
Method for raising frame rendering queued events.

Specified by:
_fireFrameRenderingQueued in interface IRoot

_fireFrameEnded

public boolean _fireFrameEnded(IFrameEvent evt)
Method for raising frame ended events.

Specified by:
_fireFrameEnded in interface IRoot

_fireFrameStarted

public boolean _fireFrameStarted()
Method for raising frame started events.

Specified by:
_fireFrameStarted in interface IRoot

_fireFrameRenderingQueued

public boolean _fireFrameRenderingQueued()
Method for raising frame rendering queued events.

Specified by:
_fireFrameRenderingQueued in interface IRoot

_fireFrameEnded

public boolean _fireFrameEnded()
Method for raising frame ended events.

Specified by:
_fireFrameEnded in interface IRoot

getNextFrameNumber

public long getNextFrameNumber()
Gets the number of the next frame to be rendered.

Specified by:
getNextFrameNumber in interface IRoot

_getCurrentSceneManager

public ISceneManager _getCurrentSceneManager()
Returns the scene manager currently being used to render a frame.

Specified by:
_getCurrentSceneManager in interface IRoot

_setCurrentSceneManager

public void _setCurrentSceneManager(ISceneManager sm)
Sets the scene manager currently being used to render a frame.

Specified by:
_setCurrentSceneManager in interface IRoot

_updateAllRenderTargets

public boolean _updateAllRenderTargets()
Internal method used for updating all objects (windows, renderable textures etc) which are set to auto-update.

Specified by:
_updateAllRenderTargets in interface IRoot

createRenderQueueInvocationSequence

public IRenderQueueInvocationSequence createRenderQueueInvocationSequence(java.lang.String name)
Create a new , useful for linking to instances to perform custom rendering.

Specified by:
createRenderQueueInvocationSequence in interface IRoot

getRenderQueueInvocationSequence

public IRenderQueueInvocationSequence getRenderQueueInvocationSequence(java.lang.String name)
Get a .

Specified by:
getRenderQueueInvocationSequence in interface IRoot

destroyRenderQueueInvocationSequence

public void destroyRenderQueueInvocationSequence(java.lang.String name)
Destroy a .

Specified by:
destroyRenderQueueInvocationSequence in interface IRoot

destroyAllRenderQueueInvocationSequences

public void destroyAllRenderQueueInvocationSequences()
Destroy all RenderQueueInvocationSequences.

Specified by:
destroyAllRenderQueueInvocationSequences in interface IRoot

clearEventTimes

public void clearEventTimes()
Clears the history of all event times.

Specified by:
clearEventTimes in interface IRoot

setFrameSmoothingPeriod

public void setFrameSmoothingPeriod(float period)
Sets the period over which OGRE smooths out fluctuations in frame times.

Specified by:
setFrameSmoothingPeriod in interface IRoot

getFrameSmoothingPeriod

public float getFrameSmoothingPeriod()
Gets the period over which OGRE smooths out fluctuations in frame times.

Specified by:
getFrameSmoothingPeriod in interface IRoot

addMovableObjectFactory

public void addMovableObjectFactory(IMovableObjectFactory fact,
                                    boolean overrideExisting)
Register a new which will create new instances of a particular type, as identified by the getType() method.

Specified by:
addMovableObjectFactory in interface IRoot

removeMovableObjectFactory

public void removeMovableObjectFactory(IMovableObjectFactory fact)
Removes a previously registered .

Specified by:
removeMovableObjectFactory in interface IRoot

hasMovableObjectFactory

public boolean hasMovableObjectFactory(java.lang.String typeName)
Specified by:
hasMovableObjectFactory in interface IRoot

getMovableObjectFactory

public IMovableObjectFactory getMovableObjectFactory(java.lang.String typeName)
Specified by:
getMovableObjectFactory in interface IRoot

_allocateNextMovableObjectTypeFlag

public long _allocateNextMovableObjectTypeFlag()
Allocate the next type flag.

Specified by:
_allocateNextMovableObjectTypeFlag in interface IRoot

getMovableObjectFactoryIterator

public void getMovableObjectFactoryIterator(IRoot.IMovableObjectFactoryIterator returnValue)
Return an iterator over all the instances currently registered.

Specified by:
getMovableObjectFactoryIterator in interface IRoot

getSingleton

public static IRoot getSingleton()
Override standard retrieval.


getSingletonPtr

public static IRoot getSingletonPtr()
Override standard retrieval.



Copyright © 2007 netAllied GmbH. All Rights Reserved.