Feel  4.3
The best way to improve your game's feel and make it extra juicy
MoreMountains.Feedbacks.MMF_RotationSpring Class Reference

This feedback will let you animate the rotation of the target object over time, with a spring effect More...

Inheritance diagram for MoreMountains.Feedbacks.MMF_RotationSpring:
MoreMountains.Feedbacks.MMF_Feedback

Public Types

enum  Modes { Modes.MoveTo, Modes.MoveToAdditive, Modes.Bump }
 

Public Attributes

override bool HasAutomatedTargetAcquisition => true
 sets the inspector color for this feedback More...
 
override bool CanForceInitialValue => true
 
override bool HasRandomness => true
 
Transform AnimateRotationTarget
 the object to animate More...
 
float DeclaredDuration = 0f
 spring duration is determined by the spring (and could be impacted real time), so it's up to you to determine how long this feedback should last, from the point of view of its parent MMF Player More...
 
Space RotationSpace = Space.World
 whether this feedback should play on local or world rotation More...
 
float DampingX = 0.4f
 the dumping ratio determines how fast the spring will evolve after a disturbance. At a low value, it'll oscillate for a long time, while closer to 1 it'll stop oscillating quickly More...
 
float FrequencyX = 6f
 the frequency determines how fast the spring will oscillate when disturbed, low frequency means less oscillations per second, high frequency means more oscillations per second More...
 
float DampingY = 0.4f
 the dumping ratio determines how fast the spring will evolve after a disturbance. At a low value, it'll oscillate for a long time, while closer to 1 it'll stop oscillating quickly More...
 
float FrequencyY = 6f
 the frequency determines how fast the spring will oscillate when disturbed, low frequency means less oscillations per second, high frequency means more oscillations per second More...
 
float DampingZ = 0.4f
 the dumping ratio determines how fast the spring will evolve after a disturbance. At a low value, it'll oscillate for a long time, while closer to 1 it'll stop oscillating quickly More...
 
float FrequencyZ = 6f
 the frequency determines how fast the spring will oscillate when disturbed, low frequency means less oscillations per second, high frequency means more oscillations per second More...
 
Modes Mode = Modes.Bump
 the chosen mode for this spring. MoveTo will move the target the specified rotation (randomized between min and max). MoveToAdditive will add the specified rotation (randomized between min and max) to the target's current rotation. Bump will bump the target's rotation by the specified power (randomized between min and max) More...
 
Vector3 MoveToRotationMin = new Vector3(45f, 0f, 0f)
 the min value from which to pick a random target value when in MoveTo or MoveToAdditive modes More...
 
Vector3 MoveToRotationMax = new Vector3(90f, 0f, 0f)
 the max value from which to pick a random target value when in MoveTo or MoveToAdditive modes More...
 
Vector3 BumpRotationMin = new Vector3(2000f, 2000f, 0f)
 the min value from which to pick a random bump amount when in Bump mode More...
 
Vector3 BumpRotationMax = new Vector3(3000f, 3000f, 0f)
 the max value from which to pick a random bump amount when in Bump mode More...
 

Static Public Attributes

static bool FeedbackTypeAuthorized = true
 a static bool used to disable all feedbacks of this type at once More...
 

Protected Member Functions

override void AutomateTargetAcquisition ()
 A method meant to be implemented per feedback letting you specify what happens (usually setting a target) More...
 
override void CustomInitialization (MMF_Player owner)
 On init we store our initial rotation More...
 
virtual void GetInitialValues ()
 Stores initial rotation for future use More...
 
override void CustomPlayFeedback (Vector3 position, float feedbacksIntensity=1.0f)
 On Play, triggers the rotation animation More...
 
virtual IEnumerator Spring ()
 a coroutine running on the Owner used to move the spring More...
 
virtual void UpdateSpring ()
 Updates the spring's values More...
 
virtual void ApplyValue ()
 Applies the current spring value to the target More...
 
override void CustomStopFeedback (Vector3 position, float feedbacksIntensity=1.0f)
 On stop, we interrupt movement if it was active More...
 
override void CustomSkipToTheEnd (Vector3 position, float feedbacksIntensity=1.0f)
 Skips to the end, matching the target value More...
 
override void CustomRestoreInitialValues ()
 On restore, we restore our initial state More...
 

Protected Attributes

Vector3 _currentValue = Vector3.zero
 
Vector3 _targetValue = Vector3.zero
 
Vector3 _velocity = Vector3.zero
 
Vector3 _initialRotation
 
virtual bool LowVelocity => (Mathf.Abs(_velocity.x) + Mathf.Abs(_velocity.y) + Mathf.Abs(_velocity.z)) < _velocityLowThreshold
 
Coroutine _coroutine
 
float _velocityLowThreshold = 0.001f
 

Properties

override float FeedbackDuration [get, set]
 the duration of this feedback is the duration of the rotation animation More...
 

Additional Inherited Members

Detailed Description

This feedback will let you animate the rotation of the target object over time, with a spring effect

Member Enumeration Documentation

◆ Modes

Enumerator
MoveTo 
MoveToAdditive 
Bump 

Member Function Documentation

◆ ApplyValue()

virtual void MoreMountains.Feedbacks.MMF_RotationSpring.ApplyValue ( )
protectedvirtual

Applies the current spring value to the target

◆ AutomateTargetAcquisition()

override void MoreMountains.Feedbacks.MMF_RotationSpring.AutomateTargetAcquisition ( )
protectedvirtual

A method meant to be implemented per feedback letting you specify what happens (usually setting a target)

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomInitialization()

override void MoreMountains.Feedbacks.MMF_RotationSpring.CustomInitialization ( MMF_Player  owner)
protectedvirtual

On init we store our initial rotation

Parameters
owner

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomPlayFeedback()

override void MoreMountains.Feedbacks.MMF_RotationSpring.CustomPlayFeedback ( Vector3  position,
float  feedbacksIntensity = 1.0f 
)
protectedvirtual

On Play, triggers the rotation animation

Parameters
position
feedbacksIntensity

Implements MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomRestoreInitialValues()

override void MoreMountains.Feedbacks.MMF_RotationSpring.CustomRestoreInitialValues ( )
protectedvirtual

On restore, we restore our initial state

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomSkipToTheEnd()

override void MoreMountains.Feedbacks.MMF_RotationSpring.CustomSkipToTheEnd ( Vector3  position,
float  feedbacksIntensity = 1.0f 
)
protectedvirtual

Skips to the end, matching the target value

Parameters
position
feedbacksIntensity

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomStopFeedback()

override void MoreMountains.Feedbacks.MMF_RotationSpring.CustomStopFeedback ( Vector3  position,
float  feedbacksIntensity = 1.0f 
)
protectedvirtual

On stop, we interrupt movement if it was active

Parameters
position
feedbacksIntensity

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ GetInitialValues()

virtual void MoreMountains.Feedbacks.MMF_RotationSpring.GetInitialValues ( )
protectedvirtual

Stores initial rotation for future use

◆ Spring()

virtual IEnumerator MoreMountains.Feedbacks.MMF_RotationSpring.Spring ( )
protectedvirtual

a coroutine running on the Owner used to move the spring

Returns

◆ UpdateSpring()

virtual void MoreMountains.Feedbacks.MMF_RotationSpring.UpdateSpring ( )
protectedvirtual

Updates the spring's values

Member Data Documentation

◆ _coroutine

Coroutine MoreMountains.Feedbacks.MMF_RotationSpring._coroutine
protected

◆ _currentValue

Vector3 MoreMountains.Feedbacks.MMF_RotationSpring._currentValue = Vector3.zero
protected

◆ _initialRotation

Vector3 MoreMountains.Feedbacks.MMF_RotationSpring._initialRotation
protected

◆ _targetValue

Vector3 MoreMountains.Feedbacks.MMF_RotationSpring._targetValue = Vector3.zero
protected

◆ _velocity

Vector3 MoreMountains.Feedbacks.MMF_RotationSpring._velocity = Vector3.zero
protected

◆ _velocityLowThreshold

float MoreMountains.Feedbacks.MMF_RotationSpring._velocityLowThreshold = 0.001f
protected

◆ AnimateRotationTarget

Transform MoreMountains.Feedbacks.MMF_RotationSpring.AnimateRotationTarget

the object to animate

◆ BumpRotationMax

Vector3 MoreMountains.Feedbacks.MMF_RotationSpring.BumpRotationMax = new Vector3(3000f, 3000f, 0f)

the max value from which to pick a random bump amount when in Bump mode

◆ BumpRotationMin

Vector3 MoreMountains.Feedbacks.MMF_RotationSpring.BumpRotationMin = new Vector3(2000f, 2000f, 0f)

the min value from which to pick a random bump amount when in Bump mode

◆ CanForceInitialValue

override bool MoreMountains.Feedbacks.MMF_RotationSpring.CanForceInitialValue => true

◆ DampingX

float MoreMountains.Feedbacks.MMF_RotationSpring.DampingX = 0.4f

the dumping ratio determines how fast the spring will evolve after a disturbance. At a low value, it'll oscillate for a long time, while closer to 1 it'll stop oscillating quickly

◆ DampingY

float MoreMountains.Feedbacks.MMF_RotationSpring.DampingY = 0.4f

the dumping ratio determines how fast the spring will evolve after a disturbance. At a low value, it'll oscillate for a long time, while closer to 1 it'll stop oscillating quickly

◆ DampingZ

float MoreMountains.Feedbacks.MMF_RotationSpring.DampingZ = 0.4f

the dumping ratio determines how fast the spring will evolve after a disturbance. At a low value, it'll oscillate for a long time, while closer to 1 it'll stop oscillating quickly

◆ DeclaredDuration

float MoreMountains.Feedbacks.MMF_RotationSpring.DeclaredDuration = 0f

spring duration is determined by the spring (and could be impacted real time), so it's up to you to determine how long this feedback should last, from the point of view of its parent MMF Player

◆ FeedbackTypeAuthorized

bool MoreMountains.Feedbacks.MMF_RotationSpring.FeedbackTypeAuthorized = true
static

a static bool used to disable all feedbacks of this type at once

◆ FrequencyX

float MoreMountains.Feedbacks.MMF_RotationSpring.FrequencyX = 6f

the frequency determines how fast the spring will oscillate when disturbed, low frequency means less oscillations per second, high frequency means more oscillations per second

◆ FrequencyY

float MoreMountains.Feedbacks.MMF_RotationSpring.FrequencyY = 6f

the frequency determines how fast the spring will oscillate when disturbed, low frequency means less oscillations per second, high frequency means more oscillations per second

◆ FrequencyZ

float MoreMountains.Feedbacks.MMF_RotationSpring.FrequencyZ = 6f

the frequency determines how fast the spring will oscillate when disturbed, low frequency means less oscillations per second, high frequency means more oscillations per second

◆ HasAutomatedTargetAcquisition

override bool MoreMountains.Feedbacks.MMF_RotationSpring.HasAutomatedTargetAcquisition => true

sets the inspector color for this feedback

◆ HasRandomness

override bool MoreMountains.Feedbacks.MMF_RotationSpring.HasRandomness => true

◆ LowVelocity

virtual bool MoreMountains.Feedbacks.MMF_RotationSpring.LowVelocity => (Mathf.Abs(_velocity.x) + Mathf.Abs(_velocity.y) + Mathf.Abs(_velocity.z)) < _velocityLowThreshold
protected

◆ Mode

Modes MoreMountains.Feedbacks.MMF_RotationSpring.Mode = Modes.Bump

the chosen mode for this spring. MoveTo will move the target the specified rotation (randomized between min and max). MoveToAdditive will add the specified rotation (randomized between min and max) to the target's current rotation. Bump will bump the target's rotation by the specified power (randomized between min and max)

◆ MoveToRotationMax

Vector3 MoreMountains.Feedbacks.MMF_RotationSpring.MoveToRotationMax = new Vector3(90f, 0f, 0f)

the max value from which to pick a random target value when in MoveTo or MoveToAdditive modes

◆ MoveToRotationMin

Vector3 MoreMountains.Feedbacks.MMF_RotationSpring.MoveToRotationMin = new Vector3(45f, 0f, 0f)

the min value from which to pick a random target value when in MoveTo or MoveToAdditive modes

◆ RotationSpace

Space MoreMountains.Feedbacks.MMF_RotationSpring.RotationSpace = Space.World

whether this feedback should play on local or world rotation

Property Documentation

◆ FeedbackDuration

override float MoreMountains.Feedbacks.MMF_RotationSpring.FeedbackDuration
getset

the duration of this feedback is the duration of the rotation animation


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