Corgi Engine  v9.2
MoreMountains.Feedbacks.MMF_Rotation Class Reference

This feedback animates the rotation of the specified object when played More...

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

Public Types

enum  Modes { Modes.Absolute, Modes.Additive, Modes.ToDestination }
 the possible modes for this feedback (Absolute : always follow the curve from start to finish, Additive : add to the values found when this feedback gets played) More...
 
enum  TimeScales { TimeScales.Scaled, TimeScales.Unscaled }
 the timescale modes this feedback can operate on More...
 

Public Member Functions

override void OnDisable ()
 On disable we reset our coroutine More...
 
override void OnValidate ()
 On Validate, we migrate our deprecated animation curves to our tween types if needed More...
 

Public Attributes

override bool HasAutomatedTargetAcquisition => true
 sets the inspector color for this feedback More...
 
override bool CanForceInitialValue => true
 
Transform AnimateRotationTarget
 the object whose rotation you want to animate More...
 
Modes Mode = Modes.Absolute
 whether this feedback should animate in absolute values or additive More...
 
Space RotationSpace = Space.World
 whether this feedback should play on local or world rotation More...
 
float AnimateRotationDuration = 0.2f
 the duration of the transition More...
 
float RemapCurveZero = 0f
 the value to remap the curve's 0 value to More...
 
float RemapCurveOne = 360f
 the value to remap the curve's 1 value to More...
 
bool AnimateX = true
 if this is true, should animate the X rotation More...
 
MMTweenType AnimateRotationTweenX = new MMTweenType( new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(1, 0)), "AnimateX")
 how the x part of the rotation should animate over time, in degrees More...
 
bool AnimateY = true
 if this is true, should animate the Y rotation More...
 
MMTweenType AnimateRotationTweenY = new MMTweenType( new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(1, 0)), "AnimateY")
 how the y part of the rotation should animate over time, in degrees More...
 
bool AnimateZ = true
 if this is true, should animate the Z rotation More...
 
MMTweenType AnimateRotationTweenZ = new MMTweenType( new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(1, 0)), "AnimateZ")
 how the z part of the rotation should animate over time, in degrees More...
 
bool AllowAdditivePlays = false
 if this is true, calling that feedback will trigger it, even if it's in progress. If it's false, it'll prevent any new Play until the current one is over More...
 
bool DetermineRotationOnPlay = false
 if this is true, initial and destination rotations will be recomputed on every play More...
 
Space ToDestinationSpace = Space.World
 the space in which the ToDestination mode should operate More...
 
Vector3 DestinationAngles = new Vector3(0f, 180f, 0f)
 the angles to match when in ToDestination mode More...
 
MMTweenType ToDestinationTween = new MMTweenType(MMTween.MMTweenCurve.EaseInQuintic, "", "Mode", (int)Modes.ToDestination)
 how the x part of the rotation should animate over time, in degrees More...
 
override bool HasRandomness => true
 
AnimationCurve AnimateRotationX = null
 [DEPRECATED] how the x part of the rotation should animate over time, in degrees More...
 
AnimationCurve AnimateRotationY = null
 [DEPRECATED] how the y part of the rotation should animate over time, in degrees More...
 
AnimationCurve AnimateRotationZ = null
 [DEPRECATED] how the z part of the rotation should animate over time, in degrees More...
 
AnimationCurve ToDestinationCurve = null
 [DEPRECATED] the animation curve to use when animating to destination (individual x,y,z curves above won't be used) 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 GetInitialRotation ()
 Stores initial rotation for future use More...
 
override void CustomPlayFeedback (Vector3 position, float feedbacksIntensity=1.0f)
 On play, we trigger our rotation animation More...
 
virtual void ClearCoroutine ()
 
virtual IEnumerator RotateToDestination ()
 A coroutine used to rotate the target to its destination rotation More...
 
virtual IEnumerator AnimateRotation (Transform targetTransform, Vector3 vector, float duration, MMTweenType curveX, MMTweenType curveY, MMTweenType curveZ, float remapZero, float remapOne)
 A coroutine used to compute the rotation over time More...
 
virtual void ApplyRotation (Transform targetTransform, float remapZero, float remapOne, MMTweenType curveX, MMTweenType curveY, MMTweenType curveZ, float percent)
 Computes and applies the rotation to the object More...
 
override void CustomStopFeedback (Vector3 position, float feedbacksIntensity=1.0f)
 On stop, we interrupt movement if it was active More...
 
override void CustomRestoreInitialValues ()
 On restore, we restore our initial state More...
 

Protected Attributes

Quaternion _initialRotation
 
Vector3 _initialToDestinationAngles
 
Quaternion _destinationRotation
 
Coroutine _coroutine
 

Properties

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

Detailed Description

This feedback animates the rotation of the specified object when played

Member Enumeration Documentation

◆ Modes

the possible modes for this feedback (Absolute : always follow the curve from start to finish, Additive : add to the values found when this feedback gets played)

Enumerator
Absolute 
Additive 
ToDestination 

◆ TimeScales

the timescale modes this feedback can operate on

Enumerator
Scaled 
Unscaled 

Member Function Documentation

◆ AnimateRotation()

virtual IEnumerator MoreMountains.Feedbacks.MMF_Rotation.AnimateRotation ( Transform  targetTransform,
Vector3  vector,
float  duration,
MMTweenType  curveX,
MMTweenType  curveY,
MMTweenType  curveZ,
float  remapZero,
float  remapOne 
)
protectedvirtual

A coroutine used to compute the rotation over time

Parameters
targetTransform
vector
duration
curveX
curveY
curveZ
multiplier
Returns

◆ ApplyRotation()

virtual void MoreMountains.Feedbacks.MMF_Rotation.ApplyRotation ( Transform  targetTransform,
float  remapZero,
float  remapOne,
MMTweenType  curveX,
MMTweenType  curveY,
MMTweenType  curveZ,
float  percent 
)
protectedvirtual

Computes and applies the rotation to the object

Parameters
targetTransform
multiplier
curveX
curveY
curveZ
percent


◆ AutomateTargetAcquisition()

override void MoreMountains.Feedbacks.MMF_Rotation.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.

◆ ClearCoroutine()

virtual void MoreMountains.Feedbacks.MMF_Rotation.ClearCoroutine ( )
protectedvirtual

◆ CustomInitialization()

override void MoreMountains.Feedbacks.MMF_Rotation.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_Rotation.CustomPlayFeedback ( Vector3  position,
float  feedbacksIntensity = 1.0f 
)
protectedvirtual

On play, we trigger our rotation animation

Parameters
position
feedbacksIntensity

Implements MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomRestoreInitialValues()

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

On restore, we restore our initial state

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomStopFeedback()

override void MoreMountains.Feedbacks.MMF_Rotation.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.

◆ GetInitialRotation()

virtual void MoreMountains.Feedbacks.MMF_Rotation.GetInitialRotation ( )
protectedvirtual

Stores initial rotation for future use

◆ OnDisable()

override void MoreMountains.Feedbacks.MMF_Rotation.OnDisable ( )
virtual

On disable we reset our coroutine

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ OnValidate()

override void MoreMountains.Feedbacks.MMF_Rotation.OnValidate ( )
virtual

On Validate, we migrate our deprecated animation curves to our tween types if needed

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ RotateToDestination()

virtual IEnumerator MoreMountains.Feedbacks.MMF_Rotation.RotateToDestination ( )
protectedvirtual

A coroutine used to rotate the target to its destination rotation

Returns

Member Data Documentation

◆ _coroutine

Coroutine MoreMountains.Feedbacks.MMF_Rotation._coroutine
protected

◆ _destinationRotation

Quaternion MoreMountains.Feedbacks.MMF_Rotation._destinationRotation
protected

◆ _initialRotation

Quaternion MoreMountains.Feedbacks.MMF_Rotation._initialRotation
protected

◆ _initialToDestinationAngles

Vector3 MoreMountains.Feedbacks.MMF_Rotation._initialToDestinationAngles
protected

◆ AllowAdditivePlays

bool MoreMountains.Feedbacks.MMF_Rotation.AllowAdditivePlays = false

if this is true, calling that feedback will trigger it, even if it's in progress. If it's false, it'll prevent any new Play until the current one is over

◆ AnimateRotationDuration

float MoreMountains.Feedbacks.MMF_Rotation.AnimateRotationDuration = 0.2f

the duration of the transition

◆ AnimateRotationTarget

Transform MoreMountains.Feedbacks.MMF_Rotation.AnimateRotationTarget

the object whose rotation you want to animate

◆ AnimateRotationTweenX

MMTweenType MoreMountains.Feedbacks.MMF_Rotation.AnimateRotationTweenX = new MMTweenType( new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(1, 0)), "AnimateX")

how the x part of the rotation should animate over time, in degrees

◆ AnimateRotationTweenY

MMTweenType MoreMountains.Feedbacks.MMF_Rotation.AnimateRotationTweenY = new MMTweenType( new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(1, 0)), "AnimateY")

how the y part of the rotation should animate over time, in degrees

◆ AnimateRotationTweenZ

MMTweenType MoreMountains.Feedbacks.MMF_Rotation.AnimateRotationTweenZ = new MMTweenType( new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(1, 0)), "AnimateZ")

how the z part of the rotation should animate over time, in degrees

◆ AnimateRotationX

AnimationCurve MoreMountains.Feedbacks.MMF_Rotation.AnimateRotationX = null

[DEPRECATED] how the x part of the rotation should animate over time, in degrees

◆ AnimateRotationY

AnimationCurve MoreMountains.Feedbacks.MMF_Rotation.AnimateRotationY = null

[DEPRECATED] how the y part of the rotation should animate over time, in degrees

◆ AnimateRotationZ

AnimationCurve MoreMountains.Feedbacks.MMF_Rotation.AnimateRotationZ = null

[DEPRECATED] how the z part of the rotation should animate over time, in degrees

◆ AnimateX

bool MoreMountains.Feedbacks.MMF_Rotation.AnimateX = true

if this is true, should animate the X rotation

◆ AnimateY

bool MoreMountains.Feedbacks.MMF_Rotation.AnimateY = true

if this is true, should animate the Y rotation

◆ AnimateZ

bool MoreMountains.Feedbacks.MMF_Rotation.AnimateZ = true

if this is true, should animate the Z rotation

◆ CanForceInitialValue

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

◆ DestinationAngles

Vector3 MoreMountains.Feedbacks.MMF_Rotation.DestinationAngles = new Vector3(0f, 180f, 0f)

the angles to match when in ToDestination mode

◆ DetermineRotationOnPlay

bool MoreMountains.Feedbacks.MMF_Rotation.DetermineRotationOnPlay = false

if this is true, initial and destination rotations will be recomputed on every play

◆ FeedbackTypeAuthorized

bool MoreMountains.Feedbacks.MMF_Rotation.FeedbackTypeAuthorized = true
static

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

◆ HasAutomatedTargetAcquisition

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

sets the inspector color for this feedback

◆ HasRandomness

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

◆ Mode

Modes MoreMountains.Feedbacks.MMF_Rotation.Mode = Modes.Absolute

whether this feedback should animate in absolute values or additive

◆ RemapCurveOne

float MoreMountains.Feedbacks.MMF_Rotation.RemapCurveOne = 360f

the value to remap the curve's 1 value to

◆ RemapCurveZero

float MoreMountains.Feedbacks.MMF_Rotation.RemapCurveZero = 0f

the value to remap the curve's 0 value to

◆ RotationSpace

Space MoreMountains.Feedbacks.MMF_Rotation.RotationSpace = Space.World

whether this feedback should play on local or world rotation

◆ ToDestinationCurve

AnimationCurve MoreMountains.Feedbacks.MMF_Rotation.ToDestinationCurve = null

[DEPRECATED] the animation curve to use when animating to destination (individual x,y,z curves above won't be used)

◆ ToDestinationSpace

Space MoreMountains.Feedbacks.MMF_Rotation.ToDestinationSpace = Space.World

the space in which the ToDestination mode should operate

◆ ToDestinationTween

MMTweenType MoreMountains.Feedbacks.MMF_Rotation.ToDestinationTween = new MMTweenType(MMTween.MMTweenCurve.EaseInQuintic, "", "Mode", (int)Modes.ToDestination)

how the x part of the rotation should animate over time, in degrees

Property Documentation

◆ FeedbackDuration

override float MoreMountains.Feedbacks.MMF_Rotation.FeedbackDuration
getset

the duration of this feedback is the duration of the rotation


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