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

This component offers a set of useful functionalities for 2D and 3D physics. More...

Inheritance diagram for Lightbug.Utilities.PhysicsComponent:
Lightbug.Utilities.PhysicsComponent2D Lightbug.Utilities.PhysicsComponent3D

Public Member Functions

abstract void IgnoreCollision (in HitInfo hitInfo, bool ignore)
 Ignores the collision between this object and some other collider. More...
 
abstract void IgnoreCollision (Transform otherTransform, bool ignore)
 Ignores the collision between this object and some other collider. More...
 
abstract void IgnoreLayerCollision (int targetLayer, bool ignore)
 Ignores the collision between this object and a layer. More...
 
abstract void IgnoreLayerMaskCollision (LayerMask layerMask, bool ignore)
 Ignores the collision between this object and a layer mask. More...
 
void ClearContacts ()
 
abstract bool CheckCollisionsWith (GameObject gameObject)
 Returns true if collisions between this collider and the target GameObject is valid at the physics simulation level. More...
 
int Raycast (out HitInfo hitInfo, Vector3 origin, Vector3 castDisplacement, in HitInfoFilter filter, bool allowOverlaps=false, HitFilterDelegate hitFilter=null)
 Performs a Raycast and gets the closest valid hit.
 
List< HitInfoRaycast (Vector3 origin, Vector3 castDisplacement, in HitInfoFilter filter, bool allowOverlaps=false, HitFilterDelegate hitFilter=null)
 Performs a Raycast and gets all the valid hits.
 
int SphereCast (out HitInfo hitInfo, Vector3 center, float radius, Vector3 castDisplacement, in HitInfoFilter filter, bool allowOverlaps=false, HitFilterDelegate hitFilter=null)
 Performs a SphereCast and gets the closest valid hit.
 
List< HitInfoSphereCast (Vector3 center, float radius, Vector3 castDisplacement, in HitInfoFilter filter, bool allowOverlaps=false, HitFilterDelegate hitFilter=null)
 Performs a SphereCast and gets all the valid hits.
 
int CapsuleCast (out HitInfo hitInfo, Vector3 bottom, Vector3 top, float radius, Vector3 castDisplacement, in HitInfoFilter filter, bool allowOverlaps=false, HitFilterDelegate hitFilter=null)
 Performs a CapsuleCast and gets the closest valid hit.
 
List< HitInfoCapsuleCast (Vector3 bottom, Vector3 top, float radius, Vector3 castDisplacement, in HitInfoFilter filter, bool allowOverlaps=false, HitFilterDelegate hitFilter=null)
 Performs a CapsuleCast and gets all the valid hits.
 
int BoxCast (out HitInfo hitInfo, Vector3 center, Vector3 size, Vector3 castDisplacement, Quaternion orientation, in HitInfoFilter filter, bool allowOverlaps=false, HitFilterDelegate hitFilter=null)
 Performs a BoxCast and gets the closest valid hit.
 
List< HitInfoBoxCast (Vector3 center, Vector3 size, Vector3 castDisplacement, Quaternion orientation, in HitInfoFilter filter, bool allowOverlaps=false, HitFilterDelegate hitFilter=null)
 Performs a BoxCast and gets all the valid hits.
 
bool OverlapSphere (Vector3 center, float radius, in HitInfoFilter filter, HitFilterDelegate hitFilter=null)
 Performs an OverlapSphere and returns true if any of the results is valid.
 
bool OverlapCapsule (Vector3 bottom, Vector3 top, float radius, in HitInfoFilter filter, HitFilterDelegate hitFilter=null)
 Performs an OverlapCapsule and returns true if any of the results is valid.
 
bool OverlapBox (Vector3 center, Vector3 size, Quaternion orientation, in HitInfoFilter filter, HitFilterDelegate hitFilter=null)
 Performs an OverlapBox and returns true if any of the results is valid.
 

Static Public Member Functions

static PhysicsComponent CreateInstance (GameObject gameObject)
 

Protected Member Functions

abstract LayerMask GetCollisionLayerMask ()
 
abstract int FilterOverlaps (int overlaps, LayerMask ignoredLayerMask, HitFilterDelegate hitFilter)
 
abstract void GetClosestHit (out HitInfo hitInfo, int hits, Vector3 castDisplacement, in HitInfoFilter filter, bool allowOverlaps, HitFilterDelegate hitFilter)
 
abstract List< HitInfoGetAllHits (int hits, Vector3 castDisplacement, in HitInfoFilter filter, bool allowOverlaps, HitFilterDelegate hitFilter)
 
abstract int InternalRaycast (Vector3 origin, Vector3 castDisplacement, int layerMask, bool ignoreTriggers, bool allowOverlaps)
 
abstract int InternalSphereCast (Vector3 center, float radius, Vector3 castDisplacement, int layerMask, bool ignoreTriggers, bool allowOverlaps)
 
abstract int InternalCapsuleCast (Vector3 bottom, Vector3 top, float radius, Vector3 castDisplacement, int layerMask, bool ignoreTriggers, bool allowOverlaps)
 
abstract int InternalBoxCast (Vector3 center, Vector3 size, Vector3 castDisplacement, Quaternion orientation, int layerMask, bool ignoreTriggers, bool allowOverlaps)
 
abstract int InternalOverlapSphere (Vector3 center, float radius, int layerMask, bool ignoreTriggers)
 
abstract int InternalOverlapCapsule (Vector3 bottom, Vector3 top, float radius, int layerMask, bool ignoreTriggers)
 
abstract int InternalOverlapBox (Vector3 center, Vector3 size, Quaternion orientation, int layerMask, bool ignoreTriggers)
 
virtual void Awake ()
 
virtual void Start ()
 

Protected Attributes

bool ignoreCollisionMessages = false
 
bool wasKinematic = false
 

Properties

List< HitInfoHitsBuffer = new List<HitInfo>(20) [get, protected set]
 
List< ContactContacts = new List<Contact>(20) [get, protected set]
 Gets a list with all the current contacts.
 
List< TriggerTriggers = new List<Trigger>(20) [get, protected set]
 Gets a list with all the current triggers.
 
LayerMask CollisionLayerMask = 0 [get, protected set]
 Returns a layer mask with all the valid collisions associated with the object, based on the collision matrix (physics settings).
 

Detailed Description

This component offers a set of useful functionalities for 2D and 3D physics.

Member Function Documentation

◆ CheckCollisionsWith()

abstract bool Lightbug.Utilities.PhysicsComponent.CheckCollisionsWith ( GameObject  gameObject)
pure virtual

Returns true if collisions between this collider and the target GameObject is valid at the physics simulation level.

Implemented in Lightbug.Utilities.PhysicsComponent2D, and Lightbug.Utilities.PhysicsComponent3D.

◆ IgnoreCollision() [1/2]

abstract void Lightbug.Utilities.PhysicsComponent.IgnoreCollision ( in HitInfo  hitInfo,
bool  ignore 
)
pure virtual

Ignores the collision between this object and some other collider.

Implemented in Lightbug.Utilities.PhysicsComponent2D, and Lightbug.Utilities.PhysicsComponent3D.

◆ IgnoreCollision() [2/2]

abstract void Lightbug.Utilities.PhysicsComponent.IgnoreCollision ( Transform  otherTransform,
bool  ignore 
)
pure virtual

Ignores the collision between this object and some other collider.

Implemented in Lightbug.Utilities.PhysicsComponent2D, and Lightbug.Utilities.PhysicsComponent3D.

◆ IgnoreLayerCollision()

abstract void Lightbug.Utilities.PhysicsComponent.IgnoreLayerCollision ( int  targetLayer,
bool  ignore 
)
pure virtual

Ignores the collision between this object and a layer.

Implemented in Lightbug.Utilities.PhysicsComponent2D, and Lightbug.Utilities.PhysicsComponent3D.

◆ IgnoreLayerMaskCollision()

abstract void Lightbug.Utilities.PhysicsComponent.IgnoreLayerMaskCollision ( LayerMask  layerMask,
bool  ignore 
)
pure virtual

Ignores the collision between this object and a layer mask.

Implemented in Lightbug.Utilities.PhysicsComponent2D, and Lightbug.Utilities.PhysicsComponent3D.


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