Struct PolygonCollider
A flat convex collider with either 3 or 4 coplanar vertices (ie, a triangle or a quad)
Inherited Members
Namespace: Unity.Physics
Assembly: Unity.Physics.dll
Syntax
public struct PolygonCollider : ICollider, ICollidable
Properties
CollisionType
Gets the Collision type.
Declaration
public CollisionType CollisionType { get; }
Property Value
Type | Description |
---|---|
CollisionType | The Collision Type. |
IsQuad
Gets a value indicating whether this object is quad.
Declaration
public bool IsQuad { get; }
Property Value
Type | Description |
---|---|
bool | True if this object is quad, false if not. |
IsTriangle
Gets a value indicating whether this object is triangle.
Declaration
public bool IsTriangle { get; }
Property Value
Type | Description |
---|---|
bool | True if this object is triangle, false if not. |
MassProperties
Gets the mass properties.
Declaration
public MassProperties MassProperties { get; }
Property Value
Type | Description |
---|---|
MassProperties | The mass properties. |
Material
Gets or sets the material.
Declaration
public Material Material { get; set; }
Property Value
Type | Description |
---|---|
Material | The material. |
MemorySize
Gets the memory size.
Declaration
public int MemorySize { get; }
Property Value
Type | Description |
---|---|
int | The size of the memory. |
Planes
Gets the planes.
Declaration
public BlobArray.Accessor<Plane> Planes { get; }
Property Value
Type | Description |
---|---|
BlobArray.Accessor<Plane> | The planes. |
Type
Gets the Collider type.
Declaration
public ColliderType Type { get; }
Property Value
Type | Description |
---|---|
ColliderType | Collider Type. |
Vertices
Gets the vertices.
Declaration
public BlobArray.Accessor<float3> Vertices { get; }
Property Value
Type | Description |
---|---|
BlobArray.Accessor<float3> | The vertices. |
Methods
BakeTransform(AffineTransform)
Bakes the provided transformation into the polygon collider geometry.
Applies the transformation to the polygon collider in local space, consequently scaling, shearing, rotating and translating its geometry according to the provided transformation.
Declaration
public void BakeTransform(AffineTransform transform)
Parameters
Type | Name | Description |
---|---|---|
AffineTransform | transform | The affine transformation to apply. |
BoxCast(float3, quaternion, float3, float3, float, out ColliderCastHit, CollisionFilter, QueryInteraction)
Box cast.
Declaration
public bool BoxCast(float3 center, quaternion orientation, float3 halfExtents, float3 direction, float maxDistance, out ColliderCastHit hitInfo, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Type | Name | Description |
---|---|---|
float3 | center | The center. |
quaternion | orientation | The orientation. |
float3 | halfExtents | Half extents of the box. |
float3 | direction | The direction. |
float | maxDistance | The maximum distance. |
ColliderCastHit | hitInfo | [out] Information describing the hit. |
CollisionFilter | filter | Specifies the filter. |
QueryInteraction | queryInteraction | (Optional) The query interaction. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
BoxCast(float3, quaternion, float3, float3, float, CollisionFilter, QueryInteraction)
Box cast.
Declaration
public bool BoxCast(float3 center, quaternion orientation, float3 halfExtents, float3 direction, float maxDistance, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Type | Name | Description |
---|---|---|
float3 | center | The center. |
quaternion | orientation | The orientation. |
float3 | halfExtents | Half extents of the box. |
float3 | direction | The direction. |
float | maxDistance | The maximum distance. |
CollisionFilter | filter | Specifies the filter. |
QueryInteraction | queryInteraction | (Optional) The query interaction. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
BoxCastAll(float3, quaternion, float3, float3, float, ref NativeList<ColliderCastHit>, CollisionFilter, QueryInteraction)
Box cast all.
Declaration
public bool BoxCastAll(float3 center, quaternion orientation, float3 halfExtents, float3 direction, float maxDistance, ref NativeList<ColliderCastHit> outHits, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Type | Name | Description |
---|---|---|
float3 | center | The center. |
quaternion | orientation | The orientation. |
float3 | halfExtents | Half extents of the box. |
float3 | direction | The direction. |
float | maxDistance | The maximum distance. |
NativeList<ColliderCastHit> | outHits | [in,out] The out hits. |
CollisionFilter | filter | Specifies the filter. |
QueryInteraction | queryInteraction | (Optional) The query interaction. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
BoxCastCustom<T>(float3, quaternion, float3, float3, float, ref T, CollisionFilter, QueryInteraction)
Box cast custom.
Declaration
public bool BoxCastCustom<T>(float3 center, quaternion orientation, float3 halfExtents, float3 direction, float maxDistance, ref T collector, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default) where T : struct, ICollector<ColliderCastHit>
Parameters
Type | Name | Description |
---|---|---|
float3 | center | The center. |
quaternion | orientation | The orientation. |
float3 | halfExtents | Half extents of the box. |
float3 | direction | The direction. |
float | maxDistance | The maximum distance. |
T | collector | [in,out] The collector. |
CollisionFilter | filter | Specifies the filter. |
QueryInteraction | queryInteraction | (Optional) The query interaction. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
Type Parameters
Name | Description |
---|---|
T | Generic type parameter. |
CalculateAabb()
Calculates the aabb.
Declaration
public Aabb CalculateAabb()
Returns
Type | Description |
---|---|
Aabb | The calculated aabb. |
CalculateAabb(RigidTransform, float)
Calculates the aabb.
Declaration
public Aabb CalculateAabb(RigidTransform transform, float uniformScale = 1)
Parameters
Type | Name | Description |
---|---|---|
RigidTransform | transform | The transform. |
float | uniformScale | (Optional) The uniform scale. |
Returns
Type | Description |
---|---|
Aabb | The calculated aabb. |
CalculateDistance(ColliderDistanceInput)
Calculate the distance from another collider to this one.
Declaration
public bool CalculateDistance(ColliderDistanceInput input)
Parameters
Type | Name | Description |
---|---|---|
ColliderDistanceInput | input | The input. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
CalculateDistance(ColliderDistanceInput, ref NativeList<DistanceHit>)
Calculates the distance.
Declaration
public bool CalculateDistance(ColliderDistanceInput input, ref NativeList<DistanceHit> allHits)
Parameters
Type | Name | Description |
---|---|---|
ColliderDistanceInput | input | The input. |
NativeList<DistanceHit> | allHits | [in,out] all hits. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
CalculateDistance(ColliderDistanceInput, out DistanceHit)
Calculates the distance.
Declaration
public bool CalculateDistance(ColliderDistanceInput input, out DistanceHit closestHit)
Parameters
Type | Name | Description |
---|---|---|
ColliderDistanceInput | input | The input. |
DistanceHit | closestHit | [out] The closest hit. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
CalculateDistance(PointDistanceInput)
Calculate the distance from a point to this collider.
Declaration
public bool CalculateDistance(PointDistanceInput input)
Parameters
Type | Name | Description |
---|---|---|
PointDistanceInput | input | The input. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
CalculateDistance(PointDistanceInput, ref NativeList<DistanceHit>)
Calculates the distance.
Declaration
public bool CalculateDistance(PointDistanceInput input, ref NativeList<DistanceHit> allHits)
Parameters
Type | Name | Description |
---|---|---|
PointDistanceInput | input | The input. |
NativeList<DistanceHit> | allHits | [in,out] all hits. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
CalculateDistance(PointDistanceInput, out DistanceHit)
Calculates the distance.
Declaration
public bool CalculateDistance(PointDistanceInput input, out DistanceHit closestHit)
Parameters
Type | Name | Description |
---|---|---|
PointDistanceInput | input | The input. |
DistanceHit | closestHit | [out] The closest hit. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
CalculateDistance<T>(ColliderDistanceInput, ref T)
Calculates the distance.
Declaration
public bool CalculateDistance<T>(ColliderDistanceInput input, ref T collector) where T : struct, ICollector<DistanceHit>
Parameters
Type | Name | Description |
---|---|---|
ColliderDistanceInput | input | The input. |
T | collector | [in,out] The collector. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
Type Parameters
Name | Description |
---|---|
T | Generic type parameter. |
CalculateDistance<T>(PointDistanceInput, ref T)
Calculates the distance.
Declaration
public bool CalculateDistance<T>(PointDistanceInput input, ref T collector) where T : struct, ICollector<DistanceHit>
Parameters
Type | Name | Description |
---|---|---|
PointDistanceInput | input | The input. |
T | collector | [in,out] The collector. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
Type Parameters
Name | Description |
---|---|
T | Generic type parameter. |
CapsuleCast(float3, float3, float, float3, float, out ColliderCastHit, CollisionFilter, QueryInteraction)
Capsule cast.
Declaration
public bool CapsuleCast(float3 point1, float3 point2, float radius, float3 direction, float maxDistance, out ColliderCastHit hitInfo, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Type | Name | Description |
---|---|---|
float3 | point1 | The first point in capsule definition. |
float3 | point2 | The second point in capsule definition. |
float | radius | The radius. |
float3 | direction | The direction. |
float | maxDistance | The maximum distance. |
ColliderCastHit | hitInfo | [out] Information describing the hit. |
CollisionFilter | filter | Specifies the filter. |
QueryInteraction | queryInteraction | (Optional) The query interaction. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
CapsuleCast(float3, float3, float, float3, float, CollisionFilter, QueryInteraction)
Capsule cast.
Declaration
public bool CapsuleCast(float3 point1, float3 point2, float radius, float3 direction, float maxDistance, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Type | Name | Description |
---|---|---|
float3 | point1 | The first point in capsule definition. |
float3 | point2 | The second point in capsule definition. |
float | radius | The radius. |
float3 | direction | The direction. |
float | maxDistance | The maximum distance. |
CollisionFilter | filter | Specifies the filter. |
QueryInteraction | queryInteraction | (Optional) The query interaction. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
CapsuleCastAll(float3, float3, float, float3, float, ref NativeList<ColliderCastHit>, CollisionFilter, QueryInteraction)
Capsule cast all.
Declaration
public bool CapsuleCastAll(float3 point1, float3 point2, float radius, float3 direction, float maxDistance, ref NativeList<ColliderCastHit> outHits, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Type | Name | Description |
---|---|---|
float3 | point1 | The first point in capsule definition. |
float3 | point2 | The second point in capsule definition. |
float | radius | The radius. |
float3 | direction | The direction. |
float | maxDistance | The maximum distance. |
NativeList<ColliderCastHit> | outHits | [in,out] The out hits. |
CollisionFilter | filter | Specifies the filter. |
QueryInteraction | queryInteraction | (Optional) The query interaction. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
CapsuleCastCustom<T>(float3, float3, float, float3, float, ref T, CollisionFilter, QueryInteraction)
Capsule cast custom.
Declaration
public bool CapsuleCastCustom<T>(float3 point1, float3 point2, float radius, float3 direction, float maxDistance, ref T collector, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default) where T : struct, ICollector<ColliderCastHit>
Parameters
Type | Name | Description |
---|---|---|
float3 | point1 | The first point in capsule definition. |
float3 | point2 | The second point in capsule definition. |
float | radius | The radius. |
float3 | direction | The direction. |
float | maxDistance | The maximum distance. |
T | collector | [in,out] The collector. |
CollisionFilter | filter | Specifies the filter. |
QueryInteraction | queryInteraction | (Optional) The query interaction. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
Type Parameters
Name | Description |
---|---|
T | Generic type parameter. |
CastCollider(ColliderCastInput)
Cast another collider against this one.
Declaration
public bool CastCollider(ColliderCastInput input)
Parameters
Type | Name | Description |
---|---|---|
ColliderCastInput | input | The input. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
CastCollider(ColliderCastInput, ref NativeList<ColliderCastHit>)
Cast collider.
Declaration
public bool CastCollider(ColliderCastInput input, ref NativeList<ColliderCastHit> allHits)
Parameters
Type | Name | Description |
---|---|---|
ColliderCastInput | input | The input. |
NativeList<ColliderCastHit> | allHits | [in,out] all hits. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
CastCollider(ColliderCastInput, out ColliderCastHit)
Cast collider.
Declaration
public bool CastCollider(ColliderCastInput input, out ColliderCastHit closestHit)
Parameters
Type | Name | Description |
---|---|---|
ColliderCastInput | input | The input. |
ColliderCastHit | closestHit | [out] The closest hit. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
CastCollider<T>(ColliderCastInput, ref T)
Cast collider.
Declaration
public bool CastCollider<T>(ColliderCastInput input, ref T collector) where T : struct, ICollector<ColliderCastHit>
Parameters
Type | Name | Description |
---|---|---|
ColliderCastInput | input | The input. |
T | collector | [in,out] The collector. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
Type Parameters
Name | Description |
---|---|
T | Generic type parameter. |
CastRay(RaycastInput)
Cast a ray against this collider.
Declaration
public bool CastRay(RaycastInput input)
Parameters
Type | Name | Description |
---|---|---|
RaycastInput | input | The input. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
CastRay(RaycastInput, ref NativeList<RaycastHit>)
Cast ray.
Declaration
public bool CastRay(RaycastInput input, ref NativeList<RaycastHit> allHits)
Parameters
Type | Name | Description |
---|---|---|
RaycastInput | input | The input. |
NativeList<RaycastHit> | allHits | [in,out] all hits. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
CastRay(RaycastInput, out RaycastHit)
Cast ray.
Declaration
public bool CastRay(RaycastInput input, out RaycastHit closestHit)
Parameters
Type | Name | Description |
---|---|---|
RaycastInput | input | The input. |
RaycastHit | closestHit | [out] The closest hit. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
CastRay<T>(RaycastInput, ref T)
Cast ray.
Declaration
public bool CastRay<T>(RaycastInput input, ref T collector) where T : struct, ICollector<RaycastHit>
Parameters
Type | Name | Description |
---|---|---|
RaycastInput | input | The input. |
T | collector | [in,out] The collector. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
Type Parameters
Name | Description |
---|---|
T | Generic type parameter. |
CheckBox(float3, quaternion, float3, CollisionFilter, QueryInteraction)
Check box.
Declaration
public bool CheckBox(float3 center, quaternion orientation, float3 halfExtents, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Type | Name | Description |
---|---|---|
float3 | center | The center. |
quaternion | orientation | The orientation. |
float3 | halfExtents | Half extents of the box. |
CollisionFilter | filter | Specifies the filter. |
QueryInteraction | queryInteraction | (Optional) The query interaction. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
CheckCapsule(float3, float3, float, CollisionFilter, QueryInteraction)
Check capsule.
Declaration
public bool CheckCapsule(float3 point1, float3 point2, float radius, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Type | Name | Description |
---|---|---|
float3 | point1 | The first point in capsule definition. |
float3 | point2 | The second point in capsule definition. |
float | radius | The radius. |
CollisionFilter | filter | Specifies the filter. |
QueryInteraction | queryInteraction | (Optional) The query interaction. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
CheckSphere(float3, float, CollisionFilter, QueryInteraction)
Checks if a sphere overlaps this collider.
Declaration
public bool CheckSphere(float3 position, float radius, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Type | Name | Description |
---|---|---|
float3 | position | The position. |
float | radius | The radius. |
CollisionFilter | filter | Specifies the filter. |
QueryInteraction | queryInteraction | (Optional) The query interaction. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
CreateQuad(float3, float3, float3, float3)
Creates a quad from vertices. Quad vertices must be coplanar and wound consistently.
Declaration
public static BlobAssetReference<Collider> CreateQuad(float3 vertex0, float3 vertex1, float3 vertex2, float3 vertex3)
Parameters
Type | Name | Description |
---|---|---|
float3 | vertex0 | The first vertex of the quad. |
float3 | vertex1 | The second vertex of the quad. |
float3 | vertex2 | The third vertex of the quad. |
float3 | vertex3 | The fourth vertex of the quad. |
Returns
Type | Description |
---|---|
BlobAssetReference<Collider> | The new quad. |
CreateQuad(float3, float3, float3, float3, CollisionFilter)
Creates a quad.
Declaration
public static BlobAssetReference<Collider> CreateQuad(float3 vertex0, float3 vertex1, float3 vertex2, float3 vertex3, CollisionFilter filter)
Parameters
Type | Name | Description |
---|---|---|
float3 | vertex0 | The first vertex of the quad. |
float3 | vertex1 | The second vertex of the quad. |
float3 | vertex2 | The third vertex of the quad. |
float3 | vertex3 | The fourth vertex of the quad. |
CollisionFilter | filter | Specifies the filter. |
Returns
Type | Description |
---|---|
BlobAssetReference<Collider> | The new quad. |
CreateQuad(float3, float3, float3, float3, CollisionFilter, Material)
Creates a quad.
Declaration
public static BlobAssetReference<Collider> CreateQuad(float3 vertex0, float3 vertex1, float3 vertex2, float3 vertex3, CollisionFilter filter, Material material)
Parameters
Type | Name | Description |
---|---|---|
float3 | vertex0 | The first vertex of the quad. |
float3 | vertex1 | The second vertex of the quad. |
float3 | vertex2 | The third vertex of the quad. |
float3 | vertex3 | The fourth vertex of the quad. |
CollisionFilter | filter | Specifies the filter. |
Material | material | The material. |
Returns
Type | Description |
---|---|
BlobAssetReference<Collider> | The new quad. |
CreateTriangle(float3, float3, float3)
Creates a triangle.
Declaration
public static BlobAssetReference<Collider> CreateTriangle(float3 vertex0, float3 vertex1, float3 vertex2)
Parameters
Type | Name | Description |
---|---|---|
float3 | vertex0 | The first vertex of the triangle. |
float3 | vertex1 | The second vertex of the triangle. |
float3 | vertex2 | The third vertex of the triangle. |
Returns
Type | Description |
---|---|
BlobAssetReference<Collider> | The new triangle. |
CreateTriangle(float3, float3, float3, CollisionFilter)
Creates a triangle.
Declaration
public static BlobAssetReference<Collider> CreateTriangle(float3 vertex0, float3 vertex1, float3 vertex2, CollisionFilter filter)
Parameters
Type | Name | Description |
---|---|---|
float3 | vertex0 | The first vertex of the triangle. |
float3 | vertex1 | The second vertex of the triangle. |
float3 | vertex2 | The third vertex of the triangle. |
CollisionFilter | filter | Specifies the filter. |
Returns
Type | Description |
---|---|
BlobAssetReference<Collider> | The new triangle. |
CreateTriangle(float3, float3, float3, CollisionFilter, Material)
Creates a triangle.
Declaration
public static BlobAssetReference<Collider> CreateTriangle(float3 vertex0, float3 vertex1, float3 vertex2, CollisionFilter filter, Material material)
Parameters
Type | Name | Description |
---|---|---|
float3 | vertex0 | The first vertex of the triangle. |
float3 | vertex1 | The second vertex of the triangle. |
float3 | vertex2 | The third vertex of the triangle. |
CollisionFilter | filter | Specifies the filter. |
Material | material | The material. |
Returns
Type | Description |
---|---|
BlobAssetReference<Collider> | The new triangle. |
GetCollisionFilter()
Gets the collision filter.
Declaration
public CollisionFilter GetCollisionFilter()
Returns
Type | Description |
---|---|
CollisionFilter | The collision filter. |
OverlapBox(float3, quaternion, float3, ref NativeList<DistanceHit>, CollisionFilter, QueryInteraction)
Overlap box.
Declaration
public bool OverlapBox(float3 center, quaternion orientation, float3 halfExtents, ref NativeList<DistanceHit> outHits, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Type | Name | Description |
---|---|---|
float3 | center | The center. |
quaternion | orientation | The orientation. |
float3 | halfExtents | Half extents of the box. |
NativeList<DistanceHit> | outHits | [in,out] The out hits. |
CollisionFilter | filter | Specifies the filter. |
QueryInteraction | queryInteraction | (Optional) The query interaction. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
OverlapBoxCustom<T>(float3, quaternion, float3, ref T, CollisionFilter, QueryInteraction)
Overlap box custom.
Declaration
public bool OverlapBoxCustom<T>(float3 center, quaternion orientation, float3 halfExtents, ref T collector, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default) where T : struct, ICollector<DistanceHit>
Parameters
Type | Name | Description |
---|---|---|
float3 | center | The center. |
quaternion | orientation | The orientation. |
float3 | halfExtents | Half extents of the box. |
T | collector | [in,out] The collector. |
CollisionFilter | filter | Specifies the filter. |
QueryInteraction | queryInteraction | (Optional) The query interaction. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
Type Parameters
Name | Description |
---|---|
T | Generic type parameter. |
OverlapCapsule(float3, float3, float, ref NativeList<DistanceHit>, CollisionFilter, QueryInteraction)
Overlap capsule.
Declaration
public bool OverlapCapsule(float3 point1, float3 point2, float radius, ref NativeList<DistanceHit> outHits, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Type | Name | Description |
---|---|---|
float3 | point1 | The first point in capsule definition. |
float3 | point2 | The second point in capsule definition. |
float | radius | The radius. |
NativeList<DistanceHit> | outHits | [in,out] The out hits. |
CollisionFilter | filter | Specifies the filter. |
QueryInteraction | queryInteraction | (Optional) The query interaction. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
OverlapCapsuleCustom<T>(float3, float3, float, ref T, CollisionFilter, QueryInteraction)
Overlap capsule custom.
Declaration
public bool OverlapCapsuleCustom<T>(float3 point1, float3 point2, float radius, ref T collector, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default) where T : struct, ICollector<DistanceHit>
Parameters
Type | Name | Description |
---|---|---|
float3 | point1 | The first point in capsule definition. |
float3 | point2 | The second point in capsule definition. |
float | radius | The radius. |
T | collector | [in,out] The collector. |
CollisionFilter | filter | Specifies the filter. |
QueryInteraction | queryInteraction | (Optional) The query interaction. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
Type Parameters
Name | Description |
---|---|
T | Generic type parameter. |
OverlapSphere(float3, float, ref NativeList<DistanceHit>, CollisionFilter, QueryInteraction)
Overlap sphere.
Declaration
public bool OverlapSphere(float3 position, float radius, ref NativeList<DistanceHit> outHits, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Type | Name | Description |
---|---|---|
float3 | position | The position. |
float | radius | The radius. |
NativeList<DistanceHit> | outHits | [in,out] The out hits. |
CollisionFilter | filter | Specifies the filter. |
QueryInteraction | queryInteraction | (Optional) The query interaction. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
OverlapSphereCustom<T>(float3, float, ref T, CollisionFilter, QueryInteraction)
Overlap sphere custom.
Declaration
public bool OverlapSphereCustom<T>(float3 position, float radius, ref T collector, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default) where T : struct, ICollector<DistanceHit>
Parameters
Type | Name | Description |
---|---|---|
float3 | position | The position. |
float | radius | The radius. |
T | collector | [in,out] The collector. |
CollisionFilter | filter | Specifies the filter. |
QueryInteraction | queryInteraction | (Optional) The query interaction. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
Type Parameters
Name | Description |
---|---|
T | Generic type parameter. |
SetCollisionFilter(CollisionFilter)
Sets the collision filter.
Declaration
public void SetCollisionFilter(CollisionFilter filter)
Parameters
Type | Name | Description |
---|---|---|
CollisionFilter | filter | Specifies the filter. |
SphereCast(float3, float, float3, float, out ColliderCastHit, CollisionFilter, QueryInteraction)
Sphere cast.
Declaration
public bool SphereCast(float3 origin, float radius, float3 direction, float maxDistance, out ColliderCastHit hitInfo, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Type | Name | Description |
---|---|---|
float3 | origin | The origin. |
float | radius | The radius. |
float3 | direction | The direction. |
float | maxDistance | The maximum distance. |
ColliderCastHit | hitInfo | [out] Information describing the hit. |
CollisionFilter | filter | Specifies the filter. |
QueryInteraction | queryInteraction | (Optional) The query interaction. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
SphereCast(float3, float, float3, float, CollisionFilter, QueryInteraction)
Sphere cast.
Declaration
public bool SphereCast(float3 origin, float radius, float3 direction, float maxDistance, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Type | Name | Description |
---|---|---|
float3 | origin | The origin. |
float | radius | The radius. |
float3 | direction | The direction. |
float | maxDistance | The maximum distance. |
CollisionFilter | filter | Specifies the filter. |
QueryInteraction | queryInteraction | (Optional) The query interaction. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
SphereCastAll(float3, float, float3, float, ref NativeList<ColliderCastHit>, CollisionFilter, QueryInteraction)
Sphere cast all.
Declaration
public bool SphereCastAll(float3 origin, float radius, float3 direction, float maxDistance, ref NativeList<ColliderCastHit> outHits, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default)
Parameters
Type | Name | Description |
---|---|---|
float3 | origin | The origin. |
float | radius | The radius. |
float3 | direction | The direction. |
float | maxDistance | The maximum distance. |
NativeList<ColliderCastHit> | outHits | [in,out] The out hits. |
CollisionFilter | filter | Specifies the filter. |
QueryInteraction | queryInteraction | (Optional) The query interaction. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
SphereCastCustom<T>(float3, float, float3, float, ref T, CollisionFilter, QueryInteraction)
Sphere cast custom.
Declaration
public bool SphereCastCustom<T>(float3 origin, float radius, float3 direction, float maxDistance, ref T collector, CollisionFilter filter, QueryInteraction queryInteraction = QueryInteraction.Default) where T : struct, ICollector<ColliderCastHit>
Parameters
Type | Name | Description |
---|---|---|
float3 | origin | The origin. |
float | radius | The radius. |
float3 | direction | The direction. |
float | maxDistance | The maximum distance. |
T | collector | [in,out] The collector. |
CollisionFilter | filter | Specifies the filter. |
QueryInteraction | queryInteraction | (Optional) The query interaction. |
Returns
Type | Description |
---|---|
bool | True if there is a hit, false otherwise. |
Type Parameters
Name | Description |
---|---|
T | Generic type parameter. |