Interface IAspectQueryable
Interface for objects that can be hit by aspect queries.
Namespace: Unity.Physics
Syntax
public interface IAspectQueryable
Methods
CalculateDistance(in ColliderAspect, Single, ref NativeList<DistanceHit>, QueryInteraction)
Calculates the distance from the collider aspect to this IAspectQueryable.
Declaration
bool CalculateDistance(in ColliderAspect colliderAspect, float maxDistance, ref NativeList<DistanceHit> allHits, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Type | Name | Description |
---|---|---|
ColliderAspect | colliderAspect | The collider aspect. |
Single | maxDistance | The maximum distance. |
NativeList<DistanceHit> | allHits | [in,out] all hits. |
QueryInteraction | queryInteraction | (Optional) The query interaction. |
Returns
Type | Description |
---|---|
Boolean | True if there is a hit, false otherwise. |
CalculateDistance(in ColliderAspect, Single, out DistanceHit, QueryInteraction)
Calculates the distance from the collider aspect to this IAspectQueryable.
Declaration
bool CalculateDistance(in ColliderAspect colliderAspect, float maxDistance, out DistanceHit closestHit, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Type | Name | Description |
---|---|---|
ColliderAspect | colliderAspect | The collider aspect. |
Single | maxDistance | The maximum distance. |
DistanceHit | closestHit | [out] The closest hit. |
QueryInteraction | queryInteraction | (Optional) The query interaction. |
Returns
Type | Description |
---|---|
Boolean | True if there is a hit, false otherwise. |
CalculateDistance(in ColliderAspect, Single, QueryInteraction)
Calculates the distance from the collider aspect to this IAspectQueryable.
Declaration
bool CalculateDistance(in ColliderAspect colliderAspect, float maxDistance, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Type | Name | Description |
---|---|---|
ColliderAspect | colliderAspect | The collider aspect. |
Single | maxDistance | The maximum distance. |
QueryInteraction | queryInteraction | (Optional) The query interaction. |
Returns
Type | Description |
---|---|
Boolean | True if there is a hit, false otherwise. |
CalculateDistance<T>(in ColliderAspect, Single, ref T, QueryInteraction)
Calculates the distance from the collider aspect to this IAspectQueryable.
Declaration
bool CalculateDistance<T>(in ColliderAspect colliderAspect, float maxDistance, ref T collector, QueryInteraction queryInteraction = QueryInteraction.Default)
where T : struct, ICollector<DistanceHit>
Parameters
Type | Name | Description |
---|---|---|
ColliderAspect | colliderAspect | The collider aspect. |
Single | maxDistance | The maximum distance. |
T | collector | [in,out] The collector. |
QueryInteraction | queryInteraction | (Optional) The query interaction. |
Returns
Type | Description |
---|---|
Boolean | True if there is a hit, false otherwise. |
Type Parameters
Name | Description |
---|---|
T | Generic type parameter. |
CastCollider(in ColliderAspect, float3, Single, ref NativeList<ColliderCastHit>, QueryInteraction)
Cast the collider aspect against this IAspectQueryable.
Declaration
bool CastCollider(in ColliderAspect colliderAspect, float3 direction, float maxDistance, ref NativeList<ColliderCastHit> allHits, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Type | Name | Description |
---|---|---|
ColliderAspect | colliderAspect | The collider aspect. |
float3 | direction | The direction of the aspect. |
Single | maxDistance | The maximum distance. |
NativeList<ColliderCastHit> | allHits | [in,out] all hits. |
QueryInteraction | queryInteraction | (Optional) The query interaction. |
Returns
Type | Description |
---|---|
Boolean | True if there is a hit, false otherwise. |
CastCollider(in ColliderAspect, float3, Single, out ColliderCastHit, QueryInteraction)
Cast the collider aspect against this IAspectQueryable.
Declaration
bool CastCollider(in ColliderAspect colliderAspect, float3 direction, float maxDistance, out ColliderCastHit closestHit, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Type | Name | Description |
---|---|---|
ColliderAspect | colliderAspect | The collider aspect. |
float3 | direction | The direction of the aspect. |
Single | maxDistance | The maximum distance. |
ColliderCastHit | closestHit | [out] The closest hit. |
QueryInteraction | queryInteraction | (Optional) The query interaction. |
Returns
Type | Description |
---|---|
Boolean | True if there is a hit, false otherwise. |
CastCollider(in ColliderAspect, float3, Single, QueryInteraction)
Cast the collider aspect against this IAspectQueryable.
Declaration
bool CastCollider(in ColliderAspect colliderAspect, float3 direction, float maxDistance, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Type | Name | Description |
---|---|---|
ColliderAspect | colliderAspect | The collider aspect. |
float3 | direction | The direction of the aspect. |
Single | maxDistance | The maximum distance. |
QueryInteraction | queryInteraction | (Optional) The query interaction. |
Returns
Type | Description |
---|---|
Boolean | True if there is a hit, false otherwise. |
CastCollider<T>(in ColliderAspect, float3, Single, ref T, QueryInteraction)
Cast the collider aspect against this IAspectQueryable.
Declaration
bool CastCollider<T>(in ColliderAspect colliderAspect, float3 direction, float maxDistance, ref T collector, QueryInteraction queryInteraction = QueryInteraction.Default)
where T : struct, ICollector<ColliderCastHit>
Parameters
Type | Name | Description |
---|---|---|
ColliderAspect | colliderAspect | The collider aspect. |
float3 | direction | The direction of the aspect. |
Single | maxDistance | The maximum distance. |
T | collector | [in,out] The collector. |
QueryInteraction | queryInteraction | (Optional) The query interaction. |
Returns
Type | Description |
---|---|
Boolean | True if there is a hit, false otherwise. |
Type Parameters
Name | Description |
---|---|
T | Generic type parameter. |