Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
OrientedBox.h
Go to the documentation of this file.
1// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
2// SPDX-FileCopyrightText: 2021 Jorrit Rouwe
3// SPDX-License-Identifier: MIT
4
5#pragma once
6
10#include <Jolt/Math/Mat44.h>
11
13
14class AABox;
15
17class [[nodiscard]] OrientedBox
18{
19public:
21
23 OrientedBox() = default;
24 OrientedBox(Mat44Arg inOrientation, Vec3Arg inHalfExtents) : mOrientation(inOrientation), mHalfExtents(inHalfExtents) { }
25
27 OrientedBox(Mat44Arg inOrientation, const AABox &inBox) : OrientedBox(inOrientation.PreTranslated(inBox.GetCenter()), inBox.GetExtent()) { }
28
30 bool Overlaps(const AABox &inBox, float inEpsilon = 1.0e-6f) const;
31
33 bool Overlaps(const OrientedBox &inBox, float inEpsilon = 1.0e-6f) const;
34
37};
38
#define JPH_NAMESPACE_END
Definition: Core.h:240
#define JPH_NAMESPACE_BEGIN
Definition: Core.h:234
#define JPH_OVERRIDE_NEW_DELETE
Macro to override the new and delete functions.
Definition: Memory.h:29
Axis aligned box.
Definition: AABox.h:16
Holds a 4x4 matrix of floats, but supports also operations on the 3x3 upper left part of the matrix.
Definition: Mat44.h:13
Oriented box.
Definition: OrientedBox.h:18
Mat44 mOrientation
Transform that positions and rotates the local space axis aligned box into world space.
Definition: OrientedBox.h:35
OrientedBox(Mat44Arg inOrientation, Vec3Arg inHalfExtents)
Definition: OrientedBox.h:24
OrientedBox(Mat44Arg inOrientation, const AABox &inBox)
Construct from axis aligned box and transform. Only works for rotation/translation matrix (no scaling...
Definition: OrientedBox.h:27
JPH_OVERRIDE_NEW_DELETE OrientedBox()=default
Constructor.
Vec3 mHalfExtents
Half extents (half the size of the edge) of the local space axis aligned box.
Definition: OrientedBox.h:36
Definition: Vec3.h:16