Interface IColliderCast
Abstraction to check for collisions and compute when this object would hit other objects.
Inherited Members
Namespace: nickmaltbie.OpenKCC.Utils
Assembly: cs.temp.dll.dll
Syntax
public interface IColliderCast : IRaycastHelper
Methods
CastSelf(Vector3, Quaternion, Vector3, Single, out IRaycastHit, Int32, QueryTriggerInteraction, Single)
Cast self in a given direction and get the first object hit.
Declaration
bool CastSelf(Vector3 position, Quaternion rotation, Vector3 direction, float distance, out IRaycastHit hit, int layerMask = -1, QueryTriggerInteraction queryTriggerInteraction = null, float skinWidth = 0.01F)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | Position of the object when it is being raycast. |
Quaternion | rotation | Rotation of the objecting when it is being raycast. |
Vector3 | direction | Direction of the raycast. |
Single | distance | Maximum distance of raycast. |
IRaycastHit | hit | First object hit and related information, will have a distance of Infinity if none is found. |
Int32 | layerMask | Layer mask for checking which objects to collide with. |
QueryTriggerInteraction | queryTriggerInteraction | Configuration for QueryTriggerInteraction when solving for collisions. |
Single | skinWidth | Buffer around player when casting object. |
Returns
Type | Description |
---|---|
Boolean | True if an object is hit within distance, false otherwise. |
GetBottom(Vector3, Quaternion)
Gets the bottom of the bounds of the collider.
Declaration
Vector3 GetBottom(Vector3 position, Quaternion rotation)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | Position of the object when it is being checked. |
Quaternion | rotation | Rotation of the objecting when it is being checked. |
Returns
Type | Description |
---|---|
Vector3 | Bottom of the bounds of the collider. |
GetHits(Vector3, Quaternion, Vector3, Single, Int32, QueryTriggerInteraction, Single)
Cast self and get the objects hit that exclude this object.
Declaration
IEnumerable<RaycastHit> GetHits(Vector3 position, Quaternion rotation, Vector3 direction, float distance, int layerMask = -1, QueryTriggerInteraction queryTriggerInteraction = null, float skinWidth = 0.01F)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | Position of the object when it is being raycast. |
Quaternion | rotation | Rotation of the objecting when it is being raycast. |
Vector3 | direction | Direction to cast self collider. |
Single | distance | Distance to cast self collider. |
Int32 | layerMask | Layer mask for checking which objects to collide with. |
QueryTriggerInteraction | queryTriggerInteraction | Configuration for QueryTriggerInteraction when solving for collisions. |
Single | skinWidth | Buffer around player when computing collisions. |
Returns
Type | Description |
---|---|
IEnumerable<RaycastHit> | List of objects this hits when it is being raycast |
GetOverlapping(Vector3, Quaternion, Int32, QueryTriggerInteraction, Single)
Gets the list of objects overlapping with this object.
Declaration
IEnumerable<Collider> GetOverlapping(Vector3 position, Quaternion rotation, int layerMask = -1, QueryTriggerInteraction queryTriggerInteraction = null, float skinWidth = 0F)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | Position of the object when it is being checked. |
Quaternion | rotation | Rotation of the objecting when it is being checked. |
Int32 | layerMask | Layer mask for checking which objects to collide with. |
QueryTriggerInteraction | queryTriggerInteraction | Configuration for QueryTriggerInteraction when solving for collisions. |
Single | skinWidth | Buffer around player when computing overlapping objects. |
Returns
Type | Description |
---|---|
IEnumerable<Collider> | The list of overlapping objects with this object. |
PushOutOverlapping(Vector3, Quaternion, Single, Int32, QueryTriggerInteraction, Single)
Get the vector to push this object out of overlapping objects with a max distance.
Declaration
Vector3 PushOutOverlapping(Vector3 position, Quaternion rotation, float maxDistance, int layerMask = -1, QueryTriggerInteraction queryTriggerInteraction = null, float skinWidth = 0F)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | Position of the object when it is being raycast. |
Quaternion | rotation | Rotation of the objecting when it is being raycast. |
Single | maxDistance | Maximum distance the player can be pushed |
Int32 | layerMask | Layer mask for checking which objects to collide with. |
QueryTriggerInteraction | queryTriggerInteraction | Configuration for QueryTriggerInteraction when solving for collisions. |
Single | skinWidth | Buffer around player when computing overlapping objects. |
Returns
Type | Description |
---|---|
Vector3 | Direction to push the object, distance player was pushed. |