| 74 | |
| 75 | template <typename S> |
| 76 | dynamics::SimpleFramePtr createHeightmapFrame( |
| 77 | std::size_t xResolution = 20u, |
| 78 | std::size_t yResolution = 20u, |
| 79 | S xSize = S(2), |
| 80 | S ySize = S(2), |
| 81 | S zMin = S(0.0), |
| 82 | S zMax = S(0.1)) |
| 83 | { |
| 84 | auto terrainFrame = SimpleFrame::createShared(Frame::World()); |
| 85 | auto tf = terrainFrame->getRelativeTransform(); |
| 86 | tf.translation()[0] = -static_cast<double>(xSize) / 2.0; |
| 87 | tf.translation()[1] = +static_cast<double>(ySize) / 2.0; |
| 88 | terrainFrame->setRelativeTransform(tf); |
| 89 | |
| 90 | terrainFrame->createVisualAspect(); |
| 91 | |
| 92 | auto terrainShape = createHeightmapShape( |
| 93 | xResolution, yResolution, xSize, ySize, zMin, zMax); |
| 94 | terrainFrame->setShape(terrainShape); |
| 95 | |
| 96 | return terrainFrame; |
| 97 | } |
| 98 | |
| 99 | class HeightmapWorld : public gui::osg::WorldNode |
| 100 | { |
nothing calls this directly
no test coverage detected