@Test public void interpolate() { State state1 = State.of(Pose.zero(), Vector3.fromXYZ(2, 10, 0)); State state2 = State.of(Pose.zero(), Vector3.fromXYZ(4, 12, 2)); assertThat(state1.interpolate(state2, 0.0)).isEqualTo(state1); assertThat(state2.interpolate(state1, 0.0)).isEqualTo(state2); assertThat(state1.interpolate(state2, 1.0)).isEqualTo(state2); assertThat(state2.interpolate(state1, 1.0)).isEqualTo(state1); assertThat(state1.interpolate(state2, 0.5)).isEqualTo(State.of(Pose.zero(), Vector3.fromXYZ(3, 11, 1))); }
@Override public State interpolate(final State state, double percentage) { IVector3 velDiff = state.vel3.subtractNew(vel3).multiply(percentage); IVector3 intpVel = vel3.addNew(velDiff); return State.of(pose.interpolate(state.pose, percentage), intpVel); }
State implements IMirrorable<State>, IExportable, IInterpolatable<State> { @Override public State interpolate(final State state, double percentage) { IVector3 velDiff = state.vel3.subtractNew(vel3).multiply(percentage); IVector3 intpVel = vel3.addNew(velDiff); return State.of(pose.interpolate(state.pose, percentage), intpVel); } }
State implements IMirrorable<State>, IExportable, IInterpolatable<State> { @Override public State interpolate(final State state, double percentage) { IVector3 velDiff = state.vel3.subtractNew(vel3).multiply(percentage); IVector3 intpVel = vel3.addNew(velDiff); return State.of(pose.interpolate(state.pose, percentage), intpVel); } protected  State(); protected  State(final Pose pose, final IVector3 vel3); }
State implements IMirrorable<State>, IExportable, IInterpolatable<State> { @Override public State interpolate(final State state, double percentage) { IVector3 velDiff = state.vel3.subtractNew(vel3).multiply(percentage); IVector3 intpVel = vel3.addNew(velDiff); return State.of(pose.interpolate(state.pose, percentage), intpVel); } protected  State(); protected  State(final Pose pose, final IVector3 vel3); static State of(final Pose pose, final IVector3 vel); static State zero(); @Override State mirrored(); @Override State interpolate(final State state, double percentage); Pose getPose(); IVector2 getPos(); double getOrientation(); IVector3 getVel3(); IVector2 getVel2(); double getAngularVel(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); @Override List<String> getHeaders(); @Override List<Number> getNumberList(); }
State implements IMirrorable<State>, IExportable, IInterpolatable<State> { @Override public State interpolate(final State state, double percentage) { IVector3 velDiff = state.vel3.subtractNew(vel3).multiply(percentage); IVector3 intpVel = vel3.addNew(velDiff); return State.of(pose.interpolate(state.pose, percentage), intpVel); } protected  State(); protected  State(final Pose pose, final IVector3 vel3); static State of(final Pose pose, final IVector3 vel); static State zero(); @Override State mirrored(); @Override State interpolate(final State state, double percentage); Pose getPose(); IVector2 getPos(); double getOrientation(); IVector3 getVel3(); IVector2 getVel2(); double getAngularVel(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); @Override List<String> getHeaders(); @Override List<Number> getNumberList();  }