TopDown Engine v4.5
Loading...
Searching...
No Matches
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 { Direct , Event }
 the possible modes for this feedback, either directly targeting a transform, or broadcasting an event More...
enum  LookAtTargetModes { Transform , TargetWorldPosition , Direction }
 whether to look at a specific transform, at a position in the world, or at a direction vector More...
enum  UpwardVectors { Forward , Up , Right }
 the vector to consider as "up" when looking at a direction More...

Public Attributes

float Duration = 1f
 the duration of this feedback, in seconds
MMTweenType LookAtTween = new MMTweenType( new AnimationCurve(new Keyframe(0, 0), new Keyframe(1, 1)))
 the curve over which to animate the look at transition
bool LockXAxis = false
 whether or not to lock rotation on the x axis
bool LockYAxis = false
 whether or not to lock rotation on the y axis
bool LockZAxis = false
 whether or not to lock rotation on the z axis
Modes Mode = Modes.Direct
 whether to make a certain transform look at a target, or to broadcast an event
Transform TransformToRotate
 in Direct mode, the transform to rotate to have it look at our target
UpwardVectors UpwardVector = UpwardVectors.Up
 the vector representing the up direction on the object we want to rotate and look at our target
bool ResetShakerValuesAfterShake = true
 whether or not to reset shaker values after shake
bool ResetTargetValuesAfterShake = true
 whether or not to reset the target's values after shake
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
Transform LookAtTarget
 the transform we want to look at
Vector3 LookAtTargetWorldPosition = Vector3.forward
 the coordinates of a point the world that we want to look at
Vector3 LookAtDirection = Vector3.forward
 a direction (from our rotating object) that we want to look at

Static Public Attributes

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

Protected Member Functions

override void CustomInitialization (MMF_Player owner)
 On init we initialize our upwards vector.
override void CustomPlayFeedback (Vector3 position, float feedbacksIntensity=1.0f)
 On Play we start looking at our target.
virtual void InitiateLookAt (Vector3 position)
 Depending on our selected mode, initiates the lookat by starting a coroutine or broadcasting an event.
virtual IEnumerator AnimateLookAt ()
 Animates look at direction over time.
virtual void ApplyRotation (float percent)
 Applies rotation at the specified time along the journey.
override void CustomStopFeedback (Vector3 position, float feedbacksIntensity=1)
 On Stop we stop our movement if we had one going (only in Direct mode)
virtual void ClearCoroutine ()
 Clears the current coroutine.
override void CustomRestoreInitialValues ()
 On restore, we restore our initial state.

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
override bool HasChannel [get]
override bool HasRange [get]

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 )
protected

On Play we start looking at our target.

Parameters
position
feedbacksIntensity

◆ 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

◆ 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

◆ HasChannel

override bool MoreMountains.Feedbacks.MMF_LookAt.HasChannel
get

◆ HasRange

override bool MoreMountains.Feedbacks.MMF_LookAt.HasRange
get

The documentation for this class was generated from the following file:
  • H:/Code/MoreMountains/topdownengine/Assets/TopDownEngine/ThirdParty/MoreMountains/MMFeedbacks/MMFeedbacks/Feedbacks/MMF_LookAt.cs