diff --git a/Source/Engine/Physics/Physics.Queries.cpp b/Source/Engine/Physics/Physics.Queries.cpp
index 6cf3c786d..27171414b 100644
--- a/Source/Engine/Physics/Physics.Queries.cpp
+++ b/Source/Engine/Physics/Physics.Queries.cpp
@@ -425,11 +425,11 @@ bool Physics::CheckSphere(const Vector3& center, const float radius, uint32 laye
return GetScene()->overlap(geometry, pose, buffer, filterData, GetQueryFilterCallback());
}
-bool Physics::CheckCapsule(const Vector3& center, const float radius, const float height, uint32 layerMask, bool hitTriggers)
+bool Physics::CheckCapsule(const Vector3& center, const float radius, const float height, const Quaternion& rotation, uint32 layerMask, bool hitTriggers)
{
// Prepare data
SCENE_QUERY_SETUP_OVERLAP_1();
- const PxTransform pose(C2P(center));
+ const PxTransform pose(C2P(center), C2P(rotation));
const PxCapsuleGeometry geometry(radius, height * 0.5f);
// Perform overlap test
@@ -470,11 +470,11 @@ bool Physics::OverlapSphere(const Vector3& center, const float radius, Array
& results, uint32 layerMask, bool hitTriggers)
+bool Physics::OverlapCapsule(const Vector3& center, const float radius, const float height, Array& results, const Quaternion& rotation, uint32 layerMask, bool hitTriggers)
{
// Prepare data
SCENE_QUERY_SETUP_OVERLAP();
- const PxTransform pose(C2P(center));
+ const PxTransform pose(C2P(center), C2P(rotation));
const PxCapsuleGeometry geometry(radius, height * 0.5f);
// Perform overlap test
@@ -521,11 +521,11 @@ bool Physics::OverlapSphere(const Vector3& center, const float radius, Array& results, uint32 layerMask, bool hitTriggers)
+bool Physics::OverlapCapsule(const Vector3& center, const float radius, const float height, Array& results, const Quaternion& rotation, uint32 layerMask, bool hitTriggers)
{
// Prepare data
SCENE_QUERY_SETUP_OVERLAP();
- const PxTransform pose(C2P(center));
+ const PxTransform pose(C2P(center), C2P(rotation));
const PxCapsuleGeometry geometry(radius, height * 0.5f);
// Perform overlap test
diff --git a/Source/Engine/Physics/Physics.h b/Source/Engine/Physics/Physics.h
index 0a5dfefd0..8aac37a2e 100644
--- a/Source/Engine/Physics/Physics.h
+++ b/Source/Engine/Physics/Physics.h
@@ -339,10 +339,11 @@ public:
/// The capsule center.
/// The radius of the capsule.
/// The height of the capsule, excluding the top and bottom spheres.
+ /// The capsule rotation.
/// The layer mask used to filter the results.
/// If set to true triggers will be hit, otherwise will skip them.
/// True if capsule overlaps any matching object, otherwise false.
- API_FUNCTION() static bool CheckCapsule(const Vector3& center, float radius, float height, uint32 layerMask = MAX_uint32, bool hitTriggers = true);
+ API_FUNCTION() static bool CheckCapsule(const Vector3& center, float radius, float height, const Quaternion& rotation = Quaternion::Identity, uint32 layerMask = MAX_uint32, bool hitTriggers = true);
///
/// Finds all colliders touching or inside of the given box.
@@ -374,10 +375,11 @@ public:
/// The radius of the capsule.
/// The height of the capsule, excluding the top and bottom spheres.
/// The result colliders that overlap with the given sphere. Valid only when method returns true.
+ /// The capsule rotation.
/// The layer mask used to filter the results.
/// If set to true triggers will be hit, otherwise will skip them.
/// True if capsule overlaps any matching object, otherwise false.
- API_FUNCTION() static bool OverlapCapsule(const Vector3& center, float radius, float height, API_PARAM(Out) Array& results, uint32 layerMask = MAX_uint32, bool hitTriggers = true);
+ API_FUNCTION() static bool OverlapCapsule(const Vector3& center, float radius, float height, API_PARAM(Out) Array& results, const Quaternion& rotation = Quaternion::Identity, uint32 layerMask = MAX_uint32, bool hitTriggers = true);
///
/// Finds all colliders touching or inside of the given box.
@@ -409,10 +411,11 @@ public:
/// The radius of the capsule.
/// The height of the capsule, excluding the top and bottom spheres.
/// The result colliders that overlap with the given sphere. Valid only when method returns true.
+ /// The capsule rotation.
/// The layer mask used to filter the results.
/// If set to true triggers will be hit, otherwise will skip them.
/// True if capsule overlaps any matching object, otherwise false.
- API_FUNCTION() static bool OverlapCapsule(const Vector3& center, float radius, float height, API_PARAM(Out) Array& results, uint32 layerMask = MAX_uint32, bool hitTriggers = true);
+ API_FUNCTION() static bool OverlapCapsule(const Vector3& center, float radius, float height, API_PARAM(Out) Array& results, const Quaternion& rotation = Quaternion::Identity, uint32 layerMask = MAX_uint32, bool hitTriggers = true);
public: