/** * Sets this line segment to be same as the given line segment. * * @param other the other line segment to copy. Not modified. */ default void set(LineSegment3DReadOnly other) { set(other.getFirstEndpoint(), other.getSecondEndpoint()); }
/** * Sets the orientation from the yaw angle of the given quaternion. * * @param orientation the orientation with the new angle value for this. Not modified. */ default void setOrientation(Orientation3DReadOnly orientation) { getOrientation().set(orientation); }
protected static void getConnectingEdges(ConvexPolygon2DReadOnly polygon1, ConvexPolygon2DReadOnly polygon2, LineSegment2DBasics connectingEdge1ToPack, LineSegment2DBasics connectingEdge2ToPack, int[][] verticesIndices) { connectingEdge1ToPack.set(polygon1.getVertex(verticesIndices[0][0]), polygon2.getVertex(verticesIndices[1][0])); connectingEdge2ToPack.set(polygon2.getVertex(verticesIndices[1][1]), polygon1.getVertex(verticesIndices[0][1])); }
/** * Sets this pose 3D to the {@code other} pose 3D. * * @param other the other pose 3D. Not modified. */ default void set(Pose3DReadOnly other) { setPosition(other.getPosition()); setOrientation(other.getOrientation()); }
/** * Updates this bounding box to be the smallest bounding box that includes this and the supplied * points. * * @param vertex2DSupplier the supply of points. */ default void updateToIncludePoints(Vertex2DSupplier vertex2DSupplier) { for (int index = 0; index < vertex2DSupplier.getNumberOfVertices(); index++) updateToIncludePoint(vertex2DSupplier.getVertex(index)); }
/** * Sets this pose 2D to the {@code other} pose 2D. * * @param other the other pose 2D. Not modified. */ default void set(Pose2DReadOnly other) { setPosition(other.getPosition()); setOrientation(other.getOrientation()); }
/** * Sets this line segment to be same as the given line segment. * * @param other the other line segment to copy. Not modified. */ default void set(LineSegment3DReadOnly other) { set(other.getFirstEndpoint(), other.getSecondEndpoint()); }
/** * Sets this line to go through the endpoints of the given line segment. * <p> * After calling this method this line is in the XY-plane. * </p> * * @param lineSegment2DReadOnly the line segment to get the endpoints from. Not modified. */ default void set(LineSegment2DReadOnly lineSegment2DReadOnly) { set(lineSegment2DReadOnly.getFirstEndpoint(), lineSegment2DReadOnly.getSecondEndpoint()); }
/** * Sets this line to go through the endpoints of the given line segment. * * @param lineSegment3DReadOnly the line segment to get the endpoints from. Not modified. */ default void set(LineSegment3DReadOnly lineSegment3DReadOnly) { set(lineSegment3DReadOnly.getFirstEndpoint(), lineSegment3DReadOnly.getSecondEndpoint()); }
/** * Updates the bounding box properties. */ default void updateBoundingBox() { BoundingBox2DBasics boundingBox = getBoundingBox(); boundingBox.setToNaN(); boundingBox.updateToIncludePoints(this); }
/** * Gets the size along the x-axis of this polygon's bounding box. * * @return the range on the x-axis of the bounding box. * @throws OutdatedPolygonException if {@link ConvexPolygon2DBasics#update()} has not been called * since last time this polygon's vertices were edited. */ default double getBoundingBoxRangeX() { BoundingBox2DReadOnly boundingBox = getBoundingBox(); return boundingBox.getMaxX() - boundingBox.getMinX(); }
/** * Computes the absolute angle difference between the orientation part of this pose 2D and the give * {@code orientation}. * * @param other the orientation used to compute the orientation distance. Not modified. * @return the absolute angle difference between {@code this} and {@code orientation}. */ default double getOrientationDistance(Orientation2DReadOnly other) { return getOrientation().distance(other); }
/** * Gets the lowest y-coordinate value of the vertices composing this polygon. * * @return the minimum y-coordinate. * @throws OutdatedPolygonException if {@link ConvexPolygon2DBasics#update()} has not been called * since last time this polygon's vertices were edited. * @throws EmptyPolygonException if this polygon is empty when calling this method. */ default double getMinY() { return getBoundingBox().getMinY(); }
/** * Gets the lowest x-coordinate value of the vertices composing this polygon. * * @return the minimum x-coordinate. * @throws OutdatedPolygonException if {@link ConvexPolygon2DBasics#update()} has not been called * since last time this polygon's vertices were edited. * @throws EmptyPolygonException if this polygon is empty when calling this method. */ default double getMinX() { return getBoundingBox().getMinX(); }
/** * Gets the highest y-coordinate value of the vertices composing this polygon. * * @return the maximum y-coordinate. * @throws OutdatedPolygonException if {@link ConvexPolygon2DBasics#update()} has not been called * since last time this polygon's vertices were edited. * @throws EmptyPolygonException if this polygon is empty when calling this method. */ default double getMaxY() { return getBoundingBox().getMaxY(); }
/** * Gets the highest x-coordinate value of the vertices composing this polygon. * * @return the maximum x-coordinate. * @throws OutdatedPolygonException if {@link ConvexPolygon2DBasics#update()} has not been called * since last time this polygon's vertices were edited. * @throws EmptyPolygonException if this polygon is empty when calling this method. */ default double getMaxX() { return getBoundingBox().getMaxX(); }
/** * Sets the orientation yaw angle value. * * @param yaw the orientation angle value. */ default void setYaw(double yaw) { getOrientation().setYaw(yaw); }
/** * Sets the orientation from the given orientation 2D. * * @param orientation the orientation with the new angle value for this. Not modified. */ default void setOrientation(Orientation2DReadOnly orientation) { getOrientation().set(orientation); }
/** * Computes the absolute angle difference between this pose 2D and {@code other}. * * @param other the other pose 2D used to compute the orientation distance. Not modified. * @return the absolute angle difference between {@code this.orientation} and * {@code other.orientation}. */ default double getOrientationDistance(Pose2DReadOnly other) { return getOrientation().distance(other.getOrientation()); }