lugre_BorderColourClipPaneOverlay.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef LUGRE_BorderColourClipPaneOVERLAY_H
00025 #define LUGRE_BorderColourClipPaneOVERLAY_H
00026 #include "lugre_ColourClipPaneOverlay.h"
00027 #include "lugre_robrenderable.h"
00028 #include <OgrePrerequisites.h>
00029
00030
00031 namespace Lugre {
00032
00033
00034
00035
00036
00037 class CCPBorderRenderable;
00038
00039 class cBorderColourClipPaneOverlay : public cColourClipPaneOverlay { public :
00040 Ogre::RenderOperation mRenderOpBorder;
00041 static Ogre::String msTypeName;
00042
00043 cBorderColourClipPaneOverlay(const Ogre::String& name);
00044 virtual ~cBorderColourClipPaneOverlay();
00045
00047 static void RegisterFactory ();
00048
00049 enum {
00050 kBCCPOPart_LT=0,
00051 kBCCPOPart_T,
00052 kBCCPOPart_RT,
00053 kBCCPOPart_L,
00054 kBCCPOPart_R,
00055 kBCCPOPart_LB,
00056 kBCCPOPart_B,
00057 kBCCPOPart_RB,
00058 kBCCPOPart_M,
00059 };
00060
00061
00062 CCPBorderRenderable* mBorderRenderable;
00063 VertexRect mFormParts[9];
00064 Ogre::Rectangle mBorder;
00065 Ogre::String mBorderMaterialName;
00066 Ogre::MaterialPtr mpBorderMaterial;
00067 cRobRenderOp mpRobRenderOpBorder;
00068
00070 virtual void setColour (const Ogre::ColourValue& col);
00071 virtual void SetColours (const Ogre::ColourValue colLT,const Ogre::ColourValue colRT,const Ogre::ColourValue colLB,const Ogre::ColourValue colRB);
00072 virtual void SetColours (const int iPart,const Ogre::ColourValue colLT,const Ogre::ColourValue colRT,const Ogre::ColourValue colLB,const Ogre::ColourValue colRB);
00073 virtual void SetTexCoords (const Ogre::Real fU1,const Ogre::Real fV1,const Ogre::Real fU2,const Ogre::Real fV2);
00074 virtual void SetTexCoords (const int iPart,const Ogre::Real fU1,const Ogre::Real fV1,const Ogre::Real fU2,const Ogre::Real fV2);
00075 virtual void SetBorder (const Ogre::Real l,const Ogre::Real t,const Ogre::Real r,const Ogre::Real b);
00076
00078 virtual const Ogre::String& getTypeName(void) const;
00079
00080 void setBorderMaterialName(const Ogre::String& name);
00081
00082 virtual void initialise (void);
00083
00085 virtual void _updateRenderQueue(Ogre::RenderQueue* queue);
00086
00088 virtual void updatePositionGeometry(void);
00089 };
00090
00091
00097 class CCPBorderRenderable : public Ogre::Renderable
00098 {
00099 protected:
00100 cBorderColourClipPaneOverlay* mParent;
00101 public:
00103 CCPBorderRenderable(cBorderColourClipPaneOverlay* parent) : mParent(parent) {
00104 mUseIdentityProjection = true;
00105 mUseIdentityView = true;
00106 }
00107 const Ogre::MaterialPtr& getMaterial(void) const { return mParent->mpBorderMaterial; }
00108 void getRenderOperation(Ogre::RenderOperation& op) { op = mParent->mRenderOpBorder; }
00109 void getWorldTransforms(Ogre::Matrix4* xform) const { mParent->getWorldTransforms(xform); }
00110 const Ogre::Quaternion& getWorldOrientation(void) const { return Ogre::Quaternion::IDENTITY; }
00111 const Ogre::Vector3& getWorldPosition(void) const { return Ogre::Vector3::ZERO; }
00112 unsigned short getNumWorldTransforms(void) const { return 1; }
00113 bool useIdentityProjection(void) const { return true; }
00114 bool useIdentityView(void) const { return true; }
00115 Ogre::Real getSquaredViewDepth(const Ogre::Camera* cam) const { return mParent->getSquaredViewDepth(cam); }
00116 const Ogre::LightList& getLights(void) const
00117 {
00118
00119 static Ogre::LightList ll;
00120 return ll;
00121 }
00122 bool getPolygonModeOverrideable(void) const
00123 {
00124 return mParent->getPolygonModeOverrideable();
00125 }
00126 };
00127
00128 };
00129
00130 #endif