public void getBasePosition(FramePoint3DBasics framePoint3D) { framePoint3D.setIncludingFrame(base); }
/** * Tests on a per component basis if this point is equal to the given {@code other} to an * {@code epsilon}. * <p> * If the two points have different frames, this method returns {@code false}. * </p> * * @param other the other point to compare against this. Not modified. * @param epsilon the tolerance to use when comparing each component. * @return {@code true} if the two points are equal and are expressed in the same reference frame, * {@code false} otherwise. */ @Override public boolean epsilonEquals(FramePoint3D other, double epsilon) { return FramePoint3DBasics.super.epsilonEquals(other, epsilon); }
/** * Tests if {@code this} and {@code other} represent the same point 3D to an {@code epsilon}. * <p> * Two points are considered geometrically equal if they are at a distance of less than or equal to * {@code epsilon}. * </p> * <p> * Note that {@code this.geometricallyEquals(other, epsilon) == true} does not necessarily imply * {@code this.epsilonEquals(other, epsilon)} and vice versa. * </p> * * @param other the other point 3D to compare against this. Not modified. * @param epsilon the maximum distance that the two points can be spaced and still considered equal. * @return {@code true} if the two points represent the same geometry, {@code false} otherwise. * @throws ReferenceFrameMismatchException if {@code other} is not expressed in the same reference * frame as {@code this}. */ @Override public boolean geometricallyEquals(FramePoint3D other, double epsilon) { return FramePoint3DBasics.super.geometricallyEquals(other, epsilon); }
/** * Gets the coordinates of two distinct points this line goes through. * * @param firstPointOnLineToPack the coordinates of a first point located on this line. Modified. * @param secondPointOnLineToPack the coordinates of a second point located on this line. Modified. */ default void getTwoPointsOnLine(FramePoint3DBasics firstPointOnLineToPack, FramePoint3DBasics secondPointOnLineToPack) { firstPointOnLineToPack.setReferenceFrame(getReferenceFrame()); secondPointOnLineToPack.setReferenceFrame(getReferenceFrame()); Line3DReadOnly.super.getTwoPointsOnLine(firstPointOnLineToPack, secondPointOnLineToPack); }
/** * Sets this frame point to {@code other}. * * @param other the other frame point to set this to. Not modified. * @throws ReferenceFrameMismatchException if {@code other} is not expressed in the same frame as * {@code this}. */ @Override public void set(FramePoint3D other) { FramePoint3DBasics.super.set(other); }
/** * Gets the endpoints defining this line segment by storing their coordinates in the given * arguments. * * @param firstEndpointToPack point in which the coordinates of this line segment's first endpoint * are stored. Modified. * @param secondEndpointToPack point in which the coordinates of this line segment's second endpoint * are stored. Modified. */ default void get(FramePoint3DBasics firstEndpointToPack, FramePoint3DBasics secondEndpointToPack) { firstEndpointToPack.setReferenceFrame(getReferenceFrame()); secondEndpointToPack.setReferenceFrame(getReferenceFrame()); LineSegment3DReadOnly.super.get(firstEndpointToPack, secondEndpointToPack); }
/** * Gets the coordinates of two distinct points this line goes through. * * @param firstPointOnLineToPack the coordinates of a first point located on this line. Modified. * @param secondPointOnLineToPack the coordinates of a second point located on this line. Modified. */ default void getTwoPointsOnLine(FramePoint3DBasics firstPointOnLineToPack, Point3DBasics secondPointOnLineToPack) { firstPointOnLineToPack.setReferenceFrame(getReferenceFrame()); Line3DReadOnly.super.getTwoPointsOnLine(firstPointOnLineToPack, secondPointOnLineToPack); }
public void getBasePosition(FramePoint3DBasics framePoint3D) { framePoint3D.setIncludingFrame(base); }
/** * Gets the coordinates of two distinct points this line goes through. * * @param firstPointOnLineToPack the coordinates of a first point located on this line. Modified. * @param secondPointOnLineToPack the coordinates of a second point located on this line. Modified. */ default void getTwoPointsOnLine(Point3DBasics firstPointOnLineToPack, FramePoint3DBasics secondPointOnLineToPack) { secondPointOnLineToPack.setReferenceFrame(getReferenceFrame()); Line3DReadOnly.super.getTwoPointsOnLine(firstPointOnLineToPack, secondPointOnLineToPack); }
/** * Packs this rigid-body's center of mass coordinates in the given argument. * <p> * Note that unless modified in runtime, this method outputs {@code (0, 0, 0)} in the * body-fixed-frame. The body-fixed-frame is centered at this rigid-body's center of mass position * by default. * </p> * * @param centerOfMassToPack the {@code FramePoint} in which the center of mass position is stored. * Modified. */ default void getCenterOfMass(FramePoint3DBasics centerOfMassToPack) { centerOfMassToPack.setIncludingFrame(getInertia().getCenterOfMassOffset()); }
/** * Computes the coordinates of the point located on the line this line segment is lying on: <br> * {@code pointToPack.interpolate(firstEndpoint, secondEndpoint, percentage)} </br> * * @param percentage the percentage along this line segment of the point. * @param pointToPack where the result is stored. Modified. */ default void pointOnLineGivenPercentage(double percentage, FramePoint3DBasics pointToPack) { pointToPack.setReferenceFrame(getReferenceFrame()); LineSegment3DReadOnly.super.pointOnLineGivenPercentage(percentage, pointToPack); }
/** * Computes the coordinates of the point located exactly at the middle of this line segment. * * @param midpointToPack point in which the mid-point of this line segment is stored. Modified. */ default void midpoint(FramePoint3DBasics midpointToPack) { midpointToPack.setReferenceFrame(getReferenceFrame()); LineSegment3DReadOnly.super.midpoint(midpointToPack); }
/** * This methods computes two points P ∈ this line and Q ∈ {@code otherLine} such that the * distance || P - Q || is the minimum distance between the two 3D lines. * <a href="http://geomalgorithms.com/a07-_distance.html"> Useful link</a>. * * @param otherLine the second line. Not modified. * @param closestPointOnThisLineToPack the 3D coordinates of the point P are packed in this 3D * point. Modified. Can be {@code null}. * @param closestPointOnOtherLineToPack the 3D coordinates of the point Q are packed in this 3D * point. Modified. Can be {@code null}. * @return the minimum distance between the two lines. */ default double closestPointsWith(Line3DReadOnly otherLine, FramePoint3DBasics closestPointOnThisLineToPack, FramePoint3DBasics closestPointOnOtherLineToPack) { closestPointOnThisLineToPack.setReferenceFrame(getReferenceFrame()); closestPointOnOtherLineToPack.setReferenceFrame(getReferenceFrame()); return Line3DReadOnly.super.closestPointsWith(otherLine, closestPointOnThisLineToPack, closestPointOnOtherLineToPack); }
/** * Gets the point and direction defining this line by storing their components in the given * arguments {@code pointToPack} and {@code directionToPack}. * * @param pointToPack point in which the coordinates of this line's point are stored. Modified. * @param directionToPack vector in which the components of this line's direction are stored. * Modified. */ default void get(FramePoint3DBasics pointToPack, Vector3DBasics directionToPack) { pointToPack.setReferenceFrame(getReferenceFrame()); Line3DReadOnly.super.get(pointToPack, directionToPack); }
/** * Computes the coordinates of the point located at a given percentage on this line segment: <br> * {@code pointToPack.interpolate(firstEndpoint, secondEndpoint, percentage)} </br> * * @param percentage the percentage along this line segment of the point. Must be in [0, 1]. * @param pointToPack where the result is stored. Modified. * @throws {@link RuntimeException} if {@code percentage} ∉ [0, 1]. */ default void pointBetweenEndpointsGivenPercentage(double percentage, FramePoint3DBasics pointToPack) { pointToPack.setReferenceFrame(getReferenceFrame()); LineSegment3DReadOnly.super.pointBetweenEndpointsGivenPercentage(percentage, pointToPack); }
/** * Gets the endpoints defining this line segment by storing their coordinates in the given * arguments. * * @param firstEndpointToPack point in which the coordinates of this line segment's first endpoint * are stored. Modified. * @param secondEndpointToPack point in which the coordinates of this line segment's second endpoint * are stored. Modified. */ default void get(FramePoint3DBasics firstEndpointToPack, Point3DBasics secondEndpointToPack) { firstEndpointToPack.setReferenceFrame(getReferenceFrame()); LineSegment3DReadOnly.super.get(firstEndpointToPack, secondEndpointToPack); }
/** * Gets the endpoints defining this line segment by storing their coordinates in the given * arguments. * * @param firstEndpointToPack point in which the coordinates of this line segment's first endpoint * are stored. Modified. * @param secondEndpointToPack point in which the coordinates of this line segment's second endpoint * are stored. Modified. */ default void get(Point3DBasics firstEndpointToPack, FramePoint3DBasics secondEndpointToPack) { secondEndpointToPack.setReferenceFrame(getReferenceFrame()); LineSegment3DReadOnly.super.get(firstEndpointToPack, secondEndpointToPack); }
/** * This methods computes two points P ∈ this line and Q ∈ {@code otherLine} such that the * distance || P - Q || is the minimum distance between the two 3D lines. * <a href="http://geomalgorithms.com/a07-_distance.html"> Useful link</a>. * * @param otherLine the second line. Not modified. * @param closestPointOnThisLineToPack the 3D coordinates of the point P are packed in this 3D * point. Modified. Can be {@code null}. * @param closestPointOnOtherLineToPack the 3D coordinates of the point Q are packed in this 3D * point. Modified. Can be {@code null}. * @return the minimum distance between the two lines. */ default double closestPointsWith(Line3DReadOnly otherLine, FramePoint3DBasics closestPointOnThisLineToPack, Point3DBasics closestPointOnOtherLineToPack) { closestPointOnThisLineToPack.setReferenceFrame(getReferenceFrame()); return Line3DReadOnly.super.closestPointsWith(otherLine, closestPointOnThisLineToPack, closestPointOnOtherLineToPack); }
/** * This methods computes two points P ∈ this line and Q ∈ {@code otherLine} such that the * distance || P - Q || is the minimum distance between the two 3D lines. * <a href="http://geomalgorithms.com/a07-_distance.html"> Useful link</a>. * * @param otherLine the second line. Not modified. * @param closestPointOnThisLineToPack the 3D coordinates of the point P are packed in this 3D * point. Modified. Can be {@code null}. * @param closestPointOnOtherLineToPack the 3D coordinates of the point Q are packed in this 3D * point. Modified. Can be {@code null}. * @return the minimum distance between the two lines. */ default double closestPointsWith(Line3DReadOnly otherLine, Point3DBasics closestPointOnThisLineToPack, FramePoint3DBasics closestPointOnOtherLineToPack) { closestPointOnOtherLineToPack.setReferenceFrame(getReferenceFrame()); return Line3DReadOnly.super.closestPointsWith(otherLine, closestPointOnThisLineToPack, closestPointOnOtherLineToPack); }
/** * Calculates the coordinates of the point 'p' given the parameter 't' as follows:<br> * p = t * n + p<sub>0</sub><br> * where n is the unit-vector defining the direction of this line and p<sub>0</sub> is the point * defining this line which also corresponds to the point for which t=0. * <p> * Note that the absolute value of 't' is equal to the distance between the point 'p' and the point * p<sub>0</sub> defining this line. * </p> * * @param t the parameter used to calculate the point coordinates. * @param pointToPack the point in which the coordinates of 'p' are stored. Modified. */ default void pointOnLineGivenParameter(double t, FramePoint3DBasics pointToPack) { pointToPack.setReferenceFrame(getReferenceFrame()); Line3DReadOnly.super.pointOnLineGivenParameter(t, pointToPack); }