OGRE  1.12.13
Object-Oriented Graphics Rendering Engine
Ogre::MovableObjectFactory Class Referenceabstract

Interface definition for a factory class which produces a certain kind of MovableObject, and can be registered with Root in order to allow all clients to produce new instances of this object, integrated with the standard Ogre processing. More...

#include <OgreMovableObject.h>

+ Inheritance diagram for Ogre::MovableObjectFactory:

Public Member Functions

 MovableObjectFactory ()
 
virtual ~MovableObjectFactory ()
 
void _notifyTypeFlags (uint32 flag)
 Notify this factory of the type mask to apply. More...
 
MovableObjectcreateInstance (const String &name, SceneManager *manager, const NameValuePairList *params=0)
 Create a new instance of the object. More...
 
virtual void destroyInstance (MovableObject *obj)
 Destroy an instance of the object. More...
 
virtual const StringgetType (void) const =0
 Get the type of the object to be created. More...
 
uint32 getTypeFlags (void) const
 Gets the type flag for this factory. More...
 
virtual bool requestTypeFlags (void) const
 Does this factory require the allocation of a 'type flag', used to selectively include / exclude this type from scene queries? More...
 

Detailed Description

Interface definition for a factory class which produces a certain kind of MovableObject, and can be registered with Root in order to allow all clients to produce new instances of this object, integrated with the standard Ogre processing.

Constructor & Destructor Documentation

◆ MovableObjectFactory()

Ogre::MovableObjectFactory::MovableObjectFactory ( )
inline

◆ ~MovableObjectFactory()

virtual Ogre::MovableObjectFactory::~MovableObjectFactory ( )
inlinevirtual

Member Function Documentation

◆ getType()

◆ createInstance()

MovableObject* Ogre::MovableObjectFactory::createInstance ( const String name,
SceneManager manager,
const NameValuePairList params = 0 
)

Create a new instance of the object.

Parameters
nameThe name of the new object
managerThe SceneManager instance that will be holding the instance once created.
paramsName/value pair list of additional parameters required to construct the object (defined per subtype). Optional.

◆ destroyInstance()

virtual void Ogre::MovableObjectFactory::destroyInstance ( MovableObject obj)
inlinevirtual

Destroy an instance of the object.

Reimplemented in Ogre::ParticleSystemFactory, and Ogre::PCZLightFactory.

◆ requestTypeFlags()

virtual bool Ogre::MovableObjectFactory::requestTypeFlags ( void  ) const
inlinevirtual

Does this factory require the allocation of a 'type flag', used to selectively include / exclude this type from scene queries?

Remarks
The default implementation here is to return 'false', ie not to request a unique type mask from Root. For objects that never need to be excluded in SceneQuery results, that's fine, since the default implementation of MovableObject::getTypeFlags is to return all ones, hence matching any query type mask. However, if you want the objects created by this factory to be filterable by queries using a broad type, you have to give them a (preferably unique) type mask - and given that you don't know what other MovableObject types are registered, Root will allocate you one.

Reimplemented in Ogre::PortalFactory, and Ogre::AntiPortalFactory.

◆ _notifyTypeFlags()

void Ogre::MovableObjectFactory::_notifyTypeFlags ( uint32  flag)
inline

Notify this factory of the type mask to apply.

Remarks
This should normally only be called by Root in response to a 'true' result from requestTypeMask. However, you can actually use it yourself if you're careful; for example to assign the same mask to a number of different types of object, should you always wish them to be treated the same in queries.

◆ getTypeFlags()

uint32 Ogre::MovableObjectFactory::getTypeFlags ( void  ) const
inline

Gets the type flag for this factory.

Remarks
A type flag is like a query flag, except that it applies to all instances of a certain type of object.

The documentation for this class was generated from the following file: