Photon Unity Networking 2 2.45

Public Types | Public Member Functions | Public Attributes | List of all members
CellTreeNode Class Reference

Represents a single node of the tree. More...

Public Types

enum  ENodeType : byte
 

Public Member Functions

 CellTreeNode ()
 Default constructor. More...
 
 CellTreeNode (byte id, ENodeType nodeType, CellTreeNode parent)
 Constructor to define the ID and the node type as well as setting a parent node. More...
 
void AddChild (CellTreeNode child)
 Adds the given child to the node. More...
 
void Draw ()
 Draws the cell in the editor. More...
 
void GetActiveCells (List< byte > activeCells, bool yIsUpAxis, Vector3 position)
 Gathers all cell IDs the player is currently inside or nearby. More...
 
bool IsPointInsideCell (bool yIsUpAxis, Vector3 point)
 Checks if the given point is inside the cell. More...
 
bool IsPointNearCell (bool yIsUpAxis, Vector3 point)
 Checks if the given point is near the cell. More...
 

Public Attributes

byte Id
 Represents the unique ID of the cell. More...
 
Vector3 Center
 Represents the center, top-left or bottom-right position of the cell or the size of the cell. More...
 
ENodeType NodeType
 Describes the current node type of the cell tree node. More...
 
CellTreeNode Parent
 Reference to the parent node. More...
 
List< CellTreeNodeChilds
 A list containing all child nodes. More...
 

Detailed Description

Represents a single node of the tree.

Constructor & Destructor Documentation

◆ CellTreeNode() [1/2]

Default constructor.

◆ CellTreeNode() [2/2]

CellTreeNode ( byte  id,
ENodeType  nodeType,
CellTreeNode  parent 
)

Constructor to define the ID and the node type as well as setting a parent node.

Parameters
idThe ID of the cell is used as the interest group.
nodeTypeThe node type of the cell tree node.
parentThe parent node of the cell tree node.

Member Function Documentation

◆ AddChild()

void AddChild ( CellTreeNode  child)

Adds the given child to the node.

Parameters
childThe child which is added to the node.

◆ Draw()

void Draw ( )

Draws the cell in the editor.

◆ GetActiveCells()

void GetActiveCells ( List< byte >  activeCells,
bool  yIsUpAxis,
Vector3  position 
)

Gathers all cell IDs the player is currently inside or nearby.

Parameters
activeCellsThe list to add all cell IDs to the player is currently inside or nearby.
yIsUpAxisDescribes if the y-axis is used as up-axis.
positionThe current position of the player.

◆ IsPointInsideCell()

bool IsPointInsideCell ( bool  yIsUpAxis,
Vector3  point 
)

Checks if the given point is inside the cell.

Parameters
yIsUpAxisDescribes if the y-axis is used as up-axis.
pointThe point to check.
Returns
True if the point is inside the cell, false if the point is not inside the cell.

◆ IsPointNearCell()

bool IsPointNearCell ( bool  yIsUpAxis,
Vector3  point 
)

Checks if the given point is near the cell.

Parameters
yIsUpAxisDescribes if the y-axis is used as up-axis.
pointThe point to check.
Returns
True if the point is near the cell, false if the point is too far away.

Member Data Documentation

◆ Center

Vector3 Center

Represents the center, top-left or bottom-right position of the cell or the size of the cell.

◆ Childs

List<CellTreeNode> Childs

A list containing all child nodes.

◆ Id

byte Id

Represents the unique ID of the cell.

◆ NodeType

ENodeType NodeType

Describes the current node type of the cell tree node.

◆ Parent

CellTreeNode Parent

Reference to the parent node.