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

This component is an encapsulation of the Physics and Physics2D classes, that serves as a physcics utility class. 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 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 SimpleRaycast (out HitInfo hitInfo, Vector3 origin, Vector3 castDisplacement, in HitInfoFilter filter)
 Raycast wrapper for 2D/3D physics. More...
 
abstract int Raycast (out HitInfo hitInfo, Vector3 origin, Vector3 castDisplacement, in HitInfoFilter filter)
 RaycastAll wrapper for 2D/3D physics. More...
 
abstract int SphereCast (out HitInfo hitInfo, Vector3 center, float radius, Vector3 castDisplacement, in HitInfoFilter filter)
 SphereCastAll wrapper for 2D/3D physics. More...
 
abstract int CapsuleCast (out HitInfo hitInfo, Vector3 bottom, Vector3 top, float radius, Vector3 castDisplacement, in HitInfoFilter filter)
 CapsuleCastAll wrapper for 2D/3D physics. More...
 
abstract int BoxCast (out HitInfo hitInfo, Vector3 center, Vector3 size, Vector3 castDisplacement, Quaternion orientation, in HitInfoFilter filter)
 BoxCastAll wrapper for 2D/3D physics. It returns (by reference) the closest hit. More...
 
abstract int BoxCast (Vector3 center, Vector3 size, Vector3 castDisplacement, Quaternion orientation, in HitInfoFilter filter)
 BoxCastAll wrapper for 2D/3D physics. It doesn't return any particular hit, instead, it updates all the hits from the buffer (HitInfo array). This buffer can be obtained via the HitsBuffer property. More...
 
abstract bool OverlapSphere (Vector3 center, float radius, in HitInfoFilter filter)
 OverlapSphere wrapper for 2D/3D physics. More...
 
abstract bool OverlapCapsule (Vector3 bottom, Vector3 top, float radius, in HitInfoFilter filter)
 OverlapCapsule wrapper for 2D/3D physics. More...
 

Static Public Member Functions

static PhysicsComponent CreateInstance (GameObject gameObject)
 

Protected Member Functions

abstract LayerMask GetCollisionLayerMask ()
 
abstract void IgnoreOverlappedColliders (LayerMask ignoredLayerMask)
 
abstract void GetClosestHit (out HitInfo hitInfo, Vector3 castDisplacement, in HitInfoFilter filter)
 
virtual void Awake ()
 
virtual void Start ()
 

Protected Attributes

int hits = 0
 
bool ignoreCollisionMessages = false
 
bool wasKinematic = false
 

Properties

HitInfo [] HitsBuffer = new HitInfo[20] [get, protected set]
 
List< ContactContacts = new List<Contact>(20) [get, protected set]
 Gets a list with all the current contacts. More...
 
List< TriggerTriggers = new List<Trigger>(20) [get, protected set]
 Gets a list with all the current triggers. More...
 
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). More...
 

Detailed Description

This component is an encapsulation of the Physics and Physics2D classes, that serves as a physcics utility class.

Member Function Documentation

◆ BoxCast() [1/2]

abstract int Lightbug.Utilities.PhysicsComponent.BoxCast ( out HitInfo  hitInfo,
Vector3  center,
Vector3  size,
Vector3  castDisplacement,
Quaternion  orientation,
in HitInfoFilter  filter 
)
pure virtual

BoxCastAll wrapper for 2D/3D physics. It returns (by reference) the closest hit.

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

◆ BoxCast() [2/2]

abstract int Lightbug.Utilities.PhysicsComponent.BoxCast ( Vector3  center,
Vector3  size,
Vector3  castDisplacement,
Quaternion  orientation,
in HitInfoFilter  filter 
)
pure virtual

BoxCastAll wrapper for 2D/3D physics. It doesn't return any particular hit, instead, it updates all the hits from the buffer (HitInfo array). This buffer can be obtained via the HitsBuffer property.

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

◆ CapsuleCast()

abstract int Lightbug.Utilities.PhysicsComponent.CapsuleCast ( out HitInfo  hitInfo,
Vector3  bottom,
Vector3  top,
float  radius,
Vector3  castDisplacement,
in HitInfoFilter  filter 
)
pure virtual

CapsuleCastAll wrapper for 2D/3D physics.

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

◆ IgnoreCollision()

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.

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

◆ OverlapCapsule()

abstract bool Lightbug.Utilities.PhysicsComponent.OverlapCapsule ( Vector3  bottom,
Vector3  top,
float  radius,
in HitInfoFilter  filter 
)
pure virtual

OverlapCapsule wrapper for 2D/3D physics.

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

◆ OverlapSphere()

abstract bool Lightbug.Utilities.PhysicsComponent.OverlapSphere ( Vector3  center,
float  radius,
in HitInfoFilter  filter 
)
pure virtual

OverlapSphere wrapper for 2D/3D physics.

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

◆ Raycast()

abstract int Lightbug.Utilities.PhysicsComponent.Raycast ( out HitInfo  hitInfo,
Vector3  origin,
Vector3  castDisplacement,
in HitInfoFilter  filter 
)
pure virtual

RaycastAll wrapper for 2D/3D physics.

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

◆ SimpleRaycast()

abstract bool Lightbug.Utilities.PhysicsComponent.SimpleRaycast ( out HitInfo  hitInfo,
Vector3  origin,
Vector3  castDisplacement,
in HitInfoFilter  filter 
)
pure virtual

Raycast wrapper for 2D/3D physics.

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

◆ SphereCast()

abstract int Lightbug.Utilities.PhysicsComponent.SphereCast ( out HitInfo  hitInfo,
Vector3  center,
float  radius,
Vector3  castDisplacement,
in HitInfoFilter  filter 
)
pure virtual

SphereCastAll wrapper for 2D/3D physics.

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

Property Documentation

◆ CollisionLayerMask

LayerMask Lightbug.Utilities.PhysicsComponent.CollisionLayerMask = 0
getprotected set

Returns a layer mask with all the valid collisions associated with the object, based on the collision matrix (physics settings).

◆ Contacts

List<Contact> Lightbug.Utilities.PhysicsComponent.Contacts = new List<Contact>(20)
getprotected set

Gets a list with all the current contacts.

◆ Triggers

List<Trigger> Lightbug.Utilities.PhysicsComponent.Triggers = new List<Trigger>(20)
getprotected set

Gets a list with all the current triggers.


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