Add overloads for physics queries with user-provided buffers
This commit is contained in:
@@ -471,4 +471,225 @@ public:
|
||||
/// <param name="hitTriggers">If set to <c>true</c> triggers will be hit, otherwise will skip them.</param>
|
||||
/// <returns>True if convex mesh overlaps any matching object, otherwise false.</returns>
|
||||
API_FUNCTION() static bool OverlapConvex(const Vector3& center, const CollisionData* convexMesh, const Vector3& scale, API_PARAM(Out) Array<PhysicsColliderActor*, HeapAllocation>& results, const Quaternion& rotation = Quaternion::Identity, uint32 layerMask = MAX_uint32, bool hitTriggers = true);
|
||||
|
||||
private:
|
||||
/// <summary>
|
||||
/// Performs a line between two points in the scene, returns all hitpoints infos.
|
||||
/// </summary>
|
||||
/// <param name="start">The origin of the ray.</param>
|
||||
/// <param name="end">The end position of the line.</param>
|
||||
/// <param name="results">The result hits. Valid only when method returns true.</param>
|
||||
/// <param name="layerMask">The layer mask used to filter the results.</param>
|
||||
/// <param name="hitTriggers">If set to <c>true</c> triggers will be hit, otherwise will skip them.</param>
|
||||
/// <returns>True if ray hits an matching object, otherwise false.</returns>
|
||||
API_FUNCTION(Public, Name = LineCastAll) static bool LineCastAllDynamic(const Vector3& start, const Vector3& end, API_PARAM(Ref, DynamicArray) Array<RayCastHit, HeapAllocation>& results, uint32 layerMask = MAX_uint32, bool hitTriggers = true)
|
||||
{
|
||||
return LineCastAll(start, end, results, layerMask, hitTriggers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs a raycast against objects in the scene, returns results in a RayCastHit structure.
|
||||
/// </summary>
|
||||
/// <param name="origin">The origin of the ray.</param>
|
||||
/// <param name="direction">The normalized direction of the ray.</param>
|
||||
/// <param name="results">The result hits. Valid only when method returns true.</param>
|
||||
/// <param name="maxDistance">The maximum distance the ray should check for collisions.</param>
|
||||
/// <param name="layerMask">The layer mask used to filter the results.</param>
|
||||
/// <param name="hitTriggers">If set to <c>true</c> triggers will be hit, otherwise will skip them.</param>
|
||||
/// <returns>True if ray hits an matching object, otherwise false.</returns>
|
||||
API_FUNCTION(Public, Name = RayCastAll) static bool RayCastAllDynamic(const Vector3& origin, const Vector3& direction, API_PARAM(Ref, DynamicArray) Array<RayCastHit, HeapAllocation>& results, float maxDistance = MAX_float, uint32 layerMask = MAX_uint32, bool hitTriggers = true)
|
||||
{
|
||||
return RayCastAll(origin, direction, results, maxDistance, layerMask, hitTriggers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs a sweep test against objects in the scene using a box geometry.
|
||||
/// </summary>
|
||||
/// <param name="center">The box center.</param>
|
||||
/// <param name="halfExtents">The half size of the box in each direction.</param>
|
||||
/// <param name="direction">The normalized direction in which cast a box.</param>
|
||||
/// <param name="results">The result hits. Valid only when method returns true.</param>
|
||||
/// <param name="rotation">The box rotation.</param>
|
||||
/// <param name="maxDistance">The maximum distance the ray should check for collisions.</param>
|
||||
/// <param name="layerMask">The layer mask used to filter the results.</param>
|
||||
/// <param name="hitTriggers">If set to <c>true</c> triggers will be hit, otherwise will skip them.</param>
|
||||
/// <returns>True if box hits an matching object, otherwise false.</returns>
|
||||
API_FUNCTION(Public, Name = BoxCastAll) static bool BoxCastAllDynamic(const Vector3& center, const Vector3& halfExtents, const Vector3& direction, API_PARAM(Ref, DynamicArray) Array<RayCastHit, HeapAllocation>& results, const Quaternion& rotation = Quaternion::Identity, float maxDistance = MAX_float, uint32 layerMask = MAX_uint32, bool hitTriggers = true)
|
||||
{
|
||||
return BoxCastAll(center, halfExtents, direction, results, rotation, maxDistance, layerMask, hitTriggers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs a sweep test against objects in the scene using a sphere geometry.
|
||||
/// </summary>
|
||||
/// <param name="center">The sphere center.</param>
|
||||
/// <param name="radius">The radius of the sphere.</param>
|
||||
/// <param name="direction">The normalized direction in which cast a sphere.</param>
|
||||
/// <param name="results">The result hits. Valid only when method returns true.</param>
|
||||
/// <param name="maxDistance">The maximum distance the ray should check for collisions.</param>
|
||||
/// <param name="layerMask">The layer mask used to filter the results.</param>
|
||||
/// <param name="hitTriggers">If set to <c>true</c> triggers will be hit, otherwise will skip them.</param>
|
||||
/// <returns>True if sphere hits an matching object, otherwise false.</returns>
|
||||
API_FUNCTION(Public, Name = SphereCastAll) static bool SphereCastAllDynamic(const Vector3& center, float radius, const Vector3& direction, API_PARAM(Ref, DynamicArray) Array<RayCastHit, HeapAllocation>& results, float maxDistance = MAX_float, uint32 layerMask = MAX_uint32, bool hitTriggers = true)
|
||||
{
|
||||
return SphereCastAll(center, radius, direction, results, maxDistance, layerMask, hitTriggers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs a sweep test against objects in the scene using a capsule geometry.
|
||||
/// </summary>
|
||||
/// <param name="center">The capsule center.</param>
|
||||
/// <param name="radius">The radius of the capsule.</param>
|
||||
/// <param name="height">The height of the capsule, excluding the top and bottom spheres.</param>
|
||||
/// <param name="direction">The normalized direction in which cast a capsule.</param>
|
||||
/// <param name="results">The result hits. Valid only when method returns true.</param>
|
||||
/// <param name="rotation">The capsule rotation.</param>
|
||||
/// <param name="maxDistance">The maximum distance the ray should check for collisions.</param>
|
||||
/// <param name="layerMask">The layer mask used to filter the results.</param>
|
||||
/// <param name="hitTriggers">If set to <c>true</c> triggers will be hit, otherwise will skip them.</param>
|
||||
/// <returns>True if capsule hits an matching object, otherwise false.</returns>
|
||||
API_FUNCTION(Public, Name = CapsuleCastAll) static bool CapsuleCastAllDynamic(const Vector3& center, float radius, float height, const Vector3& direction, API_PARAM(Ref, DynamicArray) Array<RayCastHit, HeapAllocation>& results, const Quaternion& rotation = Quaternion::Identity, float maxDistance = MAX_float, uint32 layerMask = MAX_uint32, bool hitTriggers = true)
|
||||
{
|
||||
return CapsuleCastAll(center, radius, height, direction, results, rotation, maxDistance, layerMask, hitTriggers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs a sweep test against objects in the scene using a convex mesh.
|
||||
/// </summary>
|
||||
/// <param name="center">The convex mesh center.</param>
|
||||
/// <param name="convexMesh">Collision data of the convex mesh.</param>
|
||||
/// <param name="scale">The scale of the convex mesh.</param>
|
||||
/// <param name="direction">The normalized direction in which cast a convex mesh.</param>
|
||||
/// <param name="results">The result hits. Valid only when method returns true.</param>
|
||||
/// <param name="rotation">The convex mesh rotation.</param>
|
||||
/// <param name="maxDistance">The maximum distance the ray should check for collisions.</param>
|
||||
/// <param name="layerMask">The layer mask used to filter the results.</param>
|
||||
/// <param name="hitTriggers">If set to <c>true</c> triggers will be hit, otherwise will skip them.</param>
|
||||
/// <returns>True if convex mesh hits an matching object, otherwise false.</returns>
|
||||
API_FUNCTION(Public, Name = ConvexCastAll) static bool ConvexCastAllDynamic(const Vector3& center, const CollisionData* convexMesh, const Vector3& scale, const Vector3& direction, API_PARAM(Ref, DynamicArray) Array<RayCastHit, HeapAllocation>& results, const Quaternion& rotation = Quaternion::Identity, float maxDistance = MAX_float, uint32 layerMask = MAX_uint32, bool hitTriggers = true)
|
||||
{
|
||||
return ConvexCastAll(center, convexMesh, scale, direction, results, rotation, maxDistance, layerMask, hitTriggers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds all colliders touching or inside of the given box.
|
||||
/// </summary>
|
||||
/// <param name="center">The box center.</param>
|
||||
/// <param name="halfExtents">The half size of the box in each direction.</param>
|
||||
/// <param name="rotation">The box rotation.</param>
|
||||
/// <param name="results">The result colliders that overlap with the given box. Valid only when method returns true.</param>
|
||||
/// <param name="layerMask">The layer mask used to filter the results.</param>
|
||||
/// <param name="hitTriggers">If set to <c>true</c> triggers will be hit, otherwise will skip them.</param>
|
||||
/// <returns>True if box overlaps any matching object, otherwise false.</returns>
|
||||
API_FUNCTION(Public, Name = OverlapBox) static bool OverlapBoxDynamic(const Vector3& center, const Vector3& halfExtents, API_PARAM(Ref, DynamicArray) Array<Collider*, HeapAllocation>& results, const Quaternion& rotation = Quaternion::Identity, uint32 layerMask = MAX_uint32, bool hitTriggers = true)
|
||||
{
|
||||
return OverlapBox(center, halfExtents, results, rotation, layerMask, hitTriggers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds all colliders touching or inside of the given sphere.
|
||||
/// </summary>
|
||||
/// <param name="center">The sphere center.</param>
|
||||
/// <param name="radius">The radius of the sphere.</param>
|
||||
/// <param name="results">The result colliders that overlap with the given sphere. Valid only when method returns true.</param>
|
||||
/// <param name="layerMask">The layer mask used to filter the results.</param>
|
||||
/// <param name="hitTriggers">If set to <c>true</c> triggers will be hit, otherwise will skip them.</param>
|
||||
/// <returns>True if sphere overlaps any matching object, otherwise false.</returns>
|
||||
API_FUNCTION(Public, Name = OverlapSphere) static bool OverlapSphereDynamic(const Vector3& center, float radius, API_PARAM(Ref, DynamicArray) Array<Collider*, HeapAllocation>& results, uint32 layerMask = MAX_uint32, bool hitTriggers = true)
|
||||
{
|
||||
return OverlapSphere(center, radius, results, layerMask, hitTriggers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds all colliders touching or inside of the given capsule.
|
||||
/// </summary>
|
||||
/// <param name="center">The capsule center.</param>
|
||||
/// <param name="radius">The radius of the capsule.</param>
|
||||
/// <param name="height">The height of the capsule, excluding the top and bottom spheres.</param>
|
||||
/// <param name="results">The result colliders that overlap with the given capsule. Valid only when method returns true.</param>
|
||||
/// <param name="rotation">The capsule rotation.</param>
|
||||
/// <param name="layerMask">The layer mask used to filter the results.</param>
|
||||
/// <param name="hitTriggers">If set to <c>true</c> triggers will be hit, otherwise will skip them.</param>
|
||||
/// <returns>True if capsule overlaps any matching object, otherwise false.</returns>
|
||||
API_FUNCTION(Public, Name = OverlapCapsule) static bool OverlapCapsuleDynamic(const Vector3& center, float radius, float height, API_PARAM(Ref, DynamicArray) Array<Collider*, HeapAllocation>& results, const Quaternion& rotation = Quaternion::Identity, uint32 layerMask = MAX_uint32, bool hitTriggers = true)
|
||||
{
|
||||
return OverlapCapsule(center, radius, height, results, rotation, layerMask, hitTriggers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds all colliders touching or inside of the given convex mesh.
|
||||
/// </summary>
|
||||
/// <param name="center">The convex mesh center.</param>
|
||||
/// <param name="convexMesh">Collision data of the convex mesh.</param>
|
||||
/// <param name="scale">The scale of the convex mesh.</param>
|
||||
/// <param name="results">The result colliders that overlap with the given convex mesh. Valid only when method returns true.</param>
|
||||
/// <param name="rotation">The convex mesh rotation.</param>
|
||||
/// <param name="layerMask">The layer mask used to filter the results.</param>
|
||||
/// <param name="hitTriggers">If set to <c>true</c> triggers will be hit, otherwise will skip them.</param>
|
||||
/// <returns>True if convex mesh overlaps any matching object, otherwise false.</returns>
|
||||
API_FUNCTION(Public, Name = OverlapConvex) static bool OverlapConvexDynamic(const Vector3& center, const CollisionData* convexMesh, const Vector3& scale, API_PARAM(Ref, DynamicArray) Array<Collider*, HeapAllocation>& results, const Quaternion& rotation = Quaternion::Identity, uint32 layerMask = MAX_uint32, bool hitTriggers = true)
|
||||
{
|
||||
return OverlapConvex(center, convexMesh, scale, results, rotation, layerMask, hitTriggers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds all colliders touching or inside of the given box.
|
||||
/// </summary>
|
||||
/// <param name="center">The box center.</param>
|
||||
/// <param name="halfExtents">The half size of the box in each direction.</param>
|
||||
/// <param name="rotation">The box rotation.</param>
|
||||
/// <param name="results">The result colliders that overlap with the given box. Valid only when method returns true.</param>
|
||||
/// <param name="layerMask">The layer mask used to filter the results.</param>
|
||||
/// <param name="hitTriggers">If set to <c>true</c> triggers will be hit, otherwise will skip them.</param>
|
||||
/// <returns>True if box overlaps any matching object, otherwise false.</returns>
|
||||
API_FUNCTION(Public, Name = OverlapBox) static bool OverlapBoxDynamic(const Vector3& center, const Vector3& halfExtents, API_PARAM(Ref, DynamicArray) Array<PhysicsColliderActor*, HeapAllocation>& results, const Quaternion& rotation = Quaternion::Identity, uint32 layerMask = MAX_uint32, bool hitTriggers = true)
|
||||
{
|
||||
return OverlapBox(center, halfExtents, results, rotation, layerMask, hitTriggers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds all colliders touching or inside of the given sphere.
|
||||
/// </summary>
|
||||
/// <param name="center">The sphere center.</param>
|
||||
/// <param name="radius">The radius of the sphere.</param>
|
||||
/// <param name="results">The result colliders that overlap with the given sphere. Valid only when method returns true.</param>
|
||||
/// <param name="layerMask">The layer mask used to filter the results.</param>
|
||||
/// <param name="hitTriggers">If set to <c>true</c> triggers will be hit, otherwise will skip them.</param>
|
||||
/// <returns>True if sphere overlaps any matching object, otherwise false.</returns>
|
||||
API_FUNCTION(Public, Name = OverlapSphere) static bool OverlapSphereDynamic(const Vector3& center, float radius, API_PARAM(Ref, DynamicArray) Array<PhysicsColliderActor*, HeapAllocation>& results, uint32 layerMask = MAX_uint32, bool hitTriggers = true)
|
||||
{
|
||||
return OverlapSphere(center, radius, results, layerMask, hitTriggers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds all colliders touching or inside of the given capsule.
|
||||
/// </summary>
|
||||
/// <param name="center">The capsule center.</param>
|
||||
/// <param name="radius">The radius of the capsule.</param>
|
||||
/// <param name="height">The height of the capsule, excluding the top and bottom spheres.</param>
|
||||
/// <param name="results">The result colliders that overlap with the given capsule. Valid only when method returns true.</param>
|
||||
/// <param name="rotation">The capsule rotation.</param>
|
||||
/// <param name="layerMask">The layer mask used to filter the results.</param>
|
||||
/// <param name="hitTriggers">If set to <c>true</c> triggers will be hit, otherwise will skip them.</param>
|
||||
/// <returns>True if capsule overlaps any matching object, otherwise false.</returns>
|
||||
API_FUNCTION(Public, Name = OverlapCapsule) static bool OverlapCapsuleDynamic(const Vector3& center, float radius, float height, API_PARAM(Ref, DynamicArray) Array<PhysicsColliderActor*, HeapAllocation>& results, const Quaternion& rotation = Quaternion::Identity, uint32 layerMask = MAX_uint32, bool hitTriggers = true)
|
||||
{
|
||||
return OverlapCapsule(center, radius, height, results, rotation, layerMask, hitTriggers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds all colliders touching or inside of the given convex mesh.
|
||||
/// </summary>
|
||||
/// <param name="center">The convex mesh center.</param>
|
||||
/// <param name="convexMesh">Collision data of the convex mesh.</param>
|
||||
/// <param name="scale">The scale of the convex mesh.</param>
|
||||
/// <param name="results">The result colliders that overlap with the given convex mesh. Valid only when method returns true.</param>
|
||||
/// <param name="rotation">The convex mesh rotation.</param>
|
||||
/// <param name="layerMask">The layer mask used to filter the results.</param>
|
||||
/// <param name="hitTriggers">If set to <c>true</c> triggers will be hit, otherwise will skip them.</param>
|
||||
/// <returns>True if convex mesh overlaps any matching object, otherwise false.</returns>
|
||||
API_FUNCTION(Public, Name = OverlapConvex) static bool OverlapConvexDynamic(const Vector3& center, const CollisionData* convexMesh, const Vector3& scale, API_PARAM(Ref, DynamicArray) Array<PhysicsColliderActor*, HeapAllocation>& results, const Quaternion& rotation = Quaternion::Identity, uint32 layerMask = MAX_uint32, bool hitTriggers = true)
|
||||
{
|
||||
return OverlapConvex(center, convexMesh, scale, results, rotation, layerMask, hitTriggers);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -509,4 +509,225 @@ public:
|
||||
/// <param name="hitTriggers">If set to <c>true</c> triggers will be hit, otherwise will skip them.</param>
|
||||
/// <returns>True if convex mesh overlaps any matching object, otherwise false.</returns>
|
||||
API_FUNCTION() bool OverlapConvex(const Vector3& center, const CollisionData* convexMesh, const Vector3& scale, API_PARAM(Out) Array<PhysicsColliderActor*, HeapAllocation>& results, const Quaternion& rotation = Quaternion::Identity, uint32 layerMask = MAX_uint32, bool hitTriggers = true);
|
||||
|
||||
private:
|
||||
/// <summary>
|
||||
/// Performs a line between two points in the scene, returns all hitpoints infos.
|
||||
/// </summary>
|
||||
/// <param name="start">The origin of the ray.</param>
|
||||
/// <param name="end">The normalized direction of the ray.</param>
|
||||
/// <param name="results">The result hits. Valid only when method returns true.</param>
|
||||
/// <param name="layerMask">The layer mask used to filter the results.</param>
|
||||
/// <param name="hitTriggers">If set to <c>true</c> triggers will be hit, otherwise will skip them.</param>
|
||||
/// <returns>True if ray hits an matching object, otherwise false.</returns>
|
||||
API_FUNCTION(Public, Name = LineCastAll) bool LineCastAllDynamic(const Vector3& start, const Vector3& end, API_PARAM(Ref, DynamicArray) Array<RayCastHit, HeapAllocation>& results, uint32 layerMask = MAX_uint32, bool hitTriggers = true)
|
||||
{
|
||||
return LineCastAll(start, end, results, layerMask, hitTriggers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs a raycast against objects in the scene, returns results in a RayCastHit structure.
|
||||
/// </summary>
|
||||
/// <param name="origin">The origin of the ray.</param>
|
||||
/// <param name="direction">The normalized direction of the ray.</param>
|
||||
/// <param name="results">The result hits. Valid only when method returns true.</param>
|
||||
/// <param name="maxDistance">The maximum distance the ray should check for collisions.</param>
|
||||
/// <param name="layerMask">The layer mask used to filter the results.</param>
|
||||
/// <param name="hitTriggers">If set to <c>true</c> triggers will be hit, otherwise will skip them.</param>
|
||||
/// <returns>True if ray hits an matching object, otherwise false.</returns>
|
||||
API_FUNCTION(Public, Name = RayCastAll) bool RayCastAllDynamic(const Vector3& origin, const Vector3& direction, API_PARAM(Ref, DynamicArray) Array<RayCastHit, HeapAllocation>& results, float maxDistance = MAX_float, uint32 layerMask = MAX_uint32, bool hitTriggers = true)
|
||||
{
|
||||
return RayCastAll(origin, direction, results, maxDistance, layerMask, hitTriggers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs a sweep test against objects in the scene using a box geometry.
|
||||
/// </summary>
|
||||
/// <param name="center">The box center.</param>
|
||||
/// <param name="halfExtents">The half size of the box in each direction.</param>
|
||||
/// <param name="direction">The normalized direction in which cast a box.</param>
|
||||
/// <param name="results">The result hits. Valid only when method returns true.</param>
|
||||
/// <param name="rotation">The box rotation.</param>
|
||||
/// <param name="maxDistance">The maximum distance the ray should check for collisions.</param>
|
||||
/// <param name="layerMask">The layer mask used to filter the results.</param>
|
||||
/// <param name="hitTriggers">If set to <c>true</c> triggers will be hit, otherwise will skip them.</param>
|
||||
/// <returns>True if box hits an matching object, otherwise false.</returns>
|
||||
API_FUNCTION(Public, Name = BoxCastAll) bool BoxCastAllDynamic(const Vector3& center, const Vector3& halfExtents, const Vector3& direction, API_PARAM(Ref, DynamicArray) Array<RayCastHit, HeapAllocation>& results, const Quaternion& rotation = Quaternion::Identity, float maxDistance = MAX_float, uint32 layerMask = MAX_uint32, bool hitTriggers = true)
|
||||
{
|
||||
return BoxCastAll(center, halfExtents, direction, results, rotation, maxDistance, layerMask, hitTriggers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs a sweep test against objects in the scene using a sphere geometry.
|
||||
/// </summary>
|
||||
/// <param name="center">The sphere center.</param>
|
||||
/// <param name="radius">The radius of the sphere.</param>
|
||||
/// <param name="direction">The normalized direction in which cast a sphere.</param>
|
||||
/// <param name="results">The result hits. Valid only when method returns true.</param>
|
||||
/// <param name="maxDistance">The maximum distance the ray should check for collisions.</param>
|
||||
/// <param name="layerMask">The layer mask used to filter the results.</param>
|
||||
/// <param name="hitTriggers">If set to <c>true</c> triggers will be hit, otherwise will skip them.</param>
|
||||
/// <returns>True if sphere hits an matching object, otherwise false.</returns>
|
||||
API_FUNCTION(Public, Name = SphereCastAll) bool SphereCastAllDynamic(const Vector3& center, float radius, const Vector3& direction, API_PARAM(Ref, DynamicArray) Array<RayCastHit, HeapAllocation>& results, float maxDistance = MAX_float, uint32 layerMask = MAX_uint32, bool hitTriggers = true)
|
||||
{
|
||||
return SphereCastAll(center, radius, direction, results, maxDistance, layerMask, hitTriggers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs a sweep test against objects in the scene using a capsule geometry.
|
||||
/// </summary>
|
||||
/// <param name="center">The capsule center.</param>
|
||||
/// <param name="radius">The radius of the capsule.</param>
|
||||
/// <param name="height">The height of the capsule, excluding the top and bottom spheres.</param>
|
||||
/// <param name="direction">The normalized direction in which cast a capsule.</param>
|
||||
/// <param name="results">The result hits. Valid only when method returns true.</param>
|
||||
/// <param name="rotation">The capsule rotation.</param>
|
||||
/// <param name="maxDistance">The maximum distance the ray should check for collisions.</param>
|
||||
/// <param name="layerMask">The layer mask used to filter the results.</param>
|
||||
/// <param name="hitTriggers">If set to <c>true</c> triggers will be hit, otherwise will skip them.</param>
|
||||
/// <returns>True if capsule hits an matching object, otherwise false.</returns>
|
||||
API_FUNCTION(Public, Name = CapsuleCastAll) bool CapsuleCastAllDynamic(const Vector3& center, float radius, float height, const Vector3& direction, API_PARAM(Ref, DynamicArray) Array<RayCastHit, HeapAllocation>& results, const Quaternion& rotation = Quaternion::Identity, float maxDistance = MAX_float, uint32 layerMask = MAX_uint32, bool hitTriggers = true)
|
||||
{
|
||||
return CapsuleCastAll(center, radius, height, direction, results, rotation, maxDistance, layerMask, hitTriggers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs a sweep test against objects in the scene using a convex mesh.
|
||||
/// </summary>
|
||||
/// <param name="center">The convex mesh center.</param>
|
||||
/// <param name="convexMesh">Collision data of the convex mesh.</param>
|
||||
/// <param name="scale">The scale of the convex mesh.</param>
|
||||
/// <param name="direction">The normalized direction in which cast a convex mesh.</param>
|
||||
/// <param name="results">The result hits. Valid only when method returns true.</param>
|
||||
/// <param name="rotation">The convex mesh rotation.</param>
|
||||
/// <param name="maxDistance">The maximum distance the ray should check for collisions.</param>
|
||||
/// <param name="layerMask">The layer mask used to filter the results.</param>
|
||||
/// <param name="hitTriggers">If set to <c>true</c> triggers will be hit, otherwise will skip them.</param>
|
||||
/// <returns>True if convex mesh hits an matching object, otherwise false.</returns>
|
||||
API_FUNCTION(Public, Name = ConvexCastAll) bool ConvexCastAllDynamic(const Vector3& center, const CollisionData* convexMesh, const Vector3& scale, const Vector3& direction, API_PARAM(Ref, DynamicArray) Array<RayCastHit, HeapAllocation>& results, const Quaternion& rotation = Quaternion::Identity, float maxDistance = MAX_float, uint32 layerMask = MAX_uint32, bool hitTriggers = true)
|
||||
{
|
||||
return ConvexCastAll(center, convexMesh, scale, direction, results, rotation, maxDistance, layerMask, hitTriggers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds all colliders touching or inside of the given box.
|
||||
/// </summary>
|
||||
/// <param name="center">The box center.</param>
|
||||
/// <param name="halfExtents">The half size of the box in each direction.</param>
|
||||
/// <param name="rotation">The box rotation.</param>
|
||||
/// <param name="results">The result colliders that overlap with the given box. Valid only when method returns true.</param>
|
||||
/// <param name="layerMask">The layer mask used to filter the results.</param>
|
||||
/// <param name="hitTriggers">If set to <c>true</c> triggers will be hit, otherwise will skip them.</param>
|
||||
/// <returns>True if box overlaps any matching object, otherwise false.</returns>
|
||||
API_FUNCTION(Public, Name = OverlapBox) bool OverlapBoxDynamic(const Vector3& center, const Vector3& halfExtents, API_PARAM(Ref, DynamicArray) Array<Collider*, HeapAllocation>& results, const Quaternion& rotation = Quaternion::Identity, uint32 layerMask = MAX_uint32, bool hitTriggers = true)
|
||||
{
|
||||
return OverlapBox(center, halfExtents, results, rotation, layerMask, hitTriggers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds all colliders touching or inside of the given sphere.
|
||||
/// </summary>
|
||||
/// <param name="center">The sphere center.</param>
|
||||
/// <param name="radius">The radius of the sphere.</param>
|
||||
/// <param name="results">The result colliders that overlap with the given sphere. Valid only when method returns true.</param>
|
||||
/// <param name="layerMask">The layer mask used to filter the results.</param>
|
||||
/// <param name="hitTriggers">If set to <c>true</c> triggers will be hit, otherwise will skip them.</param>
|
||||
/// <returns>True if sphere overlaps any matching object, otherwise false.</returns>
|
||||
API_FUNCTION(Public, Name = OverlapSphere) bool OverlapSphereDynamic(const Vector3& center, float radius, API_PARAM(Ref, DynamicArray) Array<Collider*, HeapAllocation>& results, uint32 layerMask = MAX_uint32, bool hitTriggers = true)
|
||||
{
|
||||
return OverlapSphere(center, radius, results, layerMask, hitTriggers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds all colliders touching or inside of the given capsule.
|
||||
/// </summary>
|
||||
/// <param name="center">The capsule center.</param>
|
||||
/// <param name="radius">The radius of the capsule.</param>
|
||||
/// <param name="height">The height of the capsule, excluding the top and bottom spheres.</param>
|
||||
/// <param name="results">The result colliders that overlap with the given capsule. Valid only when method returns true.</param>
|
||||
/// <param name="rotation">The capsule rotation.</param>
|
||||
/// <param name="layerMask">The layer mask used to filter the results.</param>
|
||||
/// <param name="hitTriggers">If set to <c>true</c> triggers will be hit, otherwise will skip them.</param>
|
||||
/// <returns>True if capsule overlaps any matching object, otherwise false.</returns>
|
||||
API_FUNCTION(Public, Name = OverlapCapsule) bool OverlapCapsuleDynamic(const Vector3& center, float radius, float height, API_PARAM(Ref, DynamicArray) Array<Collider*, HeapAllocation>& results, const Quaternion& rotation = Quaternion::Identity, uint32 layerMask = MAX_uint32, bool hitTriggers = true)
|
||||
{
|
||||
return OverlapCapsule(center, radius, height, results, rotation, layerMask, hitTriggers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds all colliders touching or inside of the given convex mesh.
|
||||
/// </summary>
|
||||
/// <param name="center">The convex mesh center.</param>
|
||||
/// <param name="convexMesh">Collision data of the convex mesh.</param>
|
||||
/// <param name="scale">The scale of the convex mesh.</param>
|
||||
/// <param name="results">The result colliders that overlap with the given convex mesh. Valid only when method returns true.</param>
|
||||
/// <param name="rotation">The convex mesh rotation.</param>
|
||||
/// <param name="layerMask">The layer mask used to filter the results.</param>
|
||||
/// <param name="hitTriggers">If set to <c>true</c> triggers will be hit, otherwise will skip them.</param>
|
||||
/// <returns>True if convex mesh overlaps any matching object, otherwise false.</returns>
|
||||
API_FUNCTION(Public, Name = OverlapConvex) bool OverlapConvexDynamic(const Vector3& center, const CollisionData* convexMesh, const Vector3& scale, API_PARAM(Ref, DynamicArray) Array<Collider*, HeapAllocation>& results, const Quaternion& rotation = Quaternion::Identity, uint32 layerMask = MAX_uint32, bool hitTriggers = true)
|
||||
{
|
||||
return OverlapConvex(center, convexMesh, scale, results, rotation, layerMask, hitTriggers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds all colliders touching or inside of the given box.
|
||||
/// </summary>
|
||||
/// <param name="center">The box center.</param>
|
||||
/// <param name="halfExtents">The half size of the box in each direction.</param>
|
||||
/// <param name="rotation">The box rotation.</param>
|
||||
/// <param name="results">The result colliders that overlap with the given box. Valid only when method returns true.</param>
|
||||
/// <param name="layerMask">The layer mask used to filter the results.</param>
|
||||
/// <param name="hitTriggers">If set to <c>true</c> triggers will be hit, otherwise will skip them.</param>
|
||||
/// <returns>True if box overlaps any matching object, otherwise false.</returns>
|
||||
API_FUNCTION(Public, Name = OverlapBox) bool OverlapBoxDynamic(const Vector3& center, const Vector3& halfExtents, API_PARAM(Ref, DynamicArray) Array<PhysicsColliderActor*, HeapAllocation>& results, const Quaternion& rotation = Quaternion::Identity, uint32 layerMask = MAX_uint32, bool hitTriggers = true)
|
||||
{
|
||||
return OverlapBox(center, halfExtents, results, rotation, layerMask, hitTriggers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds all colliders touching or inside of the given sphere.
|
||||
/// </summary>
|
||||
/// <param name="center">The sphere center.</param>
|
||||
/// <param name="radius">The radius of the sphere.</param>
|
||||
/// <param name="results">The result colliders that overlap with the given sphere. Valid only when method returns true.</param>
|
||||
/// <param name="layerMask">The layer mask used to filter the results.</param>
|
||||
/// <param name="hitTriggers">If set to <c>true</c> triggers will be hit, otherwise will skip them.</param>
|
||||
/// <returns>True if sphere overlaps any matching object, otherwise false.</returns>
|
||||
API_FUNCTION(Public, Name = OverlapSphere) bool OverlapSphereDynamic(const Vector3& center, float radius, API_PARAM(Ref, DynamicArray) Array<PhysicsColliderActor*, HeapAllocation>& results, uint32 layerMask = MAX_uint32, bool hitTriggers = true)
|
||||
{
|
||||
return OverlapSphere(center, radius, results, layerMask, hitTriggers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds all colliders touching or inside of the given capsule.
|
||||
/// </summary>
|
||||
/// <param name="center">The capsule center.</param>
|
||||
/// <param name="radius">The radius of the capsule.</param>
|
||||
/// <param name="height">The height of the capsule, excluding the top and bottom spheres.</param>
|
||||
/// <param name="results">The result colliders that overlap with the given capsule. Valid only when method returns true.</param>
|
||||
/// <param name="rotation">The capsule rotation.</param>
|
||||
/// <param name="layerMask">The layer mask used to filter the results.</param>
|
||||
/// <param name="hitTriggers">If set to <c>true</c> triggers will be hit, otherwise will skip them.</param>
|
||||
/// <returns>True if capsule overlaps any matching object, otherwise false.</returns>
|
||||
API_FUNCTION(Public, Name = OverlapCapsule) bool OverlapCapsuleDynamic(const Vector3& center, float radius, float height, API_PARAM(Ref, DynamicArray) Array<PhysicsColliderActor*, HeapAllocation>& results, const Quaternion& rotation = Quaternion::Identity, uint32 layerMask = MAX_uint32, bool hitTriggers = true)
|
||||
{
|
||||
return OverlapCapsule(center, radius, height, results, rotation, layerMask, hitTriggers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds all colliders touching or inside of the given convex mesh.
|
||||
/// </summary>
|
||||
/// <param name="center">The convex mesh center.</param>
|
||||
/// <param name="convexMesh">Collision data of the convex mesh.</param>
|
||||
/// <param name="scale">The scale of the convex mesh.</param>
|
||||
/// <param name="results">The result colliders that overlap with the given convex mesh. Valid only when method returns true.</param>
|
||||
/// <param name="rotation">The convex mesh rotation.</param>
|
||||
/// <param name="layerMask">The layer mask used to filter the results.</param>
|
||||
/// <param name="hitTriggers">If set to <c>true</c> triggers will be hit, otherwise will skip them.</param>
|
||||
/// <returns>True if convex mesh overlaps any matching object, otherwise false.</returns>
|
||||
API_FUNCTION(Public, Name = OverlapConvex) bool OverlapConvexDynamic(const Vector3& center, const CollisionData* convexMesh, const Vector3& scale, API_PARAM(Ref, DynamicArray) Array<PhysicsColliderActor*, HeapAllocation>& results, const Quaternion& rotation = Quaternion::Identity, uint32 layerMask = MAX_uint32, bool hitTriggers = true)
|
||||
{
|
||||
return OverlapConvex(center, convexMesh, scale, results, rotation, layerMask, hitTriggers);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user