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

This component is an encapsulation of the Collider and Collider2D components, containing the most commonly used properties and methods from these components. More...

Inheritance diagram for Lightbug.Utilities.ColliderComponent:
Lightbug.Utilities.ColliderComponent2D Lightbug.Utilities.ColliderComponent3D Lightbug.Utilities.BoxColliderComponent2D Lightbug.Utilities.CapsuleColliderComponent2D Lightbug.Utilities.SphereColliderComponent2D Lightbug.Utilities.BoxColliderComponent3D Lightbug.Utilities.CapsuleColliderComponent3D Lightbug.Utilities.SphereColliderComponent3D

Public Member Functions

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...
 

Static Public Member Functions

static ColliderComponent CreateInstance (GameObject gameObject, bool includeChildren=true)
 

Protected Member Functions

abstract void OnEnable ()
 
abstract void OnDisable ()
 
virtual void Awake ()
 

Properties

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]
 

Detailed Description

This component is an encapsulation of the Collider and Collider2D components, containing the most commonly used properties and methods from these components.

Member Function Documentation

◆ ComputePenetration()

abstract bool Lightbug.Utilities.ColliderComponent.ComputePenetration ( ref Vector3  position,
ref Quaternion  rotation,
PenetrationDelegate  Action 
)
pure virtual

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.

Implemented in Lightbug.Utilities.ColliderComponent2D, and Lightbug.Utilities.ColliderComponent3D.

◆ ComputePenetrationVector()

abstract Vector3 Lightbug.Utilities.ColliderComponent.ComputePenetrationVector ( ref Vector3  position,
ref Quaternion  rotation,
PenetrationDelegate  Action 
)
pure virtual

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.

Implemented in Lightbug.Utilities.ColliderComponent2D, and Lightbug.Utilities.ColliderComponent3D.

◆ OverlapBody()

abstract int Lightbug.Utilities.ColliderComponent.OverlapBody ( Vector3  position,
Quaternion  rotation 
)
pure virtual

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.

Implemented in Lightbug.Utilities.ColliderComponent2D, and Lightbug.Utilities.ColliderComponent3D.


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