initial commit, 4.5 stable
Some checks failed
🔗 GHA / 📊 Static checks (push) Has been cancelled
🔗 GHA / 🤖 Android (push) Has been cancelled
🔗 GHA / 🍏 iOS (push) Has been cancelled
🔗 GHA / 🐧 Linux (push) Has been cancelled
🔗 GHA / 🍎 macOS (push) Has been cancelled
🔗 GHA / 🏁 Windows (push) Has been cancelled
🔗 GHA / 🌐 Web (push) Has been cancelled
Some checks failed
🔗 GHA / 📊 Static checks (push) Has been cancelled
🔗 GHA / 🤖 Android (push) Has been cancelled
🔗 GHA / 🍏 iOS (push) Has been cancelled
🔗 GHA / 🐧 Linux (push) Has been cancelled
🔗 GHA / 🍎 macOS (push) Has been cancelled
🔗 GHA / 🏁 Windows (push) Has been cancelled
🔗 GHA / 🌐 Web (push) Has been cancelled
This commit is contained in:
39
thirdparty/jolt_physics/Jolt/Geometry/OrientedBox.h
vendored
Normal file
39
thirdparty/jolt_physics/Jolt/Geometry/OrientedBox.h
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
|
||||
// SPDX-FileCopyrightText: 2021 Jorrit Rouwe
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Jolt/Geometry/Triangle.h>
|
||||
#include <Jolt/Geometry/IndexedTriangle.h>
|
||||
#include <Jolt/Geometry/AABox.h>
|
||||
#include <Jolt/Math/Mat44.h>
|
||||
|
||||
JPH_NAMESPACE_BEGIN
|
||||
|
||||
class AABox;
|
||||
|
||||
/// Oriented box
|
||||
class JPH_EXPORT_GCC_BUG_WORKAROUND [[nodiscard]] OrientedBox
|
||||
{
|
||||
public:
|
||||
JPH_OVERRIDE_NEW_DELETE
|
||||
|
||||
/// Constructor
|
||||
OrientedBox() = default;
|
||||
OrientedBox(Mat44Arg inOrientation, Vec3Arg inHalfExtents) : mOrientation(inOrientation), mHalfExtents(inHalfExtents) { }
|
||||
|
||||
/// Construct from axis aligned box and transform. Only works for rotation/translation matrix (no scaling / shearing).
|
||||
OrientedBox(Mat44Arg inOrientation, const AABox &inBox) : OrientedBox(inOrientation.PreTranslated(inBox.GetCenter()), inBox.GetExtent()) { }
|
||||
|
||||
/// Test if oriented box overlaps with axis aligned box each other
|
||||
bool Overlaps(const AABox &inBox, float inEpsilon = 1.0e-6f) const;
|
||||
|
||||
/// Test if two oriented boxes overlap each other
|
||||
bool Overlaps(const OrientedBox &inBox, float inEpsilon = 1.0e-6f) const;
|
||||
|
||||
Mat44 mOrientation; ///< Transform that positions and rotates the local space axis aligned box into world space
|
||||
Vec3 mHalfExtents; ///< Half extents (half the size of the edge) of the local space axis aligned box
|
||||
};
|
||||
|
||||
JPH_NAMESPACE_END
|
Reference in New Issue
Block a user