private static Point3D32[] makePoint3fArrayFromPoint3dArray(Point3DReadOnly[] pPoints) { Point3D32[] points3f = new Point3D32[pPoints.length]; int i = 0; for (Point3DReadOnly point3d : pPoints) { points3f[i++] = new Point3D32(point3d); } return points3f; }
public void setCenter(Point3D center) { isEmpty = false; this.center = new Point3D32(center); }
@Override public Point3D32 createData() { return new Point3D32(); }
@Override public Point3D32 createEmptyTuple() { return new Point3D32(); }
@Override public Point3D32 createTuple(double x, double y, double z) { return new Point3D32((float) x, (float) y, (float) z); }
public void add(Point3DReadOnly point) { points.add(new Point3D32(point)); }
public void add(float x, float y, float z) { points.add(new Point3D32(x, y, z)); }
public void addAll(Iterable<? extends Point3DReadOnly> points) { for (Point3DReadOnly point : points) add(new Point3D32(point)); }
public static MeshDataHolder createFromVerticesAndStripCounts(Point3D[] vertices, int[] polygonStripCounts) { Point3D32[] verticesWithFloats = new Point3D32[vertices.length]; for (int i = 0; i < vertices.length; i++) { verticesWithFloats[i] = new Point3D32(vertices[i]); } return createFromVerticesAndStripCounts(verticesWithFloats, polygonStripCounts); }
public static PlanarRegionSegmentationMessage createPlanarRegionSegmentationMessage(int id, Point3D origin, Vector3D normal, OcTreeKeyMessage[] regionNodeKeys, List<Point3D> hitLocations) { PlanarRegionSegmentationMessage message = new PlanarRegionSegmentationMessage(); message.id = id; message.origin = new Point3D32(origin); message.normal = new Vector3D32(normal); message.nodeKeys = regionNodeKeys; message.hitLocations = hitLocations.stream().map(Point3D32::new).toArray(Point3D32[]::new); return message; }
private static void translateMeshVertices(MeshDataHolder meshToModify, Tuple3DReadOnly offset) { Point3D32 offset3f = new Point3D32(offset); for (Point3D32 vertex : meshToModify.getVertices()) vertex.add(offset3f); }
@Override public void set(BoxMessage other) { setPacketInformation(other); isEmpty = other.isEmpty; size = new Vector3D32(other.size); center = new Point3D32(center); orientation = new Quaternion32(other.orientation); }
public static Point3D32 generateRandomPoint3D32(Random random, float maxAbsoluteX, float maxAbsoluteY, float maxAbsoluteZ) { float x = generateRandomFloat(random, -maxAbsoluteX, maxAbsoluteX); float y = generateRandomFloat(random, -maxAbsoluteY, maxAbsoluteY); float z = generateRandomFloat(random, -maxAbsoluteZ, maxAbsoluteZ); return new Point3D32(x, y, z); }
public static LineSegment3DMessage[] createLineSegment3dMessages(RegionFeaturesProvider regionFeaturesProvider) { LineSegment3DMessage[] messages = new LineSegment3DMessage[regionFeaturesProvider.getNumberOfPlaneIntersections()]; for (int i = 0; i < regionFeaturesProvider.getNumberOfPlaneIntersections(); i++) { messages[i] = new LineSegment3DMessage(); messages[i].start = new Point3D32(regionFeaturesProvider.getIntersection(i).getFirstEndpoint()); messages[i].end = new Point3D32(regionFeaturesProvider.getIntersection(i).getSecondEndpoint()); } return messages; }
protected Point3D32 getPoint3f(int index, float range) { Point3D32 p = new Point3D32(range, 0.0f, 0.0f); RigidBodyTransform transform = new RigidBodyTransform(); getInterpolatedTransform(index, transform); transform.multiply(getSweepTransform(index)); transform.transform(p); return p; }
@ContinuousIntegrationTest(estimatedDuration = 0.0) @Test(timeout = 30000) public void testNextPoint3D32Array() { Random random = new Random(); Point3D32 min = new Point3D32(-7.0f, -5.0f, -6.0f); Point3D32 max = new Point3D32(5.0f, 4.0f, 8.0f); Point3D32[] randomPoint3fCloud = RandomGeometry.nextPoint3D32Array(random, 1000, min, max); for (int i = 0; i < 1000; i++) { assertTrue((randomPoint3fCloud[i].getX() >= -7.0f) && (randomPoint3fCloud[i].getX() <= 5.0)); assertTrue((randomPoint3fCloud[i].getY() >= -5.0f) && (randomPoint3fCloud[i].getY() <= 4.0)); assertTrue((randomPoint3fCloud[i].getZ() >= -6.0f) && (randomPoint3fCloud[i].getZ() <= 8.0)); } }
public static Point3D32 nextPoint3D32(Random random, Tuple3DReadOnly min, Tuple3DReadOnly max) { float x = RandomNumbers.nextFloat(random, min.getX32(), max.getX32()); float y = RandomNumbers.nextFloat(random, min.getY32(), max.getY32()); float z = RandomNumbers.nextFloat(random, min.getZ32(), max.getZ32()); return new Point3D32(x, y, z); }
public static Point3D32[] getDecayingWorldScan(PointCloudWorldPacket pointCloudWorldPacket) { int numberOfPoints = pointCloudWorldPacket.getDecayingWorldScan().size() / 3; Point3D32[] points = new Point3D32[numberOfPoints]; for (int i = 0; i < numberOfPoints; i++) { Point3D32 point = new Point3D32(); point.setX(pointCloudWorldPacket.getDecayingWorldScan().get(3 * i)); point.setY(pointCloudWorldPacket.getDecayingWorldScan().get(3 * i + 1)); point.setZ(pointCloudWorldPacket.getDecayingWorldScan().get(3 * i + 2)); points[i] = point; } return points; }
public static Point3D32[] unpackLocalizationPointMap(LocalizationPointMapPacket localizationPointMapPacket) { int numberOfPoints = localizationPointMapPacket.getLocalizationPointMap().size() / 3; Point3D32[] points = new Point3D32[numberOfPoints]; for (int i = 0; i < numberOfPoints; i++) { Point3D32 point = new Point3D32(); point.setX(localizationPointMapPacket.getLocalizationPointMap().get(3 * i)); point.setY(localizationPointMapPacket.getLocalizationPointMap().get(3 * i + 1)); point.setZ(localizationPointMapPacket.getLocalizationPointMap().get(3 * i + 2)); points[i] = point; } return points; }