Class OBBFactoryImpl
java.lang.Object
com.hammy275.immersivemc.common.api_impl.hitbox.OBBFactoryImpl
- All Implemented Interfaces:
OBBFactory
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreate
(net.minecraft.world.phys.AABB aabb) Creates an OBB with no rotation.create
(net.minecraft.world.phys.AABB aabb, double pitch, double yaw, double roll) Creates an OBB with the provided pitch, yaw, and roll rotation.create
(net.minecraft.world.phys.AABB aabb, org.joml.Quaternionfc rotation) Creates an OBB with the provided Quaternion as the rotation.
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
OBBFactoryImpl
public OBBFactoryImpl()
-
-
Method Details
-
create
Description copied from interface:OBBFactory
Creates an OBB with no rotation. From a gameplay perspective, this is identical to an AABB. As such, it's recommended to just create an AABB instead.- Specified by:
create
in interfaceOBBFactory
- Parameters:
aabb
- The AABB to create the OBB with.- Returns:
- A new OBB instance.
-
create
Description copied from interface:OBBFactory
Creates an OBB with the provided pitch, yaw, and roll rotation. The rotations are applied in the order yaw->pitch->roll.- Specified by:
create
in interfaceOBBFactory
- Parameters:
aabb
- The AABB that represents this OBB without rotations.pitch
- The pitch of the rotation.yaw
- The yaw of the rotation.roll
- The roll of the rotation.- Returns:
- A new OBB instance.
-
create
Description copied from interface:OBBFactory
Creates an OBB with the provided Quaternion as the rotation.- Specified by:
create
in interfaceOBBFactory
- Parameters:
aabb
- The AABB that represents this OBB without rotations.rotation
- The Quaternion specifying how the OBB is rotated.- Returns:
- A new OBB instance.
-