| OGRE 1.11.1 Object-Oriented Graphics Rendering Engine

Public Member Functions | Static Public Attributes | List of all members
Ogre::Grid2DPageStrategyData Class Reference
Optional Components » Paging

Specialisation of PageStrategyData for Grid2DPageStrategy. More...

`#include <OgreGrid2DPageStrategy.h>`

Inheritance diagram for Ogre::Grid2DPageStrategyData:
[legend]

## Public Member Functions
| Grid2DPageStrategyData ()
| ~Grid2DPageStrategyData ()
void | calculateCell (PageID inPageID, int32 *x, int32 *y)
PageID | calculatePageID (int32 x, int32 y)
virtual void | convertGridToWorldSpace (const Vector2 &grid, Vector3 &world)
| Convert a grid point to world space - note only 2 axes populated. More...
virtual void | convertWorldToGridSpace (const Vector3 &world, Vector2 &grid)
| Convert a world point to grid space (not relative to origin) More...
void | determineGridLocation (const Vector2 &gridpos, int32 *x, int32 *y)
| Convert a grid position into a row and column index. More...
virtual void | getBottomLeftGridSpace (int32 x, int32 y, Vector2 &bl)
| Get the (grid space) bottom-left of a cell. More...
virtual int32 | getCellRangeMaxX () const
| get the index range of all cells (values outside this will be ignored) More...
virtual int32 | getCellRangeMaxY () const
| get the index range of all cells (values outside this will be ignored) More...
virtual int32 | getCellRangeMinX () const
| get the index range of all cells (values outside this will be ignored) More...
virtual int32 | getCellRangeMinY () const
| get the index range of all cells (values outside this will be ignored) More...
virtual Real | getCellSize () const
| Get the size of the cells in the grid. More...
virtual void | getCornersGridSpace (int32 x, int32 y, Vector2 *pFourPoints)
| Get the (grid space) corners of a cell. More...
virtual Real | getHoldRadius () const
| Get the Holding radius. More...
virtual Real | getHoldRadiusInCells ()
| Get the Hold radius as a multiple of cells. More...
virtual Real | getLoadRadius () const
| Get the loading radius. More...
virtual Real | getLoadRadiusInCells ()
| Get the load radius as a multiple of cells. More...
virtual void | getMidPointGridSpace (int32 x, int32 y, Vector2 &mid)
| Get the (grid space) mid point of a cell. More...
virtual Grid2DMode | getMode () const
| Set the grid alignment mode. More...
virtual const Vector3 & | getOrigin (const Vector3 &worldOrigin)
| Get the origin of the grid in world space. More...
bool | load (StreamSerialiser &stream)
| Load this data from a stream (returns true if successful) More...
void | save (StreamSerialiser &stream)
| Save this data to a stream. More...
virtual void | setCellRange (int32 minX, int32 minY, int32 maxX, int32 maxY)
| Set the index range of all cells (values outside this will be ignored) More...
virtual void | setCellRangeMaxX (int32 maxX)
| Set the index range of all cells (values outside this will be ignored) More...
virtual void | setCellRangeMaxY (int32 maxY)
| Set the index range of all cells (values outside this will be ignored) More...
virtual void | setCellRangeMinX (int32 minX)
| Set the index range of all cells (values outside this will be ignored) More...
virtual void | setCellRangeMinY (int32 minY)
| Set the index range of all cells (values outside this will be ignored) More...
virtual void | setCellSize (Real sz)
| Set the size of the cells in the grid. More...
virtual void | setHoldRadius (Real sz)
| Set the Holding radius. More...
virtual void | setLoadRadius (Real sz)
| Set the loading radius. More...
virtual void | setMode (Grid2DMode mode)
| Set the grid alignment mode. More...
virtual void | setOrigin (const Vector3 &worldOrigin)
| Set the origin of the grid in world space. More...

## Static Public Attributes
static const uint32 | CHUNK_ID
static const uint16 | CHUNK_VERSION

## Detailed Description

Specialisation of PageStrategyData for Grid2DPageStrategy.

Remarks
  Structurally this data defines with a grid of pages, with the logical origin in the middle of the entire grid. The grid cells are indexed from 0 as a 'centre' slot, supporting both positive and negative values. so (0,0) is the centre cell, (1,0) is the cell to the right of the centre, (1,0) is the cell above the centre, (-2,1) is the cell two to the left of the centre and one up, etc. The maximum extent of each axis is -32768 to +32767, so in other words enough for over 4 billion entries.

  To limit the page load requests that are generated to a fixed region, you can set the min and max cell indexes (inclusive)for each direction; if a page request would address a cell outside this range it is ignored so you don't have the expense of checking for page data that will never exist.

  The data format for this in a file is:
  Grid2DPageStrategyData (Identifier 'G2DD')
  [Version 1]

  Name | Type | Description
  Grid orientation | uint8 | The orientation of the grid; XZ = 0, XY = 1, YZ = 2
  Grid origin | Vector3 | World origin of the grid.
  Grid cell size | Real | The size of each cell (page) in the grid
  Grid cell range (minx, maxx, miny, maxy) | int16 * 4 | The extents of the world in cell indexes
  Load radius | Real | The outer radius at which new pages should start loading
  Hold radius | Real | The radius at which existing pages should be held if already loaded but not actively loaded (should be larger than Load radius)

See also
  Grid3DPageStrategyData

## Constructor & Destructor Documentation

## ◆ Grid2DPageStrategyData()

Ogre::Grid2DPageStrategyData::Grid2DPageStrategyData | ( |  | ) |

## ◆ ~Grid2DPageStrategyData()

Ogre::Grid2DPageStrategyData::~Grid2DPageStrategyData | ( |  | ) |

## Member Function Documentation

## ◆ setMode()

virtual void Ogre::Grid2DPageStrategyData::setMode | ( | Grid2DMode | mode | ) |
| virtual

Set the grid alignment mode.

## ◆ getMode()

virtual Grid2DMode Ogre::Grid2DPageStrategyData::getMode | ( |  | ) | const
| inline virtual

Set the grid alignment mode.

## ◆ setOrigin()

virtual void Ogre::Grid2DPageStrategyData::setOrigin | ( | const Vector3 & | worldOrigin | ) |
| virtual

Set the origin of the grid in world space.

## ◆ getOrigin()

virtual const Vector3& Ogre::Grid2DPageStrategyData::getOrigin | ( | const Vector3 & | worldOrigin | ) |
| inline virtual

Get the origin of the grid in world space.

## ◆ setCellSize()

virtual void Ogre::Grid2DPageStrategyData::setCellSize | ( | Real | sz | ) |
| virtual

Set the size of the cells in the grid.

## ◆ getCellSize()

virtual Real Ogre::Grid2DPageStrategyData::getCellSize | ( |  | ) | const
| inline virtual

Get the size of the cells in the grid.

## ◆ setLoadRadius()

virtual void Ogre::Grid2DPageStrategyData::setLoadRadius | ( | Real | sz | ) |
| virtual

Set the loading radius.

## ◆ getLoadRadius()

virtual Real Ogre::Grid2DPageStrategyData::getLoadRadius | ( |  | ) | const
| inline virtual

Get the loading radius.

## ◆ setHoldRadius()

virtual void Ogre::Grid2DPageStrategyData::setHoldRadius | ( | Real | sz | ) |
| virtual

Set the Holding radius.

## ◆ getHoldRadius()

virtual Real Ogre::Grid2DPageStrategyData::getHoldRadius | ( |  | ) | const
| inline virtual

Get the Holding radius.

## ◆ getLoadRadiusInCells()

virtual Real Ogre::Grid2DPageStrategyData::getLoadRadiusInCells | ( |  | ) |
| inline virtual

Get the load radius as a multiple of cells.

## ◆ getHoldRadiusInCells()

virtual Real Ogre::Grid2DPageStrategyData::getHoldRadiusInCells | ( |  | ) |
| inline virtual

Get the Hold radius as a multiple of cells.

## ◆ setCellRange()

virtual void Ogre::Grid2DPageStrategyData::setCellRange | ( | int32 | minX,
|  | int32 | minY,
|  | int32 | maxX,
|  | int32 | maxY
| ) |  |
| virtual

Set the index range of all cells (values outside this will be ignored)

## ◆ setCellRangeMinX()

virtual void Ogre::Grid2DPageStrategyData::setCellRangeMinX | ( | int32 | minX | ) |
| virtual

Set the index range of all cells (values outside this will be ignored)

## ◆ setCellRangeMinY()

virtual void Ogre::Grid2DPageStrategyData::setCellRangeMinY | ( | int32 | minY | ) |
| virtual

Set the index range of all cells (values outside this will be ignored)

## ◆ setCellRangeMaxX()

virtual void Ogre::Grid2DPageStrategyData::setCellRangeMaxX | ( | int32 | maxX | ) |
| virtual

Set the index range of all cells (values outside this will be ignored)

## ◆ setCellRangeMaxY()

virtual void Ogre::Grid2DPageStrategyData::setCellRangeMaxY | ( | int32 | maxY | ) |
| virtual

Set the index range of all cells (values outside this will be ignored)

## ◆ getCellRangeMinX()

virtual int32 Ogre::Grid2DPageStrategyData::getCellRangeMinX | ( |  | ) | const
| inline virtual

get the index range of all cells (values outside this will be ignored)

## ◆ getCellRangeMinY()

virtual int32 Ogre::Grid2DPageStrategyData::getCellRangeMinY | ( |  | ) | const
| inline virtual

get the index range of all cells (values outside this will be ignored)

## ◆ getCellRangeMaxX()

virtual int32 Ogre::Grid2DPageStrategyData::getCellRangeMaxX | ( |  | ) | const
| inline virtual

get the index range of all cells (values outside this will be ignored)

## ◆ getCellRangeMaxY()

virtual int32 Ogre::Grid2DPageStrategyData::getCellRangeMaxY | ( |  | ) | const
| inline virtual

get the index range of all cells (values outside this will be ignored)

## ◆ load()

bool Ogre::Grid2DPageStrategyData::load | ( | StreamSerialiser & | stream | ) |
| virtual

Load this data from a stream (returns true if successful)

Implements Ogre::PageStrategyData.

## ◆ save()

void Ogre::Grid2DPageStrategyData::save | ( | StreamSerialiser & | stream | ) |
| virtual

Save this data to a stream.

Implements Ogre::PageStrategyData.

## ◆ convertWorldToGridSpace()

virtual void Ogre::Grid2DPageStrategyData::convertWorldToGridSpace | ( | const Vector3 & | world,
|  | Vector2 & | grid
| ) |  |
| virtual

Convert a world point to grid space (not relative to origin)

## ◆ convertGridToWorldSpace()

virtual void Ogre::Grid2DPageStrategyData::convertGridToWorldSpace | ( | const Vector2 & | grid,
|  | Vector3 & | world
| ) |  |
| virtual

Convert a grid point to world space - note only 2 axes populated.

## ◆ getMidPointGridSpace()

virtual void Ogre::Grid2DPageStrategyData::getMidPointGridSpace | ( | int32 | x,
|  | int32 | y,
|  | Vector2 & | mid
| ) |  |
| virtual

Get the (grid space) mid point of a cell.

## ◆ getBottomLeftGridSpace()

virtual void Ogre::Grid2DPageStrategyData::getBottomLeftGridSpace | ( | int32 | x,
|  | int32 | y,
|  | Vector2 & | bl
| ) |  |
| virtual

Get the (grid space) bottom-left of a cell.

## ◆ getCornersGridSpace()

virtual void Ogre::Grid2DPageStrategyData::getCornersGridSpace | ( | int32 | x,
|  | int32 | y,
|  | Vector2 * | pFourPoints
| ) |  |
| virtual

Get the (grid space) corners of a cell.

Remarks
  Populates pFourPoints in anticlockwise order from the bottom left point.

## ◆ determineGridLocation()

void Ogre::Grid2DPageStrategyData::determineGridLocation | ( | const Vector2 & | gridpos,
|  | int32 * | x,
|  | int32 * | y
| ) |  |

Convert a grid position into a row and column index.

## ◆ calculatePageID()

PageID Ogre::Grid2DPageStrategyData::calculatePageID | ( | int32 | x,
|  | int32 | y
| ) |  |

## ◆ calculateCell()

void Ogre::Grid2DPageStrategyData::calculateCell | ( | PageID | inPageID,
|  | int32 * | x,
|  | int32 * | y
| ) |  |

## Member Data Documentation

## ◆ CHUNK_ID

const uint32 Ogre::Grid2DPageStrategyData::CHUNK_ID
| static

## ◆ CHUNK_VERSION

const uint16 Ogre::Grid2DPageStrategyData::CHUNK_VERSION
| static

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

- OgreGrid2DPageStrategy.h