40 #ifndef _graphicsbillboardsetproxy_cpp
41 #define _graphicsbillboardsetproxy_cpp
47 #include "Graphics/scenemanager.h"
52 #include "stringtool.h"
96 return Ogre::BBO_CENTER;
123 return Ogre::BBR_TEXCOORD;
156 return Ogre::BBT_POINT;
194 this->
GraphicsBillboardSet->MovableObject::setUserAny( Ogre::Any( static_cast<RenderableProxy*>(
this ) ) );
212 return Mezzanine::PT_Graphics_BillboardSetProxy;
247 if( (*BillIt) == ToBeDestroyed )
376 (*BillIt)->ProtoSerialize( BillboardsNode );
390 if( !PropertiesNode.
Empty() ) {
393 if( !CurrAttrib.
Empty() )
396 CurrAttrib = PropertiesNode.
GetAttribute(
"AccurateFacing");
397 if( !CurrAttrib.
Empty() )
401 if( !CurrAttrib.
Empty() )
404 CurrAttrib = PropertiesNode.
GetAttribute(
"BillboardOrigin");
405 if( !CurrAttrib.
Empty() )
408 CurrAttrib = PropertiesNode.
GetAttribute(
"BillboardRotation");
409 if( !CurrAttrib.
Empty() )
412 CurrAttrib = PropertiesNode.
GetAttribute(
"BillboardType");
413 if( !CurrAttrib.
Empty() )
416 CurrAttrib = PropertiesNode.
GetAttribute(
"DefaultWidth");
417 if( !CurrAttrib.
Empty() )
420 CurrAttrib = PropertiesNode.
GetAttribute(
"DefaultHeight");
421 if( !CurrAttrib.
Empty() )
424 CurrAttrib = PropertiesNode.
GetAttribute(
"MaterialName");
425 if( !CurrAttrib.
Empty() )
429 if( !CommonDirectionNode.
Empty() ) {
430 Vector3 CommonDir(CommonDirectionNode);
435 if( !CommonUpVectorNode.
Empty() ) {
436 Vector3 CommonUpVec(CommonUpVectorNode);
453 if( !BillboardsNode.
Empty() ) {
468 {
return "BillboardSetProxy"; }
Billboards are oriented around their own individually set direction axis, which will act as their loc...
Position/Rotate around the Top-Right corner of the billboard.
virtual Graphics::BillboardType GetBillboardType() const
Gets the type of BillboardSetProxy this is.
virtual void SetBillboardRotation(const Graphics::BillboardRotation Rotation)
Sets the type of rotation to apply when a rotation is made to a billboard.
Attribute AppendAttribute(const Char8 *Name)
Creates an Attribute and puts it at the end of this Nodes attributes.
virtual void DestroyBillboard(Billboard *ToBeDestroyed)
Deletes a Billboard.
virtual Graphics::BillboardOrigin GetBillboardOrigin() const
Gets the part of the billboard that is currently being treated as the origin for all children of this...
A light-weight handle for manipulating attributes in DOM tree.
virtual void ProtoSerializeImpl(XML::Node &SelfRoot) const
Implementation method for serializing additional sets of data.
virtual void DestroyAllBillboards()
Deletes all stored Billboard instances.
BillboardContainer::const_iterator ConstBillboardIterator
Const Iterator type for Billboard instances stored by this class.
bool Boole
Generally acts a single bit, true or false.
void ProtoDeSerialize(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite this object with it.
This class contains utilities and functions to allow the manipulation of the Graphical scene...
This is the proxy class for placing and manipulating a set of 2D billboards in the scene...
virtual Vector3 GetCommonDirection() const
Gets the common facing direction for all billboards in this set.
virtual Vector3 GetCommonUpVector() const
Gets the common up direction for all billboards in this set.
virtual Ogre::MovableObject * _GetBaseGraphicsObject() const
Accessor for the internal graphics object.
Billboards are oriented around a common axis provided to the BillboardSetProxy, which will act as the...
virtual void SetDefaultWidth(const Real Width)
Sets the default width all billboards in this set are to be configured with when constructed.
Thrown when the requested identity could not be found.
virtual void ProtoSerializeImpl(XML::Node &SelfRoot) const
Implementation method for serializing additional sets of data.
Node GetFirstChild() const
Get the first child Node of this Node.
#define MEZZ_EXCEPTION(num, desc)
An easy way to throw exceptions with rich information.
virtual void SetCommonDirection(const Vector3 &Dir)
Sets the common facing direction for all billboards in this set.
SceneManager * Manager
This is a pointer to the scene manager that created and owns this proxy.
virtual void SetBillboardType(const Graphics::BillboardType Type)
Sets the type of BillboardSetProxy this is.
virtual void ProtoDeSerialize(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite this object with it.
virtual void ProtoSerializeBillboards(XML::Node &SelfRoot) const
Convert the Billboards of this class to an XML::Node ready for serialization.
Billboards are oriented around a common axis provided to the BillboardSetProxy, which will act as the...
Rotates the texture coordinates of the billboard when rotated, preserving the vertex positions...
virtual void ProtoSerializeProperties(XML::Node &SelfRoot) const
Convert the properties of this class to an XML::Node ready for serialization.
Thrown when a version is accessed/parsed/required and it cannot work correctly or is missing...
const Char8 * AsString(const Char8 *def="") const
Attempts to convert the value of the attribute to a String and returns the results.
virtual Ogre::BillboardSet * _GetGraphicsObject() const
Accessor for the internal billboard set.
BillboardContainer::iterator BillboardIterator
Iterator type for Billboard instances stored by this class.
Ogre::BillboardSet * GraphicsBillboardSet
A pointer to the internal BillboardSet this proxy is based on.
Default setting. Billboard direction always faces the camera and is always oriented to be upright...
This is the base proxy class for world proxies wrapping functionality of the graphics subsystem...
virtual void SetPoolSize(const UInt32 Size)
Sets a new size of the billboard pool in this set.
This file contains the declaration for the World proxy wrapping billboard functionality.
virtual ~BillboardSetProxy()
Class destructor.
BillboardContainer Billboards
Container storing all of the Billboard instances created by this proxy.
This is a simple class for holding 4 reals representing the colour any give object or lightsource can...
virtual Boole GetAccurateFacing() const
Gets whether direction vectors are being calculated using a more expensive but more accurate algorith...
bool Empty() const
Is this storing anything at all?
This implements the exception hiearchy for Mezzanine.
virtual void SetDefaultHeight(const Real Height)
Sets the default height all billboards in this set are to be configured with when constructed...
virtual void SetAccurateFacing(const Boole AccFace)
Sets whether direction vectors will be calculated using a more expensive but more accurate algorithm...
virtual void ProtoDeSerializeBillboards(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite the Billboards of this object with it...
Rotates the vertices of the billboard when rotated.
BillboardOrigin
This is used by the BillboardSetProxy to describe which part of the billboard will be treated as the ...
Ogre::SceneNode * GraphicsNode
A pointer to the internal object storing the proxy transform.
float Real
A Datatype used to represent a real floating point number.
The interface for serialization.
bool SetValue(const Char8 *rhs)
Set the value of this.
virtual void ProtoDeSerializeProperties(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite the properties of this object with it...
virtual void ProtoDeSerializeProperties(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite the properties of this object with it...
Whole AsWhole(Whole def=0) const
Attempts to convert the value of the attribute to a Whole and returns the results.
Child node iterator (a bidirectional iterator over a collection of Node)
A light-weight handle for manipulating nodes in DOM tree.
iterator begin() const
Get a Child node iterator that references the first child Node.
int AsInt(int def=0) const
Attempts to convert the value of the attribute to an int and returns the results. ...
ProxyType
Used by all World proxies to describe what their derived types are.
uint32_t UInt32
An 32-bit unsigned integer.
iterator end() const
Get a Child node iterator that references one past the last child Node.
virtual Boole GetAutoExtend() const
Gets whether or not this BillboardSetProxy will increase the size of it's billboard pool automaticall...
bool Empty() const
Is this storing anything at all?
Position/Rotate around the Top-Left corner of the billboard.
Ogre::Vector3 GetOgreVector3() const
Gets a Ogre vector3.
virtual void CreateBillboardSet(const UInt32 InitialPoolSize)
Creates an internal BillboardSet to be used by the calling instance.
Real AsReal(Real def=0) const
Attempts to convert the value of the attribute to a Real and returns the results. ...
virtual Real GetDefaultHeight() const
Gets the default height all billboards in this set are constructed with.
virtual String GetDerivedSerializableName() const
Gets the most derived serializable name of this WorldProxy.
virtual void SetDefaultDimensions(const Real Width, const Real Height)
Sets the default width and height all billboards in this set are to be configured with when construct...
Position/Rotate around the Center of the billboard.
virtual Billboard * GetBillboard(UInt32 Index)
Gets a Billboard instance by index.
BillboardSetProxy(const UInt32 ID, const UInt32 InitialPoolSize, SceneManager *Creator)
Class constructor.
Position/Rotate around the Center-Left side of the billboard.
virtual void SetBillboardOrigin(const Graphics::BillboardOrigin Origin)
Sets the part of the billboard that will be treated as the origin for all children of this set...
virtual Mezzanine::ProxyType GetProxyType() const
Accessor for the type of proxy.
virtual Billboard * CreateBillboard(const Vector3 &Location, const ColourValue &Colour=ColourValue::White())
Creates a new Billboard for this set.
virtual void ProtoDeSerializeImpl(const XML::Node &SelfRoot)
Implementation method for deseriailizing additional sets of data.
virtual UInt32 GetPoolSize() const
Gets the current size of the billboard pool in this set.
This file contains the declaration for the Billboard class used by BillboardSetProxy.
Ogre::SceneManager * _GetGraphicsWorldPointer() const
Gets the internal Ogre Scene Manager pointer.
virtual void SetCommonUpVector(const Vector3 &UpDir)
Sets the common up direction for all billboards in this set.
This is used to represent a point in space, or a vector through space.
The bulk of the engine components go in this namspace.
Position/Rotate around the Bottom-Center of the billboard.
Ogre::Billboard * _GetGraphicsObject() const
Accessor for the internal billboard.
Position/Rotate around the Bottom-Right corner of the billboard.
static String GetSerializableName()
Get the name of the the XML tag the proxy class will leave behind as its instances are serialized...
virtual String GetMaterialName() const
Gets the name of the material being used by this set.
virtual void SetAutoExtend(const Boole AutoExtend)
Sets whether or not this BillboardSetProxy will increase the size of it's billboard pool automaticall...
virtual void SetMaterialName(const String &MatName)
Sets a material for this set by name.
virtual Real GetDefaultWidth() const
Gets the default width all billboards in this set are constructed with.
Ogre::ColourValue GetOgreColourValue() const
Creates and returns an Ogre ColourValue class with values equal to this one.
Position/Rotate around the Center-Right side of the billboard.
BillboardType
This is used by BillboardSetProxies to describe how the billboards are to be oriented.
void SerializeError(const String &FailedTo, const String &ClassName, Boole SOrD)
Simply does some string concatenation, then throws an Exception.
Node AppendChild(NodeType Type=NodeElement)
Creates a Node and makes it a child of this one.
virtual UInt32 GetNumBillboards() const
Gets the number of Billboard instances in this set.
virtual void DestroyBillboardSet()
Destroys the internal BillboardSet in use by this proxy.
std::string String
A datatype used to a series of characters.
BillboardRotation
This is used by the BillboardSetProxy to decide how billboards should be rotated when they are reques...
Attribute GetAttribute(const Char8 *Name) const
Attempt to get an Attribute on this Node with a given name.
void ProtoSerialize(XML::Node &CurrentRoot) const
Convert this class to an XML::Node ready for serialization.
Position/Rotate around the Bottom-Left corner of the billboard.
Position/Rotate around the Top-Center of the billboard.
Node GetChild(const Char8 *Name) const
Attempt to get a child Node with a given name.
virtual void ProtoSerializeProperties(XML::Node &SelfRoot) const
Convert the properties of this class to an XML::Node ready for serialization.
virtual void ProtoDeSerializeImpl(const XML::Node &SelfRoot)
Implementation method for deseriailizing additional sets of data.
virtual Graphics::BillboardRotation GetBillboardRotation() const
Gets the type of rotation to apply when a rotation is made to a billboard.
Billboards are oriented around their own individually set direction axis, which will act as their loc...