Infinite Runner Engine v1.9
Public Attributes | Protected Member Functions | Protected Attributes | List of all members
MoreMountains.Tools.MMPreventPassingThrough3D Class Reference

Prevents fast moving objects from going through colliders by casting a ray backwards after each movement More...

Inheritance diagram for MoreMountains.Tools.MMPreventPassingThrough3D:

Public Attributes

LayerMask ObstaclesLayerMask
 the layer mask to search obstacles on More...
 
float SkinWidth = 0.1f
 the bounds adjustment variable More...
 
bool RepositionRigidbody = true
 

Protected Member Functions

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 FixedUpdate ()
 On fixedUpdate, checks the last movement and if needed casts a ray to detect obstacles More...
 

Protected Attributes

float _smallestBoundsWidth
 
float _adjustedSmallestBoundsWidth
 
float _squaredBoundsWidth
 
Vector3 _positionLastFrame
 
Rigidbody _rigidbody
 
Collider _collider
 
Vector3 _lastMovement
 
float _lastMovementSquared
 

Detailed Description

Prevents fast moving objects from going through colliders by casting a ray backwards after each movement

Member Function Documentation

◆ FixedUpdate()

virtual void MoreMountains.Tools.MMPreventPassingThrough3D.FixedUpdate ( )
protectedvirtual

On fixedUpdate, checks the last movement and if needed casts a ray to detect obstacles

◆ Initialization()

virtual void MoreMountains.Tools.MMPreventPassingThrough3D.Initialization ( )
protectedvirtual

Grabs the rigidbody and computes the bounds width

◆ OnEnable()

virtual void MoreMountains.Tools.MMPreventPassingThrough3D.OnEnable ( )
protectedvirtual

On Enable, we initialize our last frame position

◆ Start()

virtual void MoreMountains.Tools.MMPreventPassingThrough3D.Start ( )
protectedvirtual

On Start we initialize our object

Member Data Documentation

◆ _adjustedSmallestBoundsWidth

float MoreMountains.Tools.MMPreventPassingThrough3D._adjustedSmallestBoundsWidth
protected

◆ _collider

Collider MoreMountains.Tools.MMPreventPassingThrough3D._collider
protected

◆ _lastMovement

Vector3 MoreMountains.Tools.MMPreventPassingThrough3D._lastMovement
protected

◆ _lastMovementSquared

float MoreMountains.Tools.MMPreventPassingThrough3D._lastMovementSquared
protected

◆ _positionLastFrame

Vector3 MoreMountains.Tools.MMPreventPassingThrough3D._positionLastFrame
protected

◆ _rigidbody

Rigidbody MoreMountains.Tools.MMPreventPassingThrough3D._rigidbody
protected

◆ _smallestBoundsWidth

float MoreMountains.Tools.MMPreventPassingThrough3D._smallestBoundsWidth
protected

◆ _squaredBoundsWidth

float MoreMountains.Tools.MMPreventPassingThrough3D._squaredBoundsWidth
protected

◆ ObstaclesLayerMask

LayerMask MoreMountains.Tools.MMPreventPassingThrough3D.ObstaclesLayerMask

the layer mask to search obstacles on

◆ RepositionRigidbody

bool MoreMountains.Tools.MMPreventPassingThrough3D.RepositionRigidbody = true

◆ SkinWidth

float MoreMountains.Tools.MMPreventPassingThrough3D.SkinWidth = 0.1f

the bounds adjustment variable


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