RealT ImageHeightMap::height (const Vec2 &at) { //std::size_t byteOffset = sizeof(pixel_t) - _image->bytesPerPixel(); PixelT max = _image->max_pixel_size(); PixelT pixel = _image->read_pixel(Vec3u(at[X], at[Y], 0)); ByteT * pixel_data = (ByteT *)&pixel; pixel_data[3] = 0; ByteT * max_data = (ByteT *)&max; max_data[3] = 0; return RealT(pixel) / RealT(max); }
void Grid::clear() { if (_occluders.size() != 0) { for(OccludersSet::iterator it = _occluders.begin(); it != _occluders.end(); it++) { delete (*it); } _occluders.clear(); } _size = Vec3r(0, 0, 0); _cell_size = Vec3r(0, 0, 0); _orig = Vec3r(0, 0, 0); _cells_nb = Vec3u(0, 0, 0); //_ray_occluders.clear(); }
PmmTracer::PmmTracer() : sMap(Vec3u(100), 10000), dMap(Vec3u(20)) { }