C# 클래스 Nez.Tweens.Lerps

series of static methods to handle all common tween type structs along with unclamped lerps for them. unclamped lerps are required for bounce, elastic or other tweens that exceed the 0 - 1 range.
파일 보기 프로젝트 열기: prime31/Nez 1 사용 예제들

공개 메소드들

메소드 설명
angleLerp ( Vector2 from, Vector2 to, float t ) : Vector2
ease ( EaseType easeType, Microsoft.Xna.Framework.Color from, Microsoft.Xna.Framework.Color to, float t, float duration ) : Microsoft.Xna.Framework.Color
ease ( EaseType easeType, Microsoft.Xna.Framework.Quaternion from, Microsoft.Xna.Framework.Quaternion to, float t, float duration ) : Microsoft.Xna.Framework.Quaternion
ease ( EaseType easeType, Rectangle from, Rectangle to, float t, float duration ) : Rectangle
ease ( EaseType easeType, Vector2 from, Vector2 to, float t, float duration ) : Vector2
ease ( EaseType easeType, Microsoft.Xna.Framework.Vector3 from, Microsoft.Xna.Framework.Vector3 to, float t, float duration ) : Microsoft.Xna.Framework.Vector3
ease ( EaseType easeType, Vector4 from, Vector4 to, float t, float duration ) : Vector4
ease ( EaseType easeType, float from, float to, float t, float duration ) : float
easeAngle ( EaseType easeType, Vector2 from, Vector2 to, float t, float duration ) : Vector2
fastSpring ( Vector2 currentValue, Vector2 targetValue, Vector2 &velocity, float dampingRatio, float angularFrequency ) : Vector2

uses the semi-implicit euler method. slower, but always stable. see http://allenchou.net/2015/04/game-math-more-on-numeric-springing/

fastSpring ( float currentValue, float targetValue, float &velocity, float dampingRatio, float angularFrequency ) : float

uses the semi-implicit euler method. faster, but not always stable. see http://allenchou.net/2015/04/game-math-more-on-numeric-springing/

lerp ( Microsoft.Xna.Framework.Color from, Microsoft.Xna.Framework.Color to, float t ) : Microsoft.Xna.Framework.Color
lerp ( Rectangle from, Rectangle to, float t ) : Rectangle
lerp ( Vector2 from, Vector2 to, float t ) : Vector2
lerp ( Microsoft.Xna.Framework.Vector3 from, Microsoft.Xna.Framework.Vector3 to, float t ) : Microsoft.Xna.Framework.Vector3
lerp ( Vector4 from, Vector4 to, float t ) : Vector4
lerp ( float from, float to, float t ) : float
lerpDamp ( float source, float target, float smoothing ) : float

A smoothing rate of zero will give you back the target value (i.e. no smoothing), and a rate of 1 is technically not allowed, but will just give you back the source value (i.e. infinite smoothing). Note that this is the opposite of the way a lerp parameter works, but if you so desire, you can just use additive inverse of the smoothing parameter inside the Pow. Smoothing rate dictates the proportion of source remaining after one second

lerpTowards ( Vector2 from, Vector2 to, float remainingFactorPerSecond, float deltaTime ) : Vector2
lerpTowards ( Microsoft.Xna.Framework.Vector3 followerCurrentPosition, Microsoft.Xna.Framework.Vector3 targetPreviousPosition, Microsoft.Xna.Framework.Vector3 targetCurrentPosition, float smoothFactor, float deltaTime ) : Microsoft.Xna.Framework.Vector3
lerpTowards ( Microsoft.Xna.Framework.Vector3 from, Microsoft.Xna.Framework.Vector3 to, float remainingFactorPerSecond, float deltaTime ) : Microsoft.Xna.Framework.Vector3
lerpTowards ( float from, float to, float remainingFactorPerSecond, float deltaTime ) : float

remainingFactorPerSecond is the percentage of the distance it covers every second. should be between 0 and 1. if it's 0.25 it means it covers 75% of the remaining distance every second independent of the framerate

stableSpring ( Vector2 currentValue, Vector2 targetValue, Vector2 &velocity, float dampingRatio, float angularFrequency ) : Vector2

uses the implicit euler method. faster, but not always stable. see http://allenchou.net/2015/04/game-math-more-on-numeric-springing/

stableSpring ( float currentValue, float targetValue, float &velocity, float dampingRatio, float angularFrequency ) : float

uses the implicit euler method. slower, but always stable. see http://allenchou.net/2015/04/game-math-more-on-numeric-springing/

메소드 상세

angleLerp() 공개 정적인 메소드

public static angleLerp ( Vector2 from, Vector2 to, float t ) : Vector2
from Microsoft.Xna.Framework.Vector2
to Microsoft.Xna.Framework.Vector2
t float
리턴 Microsoft.Xna.Framework.Vector2

ease() 공개 정적인 메소드

public static ease ( EaseType easeType, Microsoft.Xna.Framework.Color from, Microsoft.Xna.Framework.Color to, float t, float duration ) : Microsoft.Xna.Framework.Color
easeType EaseType
from Microsoft.Xna.Framework.Color
to Microsoft.Xna.Framework.Color
t float
duration float
리턴 Microsoft.Xna.Framework.Color

ease() 공개 정적인 메소드

public static ease ( EaseType easeType, Microsoft.Xna.Framework.Quaternion from, Microsoft.Xna.Framework.Quaternion to, float t, float duration ) : Microsoft.Xna.Framework.Quaternion
easeType EaseType
from Microsoft.Xna.Framework.Quaternion
to Microsoft.Xna.Framework.Quaternion
t float
duration float
리턴 Microsoft.Xna.Framework.Quaternion

ease() 공개 정적인 메소드

public static ease ( EaseType easeType, Rectangle from, Rectangle to, float t, float duration ) : Rectangle
easeType EaseType
from Microsoft.Xna.Framework.Rectangle
to Microsoft.Xna.Framework.Rectangle
t float
duration float
리턴 Microsoft.Xna.Framework.Rectangle

ease() 공개 정적인 메소드

public static ease ( EaseType easeType, Vector2 from, Vector2 to, float t, float duration ) : Vector2
easeType EaseType
from Microsoft.Xna.Framework.Vector2
to Microsoft.Xna.Framework.Vector2
t float
duration float
리턴 Microsoft.Xna.Framework.Vector2

ease() 공개 정적인 메소드

public static ease ( EaseType easeType, Microsoft.Xna.Framework.Vector3 from, Microsoft.Xna.Framework.Vector3 to, float t, float duration ) : Microsoft.Xna.Framework.Vector3
easeType EaseType
from Microsoft.Xna.Framework.Vector3
to Microsoft.Xna.Framework.Vector3
t float
duration float
리턴 Microsoft.Xna.Framework.Vector3

ease() 공개 정적인 메소드

public static ease ( EaseType easeType, Vector4 from, Vector4 to, float t, float duration ) : Vector4
easeType EaseType
from Microsoft.Xna.Framework.Vector4
to Microsoft.Xna.Framework.Vector4
t float
duration float
리턴 Microsoft.Xna.Framework.Vector4

ease() 공개 정적인 메소드

public static ease ( EaseType easeType, float from, float to, float t, float duration ) : float
easeType EaseType
from float
to float
t float
duration float
리턴 float

easeAngle() 공개 정적인 메소드

public static easeAngle ( EaseType easeType, Vector2 from, Vector2 to, float t, float duration ) : Vector2
easeType EaseType
from Microsoft.Xna.Framework.Vector2
to Microsoft.Xna.Framework.Vector2
t float
duration float
리턴 Microsoft.Xna.Framework.Vector2

fastSpring() 공개 정적인 메소드

uses the semi-implicit euler method. slower, but always stable. see http://allenchou.net/2015/04/game-math-more-on-numeric-springing/
public static fastSpring ( Vector2 currentValue, Vector2 targetValue, Vector2 &velocity, float dampingRatio, float angularFrequency ) : Vector2
currentValue Microsoft.Xna.Framework.Vector2 Current value.
targetValue Microsoft.Xna.Framework.Vector2 Target value.
velocity Microsoft.Xna.Framework.Vector2 Velocity by reference. Be sure to reset it to 0 if changing the targetValue between calls
dampingRatio float lower values are less damped and higher values are more damped resulting in less springiness. /// should be between 0.01f, 1f to avoid unstable systems.
angularFrequency float An angular frequency of 2pi (radians per second) means the oscillation completes one /// full period over one second, i.e. 1Hz. should be less than 35 or so to remain stable
리턴 Microsoft.Xna.Framework.Vector2

fastSpring() 공개 정적인 메소드

uses the semi-implicit euler method. faster, but not always stable. see http://allenchou.net/2015/04/game-math-more-on-numeric-springing/
public static fastSpring ( float currentValue, float targetValue, float &velocity, float dampingRatio, float angularFrequency ) : float
currentValue float Current value.
targetValue float Target value.
velocity float Velocity by reference. Be sure to reset it to 0 if changing the targetValue between calls
dampingRatio float lower values are less damped and higher values are more damped resulting in less springiness. /// should be between 0.01f, 1f to avoid unstable systems.
angularFrequency float An angular frequency of 2pi (radians per second) means the oscillation completes one /// full period over one second, i.e. 1Hz. should be less than 35 or so to remain stable
리턴 float

lerp() 공개 정적인 메소드

public static lerp ( Microsoft.Xna.Framework.Color from, Microsoft.Xna.Framework.Color to, float t ) : Microsoft.Xna.Framework.Color
from Microsoft.Xna.Framework.Color
to Microsoft.Xna.Framework.Color
t float
리턴 Microsoft.Xna.Framework.Color

lerp() 공개 정적인 메소드

public static lerp ( Rectangle from, Rectangle to, float t ) : Rectangle
from Microsoft.Xna.Framework.Rectangle
to Microsoft.Xna.Framework.Rectangle
t float
리턴 Microsoft.Xna.Framework.Rectangle

lerp() 공개 정적인 메소드

public static lerp ( Vector2 from, Vector2 to, float t ) : Vector2
from Microsoft.Xna.Framework.Vector2
to Microsoft.Xna.Framework.Vector2
t float
리턴 Microsoft.Xna.Framework.Vector2

lerp() 공개 정적인 메소드

public static lerp ( Microsoft.Xna.Framework.Vector3 from, Microsoft.Xna.Framework.Vector3 to, float t ) : Microsoft.Xna.Framework.Vector3
from Microsoft.Xna.Framework.Vector3
to Microsoft.Xna.Framework.Vector3
t float
리턴 Microsoft.Xna.Framework.Vector3

lerp() 공개 정적인 메소드

public static lerp ( Vector4 from, Vector4 to, float t ) : Vector4
from Microsoft.Xna.Framework.Vector4
to Microsoft.Xna.Framework.Vector4
t float
리턴 Microsoft.Xna.Framework.Vector4

lerp() 공개 정적인 메소드

public static lerp ( float from, float to, float t ) : float
from float
to float
t float
리턴 float

lerpDamp() 공개 정적인 메소드

A smoothing rate of zero will give you back the target value (i.e. no smoothing), and a rate of 1 is technically not allowed, but will just give you back the source value (i.e. infinite smoothing). Note that this is the opposite of the way a lerp parameter works, but if you so desire, you can just use additive inverse of the smoothing parameter inside the Pow. Smoothing rate dictates the proportion of source remaining after one second
public static lerpDamp ( float source, float target, float smoothing ) : float
source float Source.
target float Target.
smoothing float Smoothing.
리턴 float

lerpTowards() 공개 정적인 메소드

public static lerpTowards ( Vector2 from, Vector2 to, float remainingFactorPerSecond, float deltaTime ) : Vector2
from Microsoft.Xna.Framework.Vector2
to Microsoft.Xna.Framework.Vector2
remainingFactorPerSecond float
deltaTime float
리턴 Microsoft.Xna.Framework.Vector2

lerpTowards() 공개 정적인 메소드

public static lerpTowards ( Microsoft.Xna.Framework.Vector3 followerCurrentPosition, Microsoft.Xna.Framework.Vector3 targetPreviousPosition, Microsoft.Xna.Framework.Vector3 targetCurrentPosition, float smoothFactor, float deltaTime ) : Microsoft.Xna.Framework.Vector3
followerCurrentPosition Microsoft.Xna.Framework.Vector3
targetPreviousPosition Microsoft.Xna.Framework.Vector3
targetCurrentPosition Microsoft.Xna.Framework.Vector3
smoothFactor float
deltaTime float
리턴 Microsoft.Xna.Framework.Vector3

lerpTowards() 공개 정적인 메소드

public static lerpTowards ( Microsoft.Xna.Framework.Vector3 from, Microsoft.Xna.Framework.Vector3 to, float remainingFactorPerSecond, float deltaTime ) : Microsoft.Xna.Framework.Vector3
from Microsoft.Xna.Framework.Vector3
to Microsoft.Xna.Framework.Vector3
remainingFactorPerSecond float
deltaTime float
리턴 Microsoft.Xna.Framework.Vector3

lerpTowards() 공개 정적인 메소드

remainingFactorPerSecond is the percentage of the distance it covers every second. should be between 0 and 1. if it's 0.25 it means it covers 75% of the remaining distance every second independent of the framerate
public static lerpTowards ( float from, float to, float remainingFactorPerSecond, float deltaTime ) : float
from float From.
to float To.
remainingFactorPerSecond float Remaining factor per second.
deltaTime float Delta time.
리턴 float

stableSpring() 공개 정적인 메소드

uses the implicit euler method. faster, but not always stable. see http://allenchou.net/2015/04/game-math-more-on-numeric-springing/
public static stableSpring ( Vector2 currentValue, Vector2 targetValue, Vector2 &velocity, float dampingRatio, float angularFrequency ) : Vector2
currentValue Microsoft.Xna.Framework.Vector2 Current value.
targetValue Microsoft.Xna.Framework.Vector2 Target value.
velocity Microsoft.Xna.Framework.Vector2 Velocity by reference. Be sure to reset it to 0 if changing the targetValue between calls
dampingRatio float lower values are less damped and higher values are more damped resulting in less springiness. /// should be between 0.01f, 1f to avoid unstable systems.
angularFrequency float An angular frequency of 2pi (radians per second) means the oscillation completes one /// full period over one second, i.e. 1Hz. should be less than 35 or so to remain stable
리턴 Microsoft.Xna.Framework.Vector2

stableSpring() 공개 정적인 메소드

uses the implicit euler method. slower, but always stable. see http://allenchou.net/2015/04/game-math-more-on-numeric-springing/
public static stableSpring ( float currentValue, float targetValue, float &velocity, float dampingRatio, float angularFrequency ) : float
currentValue float Current value.
targetValue float Target value.
velocity float Velocity by reference. Be sure to reset it to 0 if changing the targetValue between calls
dampingRatio float lower values are less damped and higher values are more damped resulting in less springiness. /// should be between 0.01f, 1f to avoid unstable systems.
angularFrequency float An angular frequency of 2pi (radians per second) means the oscillation completes one /// full period over one second, i.e. 1Hz. should be less than 35 or so to remain stable
리턴 float