#include <lugre_robrenderable.h>


Public Types | |
| enum | eVertexFormat { kVertexFormat_none, kVertexFormat_p, kVertexFormat_puv, kVertexFormat_pn, kVertexFormat_pnuv, kVertexFormat_pc, kVertexFormat_puvc, kVertexFormat_pnc, kVertexFormat_pnuvc } |
| p:position n:normal uv:texcoords c:color More... | |
Public Member Functions | |
| cRobRenderOp (Ogre::RenderOperation *pRenderOp=0, Ogre::AxisAlignedBox *pBox=0) | |
| virtual | ~cRobRenderOp () |
| void | Begin (const size_t iVertexCount, const size_t iIndexCount=0, const bool bDynamic=false, const bool bKeepOldIndices=false, const Ogre::RenderOperation::OperationType opType=Ogre::RenderOperation::OT_TRIANGLE_LIST, const bool bReadable=false) |
| void | Vertex (const Ogre::Vector3 &p) |
| void | Vertex (const Ogre::Vector3 &p, const Ogre::Real u, const Ogre::Real v) |
| void | Vertex (const Ogre::Vector3 &p, const Ogre::Vector3 &n) |
| void | Vertex (const Ogre::Vector3 &p, const Ogre::Vector3 &n, const Ogre::Real u, const Ogre::Real v) |
| void | Vertex (const Ogre::Vector3 &p, const Ogre::ColourValue &c) |
| void | Vertex (const Ogre::Vector3 &p, const Ogre::Real u, const Ogre::Real v, const Ogre::ColourValue &c) |
| void | Vertex (const Ogre::Vector3 &p, const Ogre::Vector3 &n, const Ogre::ColourValue &c) |
| void | Vertex (const Ogre::Vector3 &p, const Ogre::Vector3 &n, const Ogre::Real u, const Ogre::Real v, const Ogre::ColourValue &c) |
| void | Index (const int i) |
| void | Index (const int i, const int j, const int k) |
| void | End () |
| void | SkipVertices (const size_t iNum=1) |
| unused vertices may be skipped even after initialisiation, no reallocation neccessary, just leave some unused buffer-space | |
| void | SkipIndices (const size_t iNum=1) |
| void | AddToMesh (Ogre::MeshPtr pMesh, const std::string &sMatName) |
| void | ConvertToMesh (const std::string &sMeshName, const std::string &sMatName) |
| Ogre::Real * | StartCustomWriter (const Ogre::Vector3 &vBoundsMin, const Ogre::Vector3 &vBoundsMax) |
| void | SetVertexFormatFromEnum (const eVertexFormat miVertexFormat, const int iNumTexCoordsSets=1) |
| Ogre::VertexDeclaration * | GetVertexDecl () |
| void | _StartWrite (const bool bVertexFormatChanged) |
| internal method, don't use directly | |
| void | _AllocateIndexBufferIfNeeded () |
| Ogre::Real * | PrepareAddVertex (const eVertexFormat miVertexFormat, const Ogre::Vector3 &p) |
| internal method, don't use directly | |
Static Public Member Functions | |
| static Ogre::Real | GetMaxZ () |
Public Attributes | |
| Ogre::Vector3 | mvAABMin |
| Ogre::Vector3 | mvAABMax |
| bool | mbBoundingBoxEmpty |
| Ogre::Real | mfBoundingRadius |
| Ogre::RenderOperation * | mpRenderOp |
| Ogre::AxisAlignedBox * | mpBox |
| size_t | miVertexCapacity |
| size_t | miIndexCapacity |
| size_t | miVertexCount |
| size_t | miIndexCount |
| size_t | miVertexSize |
| bool | mbBufferIsDynamic |
| todo : only used for vertexbuffer so far | |
| bool | mbBufferIsReadable |
| todo : only used for vertexbuffer so far | |
| bool | mbDynamic |
| bool | mbReadable |
| bool | mbKeepOldIndices |
| eVertexFormat | miVertexFormat |
| size_t | miReceivedVertices |
| size_t | miReceivedIndices |
| Ogre::RenderSystem * | mpRenderSys |
| char * | mVertexWritePtr |
| unsigned short * | mIndexWritePtr |
| Ogre::HardwareVertexBufferSharedPtr | mHWVBuf |
| Ogre::HardwareIndexBufferSharedPtr | mHWIBuf |
Definition at line 37 of file lugre_robrenderable.h.
p:position n:normal uv:texcoords c:color
| kVertexFormat_none | |
| kVertexFormat_p | |
| kVertexFormat_puv | |
| kVertexFormat_pn | |
| kVertexFormat_pnuv | |
| kVertexFormat_pc | |
| kVertexFormat_puvc | |
| kVertexFormat_pnc | |
| kVertexFormat_pnuvc |
Definition at line 44 of file lugre_robrenderable.h.
| Lugre::cRobRenderOp::cRobRenderOp | ( | Ogre::RenderOperation * | pRenderOp = 0, |
|
| Ogre::AxisAlignedBox * | pBox = 0 | |||
| ) |
| Lugre::cRobRenderOp::~cRobRenderOp | ( | ) | [virtual] |
| void Lugre::cRobRenderOp::Begin | ( | const size_t | iVertexCount, | |
| const size_t | iIndexCount = 0, |
|||
| const bool | bDynamic = false, |
|||
| const bool | bKeepOldIndices = false, |
|||
| const Ogre::RenderOperation::OperationType | opType = Ogre::RenderOperation::OT_TRIANGLE_LIST, |
|||
| const bool | bReadable = false | |||
| ) |
Definition at line 87 of file lugre_robrenderable.cpp.
References assert, mbBoundingBoxEmpty, mbDynamic, mbKeepOldIndices, mbReadable, miIndexCount, mIndexWritePtr, miReceivedIndices, miReceivedVertices, miVertexCount, mpRenderOp, mpRenderSys, mvAABMax, mvAABMin, mVertexWritePtr, and PROFILE.
Referenced by Lugre::cBeam::Draw(), Lugre::cRobRenderable2D_L::RobRenderable2D_Open(), Lugre::cGfx3D::SetStarfield(), Lugre::cGfx3D::SetText(), Lugre::cGfx3D::SetWireBoundingBox(), Lugre::cRadar::Step(), Lugre::cRadialGrid::Step(), Lugre::cRadialGrid::UpdateCircles(), Lugre::cSpriteList::UpdateGeometry(), Lugre::cSpriteList::UpdateGeometryClipped(), Lugre::cCompassOverlay::updatePositionGeometry(), Lugre::cColourClipTextOverlay::updatePositionGeometry(), Lugre::cColourClipPaneOverlay::updatePositionGeometry(), and Lugre::cBorderColourClipPaneOverlay::updatePositionGeometry().
| void Lugre::cRobRenderOp::Vertex | ( | const Ogre::Vector3 & | p | ) |
Definition at line 243 of file lugre_robrenderable.cpp.
References kVertexFormat_p, and PrepareAddVertex().
Referenced by Lugre::cColourClipPaneOverlay::Vertex::Draw(), Lugre::cBeam::Draw(), Lugre::cRobRenderable2D_L::RobRenderable2D_Vertex(), Lugre::cGfx3D::SetStarfield(), Lugre::cGfx3D::SetText(), Lugre::cGfx3D::SetWireBoundingBox(), Lugre::cRadar::Step(), Lugre::cRadialGrid::Step(), Lugre::cRadialGrid::UpdateCircles(), and Lugre::cCompassOverlay::updatePositionGeometry().
| void Lugre::cRobRenderOp::Vertex | ( | const Ogre::Vector3 & | p, | |
| const Ogre::Real | u, | |||
| const Ogre::Real | v | |||
| ) |
Definition at line 247 of file lugre_robrenderable.cpp.
References kVertexFormat_puv, and PrepareAddVertex().
| void Lugre::cRobRenderOp::Vertex | ( | const Ogre::Vector3 & | p, | |
| const Ogre::Vector3 & | n | |||
| ) |
Definition at line 253 of file lugre_robrenderable.cpp.
References kVertexFormat_pn, and PrepareAddVertex().
| void Lugre::cRobRenderOp::Vertex | ( | const Ogre::Vector3 & | p, | |
| const Ogre::Vector3 & | n, | |||
| const Ogre::Real | u, | |||
| const Ogre::Real | v | |||
| ) |
Definition at line 260 of file lugre_robrenderable.cpp.
References kVertexFormat_pnuv, and PrepareAddVertex().
| void Lugre::cRobRenderOp::Vertex | ( | const Ogre::Vector3 & | p, | |
| const Ogre::ColourValue & | c | |||
| ) |
Definition at line 276 of file lugre_robrenderable.cpp.
References kVertexFormat_pc, mpRenderSys, PrepareAddVertex(), and Lugre::RobWriteCol().
| void Lugre::cRobRenderOp::Vertex | ( | const Ogre::Vector3 & | p, | |
| const Ogre::Real | u, | |||
| const Ogre::Real | v, | |||
| const Ogre::ColourValue & | c | |||
| ) |
Definition at line 281 of file lugre_robrenderable.cpp.
References kVertexFormat_puvc, mpRenderSys, PrepareAddVertex(), and Lugre::RobWriteCol().
| void Lugre::cRobRenderOp::Vertex | ( | const Ogre::Vector3 & | p, | |
| const Ogre::Vector3 & | n, | |||
| const Ogre::ColourValue & | c | |||
| ) |
Definition at line 288 of file lugre_robrenderable.cpp.
References kVertexFormat_pnc, mpRenderSys, PrepareAddVertex(), and Lugre::RobWriteCol().
| void Lugre::cRobRenderOp::Vertex | ( | const Ogre::Vector3 & | p, | |
| const Ogre::Vector3 & | n, | |||
| const Ogre::Real | u, | |||
| const Ogre::Real | v, | |||
| const Ogre::ColourValue & | c | |||
| ) |
Definition at line 296 of file lugre_robrenderable.cpp.
References kVertexFormat_pnuvc, mpRenderSys, PrepareAddVertex(), and Lugre::RobWriteCol().
| void Lugre::cRobRenderOp::Index | ( | const int | i | ) |
Definition at line 308 of file lugre_robrenderable.cpp.
References _AllocateIndexBufferIfNeeded(), assert, mHWIBuf, miIndexCount, mIndexWritePtr, miReceivedIndices, miVertexCount, mpRenderOp, and PROFILE.
Referenced by Lugre::cBeam::Draw(), Index(), Lugre::cRobRenderable2D_L::RobRenderable2D_Index(), Lugre::cRobRenderable2D_L::RobRenderable2D_Index2(), Lugre::cRobRenderable2D_L::RobRenderable2D_Index3(), Lugre::cGfx3D::SetText(), Lugre::cSpriteList::UpdateGeometry(), Lugre::cSpriteList::UpdateGeometryClipped(), and Lugre::cCompassOverlay::updatePositionGeometry().
| void Lugre::cRobRenderOp::Index | ( | const int | i, | |
| const int | j, | |||
| const int | k | |||
| ) |
| void Lugre::cRobRenderOp::End | ( | ) |
Definition at line 342 of file lugre_robrenderable.cpp.
References _AllocateIndexBufferIfNeeded(), assert, max(), mbKeepOldIndices, mfBoundingRadius, mHWIBuf, mHWVBuf, miIndexCount, mIndexWritePtr, miReceivedIndices, miReceivedVertices, miVertexCount, mpBox, mpRenderOp, mvAABMax, mvAABMin, mVertexWritePtr, and PROFILE.
Referenced by Lugre::cBeam::Draw(), Lugre::cRobRenderable2D_L::RobRenderable2D_Close(), Lugre::cGfx3D::SetStarfield(), Lugre::cGfx3D::SetText(), Lugre::cGfx3D::SetWireBoundingBox(), Lugre::cRadar::Step(), Lugre::cRadialGrid::Step(), Lugre::cRadialGrid::UpdateCircles(), Lugre::cSpriteList::UpdateGeometry(), Lugre::cSpriteList::UpdateGeometryClipped(), Lugre::cCompassOverlay::updatePositionGeometry(), Lugre::cColourClipTextOverlay::updatePositionGeometry(), Lugre::cColourClipPaneOverlay::updatePositionGeometry(), and Lugre::cBorderColourClipPaneOverlay::updatePositionGeometry().
| void Lugre::cRobRenderOp::SkipVertices | ( | const size_t | iNum = 1 |
) |
unused vertices may be skipped even after initialisiation, no reallocation neccessary, just leave some unused buffer-space
Definition at line 359 of file lugre_robrenderable.cpp.
References miVertexCount, and mpRenderOp.
Referenced by Lugre::cRobRenderable2D_L::RobRenderable2D_SkipVertices(), Lugre::cGfx3D::SetText(), Lugre::cSpriteList::UpdateGeometryClipped(), and Lugre::cColourClipTextOverlay::updatePositionGeometry().
| void Lugre::cRobRenderOp::SkipIndices | ( | const size_t | iNum = 1 |
) |
Definition at line 364 of file lugre_robrenderable.cpp.
References miIndexCount, and mpRenderOp.
Referenced by Lugre::cRobRenderable2D_L::RobRenderable2D_SkipIndices(), Lugre::cGfx3D::SetText(), and Lugre::cSpriteList::UpdateGeometryClipped().
| void Lugre::cRobRenderOp::AddToMesh | ( | Ogre::MeshPtr | pMesh, | |
| const std::string & | sMatName | |||
| ) |
Definition at line 377 of file lugre_robrenderable.cpp.
References mfBoundingRadius, mpRenderOp, mvAABMax, mvAABMin, and Lugre::mymax().
Referenced by Lugre::cRobSimpleRenderable::AddToMesh(), and ConvertToMesh().
| void Lugre::cRobRenderOp::ConvertToMesh | ( | const std::string & | sMeshName, | |
| const std::string & | sMatName | |||
| ) |
Definition at line 370 of file lugre_robrenderable.cpp.
References AddToMesh().
Referenced by Lugre::cRobSimpleRenderable::ConvertToMesh().
| Ogre::Real * Lugre::cRobRenderOp::StartCustomWriter | ( | const Ogre::Vector3 & | vBoundsMin, | |
| const Ogre::Vector3 & | vBoundsMax | |||
| ) |
if the Vertex() methods above are not enough, and you want to use a custom vertex decl (e.g for multitexturing) you can use GetVertexDecl() to assemble the vertex declaration and this function for writing to the buffers vertex declaration should be modified via GetVertexDecl before this... bVertexFormatChanged : if in doubt, set to true use this after calling Begin(), then write vertex data to the returned pointer (vram) don't forget to call End()
Definition at line 189 of file lugre_robrenderable.cpp.
References _StartWrite(), assert, mbBoundingBoxEmpty, miReceivedVertices, miVertexCount, mpRenderOp, mvAABMax, mvAABMin, and mVertexWritePtr.
| void Lugre::cRobRenderOp::SetVertexFormatFromEnum | ( | const eVertexFormat | miVertexFormat, | |
| const int | iNumTexCoordsSets = 1 | |||
| ) |
a higher level access to the vertex declaration for most cases this should be enough, but if you need lowlevel access, see GetVertexDecl() iNumTexCoordsSets is ignored if the format doesn't include texcoords, only 1 is valid for Vertex() methods, rest is for custom
Definition at line 143 of file lugre_robrenderable.cpp.
References GetVertexDecl(), kVertexFormat_pc, kVertexFormat_pn, kVertexFormat_pnc, kVertexFormat_pnuv, kVertexFormat_pnuvc, kVertexFormat_puv, kVertexFormat_puvc, and miVertexSize.
Referenced by PrepareAddVertex().
| Ogre::VertexDeclaration * Lugre::cRobRenderOp::GetVertexDecl | ( | ) |
low-level access to the vertex declaration see also SetVertexFormatFromEnum for a higher level interface use this to add elements to the vertex-declaration before using StartWrite do this only once per cRobRenderOp instance (clearing old definition not implemented yet)
Definition at line 187 of file lugre_robrenderable.cpp.
References mpRenderOp.
Referenced by _StartWrite(), and SetVertexFormatFromEnum().
| void Lugre::cRobRenderOp::_StartWrite | ( | const bool | bVertexFormatChanged | ) |
internal method, don't use directly
Definition at line 116 of file lugre_robrenderable.cpp.
References GetVertexDecl(), mbBufferIsDynamic, mbBufferIsReadable, mbDynamic, mbReadable, mHWVBuf, miVertexCapacity, miVertexCount, miVertexSize, mpRenderOp, mVertexWritePtr, and PROFILE.
Referenced by PrepareAddVertex(), and StartCustomWriter().
| void Lugre::cRobRenderOp::_AllocateIndexBufferIfNeeded | ( | ) |
Definition at line 326 of file lugre_robrenderable.cpp.
References mHWIBuf, miIndexCapacity, miIndexCount, and mpRenderOp.
| Ogre::Real * Lugre::cRobRenderOp::PrepareAddVertex | ( | const eVertexFormat | miVertexFormat, | |
| const Ogre::Vector3 & | p | |||
| ) |
internal method, don't use directly
Definition at line 202 of file lugre_robrenderable.cpp.
References _StartWrite(), assert, mbBoundingBoxEmpty, miReceivedVertices, miVertexCount, miVertexFormat, miVertexSize, mpRenderOp, mvAABMax, mvAABMin, mVertexWritePtr, PROFILE, PROFILE_PRINT_STACKTRACE, and SetVertexFormatFromEnum().
Referenced by Vertex().
| Ogre::Real Lugre::cRobRenderOp::GetMaxZ | ( | ) | [static] |
Definition at line 450 of file lugre_robrenderable.cpp.
References PROFILE.
Referenced by Lugre::cCompassOverlay::updatePositionGeometry(), Lugre::cColourClipPaneOverlay::updatePositionGeometry(), and Lugre::cBorderColourClipPaneOverlay::updatePositionGeometry().
| Ogre::Vector3 Lugre::cRobRenderOp::mvAABMin |
Definition at line 55 of file lugre_robrenderable.h.
Referenced by AddToMesh(), Begin(), End(), PrepareAddVertex(), StartCustomWriter(), and Lugre::cRobRenderable2D::UpdateRelBounds().
| Ogre::Vector3 Lugre::cRobRenderOp::mvAABMax |
Definition at line 56 of file lugre_robrenderable.h.
Referenced by AddToMesh(), Begin(), End(), PrepareAddVertex(), StartCustomWriter(), and Lugre::cRobRenderable2D::UpdateRelBounds().
Definition at line 57 of file lugre_robrenderable.h.
Referenced by Begin(), PrepareAddVertex(), and StartCustomWriter().
| Ogre::Real Lugre::cRobRenderOp::mfBoundingRadius |
Definition at line 58 of file lugre_robrenderable.h.
Referenced by AddToMesh(), cRobRenderOp(), End(), Lugre::cRobSimpleRenderable::getBoundingRadius(), and Lugre::cBeam::UpdateBeamBounds().
| Ogre::RenderOperation* Lugre::cRobRenderOp::mpRenderOp |
Definition at line 59 of file lugre_robrenderable.h.
Referenced by _AllocateIndexBufferIfNeeded(), _StartWrite(), AddToMesh(), Begin(), End(), GetVertexDecl(), Index(), PrepareAddVertex(), Lugre::cGfx3D_L::RegisterMethods(), SkipIndices(), SkipVertices(), and StartCustomWriter().
| Ogre::AxisAlignedBox* Lugre::cRobRenderOp::mpBox |
Definition at line 60 of file lugre_robrenderable.h.
Referenced by cRobRenderOp(), End(), and Lugre::cBeam::UpdateBeamBounds().
Definition at line 63 of file lugre_robrenderable.h.
Referenced by _StartWrite(), Begin(), End(), Index(), PrepareAddVertex(), SkipVertices(), and StartCustomWriter().
Definition at line 64 of file lugre_robrenderable.h.
Referenced by _AllocateIndexBufferIfNeeded(), Begin(), End(), Index(), and SkipIndices().
Definition at line 65 of file lugre_robrenderable.h.
Referenced by _StartWrite(), PrepareAddVertex(), and SetVertexFormatFromEnum().
todo : only used for vertexbuffer so far
Definition at line 66 of file lugre_robrenderable.h.
Referenced by _StartWrite().
todo : only used for vertexbuffer so far
Definition at line 67 of file lugre_robrenderable.h.
Referenced by _StartWrite().
Definition at line 72 of file lugre_robrenderable.h.
Referenced by Begin(), End(), PrepareAddVertex(), and StartCustomWriter().
| Ogre::RenderSystem* Lugre::cRobRenderOp::mpRenderSys |
Definition at line 76 of file lugre_robrenderable.h.
Referenced by _StartWrite(), Begin(), End(), PrepareAddVertex(), and StartCustomWriter().
| unsigned short* Lugre::cRobRenderOp::mIndexWritePtr |
| Ogre::HardwareVertexBufferSharedPtr Lugre::cRobRenderOp::mHWVBuf |
| Ogre::HardwareIndexBufferSharedPtr Lugre::cRobRenderOp::mHWIBuf |
Definition at line 79 of file lugre_robrenderable.h.
Referenced by _AllocateIndexBufferIfNeeded(), End(), and Index().
1.5.6