Go to the documentation of this file.
29 #ifndef __Ogre_Grid2DPageStrategy_H__
30 #define __Ogre_Grid2DPageStrategy_H__
virtual void setMode(Grid2DMode mode)
Set the grid alignment mode.
virtual void setLoadRadius(Real sz)
Set the loading radius.
virtual void setCellRange(int32 minX, int32 minY, int32 maxX, int32 maxY)
Set the index range of all cells (values outside this will be ignored)
void updateDebugDisplay(Page *p, SceneNode *sn)
Update the contents of the passed in SceneNode to reflect the debug display of a given page.
Grid2DPageStrategy(PageManager *manager)
Page strategy which loads new pages based on a regular 2D grid.
@ G2D_X_Y
Grid is in the X/Y plane.
A viewpoint from which the scene will be rendered.
void notifyCamera(Camera *cam, PagedWorldSection *section)
Called when a camera is used for any kind of rendering.
virtual void convertWorldToGridSpace(const Vector3 &world, Vector2 &grid)
Convert a world point to grid space (not relative to origin)
virtual int32 getCellRangeMinY() const
get the index range of all cells (values outside this will be ignored)
The PageManager is the entry point through which you load all PagedWorld instances,...
void destroyData(PageStrategyData *d)
Destroy a PageStrategyData instance containing the data specific to this PageStrategy.
virtual void setCellRangeMaxX(int32 maxX)
Set the index range of all cells (values outside this will be ignored)
Abstract marker class representing the data held against the PagedWorldSection which is specifically ...
virtual void setCellSize(Real sz)
Set the size of the cells in the grid.
virtual int32 getCellRangeMaxX() const
get the index range of all cells (values outside this will be ignored)
Real mHoldRadius
Hold radius.
virtual void setHoldRadius(Real sz)
Set the Holding radius.
Class representing a node in the scene graph.
uint32 PageID
Identifier for a page.
Defines the interface to a strategy class which is responsible for deciding when Page instances are r...
virtual int32 getCellRangeMinX() const
get the index range of all cells (values outside this will be ignored)
virtual void getMidPointGridSpace(int32 x, int32 y, Vector2 &mid)
Get the (grid space) mid point of a cell.
static const uint16 CHUNK_VERSION
void save(StreamSerialiser &stream)
Save this data to a stream.
void updateDerivedMetrics()
Vector2 mOrigin
Origin (grid-aligned world space)
virtual Real getCellSize() const
Get the size of the cells in the grid.
virtual const Vector3 & getOrigin(const Vector3 &worldOrigin)
Get the origin of the grid in world space.
virtual void getCornersGridSpace(int32 x, int32 y, Vector2 *pFourPoints)
Get the (grid space) corners of a cell.
bool load(StreamSerialiser &stream)
Load this data from a stream (returns true if successful)
PageID calculatePageID(int32 x, int32 y)
@ G2D_X_Z
Grid is in the X/Z plane.
Grid2DMode
The 2D grid mode.
Represents a section of the PagedWorld which uses a given PageStrategy, and which is made up of a gen...
virtual Real getHoldRadius() const
Get the Holding radius.
Utility class providing helper methods for reading / writing structured data held in a DataStream.
virtual void setCellRangeMinX(int32 minX)
Set the index range of all cells (values outside this will be ignored)
@ G2D_Y_Z
Grid is in the Y/Z plane.
virtual void convertGridToWorldSpace(const Vector2 &grid, Vector3 &world)
Convert a grid point to world space - note only 2 axes populated.
Real mLoadRadius
Load radius.
virtual Real getLoadRadius() const
Get the loading radius.
virtual int32 getCellRangeMaxY() const
get the index range of all cells (values outside this will be ignored)
Standard 2-dimensional vector.
Specialisation of PageStrategyData for Grid2DPageStrategy.
void calculateCell(PageID inPageID, int32 *x, int32 *y)
~Grid2DPageStrategyData()
Vector3 mWorldOrigin
Origin (world space)
virtual void setCellRangeMaxY(int32 maxY)
Set the index range of all cells (values outside this will be ignored)
virtual void getBottomLeftGridSpace(int32 x, int32 y, Vector2 &bl)
Get the (grid space) bottom-left of a cell.
PageID getPageID(const Vector3 &worldPos, PagedWorldSection *section)
Get the page ID for a given world position.
float Real
Software floating point type.
Real mCellSize
Grid cell (page) size.
virtual void setOrigin(const Vector3 &worldOrigin)
Set the origin of the grid in world space.
static const uint32 CHUNK_ID
Grid2DMode mMode
Orientation of the grid.
void determineGridLocation(const Vector2 &gridpos, int32 *x, int32 *y)
Convert a grid position into a row and column index.
virtual Real getLoadRadiusInCells()
Get the load radius as a multiple of cells.
virtual void setCellRangeMinY(int32 minY)
Set the index range of all cells (values outside this will be ignored)
Standard 3-dimensional vector.
virtual Real getHoldRadiusInCells()
Get the Hold radius as a multiple of cells.
PageStrategyData * createData()
Create a PageStrategyData instance containing the data specific to this PageStrategy.
virtual Grid2DMode getMode() const
Set the grid alignment mode.
#define _OgrePagingExport
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.