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
| Vector3 |
Children
Gets the child nodes of this node
public IEnumerable<NavMapGridNode> Children { get; }
Property Type
| IEnumerable<NavMapGridNode> |
ColorRgba
Gets the color of the node in RGBA.
public uint ColorRgba { get; }
Property Type
| UInt32 |
Content
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
| Nullable<NavNodeContentType> |
Depth
Gets the depth of this node (i.e. how far down the quad-tree it is).
public int Depth { get; }
Property Type
| Int32 |
HasChildren
Gets a value indicating whether this instance has child nodes.
public bool HasChildren { get; }
Property Type
| Boolean |
Parent
Gets the parent of this node. Is null for the root node.
public NavMapGridNode Parent { get; }
Property Type
| NavMapGridNode |
Size
Gets the size (width or length) of this square node in mm.
public float Size { get; }
Property Type
| Single |
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 |
|---|---|
| NavNodeContentType | The content included at that point. Will be NavNodeUnknown if point is outside the map. |
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 |
|---|---|
| NavMapGridNode | The smallest node that includes the point. Will return |