Search in sources :

Example 71 with Vector3d

use of org.spongepowered.math.vector.Vector3d 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

Vector3d (org.spongepowered.math.vector.Vector3d)71 Vector3i (org.spongepowered.math.vector.Vector3i)16 CauseStackManager (org.spongepowered.api.event.CauseStackManager)14 AABB (org.spongepowered.api.util.AABB)14 Test (org.junit.jupiter.api.Test)13 ServerWorld (org.spongepowered.api.world.server.ServerWorld)13 BlockPos (net.minecraft.core.BlockPos)8 ServerLevel (net.minecraft.server.level.ServerLevel)7 BlockState (org.spongepowered.api.block.BlockState)7 Transformation (org.spongepowered.api.util.transformation.Transformation)7 Function (java.util.function.Function)6 IntStream (java.util.stream.IntStream)6 Stream (java.util.stream.Stream)6 Entity (org.spongepowered.api.entity.Entity)6 MoveEntityEvent (org.spongepowered.api.event.entity.MoveEntityEvent)6 ServerLocation (org.spongepowered.api.world.server.ServerLocation)6 Nullable (org.checkerframework.checker.nullness.qual.Nullable)5 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)5 MethodSource (org.junit.jupiter.params.provider.MethodSource)5 BlockType (org.spongepowered.api.block.BlockType)5