BotNavSim  v0.4.3
Mobile Robot Simulation
BotPath Class Reference

BotPath displays information about a recorded path taken or calculated. More...

Inheritance diagram for BotPath:
Collaboration diagram for BotPath:

Public Member Functions

 BotPath ()
 
void AddNode (Vector3 node, float time)
 Adds a node to the path. More...
 
void DrawPath ()
 Draws the path on screen using Draw class More...
 

Properties

bool visible [get, set]
 Gets or sets a value indicating whether this BotPath is visible. More...
 
bool highlight [get, set]
 Gets or sets a value indicating whether this BotPath is highlighted. When highlighted, the path is drawn in white. More...
 
string csvName [get, set]
 Gets or sets the name of the csv. More...
 
float distance [get, private set]
 Gets the total distance this BotPath covers. More...
 
Vector3 start [get]
 Gets the start of the path. More...
 
Vector3 end [get]
 Gets the end of the path. More...
 
Bounds bounds [get, private set]
 
string name [get]
 
Color color [get, set]
 Gets or sets the color used in drawing the path via Draw. More...
 
- Properties inherited from IObservable
string name [get]
 Gets the name of the observable object More...
 
Bounds bounds [get]
 Gets the bounds of the observable object (size and location) More...
 

Private Attributes

List< Vector3 > _nodes
 
List< float > _times
 

Detailed Description

BotPath displays information about a recorded path taken or calculated.

Definition at line 9 of file BotPath.cs.

Constructor & Destructor Documentation

BotPath.BotPath ( )

Definition at line 11 of file BotPath.cs.

11  {
12  _nodes = new List<Vector3>();
13  _times = new List<float>();
14  color = Color.blue;
15  visible = true;
16  }
Color color
Gets or sets the color used in drawing the path via Draw.
Definition: BotPath.cs:70
List< float > _times
Definition: BotPath.cs:74
bool visible
Gets or sets a value indicating whether this BotPath is visible.
Definition: BotPath.cs:22
List< Vector3 > _nodes
Definition: BotPath.cs:73

Member Function Documentation

void BotPath.AddNode ( Vector3  node,
float  time 
)

Adds a node to the path.

Parameters
nodeNode.
timeTime.

Definition at line 81 of file BotPath.cs.

81  {
82  if (_nodes.Count > 1) {
83  distance += Vector3.Distance(_nodes[_nodes.Count-1], node);
84 
85  Bounds b = new Bounds(node, Vector3.one);
86  b.Encapsulate(bounds);
87  bounds = b;
88  }
89  else {
90  bounds = new Bounds(node, Vector3.one);
91  }
92 
93  _nodes.Add(node);
94  _times.Add(time);
95 
96  }
Bounds bounds
Definition: BotPath.cs:59
float distance
Gets the total distance this BotPath covers.
Definition: BotPath.cs:39
List< float > _times
Definition: BotPath.cs:74
List< Vector3 > _nodes
Definition: BotPath.cs:73

Here is the caller graph for this function:

void BotPath.DrawPath ( )

Draws the path on screen using Draw class

Definition at line 101 of file BotPath.cs.

101  {
102  Color c = highlight ? Color.white : color;
103  for(int i = 1; i < _nodes.Count-1; i++) {
105  _nodes[i-1],
106  _nodes[i],
107  c);
108  }
109  if (_nodes.Count > 2) {
110  // draw start node
112  _nodes[0],
113  Vector3.one * 0.25f,
114  c);
115  // draw end node
117  _nodes[_nodes.Count-1],
118  Vector3.one,
119  c);
121  _nodes[_nodes.Count-1],
122  Vector3.one * 0.1f,
123  c);
124  }
125 
126  }
void Cube(Vector3 center, Vector3 size, Color color)
Draw any sized cube at a location in any color.
Definition: Draw.cs:101
Draws stuff, useful for displaying debug data in the simulation. Note that GL implementations require...
Definition: Draw.cs:10
Color color
Gets or sets the color used in drawing the path via Draw.
Definition: BotPath.cs:70
bool highlight
Gets or sets a value indicating whether this BotPath is highlighted. When highlighted, the path is drawn in white.
Definition: BotPath.cs:29
List< Vector3 > _nodes
Definition: BotPath.cs:73
void Line(Vector3 start, Vector3 end, Color color, Space relativeTo=Space.World)
Draw a line between two positions, start and end, in a specified color.
Definition: Draw.cs:76
static Draw Instance
Reference to the MonoBehaviour instance.
Definition: Draw.cs:39

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

List<Vector3> BotPath._nodes
private

Definition at line 73 of file BotPath.cs.

List<float> BotPath._times
private

Definition at line 74 of file BotPath.cs.

Property Documentation

Bounds BotPath.bounds
getprivate set

Definition at line 59 of file BotPath.cs.

Color BotPath.color
getset

Gets or sets the color used in drawing the path via Draw.

Definition at line 70 of file BotPath.cs.

string BotPath.csvName
getset

Gets or sets the name of the csv.

Definition at line 34 of file BotPath.cs.

float BotPath.distance
getprivate set

Gets the total distance this BotPath covers.

Definition at line 39 of file BotPath.cs.

Vector3 BotPath.end
get

Gets the end of the path.

Definition at line 53 of file BotPath.cs.

bool BotPath.highlight
getset

Gets or sets a value indicating whether this BotPath is highlighted. When highlighted, the path is drawn in white.

true if highlight; otherwise, false.

Definition at line 29 of file BotPath.cs.

string BotPath.name
get

Definition at line 63 of file BotPath.cs.

Vector3 BotPath.start
get

Gets the start of the path.

Definition at line 44 of file BotPath.cs.

bool BotPath.visible
getset

Gets or sets a value indicating whether this BotPath is visible.

true if visible; otherwise, false.

Definition at line 22 of file BotPath.cs.


The documentation for this class was generated from the following file: