Photon Fusion 2.0.4

Static Public Member Functions | Static Public Attributes | List of all members
Simulation.AreaOfInterest Struct Reference

Area of Interest Definition More...

Static Public Member Functions

static int int int z ClampCellCoords (int x, int y, int z)
 
static int GetCellSize ()
 Get the size of each cell in the AOI grid. More...
 
static int int int z GetGridSize ()
 
static void SphereToCells (Vector3 position, float radius, HashSet< int > cells)
 Convert a sphere into a set of AOI cells. More...
 
static int ToCell (int x, int y, int z)
 Convert a cell coordinate into the respective cell index. More...
 
static int ToCell (Vector3 position)
 Convert a position into the respective cell index. More...
 
static Vector3 ToCellCenter (int index)
 Convert a cell index into the respective cell center position. More...
 
static int int int z ToCellCoords (int index)
 
static int int int z ToCellCoords (Vector3 position)
 

Static Public Attributes

static int CELL_SIZE = SIZE_DEFAULT
 Size of each cell in the AOI grid. More...
 
static int x
 Get the size of the AOI grid. More...
 
static int int y
 

Detailed Description

Area of Interest Definition

Member Function Documentation

◆ GetCellSize()

static int GetCellSize ( )
static

Get the size of each cell in the AOI grid.

Returns
The size of each cell in the AOI grid.

◆ SphereToCells()

static void SphereToCells ( Vector3  position,
float  radius,
HashSet< int >  cells 
)
static

Convert a sphere into a set of AOI cells.

Parameters
positionSphere center
radiusSphere radius. Max allowed radius is MAX_SHARED_RADIUS
cellsResulting set of cells

◆ ToCell() [1/2]

static int ToCell ( int  x,
int  y,
int  z 
)
static

Convert a cell coordinate into the respective cell index.

Parameters
xX coordinate
yY coordinate
zZ coordinate
Returns
Cell index

◆ ToCell() [2/2]

static int ToCell ( Vector3  position)
static

Convert a position into the respective cell index.

Parameters
positionPosition
Returns
Cell index

◆ ToCellCenter()

static Vector3 ToCellCenter ( int  index)
static

Convert a cell index into the respective cell center position.

Parameters
indexCell index
Returns
Cell center position

Member Data Documentation

◆ CELL_SIZE

int CELL_SIZE = SIZE_DEFAULT
static

Size of each cell in the AOI grid.

◆ x

static int x
static

Get the size of the AOI grid.

Clamp cell coordinates to the valid range.

Converts a cell index into its corresponding cell coordinates.

Convert a position into the respective cell coordinate.

Returns
The size of the AOI grid.
Parameters
positionPosition
Returns
Cell coordinate
Parameters
indexThe index of the cell to be converted.
Returns
A tuple containing the x, y, and z coordinates of the cell.
Parameters
xX coordinate
yY coordinate
zZ coordinate
Returns
Clamped cell coordinates