Class BoxColliderCast
ColliderCast behaviour intended to work with any box collider shape.
Inherited Members
Namespace: nickmaltbie.OpenKCC.Utils.ColliderCast
Assembly: cs.temp.dll.dll
Syntax
public class BoxColliderCast : AbstractPrimitiveColliderCast, IColliderCast, IRaycastHelper
Fields
center
Center of the box collider.
Declaration
public Vector3 center
Field Value
Type | Description |
---|---|
Vector3 |
size
Size of the box collider in 3D space.
Declaration
public Vector3 size
Field Value
Type | Description |
---|---|
Vector3 |
Methods
GetBottom(Vector3, Quaternion)
Gets the bottom of the bounds of the collider.
Declaration
public override 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. |
Overrides
GetHits(Vector3, Quaternion, Vector3, Single, Int32, QueryTriggerInteraction, Single)
Cast self and get the objects hit that exclude this object.
Declaration
public override 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 |
Overrides
GetOverlapping(Vector3, Quaternion, Int32, QueryTriggerInteraction, Single)
Gets the list of objects overlapping with this object.
Declaration
public override 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. |
Overrides
GetParams(Vector3, Quaternion, Single)
Gets transformed parameters describing this sphere collider for a given position and rotation
Declaration
public (Vector3, Vector3) GetParams(Vector3 position, Quaternion rotation, float buffer = 0F)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | Position of the object. |
Quaternion | rotation | Rotation of the object. |
Single | buffer | Buffer space around the object. |
Returns
Type | Description |
---|---|
(T1 Item1, T2 Item2)<Vector3, Vector3> | Returns the center of the collider in world space and the size along each axis. |
GetParams(Vector3, Vector3, Vector3, Quaternion, Single)
Gets transformed parameters describing this sphere collider for a given position and rotation
Declaration
public static (Vector3, Vector3) GetParams(Vector3 boxCenter, Vector3 boxSize, Vector3 position, Quaternion rotation, float buffer = 0F)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | boxCenter | Center of box relative to position. |
Vector3 | boxSize | Size of the box collider. |
Vector3 | position | Position of the object. |
Quaternion | rotation | Rotation of the object. |
Single | buffer | Buffer space around the object. |
Returns
Type | Description |
---|---|
(T1 Item1, T2 Item2)<Vector3, Vector3> | Returns the center of the collider in world space and the size along each axis. |
SetupColliderComponent()
Setup the collider component associated with this object.
Declaration
protected override Collider SetupColliderComponent()
Returns
Type | Description |
---|---|
Collider | Collider created (or one that already exists) for this object. |
Overrides
UpdateColliderParameters()
Update the parameters of the collider on a configuration change.
Declaration
public override void UpdateColliderParameters()