Object 2D grid.
More...
#include <ObjectGrid.hh>
|
| | ObjectGrid (int num_x, int num_y, float size_x, float size_y, float size_z) |
| | Constructor. More...
|
| |
| void | populate (int num_objects) |
| | Populates a grid with random objects. More...
|
| |
| ObjectGrid |
( |
int |
num_x, |
|
|
int |
num_y, |
|
|
float |
size_x, |
|
|
float |
size_y, |
|
|
float |
size_z |
|
) |
| |
Constructor.
- Parameters
-
| num_x | Number of cells in x dimension |
| num_y | Number of cells in y dimension |
| size_x | Size of grid in x dimension |
| size_y | Size of grid in x dimension |
| size_z | Height of grid cells (z dimension) |
| void addRandomObject |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
|
private |
Adds a single random object to grid in a given cell.
- Parameters
-
| x | X coordinate of cell |
| y | Y coordinate of cell |
| void populate |
( |
int |
num_objects | ) |
|
Populates a grid with random objects.
- Parameters
-
| num_objects | Desired number of objects |
Size of each cell in x dimension.
Size of each cell in y dimension.
Array of counters, one per object type.
Number of cells in x dimension.
Number of cells in y dimension.
| const std::vector<std::string> TYPES = {"sphere", "cylinder","box"} |
The documentation for this class was generated from the following files: