Class NavMapGridNode
A node in the NavMap
Leaf nodes contain content, all other nodes are split into 4 equally sized children.
Child node indices are stored in the following X,Y orientation:
+---+----+---+ | ^ | 2 | 0 | +---+----+---+ | Y | 3 | 1 | +---+----+---+ | | X->| | +---+----+---+
Namespace: Anki.Vector.Types
Assembly: Anki.Vector.dll
Syntax
public class NavMapGridNode
Properties
| Improve this Doc View SourceCenter
Gets the center of this node.
public Vector3 Center { get; }
Property Type
| Improve this Doc View SourceChildren
Gets the child nodes of this node
public IEnumerable<NavMapGridNode> Children { get; }
Property Type
| Improve this Doc View SourceColorRgba
Gets the color of the node in RGBA.
public uint ColorRgba { get; }
Property Type
| Improve this Doc View SourceContent
Gets the content type in this node. Only leaf nodes have content, this is null
for all other nodes.
public NavNodeContentType? Content { get; }
Property Type
| Improve this Doc View SourceDepth
Gets the depth of this node (i.e. how far down the quad-tree it is).
public int Depth { get; }
Property Type
| Improve this Doc View SourceHasChildren
Gets a value indicating whether this instance has child nodes.
public bool HasChildren { get; }
Property Type
| Improve this Doc View SourceParent
Gets the parent of this node. Is null for the root node.
public NavMapGridNode Parent { get; }
Property Type
| Improve this Doc View SourceSize
Gets the size (width or length) of this square node in mm.
public float Size { get; }
Property Type
Methods
| Improve this Doc View SourceContainsPoint(Single, Single)
Test if the node contains the given x,y coordinates.
public bool ContainsPoint(float x, float y)
Parameters
Type | Name | Description |
---|---|---|
Single | x | The x coordinate for the point. |
Single | y | The y coordinate for the point. |
Returns
Type | Description |
---|---|
Boolean |
|
GetContent(Single, Single)
Get the node's content at the given x,y coordinates.
public NavNodeContentType GetContent(float x, float y)
Parameters
Type | Name | Description |
---|---|---|
Single | x | The x coordinate for the point. |
Single | y | The y coordinate for the point. |
Returns
Type | Description |
---|---|
Nav |
The content included at that point. Will be Nav |
GetNode(Single, Single)
Get the node at the given x, y coordinates.
public NavMapGridNode GetNode(float x, float y)
Parameters
Type | Name | Description |
---|---|---|
Single | x | The x coordinate for the point. |
Single | y | The y coordinate for the point. |
Returns
Type | Description |
---|---|
Nav |
The smallest node that includes the point. Will return |