/** * Checks that the reference frames used by {@code this} correspond to the given ones. * * @param bodyFrame the query for the body frame. * @param baseFrame the query for the base frame. * @param expressedInFrame the query for the "expressed in frame". * @throws ReferenceFrameMismatchException if the reference frames are not the same: * {@code this.getBodyFrame() != bodyFrame}, {@code this.getBaseFrame() != baseFrame}, * or {@code this.getReferenceFrame() != expressedInFrame}. */ default void checkReferenceFrameMatch(ReferenceFrame bodyFrame, ReferenceFrame baseFrame, ReferenceFrame expressedInFrame) throws ReferenceFrameMismatchException { checkBodyFrameMatch(bodyFrame); checkBaseFrameMatch(baseFrame); checkExpressedInFrameMatch(expressedInFrame); }
/** * Sets this motion vector to {@code other}. * <p> * If {@code other} is expressed in the frame as {@code this}, then this method is equivalent to * {@link #set(SpatialMotionReadOnly)}. * </p> * <p> * If {@code other} is expressed in a different frame than {@code this}, then {@code this} is set * to {@code other} once transformed to be expressed in {@code this.getReferenceFrame()}. * </p> * * @param other the other vector to copy. Not modified. * @throws ReferenceFrameMismatchException if either the body frame or base frame in * {@code other} does not match {@code this}. */ default void setMatchingFrame(SpatialMotionReadOnly other) { other.checkBodyFrameMatch(getBodyFrame()); other.checkBaseFrameMatch(getBaseFrame()); FixedFrameSpatialVectorBasics.super.setMatchingFrame(other); }