MCPcopy Create free account
hub / github.com/dartsim/dart / createHeightmapFrame

Function createHeightmapFrame

examples/heightmap/main.cpp:76–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74
75template <typename S>
76dynamics::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
99class HeightmapWorld : public gui::osg::WorldNode
100{

Callers

nothing calls this directly

Calls 4

createHeightmapShapeFunction · 0.85
setShapeMethod · 0.80
WorldClass · 0.50
setRelativeTransformMethod · 0.45

Tested by

no test coverage detected