Photon Unity Networking 2
2.12
|
CellTreeNode Class Reference
Represents a single node of the tree. More...
Public Types | |
enum | ENodeType |
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< CellTreeNode > | Childs |
A list containing all child nodes. More... | |
Detailed Description
Represents a single node of the tree.
Constructor & Destructor Documentation
CellTreeNode | ( | ) |
Default constructor.
CellTreeNode | ( | byte | id, |
ENodeType | nodeType, | ||
CellTreeNode | parent | ||
) |
Constructor to define the ID and the node type as well as setting a parent node.
- Parameters
-
id The ID of the cell is used as the interest group. nodeType The node type of the cell tree node. parent The parent node of the cell tree node.
Member Function Documentation
void AddChild | ( | CellTreeNode | child | ) |
Adds the given child to the node.
- Parameters
-
child The child which is added to the node.
void Draw | ( | ) |
Draws the cell in the editor.
void GetActiveCells | ( | List< byte > | activeCells, |
bool | yIsUpAxis, | ||
Vector3 | position | ||
) |
Gathers all cell IDs the player is currently inside or nearby.
- Parameters
-
activeCells The list to add all cell IDs to the player is currently inside or nearby. yIsUpAxis Describes if the y-axis is used as up-axis. position The current position of the player.
bool IsPointInsideCell | ( | bool | yIsUpAxis, |
Vector3 | point | ||
) |
Checks if the given point is inside the cell.
- Parameters
-
yIsUpAxis Describes if the y-axis is used as up-axis. point The point to check.
- Returns
- True if the point is inside the cell, false if the point is not inside the cell.
bool IsPointNearCell | ( | bool | yIsUpAxis, |
Vector3 | point | ||
) |
Checks if the given point is near the cell.
- Parameters
-
yIsUpAxis Describes if the y-axis is used as up-axis. point The point to check.
- Returns
- True if the point is near the cell, false if the point is too far away.
Member Data Documentation
Vector3 Center |
Represents the center, top-left or bottom-right position of the cell or the size of the cell.
List<CellTreeNode> Childs |
A list containing all child nodes.
byte Id |
Represents the unique ID of the cell.
ENodeType NodeType |
Describes the current node type of the cell tree node.
CellTreeNode Parent |
Reference to the parent node.