Prevents fast moving objects from going through colliders by casting a ray backwards after each movement
More...
|
virtual void | Start () |
| On Start we initialize our object More...
|
|
virtual void | Initialization () |
| Grabs the rigidbody and computes the bounds width More...
|
|
virtual void | OnEnable () |
| On Enable, we initialize our last frame position More...
|
|
virtual void | Update () |
| On fixedUpdate, checks the last movement and if needed casts a ray to detect obstacles More...
|
|
Prevents fast moving objects from going through colliders by casting a ray backwards after each movement
◆ Initialization()
virtual void MoreMountains.Tools.MMPreventPassingThrough2D.Initialization |
( |
| ) |
|
|
protectedvirtual |
Grabs the rigidbody and computes the bounds width
◆ OnEnable()
virtual void MoreMountains.Tools.MMPreventPassingThrough2D.OnEnable |
( |
| ) |
|
|
protectedvirtual |
On Enable, we initialize our last frame position
◆ Start()
virtual void MoreMountains.Tools.MMPreventPassingThrough2D.Start |
( |
| ) |
|
|
protectedvirtual |
On Start we initialize our object
◆ Update()
virtual void MoreMountains.Tools.MMPreventPassingThrough2D.Update |
( |
| ) |
|
|
protectedvirtual |
On fixedUpdate, checks the last movement and if needed casts a ray to detect obstacles
◆ _adjustedSmallestBoundsWidth
float MoreMountains.Tools.MMPreventPassingThrough2D._adjustedSmallestBoundsWidth |
|
protected |
◆ _collider
Collider2D MoreMountains.Tools.MMPreventPassingThrough2D._collider |
|
protected |
◆ _lastMovement
Vector2 MoreMountains.Tools.MMPreventPassingThrough2D._lastMovement |
|
protected |
◆ _lastMovementSquared
float MoreMountains.Tools.MMPreventPassingThrough2D._lastMovementSquared |
|
protected |
◆ _positionLastFrame
Vector3 MoreMountains.Tools.MMPreventPassingThrough2D._positionLastFrame |
|
protected |
◆ _rigidbody
Rigidbody2D MoreMountains.Tools.MMPreventPassingThrough2D._rigidbody |
|
protected |
◆ _smallestBoundsWidth
float MoreMountains.Tools.MMPreventPassingThrough2D._smallestBoundsWidth |
|
protected |
◆ _squaredBoundsWidth
float MoreMountains.Tools.MMPreventPassingThrough2D._squaredBoundsWidth |
|
protected |
◆ Hit
RaycastHit2D MoreMountains.Tools.MMPreventPassingThrough2D.Hit |
◆ ObstaclesLayerMask
LayerMask MoreMountains.Tools.MMPreventPassingThrough2D.ObstaclesLayerMask |
the layer mask to search obstacles on
◆ RepositionRigidbody
bool MoreMountains.Tools.MMPreventPassingThrough2D.RepositionRigidbody = true |
◆ SkinWidth
float MoreMountains.Tools.MMPreventPassingThrough2D.SkinWidth = 0.1f |
the bounds adjustment variable
The documentation for this class was generated from the following file: