public HeightMap getHeightMap() { HeightMap ret = null; if (groundProfile3D != null) { ret = groundProfile3D.getHeightMapIfAvailable(); } return ret; }
public HeightMap getHeightMap() { HeightMap ret = null; if (groundProfile3D != null) { ret = groundProfile3D.getHeightMapIfAvailable(); } return ret; }
private ArrayList<Graphics3DObject> createGroundLinkGraphicsFromGroundProfile(GroundProfile3D groundProfile) { ArrayList<Graphics3DObject> ret = new ArrayList<Graphics3DObject>(); Graphics3DObject texturedGroundLinkGraphics = new Graphics3DObject(); HeightMap heightMap = null; if (groundProfile != null) heightMap = groundProfile.getHeightMapIfAvailable(); else if (groundProfile3D != null) heightMap = groundProfile3D.getHeightMapIfAvailable(); texturedGroundLinkGraphics.addHeightMap(heightMap, 300, 300, YoAppearance.DarkGreen()); ret.add(texturedGroundLinkGraphics); return ret; }
public ArrayList<Point3D> createAListOfPointsFromAGroundProfile(GroundProfile3D groundProfile, double minX, double minY, double maxX, double maxY, double resolution) { ArrayList<Point3D> points = new ArrayList<Point3D>(); for (double x = minX; x < maxX; x = x + resolution) { for (double y = minY; y < maxY; y = y + resolution) { double z = groundProfile.getHeightMapIfAvailable().heightAt(x, y, 0.0); points.add(new Point3D(x, y, z)); } } return points; }
public ArrayList<Point3D> createAListOfPointsFromAGroundProfile(GroundProfile3D groundProfile, double minX, double minY, double maxX, double maxY, double resolution) { ArrayList<Point3D> points = new ArrayList<Point3D>(); for (double x = minX; x < maxX; x = x + resolution) { for (double y = minY; y < maxY; y = y + resolution) { double z = groundProfile.getHeightMapIfAvailable().heightAt(x, y, 0.0); points.add(new Point3D(x, y, z)); } } return points; }
private Graphics3DObject createGroundLinkGraphicsFromGroundProfile(GroundProfile3D groundProfile) { Graphics3DObject texturedGroundLinkGraphics = new Graphics3DObject(); HeightMap heightMap = null; if (groundProfile != null) heightMap = groundProfile.getHeightMapIfAvailable(); texturedGroundLinkGraphics.addHeightMap(heightMap, 300, 300, YoAppearance.DarkGreen()); return texturedGroundLinkGraphics; }
public void testSimpleFootstepSnapperOnBumpyGround() throws InsufficientDataException { boolean assertPositionConditions = true; boolean assertPointConditions = false; boolean visualizeAndKeepUp = false; GroundProfile3D groundProfile = createBumpyGroundProfile(); SimpleFootstepSnapper footstepSnapper = createSimpleFootstepSnapper(); double maskSafetyBuffer = 0.01; double boundingBoxDimension = 0.3; footstepSnapper.setUseMask(true, maskSafetyBuffer, boundingBoxDimension); BoundingBox2D rangeOfPointsToTest = new BoundingBox2D(-1.0, -1.0, 1.0, 1.0); FootstepSnapperTestHelper helper = new FootstepSnapperTestHelper("Simple Bumpy Ground", footstepSnapper, null, visualizeAndKeepUp); double resolution = 0.02; double heightThreshold = 0.002; double quadTreeMaxMultiLevelZChangeToFilterNoise = 0.2; int maxSameHeightPointsPerNode = 20; double maxAllowableXYDistanceForAPointToBeConsideredClose = 0.2; int maxNodes = 1000000; helper.createHeightMap(groundProfile.getHeightMapIfAvailable(), rangeOfPointsToTest, resolution, heightThreshold, quadTreeMaxMultiLevelZChangeToFilterNoise, maxSameHeightPointsPerNode, maxAllowableXYDistanceForAPointToBeConsideredClose, maxNodes); int numberOfPointsToTest = 1000; helper.testRandomPoints(numberOfPointsToTest, rangeOfPointsToTest, assertPositionConditions, assertPointConditions); if (visualizeAndKeepUp) { ThreadTools.sleepForever(); } }
HeightMapWithNormals heightMap = groundProfile.getHeightMapIfAvailable(); if (heightMap == null) return;