OgreBillboard.h
Go to the documentation of this file.
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2013 Torus Knot Software Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-----------------------------------------------------------------------------
*/
#ifndef __Billboard_H__
#define __Billboard_H__
#include "OgrePrerequisites.h"
#include "OgreVector3.h"
#include "OgreColourValue.h"
#include "OgreCommon.h"
#include "OgreHeaderPrefix.h"
namespace Ogre {
class _OgreExport Billboard : public FXAlloc
{
friend class BillboardSet;
friend class BillboardParticleRenderer;
protected:
bool mOwnDimensions;
bool mUseTexcoordRect;
uint16 mTexcoordIndex;
FloatRect mTexcoordRect;
Real mWidth;
Real mHeight;
public:
// Note the intentional public access to main internal variables used at runtime
// Forcing access via get/set would be too costly for 000's of billboards
Vector3 mPosition;
Vector3 mDirection;
BillboardSet* mParentSet;
ColourValue mColour;
Radian mRotation;
Billboard();
~Billboard();
Billboard(const Vector3& position, BillboardSet* owner, const ColourValue& colour = ColourValue::White);
const Radian& getRotation(void) const { return mRotation; }
void setRotation(const Radian& rotation);
void setPosition(const Vector3& position);
void setPosition(Real x, Real y, Real z);
const Vector3& getPosition(void) const;
void setDimensions(Real width, Real height);
void resetDimensions(void) { mOwnDimensions = false; }
void setColour(const ColourValue& colour);
const ColourValue& getColour(void) const;
bool hasOwnDimensions(void) const;
Real getOwnWidth(void) const;
Real getOwnHeight(void) const;
void _notifyOwner(BillboardSet* owner);
bool isUseTexcoordRect(void) const { return mUseTexcoordRect; }
void setTexcoordIndex(uint16 texcoordIndex);
uint16 getTexcoordIndex(void) const { return mTexcoordIndex; }
void setTexcoordRect(const FloatRect& texcoordRect);
void setTexcoordRect(Real u0, Real v0, Real u1, Real v1);
const FloatRect& getTexcoordRect(void) const { return mTexcoordRect; }
};
}
#include "OgreHeaderSuffix.h"
#endif
OgreVector3.h
_OgreExport
#define _OgreExport
Definition: OgrePlatform.h:257
Ogre::Billboard::mOwnDimensions
bool mOwnDimensions
Definition: OgreBillboard.h:72
Ogre::ColourValue
Class representing colour.
Definition: OgreColourValue.h:57
Ogre::Real
float Real
Software floating point type.
Definition: OgrePrerequisites.h:70
Ogre::TRect< float >
Ogre::Billboard::mDirection
Vector3 mDirection
Normalised direction vector.
Definition: OgreBillboard.h:83
Ogre::Billboard::mUseTexcoordRect
bool mUseTexcoordRect
Definition: OgreBillboard.h:73
Ogre::ColourValue::White
static const ColourValue White
Definition: OgreColourValue.h:62
OgreCommon.h
Ogre::Vector3
Standard 3-dimensional vector.
Definition: OgreVector3.h:51
OgrePrerequisites.h
Ogre::Billboard::mRotation
Radian mRotation
Definition: OgreBillboard.h:86
Ogre::BillboardParticleRenderer
Specialisation of ParticleSystemRenderer to render particles using a BillboardSet.
Definition: OgreBillboardParticleRenderer.h:52
Ogre::Billboard::mParentSet
BillboardSet * mParentSet
Definition: OgreBillboard.h:84
Ogre::Billboard::resetDimensions
void resetDimensions(void)
Resets this Billboard to use the parent BillboardSet&#39;s dimensions instead of it&#39;s own...
Definition: OgreBillboard.h:143
Ogre::Billboard::getTexcoordRect
const FloatRect & getTexcoordRect(void) const
getTexcoordRect() returns the previous value set by setTexcoordRect().
Definition: OgreBillboard.h:218
OgreHeaderSuffix.h
Ogre::Billboard::mColour
ColourValue mColour
Definition: OgreBillboard.h:85
Ogre::Billboard::mWidth
Real mWidth
Individual texture coordinates.
Definition: OgreBillboard.h:76
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::Billboard::mHeight
Real mHeight
Definition: OgreBillboard.h:77
Ogre::Billboard::mPosition
Vector3 mPosition
Definition: OgreBillboard.h:81
OgreColourValue.h
OgreHeaderPrefix.h
Ogre::BillboardSet
A collection of billboards (faces which are always facing the given direction) with the same (default...
Definition: OgreBillboardSet.h:110
Ogre::Billboard::getTexcoordIndex
uint16 getTexcoordIndex(void) const
getTexcoordIndex() returns the previous value set by setTexcoordIndex().
Definition: OgreBillboard.h:198
Ogre::Billboard::isUseTexcoordRect
bool isUseTexcoordRect(void) const
Returns true if this billboard use individual texture coordinate rect (i.e.
Definition: OgreBillboard.h:182
Ogre::Billboard
A billboard is a primitive which always faces the camera in every frame.
Definition: OgreBillboard.h:67
Ogre::Billboard::getRotation
const Radian & getRotation(void) const
Get the rotation of the billboard.
Definition: OgreBillboard.h:104
Ogre::Billboard::mTexcoordRect
FloatRect mTexcoordRect
Index into the BillboardSet array of texture coordinates.
Definition: OgreBillboard.h:75
Ogre::Billboard::mTexcoordIndex
uint16 mTexcoordIndex
Definition: OgreBillboard.h:74
Ogre::uint16
unsigned short uint16
Definition: OgrePlatform.h:360
Ogre::AllocatedObject
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Definition: OgreMemoryAllocatedObject.h:58
Ogre::Radian
Wrapper class which indicates a given angle value is in Radians.
Definition: OgreMath.h:47

Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.