OrientedBoundingBox
Represents a bounding box that can be rotated in any direction. Unlike an axis-aligned bounding box, this can rotate with the model. Optimized for performance with object reuse and dirty flag system. Now supports dynamic scaling.
Constructors
Link copied to clipboard
Creates an oriented bounding box
public void OrientedBoundingBox(Vector3d center, double width, double height, double depth, ModeledEntity entity)
Creates an oriented bounding box with scale support
Creates an oriented bounding box from a Bukkit location and dimensions
public void OrientedBoundingBox(Location location, double width, double height, double depth, ModeledEntity entity)
Creates an oriented bounding box from a Bukkit location and dimensions with entity reference
Properties
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
public double scaleModifier
Functions
Link copied to clipboard
public synchronized double centerDistanceIfIntersects(BoundingBox aabb, double x, double y, double z)
Returns the center distance when the supplied AABB intersects this exact pose, or
-1 when it does not.Link copied to clipboard
Returns the distance from the current coherent OBB center to a point.
Link copied to clipboard
Link copied to clipboard
Gets the 8 corners of the OBB in world space
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Exact OBB-vs-AABB intersection via the Separating Axis Theorem (15 axes).
Link copied to clipboard
Runs the cheap enclosing-AABB rejection and the exact SAT test against the same pose.
Link copied to clipboard
Coarse pre-filter: returns true if the AABB overlaps the OBB's enclosing world-aligned bounding box.
Link copied to clipboard
Checks if a ray from a player's eye location intersects with this OBB.
public synchronized double rayIntersection(double ox, double oy, double oz, double dx, double dy, double dz, double maxDistance)
Ray/segment intersection against this OBB from an explicit origin and direction.
Link copied to clipboard
Perform a ray trace from a player's eye location in the direction they're looking
Link copied to clipboard
public static Optional<ModeledEntity> raytraceFromPoint(World world, Location location, float maxDistance)
Perform a ray trace from a specific point in a specific direction
Link copied to clipboard
Sets the associated entity for scale calculations
Link copied to clipboard
Updates both position, rotation, and scale from a Location in one efficient call.
Link copied to clipboard