40 #ifndef _graphicsbillboard_cpp
41 #define _graphicsbillboard_cpp
50 #include "stringtool.h"
59 GraphicsBillboard(InternalBillboard)
175 Real OwnWidth = -1.0, OwnHeight = -1.0;
176 Real LeftTexCoord = -1.0, TopTexCoord = -1.0, RightTexCoord = -1.0, BottomTexCoord = -1.0;
179 if( !CurrAttrib.
Empty() )
183 if( !CurrAttrib.
Empty() )
184 OwnWidth = CurrAttrib.
AsReal();
187 if( !CurrAttrib.
Empty() )
188 OwnHeight = CurrAttrib.
AsReal();
190 if( OwnWidth >= 0 && OwnHeight >= 0 ) {
195 if( !CurrAttrib.
Empty() )
196 LeftTexCoord = CurrAttrib.
AsReal();
199 if( !CurrAttrib.
Empty() )
200 TopTexCoord = CurrAttrib.
AsReal();
203 if( !CurrAttrib.
Empty() )
204 RightTexCoord = CurrAttrib.
AsReal();
207 if( !CurrAttrib.
Empty() )
208 BottomTexCoord = CurrAttrib.
AsReal();
210 if( LeftTexCoord >= 0 && TopTexCoord >= 0 && RightTexCoord >= 0 && BottomTexCoord >= 0 ) {
215 if( !LocationNode.
Empty() ) {
221 if( !DirectionNode.
Empty() ) {
227 if( !ColourNode.
Empty() ) {
240 {
return "Billboard"; }
Attribute AppendAttribute(const Char8 *Name)
Creates an Attribute and puts it at the end of this Nodes attributes.
void SetColour(const ColourValue &Colour)
Sets the base colour of this billboard.
A light-weight handle for manipulating attributes in DOM tree.
void ResetDimensions()
Resets whatever dimensions are on this billboard to the default provided to the parent BillboardSetPr...
void SetLocation(const Vector3 &Loc)
Sets the location of this billboard relative to it's parent set.
bool Boole
Generally acts a single bit, true or false.
Real GetRightTextureCoord() const
Gets the Right side texture coordinate being used to render this billboard.
void ProtoDeSerialize(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite this object with it.
Vector3 GetDirection() const
Gets the facing direction of this billboard. Only useful with specific types of BillboardSetProxies.
Thrown when the requested identity could not be found.
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.
Real GetBottomTextureCoord() const
Gets the Bottom side texture coordinate being used to render this billboard.
Real GetOwnHeight() const
Gets the individually configured world unit Height of this billboard.
Thrown when a version is accessed/parsed/required and it cannot work correctly or is missing...
~Billboard()
Class destructor.
ColourValue GetColour() const
Gets the base colour of this billboard.
Vector3 GetLocation() const
Gets the location of this billboard relative to it's parent set.
This is a simple class for holding 4 reals representing the colour any give object or lightsource can...
bool Empty() const
Is this storing anything at all?
This implements the exception hiearchy for Mezzanine.
void SetTextureCoordRect(const Real Left, const Real Top, const Real Right, const Real Bottom)
Sets the rect in texture coordinates to use for rendering this billboard.
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.
static String GetSerializableName()
Get the name of the the XML tag the proxy class will leave behind as its instances are serialized...
A light-weight handle for manipulating nodes in DOM tree.
Real GetLeftTextureCoord() const
Gets the Left side texture coordinate being used to render this billboard.
int AsInt(int def=0) const
Attempts to convert the value of the attribute to an int and returns the results. ...
Real GetOwnWidth() const
Gets the individually configured world unit Width of this billboard.
bool Empty() const
Is this storing anything at all?
Real GetTopTextureCoord() const
Gets the Top side texture coordinate being used to render this billboard.
Ogre::Vector3 GetOgreVector3() const
Gets a Ogre vector3.
Real AsReal(Real def=0) const
Attempts to convert the value of the attribute to a Real and returns the results. ...
void ProtoSerialize(XML::Node &ParentNode) const
Convert this class to an XML::Node ready for serialization.
This file contains the declaration for the Billboard class used by BillboardSetProxy.
This is used to represent a point in space, or a vector through space.
Boole IsUsingTextureCoordRect() const
Gets whether or not this billboard is using custom texture coordinates.
The bulk of the engine components go in this namspace.
Ogre::Billboard * _GetGraphicsObject() const
Accessor for the internal billboard.
void ProtoSerialize(XML::Node &CurrentRoot) const
Convert this class to an XML::Node ready for serialization.
Boole HasOwnDimensions() const
Gets whether or not this billboard has had it's dimensions individually configured.
const Char8 * Name() const
ptrdiff_tGet the name of this Node.
Ogre::ColourValue GetOgreColourValue() const
Creates and returns an Ogre ColourValue class with values equal to this one.
void SerializeError(const String &FailedTo, const String &ClassName, Boole SOrD)
Simply does some string concatenation, then throws an Exception.
Billboard(Ogre::Billboard *InternalBillboard)
Internal constructor.
Node AppendChild(NodeType Type=NodeElement)
Creates a Node and makes it a child of this one.
std::string String
A datatype used to a series of characters.
void SetDirection(const Vector3 &Dir)
Sets the facing direction of this billboard. Only useful with specific types of BillboardSetProxies.
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.
Real GetRotation() const
Gets the rotation of this billboard.
Node GetChild(const Char8 *Name) const
Attempt to get a child Node with a given name.
Ogre::Billboard * GraphicsBillboard
A pointer to the internal Billboard.
void SetRotation(const Real Rot)
Sets the rotation of this billboard.
void SetDimensions(const Real Width, const Real Height)
Sets the world unit dimensions of this billboard.