Feel
5.1
The best way to improve your game's feel and make it extra juicy
|
Prevents fast moving objects from going through colliders by casting a ray backwards after each movement More...
Public Types | |
enum | AdjustmentAxis { AdjustmentAxis.Auto, AdjustmentAxis.X, AdjustmentAxis.Y, AdjustmentAxis.Z } |
Public Attributes | |
LayerMask | ObstaclesLayerMask |
the layer mask to search obstacles on More... | |
float | SkinWidth = 0.1f |
the bounds adjustment variable More... | |
bool | RepositionRigidbody = true |
LayerMask | RepositionRigidbodyLayerMask |
the layer mask to filter when to reposition rigidbody More... | |
AdjustmentAxis | Adjustment = AdjustmentAxis.Auto |
the local axis of the collider to use for adjustment (usually you'll want to use the axis the object is moving on) More... | |
Protected Member Functions | |
virtual void | OnValidate () |
virtual void | Start () |
On Start we initialize our object More... | |
virtual void | Initialization () |
Grabs the rigidbody and computes the bounds width More... | |
virtual float | ComputeAdjustmentDistance () |
Determines the adjustment distance, over which we decide whether or not we've moved too far 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 | _adjustmentDistance |
float | _adjustedDistance |
float | _squaredBoundsWidth |
Vector3 | _positionLastFrame |
Rigidbody | _rigidbody |
Collider | _collider |
Vector3 | _lastMovement |
float | _lastMovementSquared |
Prevents fast moving objects from going through colliders by casting a ray backwards after each movement
|
protectedvirtual |
Determines the adjustment distance, over which we decide whether or not we've moved too far
|
protectedvirtual |
On fixedUpdate, checks the last movement and if needed casts a ray to detect obstacles
|
protectedvirtual |
Grabs the rigidbody and computes the bounds width
|
protectedvirtual |
On Enable, we initialize our last frame position
|
protectedvirtual |
|
protectedvirtual |
On Start we initialize our object
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
AdjustmentAxis MoreMountains.Tools.MMPreventPassingThrough3D.Adjustment = AdjustmentAxis.Auto |
the local axis of the collider to use for adjustment (usually you'll want to use the axis the object is moving on)
LayerMask MoreMountains.Tools.MMPreventPassingThrough3D.ObstaclesLayerMask |
the layer mask to search obstacles on
bool MoreMountains.Tools.MMPreventPassingThrough3D.RepositionRigidbody = true |
LayerMask MoreMountains.Tools.MMPreventPassingThrough3D.RepositionRigidbodyLayerMask |
the layer mask to filter when to reposition rigidbody
float MoreMountains.Tools.MMPreventPassingThrough3D.SkinWidth = 0.1f |
the bounds adjustment variable