Character Controller Pro 1.4.11
A 2D/3D character controller asset for Unity.
Lightbug.Utilities.ColliderComponent2D Class Referenceabstract

An implementation of a ColliderComponent for 2D colliders. More...

Inheritance diagram for Lightbug.Utilities.ColliderComponent2D:
Lightbug.Utilities.ColliderComponent Lightbug.Utilities.BoxColliderComponent2D Lightbug.Utilities.CapsuleColliderComponent2D Lightbug.Utilities.SphereColliderComponent2D

Public Member Functions

sealed override int OverlapBody (Vector3 position, Quaternion rotation)
 Performs an overlap check using the body shape. The filter used in this case corresponds to the internal one from the PhysicsBody2D/3D class. If a custom filter is required, 2D/3D implementations must be used instead. More...
 
override bool ComputePenetration (ref Vector3 position, ref Quaternion rotation, PenetrationDelegate Action)
 Calcules the amount of penetration between this body and nearby neighbors. Alternatively, an action (delegate) can be passed in, so the resulting position/rotation can be modified if needed. More...
 
override Vector3 ComputePenetrationVector (ref Vector3 position, ref Quaternion rotation, PenetrationDelegate Action)
 Calcules the amount of penetration between this body and nearby neighbors. Alternatively, an action (delegate) can be passed in, so the resulting position/rotation can be modified if needed. More...
 
- Public Member Functions inherited from Lightbug.Utilities.ColliderComponent
delegate void PenetrationDelegate (ref Vector3 bodyPosition, ref Quaternion bodyRotation, Transform otherColliderTransform, Vector3 penetrationDirection, float penetrationDistance)
 
abstract bool ComputePenetration (ref Vector3 position, ref Quaternion rotation, PenetrationDelegate Action)
 Calcules the amount of penetration between this body and nearby neighbors. Alternatively, an action (delegate) can be passed in, so the resulting position/rotation can be modified if needed. More...
 
abstract Vector3 ComputePenetrationVector (ref Vector3 position, ref Quaternion rotation, PenetrationDelegate Action)
 Calcules the amount of penetration between this body and nearby neighbors. Alternatively, an action (delegate) can be passed in, so the resulting position/rotation can be modified if needed. More...
 
abstract int OverlapBody (Vector3 position, Quaternion rotation)
 Performs an overlap check using the body shape. The filter used in this case corresponds to the internal one from the PhysicsBody2D/3D class. If a custom filter is required, 2D/3D implementations must be used instead. More...
 

Protected Member Functions

abstract int InternalOverlapBody (Vector3 position, Quaternion rotation, Collider2D[] unfilteredResults, List< Collider2D > filteredResults, OverlapFilterDelegate2D filter)
 
bool InternalHitFilter (RaycastHit2D raycastHit)
 
bool InternalOverlapFilter (Collider2D collider)
 
int FilterValidOverlaps (int hits, Collider2D[] overlapsBuffer, List< Collider2D > filteredOverlaps, OverlapFilterDelegate2D Filter)
 
override void Awake ()
 
override void OnEnable ()
 
override void OnDisable ()
 
abstract void OnEnable ()
 
abstract void OnDisable ()
 
virtual void Awake ()
 

Protected Attributes

new Collider2D collider = null
 
ContactFilter2D ContactFilter
 

Properties

RaycastHit2D[] UnfilteredHits = new RaycastHit2D[20] [get, protected set]
 
List< RaycastHit2D > FilteredHits = new List<RaycastHit2D>(10) [get, protected set]
 
Collider2D[] UnfilteredOverlaps = new Collider2D[20] [get, protected set]
 
List< Collider2D > FilteredOverlaps = new List<Collider2D>(10) [get, protected set]
 
PhysicsMaterial2D Material [get, set]
 
- Properties inherited from Lightbug.Utilities.ColliderComponent
abstract Vector3 Size [get, set]
 The size of the collider.
 
abstract Vector3 Offset [get, set]
 The distance between the center of the collider and the position of the object.
 
abstract Vector3 BoundsSize [get]
 The collider bounding volume.
 
Vector3 Center [get]
 

Additional Inherited Members

- Static Public Member Functions inherited from Lightbug.Utilities.ColliderComponent
static ColliderComponent CreateInstance (GameObject gameObject, bool includeChildren=true)
 

Detailed Description

An implementation of a ColliderComponent for 2D colliders.

Member Function Documentation

◆ Awake()

override void Lightbug.Utilities.ColliderComponent2D.Awake ( )
inlineprotectedvirtual

◆ ComputePenetration()

override bool Lightbug.Utilities.ColliderComponent2D.ComputePenetration ( ref Vector3  position,
ref Quaternion  rotation,
PenetrationDelegate  Action 
)
inlinevirtual

Calcules the amount of penetration between this body and nearby neighbors. Alternatively, an action (delegate) can be passed in, so the resulting position/rotation can be modified if needed.

Parameters
positionThe position reference.
rotationThe rotation reference.
ActionThis delegate will be called after the penetration value is calculated.
Returns
True if there was any valid overlap.

Implements Lightbug.Utilities.ColliderComponent.

◆ ComputePenetrationVector()

override Vector3 Lightbug.Utilities.ColliderComponent2D.ComputePenetrationVector ( ref Vector3  position,
ref Quaternion  rotation,
PenetrationDelegate  Action 
)
inlinevirtual

Calcules the amount of penetration between this body and nearby neighbors. Alternatively, an action (delegate) can be passed in, so the resulting position/rotation can be modified if needed.

Parameters
positionThe position reference.
rotationThe rotation reference.
ActionThis delegate will be called after the penetration value is calculated.
Returns
The penetration vector.

Implements Lightbug.Utilities.ColliderComponent.

◆ OnDisable()

override void Lightbug.Utilities.ColliderComponent2D.OnDisable ( )
inlineprotectedvirtual

◆ OnEnable()

override void Lightbug.Utilities.ColliderComponent2D.OnEnable ( )
inlineprotectedvirtual

◆ OverlapBody()

sealed override int Lightbug.Utilities.ColliderComponent2D.OverlapBody ( Vector3  position,
Quaternion  rotation 
)
inlinevirtual

Performs an overlap check using the body shape. The filter used in this case corresponds to the internal one from the PhysicsBody2D/3D class. If a custom filter is required, 2D/3D implementations must be used instead.

Implements Lightbug.Utilities.ColliderComponent.


The documentation for this class was generated from the following file: