Loading...
Searching...
No Matches
Ogre::Grid2DPageStrategy Class Reference
Optional Components » Paging

Page strategy which loads new pages based on a regular 2D grid. More...

`#include <OgreGrid2DPageStrategy.h>`

Inheritance diagram for Ogre::Grid2DPageStrategy:
[legend]

## Public Member Functions

| Grid2DPageStrategy (PageManager *manager)
| ~Grid2DPageStrategy ()
PageStrategyData * | createData () override
| Create a PageStrategyData instance containing the data specific to this PageStrategy.
void | destroyData (PageStrategyData *d) override
| Destroy a PageStrategyData instance containing the data specific to this PageStrategy.
PageID | getPageID (const Vector3 &worldPos, PagedWorldSection *section) override
| Get the page ID for a given world position.
void | notifyCamera (Camera *cam, PagedWorldSection *section) override
| Called when a camera is used for any kind of rendering.
void | updateDebugDisplay (Page *p, SceneNode *sn) override
| Update the contents of the passed in SceneNode to reflect the debug display of a given page.
Public Member Functions inherited from Ogre::PageStrategy
| PageStrategy (const String &name, PageManager *manager)
virtual | ~PageStrategy ()
virtual void | frameEnd (Real timeElapsed, PagedWorldSection *section)
| Called when the frame ends.
virtual void | frameStart (Real timeSinceLastFrame, PagedWorldSection *section)
| Called when the frame starts.
PageManager * | getManager () const
const String & | getName () const

## Detailed Description

Page strategy which loads new pages based on a regular 2D grid.

The grid can be up to 65536 x 65536 cells in size. PageIDs are generated like this: (row * 65536) + col. The grid is centred around the grid origin, such that the boundaries of the cell around that origin are [-CellSize/2, CellSize/2)

## Constructor & Destructor Documentation

## Grid2DPageStrategy()

Ogre::Grid2DPageStrategy::Grid2DPageStrategy | ( | PageManager * | manager | ) |

## ~Grid2DPageStrategy()

Ogre::Grid2DPageStrategy::~Grid2DPageStrategy | ( |  | ) |

## Member Function Documentation

## notifyCamera()

void Ogre::Grid2DPageStrategy::notifyCamera | ( | Camera * | cam,
|  | PagedWorldSection * | section )

override virtual

Called when a camera is used for any kind of rendering.

This is probably the primary way in which the strategy will request new pages.

Parameters

  cam | Camera which is being used for rendering. Class should not rely on this pointer remaining valid permanently because no notification will be given when the camera is destroyed.
  section |

Reimplemented from Ogre::PageStrategy.

## createData()

PageStrategyData * Ogre::Grid2DPageStrategy::createData | ( |  | ) |

override virtual

Create a PageStrategyData instance containing the data specific to this PageStrategy.

  This data will be held by a given PagedWorldSection and the structure of the data will be specific to the PageStrategy subclass.

Implements Ogre::PageStrategy.

## destroyData()

void Ogre::Grid2DPageStrategy::destroyData | ( | PageStrategyData * | d | ) |

override virtual

Destroy a PageStrategyData instance containing the data specific to this PageStrategy.

  This data will be held by a given PagedWorldSection and the structure of the data will be specific to the PageStrategy subclass.

Implements Ogre::PageStrategy.

## updateDebugDisplay()

void Ogre::Grid2DPageStrategy::updateDebugDisplay | ( | Page * | p,
|  | SceneNode * | sn )

override virtual

Update the contents of the passed in SceneNode to reflect the debug display of a given page.

The PageStrategy is to have complete control of the contents of this SceneNode, it must not be altered / added to by others.

Implements Ogre::PageStrategy.

## getPageID()

PageID Ogre::Grid2DPageStrategy::getPageID | ( | const Vector3 & | worldPos,
|  | PagedWorldSection * | section )

override virtual

Get the page ID for a given world position.

Returns
  The page ID

Implements Ogre::PageStrategy.

The documentation for this class was generated from the following file:

- OgreGrid2DPageStrategy.h