Class OBBFactoryImpl

java.lang.Object
com.hammy275.immersivemc.common.api_impl.hitbox.OBBFactoryImpl
All Implemented Interfaces:
OBBFactory

public class OBBFactoryImpl extends Object implements OBBFactory
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final OBBFactory
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    create(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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • INSTANCE

      public static final OBBFactory INSTANCE
  • Constructor Details

    • OBBFactoryImpl

      public OBBFactoryImpl()
  • Method Details

    • create

      public OBB create(net.minecraft.world.phys.AABB aabb)
      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 interface OBBFactory
      Parameters:
      aabb - The AABB to create the OBB with.
      Returns:
      A new OBB instance.
    • create

      public OBB create(net.minecraft.world.phys.AABB aabb, double pitch, double yaw, double roll)
      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 interface OBBFactory
      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

      public OBB create(net.minecraft.world.phys.AABB aabb, org.joml.Quaternionfc rotation)
      Description copied from interface: OBBFactory
      Creates an OBB with the provided Quaternion as the rotation.
      Specified by:
      create in interface OBBFactory
      Parameters:
      aabb - The AABB that represents this OBB without rotations.
      rotation - The Quaternion specifying how the OBB is rotated.
      Returns:
      A new OBB instance.