Search in sources :

Example 1 with SpongeTransformationBuilder

use of org.spongepowered.common.util.transformation.SpongeTransformationBuilder in project SpongeCommon by SpongePowered.

the class AbstractReferentArchetypeVolumeTest method testSizeTransformations.

private static Stream<Arguments> testSizeTransformations() {
    final Rotation rotate0 = Mockito.mock(Rotation.class, Mockito.withSettings().defaultAnswer(Mockito.CALLS_REAL_METHODS));
    final Rotation rotate90 = Mockito.mock(Rotation.class, Mockito.withSettings().defaultAnswer(Mockito.CALLS_REAL_METHODS));
    Mockito.when(rotate0.angle()).thenReturn(Angle.fromDegrees(0));
    Mockito.when(rotate90.angle()).thenReturn(Angle.fromDegrees(90));
    return Stream.of(Arguments.of(new Vector3i(0, 0, 0), new Vector3i(1, 1, 1), new Vector3i(0, 0, 0), new Vector3i(1, 1, 1), new SpongeTransformationBuilder().rotate(rotate0).origin(new Vector3d(1, 0, 1)).build()), Arguments.of(new Vector3i(0, 0, 0), new Vector3i(1, 1, 1), new Vector3i(1, 0, 0), new Vector3i(0, 1, 1), new SpongeTransformationBuilder().rotate(rotate90).origin(new Vector3d(1, 1, 1)).build()), Arguments.of(new Vector3i(1, 1, 1), new Vector3i(2, 2, 2), new Vector3i(2, 1, 1), new Vector3i(1, 2, 2), new SpongeTransformationBuilder().rotate(rotate90).origin(new Vector3d(2, 2, 2)).build()), Arguments.of(new Vector3i(1, 1, 1), new Vector3i(5, 5, 5), new Vector3i(5, 1, 1), new Vector3i(1, 5, 5), new SpongeTransformationBuilder().rotate(rotate90).origin(new Vector3d(3.5, 3.5, 3.5)).build()));
}
Also used : SpongeTransformationBuilder(org.spongepowered.common.util.transformation.SpongeTransformationBuilder) Vector3d(org.spongepowered.math.vector.Vector3d) Vector3i(org.spongepowered.math.vector.Vector3i) Rotation(org.spongepowered.api.util.rotation.Rotation)

Aggregations

Rotation (org.spongepowered.api.util.rotation.Rotation)1 SpongeTransformationBuilder (org.spongepowered.common.util.transformation.SpongeTransformationBuilder)1 Vector3d (org.spongepowered.math.vector.Vector3d)1 Vector3i (org.spongepowered.math.vector.Vector3i)1