raisim::VoxelMapResource
final class · #include <raisim/object/terrain/VoxelMap.hpp>
Immutable voxel occupancy that several voxel maps (in one world or many) can share (see World::addVoxelMap(const VoxelMapResource&, ...)). Editing a map that shares a resource gives that map its own copy first.
Public member functions
getGrid
cpp
const ::contact::VoxelGrid &getGrid() constReturns the shared occupancy grid
Static member functions
fromKeys static
cpp
static VoxelMapResource fromKeys(
double voxelSize,
const std::array<int, 3> &minKey,
const std::array<int, 3> &size,
const std::vector<std::array<int, 3>> &occupiedKeys)Occupancy from a list of occupied keys.
Parameters
| Parameter | Description |
|---|---|
voxelSize (in) | voxel side length (m) |
minKey (in) | key of the first voxel of the domain along each axis |
size (in) | domain size in voxels along each axis (limits and memory as in VoxelMap::VoxelMap()) |
occupiedKeys (in) | occupied voxel keys; keys outside the domain are fatal |
Returns the resource
fromOccupancy static
cpp
static VoxelMapResource fromOccupancy(
double voxelSize,
const std::array<int, 3> &minKey,
const std::array<int, 3> &size,
const std::vector<std::uint8_t> &occupancy)Occupancy from a dense array over the domain, x fastest: entry x + size[0] (y + size[1] z) is the voxel with key minKey + (x, y, z); nonzero entries are occupied.
Parameters
| Parameter | Description |
|---|---|
voxelSize (in) | voxel side length (m) |
minKey (in) | key of the first voxel of the domain along each axis |
size (in) | domain size in voxels along each axis (limits and memory as in VoxelMap::VoxelMap()) |
occupancy (in) | size[0] size[1] size[2] entries (fatal otherwise) |
Returns the resource