C# Класс Axiom.Components.Paging.Grid2DPageStrategyData

Specialisation of PageStrategyData for GridPageStrategy.
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. @par 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. @par The data format for this in a file is:
Grid2DPageStrategyData (Identifier 'G2DD')\n [Version 1]
Name Type Description
Grid orientation byte 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) short * 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)
Наследование: IPageStrategyData
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
CHUNK_ID uint
CHUNK_VERSION ushort

Защищенные свойства (Protected)

Свойство Тип Описание
mBottomLeft Vector2
mCellSize float
mGridExtentsHorz int
mGridExtentsVert int
mHoldRadius float
mHoldRadiusInCells float
mLoadRadius float
mLoadRadiusInCells float
mMode Grid2Mode
mOrigin Vector2
mWorldOrigin Vector3

Открытые методы

Метод Описание
CalculatePageID ( int row, int col ) : PageID

CalculateRowCol ( PageID inPageID, int &row, int &col ) : void

ConvertGridToWorldSpace ( Vector2 grid, Vector3 &world ) : void

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

ConvetWorldToGridSpace ( Vector3 world, Vector2 &grid ) : void

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

DetermineGridLocation ( Vector2 gridPos, int &row, int &col ) : void

Convert a grid position into a row and column index

GetBottomLeftGridSpace ( int row, int col, Vector2 &bl ) : void

Get the (grid space) corners of a cell.

GetCornersGridSpace ( int row, int col, Vector2 &fourPoints ) : void

GetMidPointGridSpace ( int row, int col, Vector2 &mid ) : void

Get the (grid space) mid point of a cell

Grid2DPageStrategyData ( ) : System

Load ( StreamSerializer stream ) : bool

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

Save ( StreamSerializer stream ) : void

Save this data to a stream

SetCellCount ( int horz, int vert ) : void

Set the number of cells in the grid in each dimension (defaults to max of 65536)

Защищенные методы

Метод Описание
UpdateDerivedMetrics ( ) : void

Описание методов

CalculatePageID() публичный метод

public CalculatePageID ( int row, int col ) : PageID
row int
col int
Результат PageID

CalculateRowCol() публичный метод

public CalculateRowCol ( PageID inPageID, int &row, int &col ) : void
inPageID PageID
row int
col int
Результат void

ConvertGridToWorldSpace() публичный метод

Convert a grid point to world space - note only 2 axes populated
public ConvertGridToWorldSpace ( Vector2 grid, Vector3 &world ) : void
grid Vector2
world Vector3
Результат void

ConvetWorldToGridSpace() публичный метод

Convert a world point to grid space (not relative to origin)
public ConvetWorldToGridSpace ( Vector3 world, Vector2 &grid ) : void
world Vector3
grid Vector2
Результат void

DetermineGridLocation() публичный метод

Convert a grid position into a row and column index
public DetermineGridLocation ( Vector2 gridPos, int &row, int &col ) : void
gridPos Vector2
row int
col int
Результат void

GetBottomLeftGridSpace() публичный метод

Get the (grid space) corners of a cell.
public GetBottomLeftGridSpace ( int row, int col, Vector2 &bl ) : void
row int
col int
bl Vector2
Результат void

GetCornersGridSpace() публичный метод

public GetCornersGridSpace ( int row, int col, Vector2 &fourPoints ) : void
row int
col int
fourPoints Vector2
Результат void

GetMidPointGridSpace() публичный метод

Get the (grid space) mid point of a cell
public GetMidPointGridSpace ( int row, int col, Vector2 &mid ) : void
row int
col int
mid Vector2
Результат void

Grid2DPageStrategyData() публичный метод

public Grid2DPageStrategyData ( ) : System
Результат System

Load() публичный метод

Load this data from a stream (returns true if successful)
public Load ( StreamSerializer stream ) : bool
stream Axiom.Serialization.StreamSerializer
Результат bool

Save() публичный метод

Save this data to a stream
public Save ( StreamSerializer stream ) : void
stream Axiom.Serialization.StreamSerializer
Результат void

SetCellCount() публичный метод

Set the number of cells in the grid in each dimension (defaults to max of 65536)
public SetCellCount ( int horz, int vert ) : void
horz int
vert int
Результат void

UpdateDerivedMetrics() защищенный метод

protected UpdateDerivedMetrics ( ) : void
Результат void

Описание свойств

CHUNK_ID публичное статическое свойство

public static uint CHUNK_ID
Результат uint

CHUNK_VERSION публичное статическое свойство

public static ushort CHUNK_VERSION
Результат ushort

mBottomLeft защищенное свойство

Bottom-left position (grid-aligned world space)
protected Vector2 mBottomLeft
Результат Vector2

mCellSize защищенное свойство

Grid cell (page) size.
protected float mCellSize
Результат float

mGridExtentsHorz защищенное свойство

Grid horizontal extent in cells
protected int mGridExtentsHorz
Результат int

mGridExtentsVert защищенное свойство

Grid vertical extent in cells
protected int mGridExtentsVert
Результат int

mHoldRadius защищенное свойство

hold radius.
protected float mHoldRadius
Результат float

mHoldRadiusInCells защищенное свойство

protected float mHoldRadiusInCells
Результат float

mLoadRadius защищенное свойство

Load radius
protected float mLoadRadius
Результат float

mLoadRadiusInCells защищенное свойство

protected float mLoadRadiusInCells
Результат float

mMode защищенное свойство

Orientation of the grid.
protected Grid2Mode mMode
Результат Grid2Mode

mOrigin защищенное свойство

Origin (grid-aligned world space)
protected Vector2 mOrigin
Результат Vector2

mWorldOrigin защищенное свойство

Origin (world space)
protected Vector3 mWorldOrigin
Результат Vector3