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

This feedback will let you animate the rotation of a transform to look at a target over time. You can also use it to broadcast a MMLookAtShake event, that MMLookAtShakers on the right channel will be able to listen for and act upon More...

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

Public Types

enum  Modes { Modes.Direct, Modes.Event }
 the possible modes for this feedback, either directly targeting a transform, or broadcasting an event More...
 
enum  LookAtTargetModes { LookAtTargetModes.Transform, LookAtTargetModes.TargetWorldPosition, LookAtTargetModes.Direction }
 whether to look at a specific transform, at a position in the world, or at a direction vector More...
 
enum  UpwardVectors { UpwardVectors.Forward, UpwardVectors.Up, UpwardVectors.Right }
 the vector to consider as "up" when looking at a direction More...
 

Public Attributes

override bool HasChannel => true
 
override bool HasRange => true
 
float Duration = 1f
 the duration of this feedback, in seconds More...
 
MMTweenType LookAtTween = new MMTweenType( new AnimationCurve(new Keyframe(0, 0), new Keyframe(1, 1)))
 the curve over which to animate the look at transition More...
 
bool LockXAxis = false
 whether or not to lock rotation on the x axis More...
 
bool LockYAxis = false
 whether or not to lock rotation on the y axis More...
 
bool LockZAxis = false
 whether or not to lock rotation on the z axis More...
 
Modes Mode = Modes.Direct
 whether to make a certain transform look at a target, or to broadcast an event More...
 
Transform TransformToRotate
 in Direct mode, the transform to rotate to have it look at our target More...
 
UpwardVectors UpwardVector = UpwardVectors.Up
 the vector representing the up direction on the object we want to rotate and look at our target More...
 
bool ResetShakerValuesAfterShake = true
 whether or not to reset shaker values after shake More...
 
bool ResetTargetValuesAfterShake = true
 whether or not to reset the target's values after shake More...
 
LookAtTargetModes LookAtTargetMode = LookAtTargetModes.Transform
 the different target modes : either a specific transform to look at, the coordinates of a world position, or a direction vector More...
 
Transform LookAtTarget
 the transform we want to look at More...
 
Vector3 LookAtTargetWorldPosition = Vector3.forward
 the coordinates of a point the world that we want to look at More...
 
Vector3 LookAtDirection = Vector3.forward
 a direction (from our rotating object) that we want to look at 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 CustomInitialization (MMF_Player owner)
 On init we initialize our upwards vector More...
 
override void CustomPlayFeedback (Vector3 position, float feedbacksIntensity=1.0f)
 On Play we start looking at our target More...
 
virtual void InitiateLookAt (Vector3 position)
 Depending on our selected mode, initiates the lookat by starting a coroutine or broadcasting an event More...
 
virtual IEnumerator AnimateLookAt ()
 Animates look at direction over time More...
 
virtual void ApplyRotation (float percent)
 Applies rotation at the specified time along the journey More...
 
override void CustomStopFeedback (Vector3 position, float feedbacksIntensity=1)
 On Stop we stop our movement if we had one going (only in Direct mode) More...
 
virtual void ClearCoroutine ()
 Clears the current coroutine More...
 
override void CustomRestoreInitialValues ()
 On restore, we restore our initial state More...
 

Protected Attributes

Coroutine _coroutine
 
Quaternion _initialDirectTargetTransformRotation
 
Quaternion _newRotation
 
Vector3 _lookAtPosition
 
Vector3 _upwards
 
Vector3 _direction
 
Quaternion _initialRotation
 

Properties

override float FeedbackDuration [get, set]
 sets the inspector color for this feedback More...
 

Additional Inherited Members

Detailed Description

This feedback will let you animate the rotation of a transform to look at a target over time. You can also use it to broadcast a MMLookAtShake event, that MMLookAtShakers on the right channel will be able to listen for and act upon

Member Enumeration Documentation

◆ LookAtTargetModes

whether to look at a specific transform, at a position in the world, or at a direction vector

Enumerator
Transform 
TargetWorldPosition 
Direction 

◆ Modes

the possible modes for this feedback, either directly targeting a transform, or broadcasting an event

Enumerator
Direct 
Event 

◆ UpwardVectors

the vector to consider as "up" when looking at a direction

Enumerator
Forward 
Up 
Right 

Member Function Documentation

◆ AnimateLookAt()

virtual IEnumerator MoreMountains.Feedbacks.MMF_LookAt.AnimateLookAt ( )
protectedvirtual

Animates look at direction over time

Returns

◆ ApplyRotation()

virtual void MoreMountains.Feedbacks.MMF_LookAt.ApplyRotation ( float  percent)
protectedvirtual

Applies rotation at the specified time along the journey

Parameters
percent

◆ ClearCoroutine()

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

Clears the current coroutine

◆ CustomInitialization()

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

On init we initialize our upwards vector

Parameters
owner

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomPlayFeedback()

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

On Play we start looking at our target

Parameters
position
feedbacksIntensity

Implements MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomRestoreInitialValues()

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

On restore, we restore our initial state

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomStopFeedback()

override void MoreMountains.Feedbacks.MMF_LookAt.CustomStopFeedback ( Vector3  position,
float  feedbacksIntensity = 1 
)
protectedvirtual

On Stop we stop our movement if we had one going (only in Direct mode)

Parameters
position
feedbacksIntensity

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ InitiateLookAt()

virtual void MoreMountains.Feedbacks.MMF_LookAt.InitiateLookAt ( Vector3  position)
protectedvirtual

Depending on our selected mode, initiates the lookat by starting a coroutine or broadcasting an event

Parameters
position

Member Data Documentation

◆ _coroutine

Coroutine MoreMountains.Feedbacks.MMF_LookAt._coroutine
protected

◆ _direction

Vector3 MoreMountains.Feedbacks.MMF_LookAt._direction
protected

◆ _initialDirectTargetTransformRotation

Quaternion MoreMountains.Feedbacks.MMF_LookAt._initialDirectTargetTransformRotation
protected

◆ _initialRotation

Quaternion MoreMountains.Feedbacks.MMF_LookAt._initialRotation
protected

◆ _lookAtPosition

Vector3 MoreMountains.Feedbacks.MMF_LookAt._lookAtPosition
protected

◆ _newRotation

Quaternion MoreMountains.Feedbacks.MMF_LookAt._newRotation
protected

◆ _upwards

Vector3 MoreMountains.Feedbacks.MMF_LookAt._upwards
protected

◆ Duration

float MoreMountains.Feedbacks.MMF_LookAt.Duration = 1f

the duration of this feedback, in seconds

◆ FeedbackTypeAuthorized

bool MoreMountains.Feedbacks.MMF_LookAt.FeedbackTypeAuthorized = true
static

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

◆ HasChannel

override bool MoreMountains.Feedbacks.MMF_LookAt.HasChannel => true

◆ HasRange

override bool MoreMountains.Feedbacks.MMF_LookAt.HasRange => true

◆ LockXAxis

bool MoreMountains.Feedbacks.MMF_LookAt.LockXAxis = false

whether or not to lock rotation on the x axis

◆ LockYAxis

bool MoreMountains.Feedbacks.MMF_LookAt.LockYAxis = false

whether or not to lock rotation on the y axis

◆ LockZAxis

bool MoreMountains.Feedbacks.MMF_LookAt.LockZAxis = false

whether or not to lock rotation on the z axis

◆ LookAtDirection

Vector3 MoreMountains.Feedbacks.MMF_LookAt.LookAtDirection = Vector3.forward

a direction (from our rotating object) that we want to look at

◆ LookAtTarget

Transform MoreMountains.Feedbacks.MMF_LookAt.LookAtTarget

the transform we want to look at

◆ LookAtTargetMode

LookAtTargetModes MoreMountains.Feedbacks.MMF_LookAt.LookAtTargetMode = LookAtTargetModes.Transform

the different target modes : either a specific transform to look at, the coordinates of a world position, or a direction vector

◆ LookAtTargetWorldPosition

Vector3 MoreMountains.Feedbacks.MMF_LookAt.LookAtTargetWorldPosition = Vector3.forward

the coordinates of a point the world that we want to look at

◆ LookAtTween

MMTweenType MoreMountains.Feedbacks.MMF_LookAt.LookAtTween = new MMTweenType( new AnimationCurve(new Keyframe(0, 0), new Keyframe(1, 1)))

the curve over which to animate the look at transition

◆ Mode

Modes MoreMountains.Feedbacks.MMF_LookAt.Mode = Modes.Direct

whether to make a certain transform look at a target, or to broadcast an event

◆ ResetShakerValuesAfterShake

bool MoreMountains.Feedbacks.MMF_LookAt.ResetShakerValuesAfterShake = true

whether or not to reset shaker values after shake

◆ ResetTargetValuesAfterShake

bool MoreMountains.Feedbacks.MMF_LookAt.ResetTargetValuesAfterShake = true

whether or not to reset the target's values after shake

◆ TransformToRotate

Transform MoreMountains.Feedbacks.MMF_LookAt.TransformToRotate

in Direct mode, the transform to rotate to have it look at our target

◆ UpwardVector

UpwardVectors MoreMountains.Feedbacks.MMF_LookAt.UpwardVector = UpwardVectors.Up

the vector representing the up direction on the object we want to rotate and look at our target

Property Documentation

◆ FeedbackDuration

override float MoreMountains.Feedbacks.MMF_LookAt.FeedbackDuration
getset

sets the inspector color for this feedback

the duration of this feedback is the duration of the movement, in seconds


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