Empeld
Empeld plugin documentation.
essentials.action.Pathing.Rails.QuadraticRail Class Reference

A rail that can be followed, were interpolation between two points is quadratic More...

Inheritance diagram for essentials.action.Pathing.Rails.QuadraticRail:
essentials.action.Pathing.Rails.AbstractRail essentials.action.Pathing.IPathRail

Public Member Functions

 QuadraticRail (IEnumerable< Vector3d > path)
 
 QuadraticRail (Path path, Vector3d offset)
 
 QuadraticRail (Path path)
 
- Public Member Functions inherited from essentials.action.Pathing.Rails.AbstractRail
 AbstractRail (IEnumerable< Vector3d > path)
 
void Advance (double dst)
 

Protected Member Functions

override Vector3d GetPosition (double t)
 

Additional Inherited Members

- Protected Attributes inherited from essentials.action.Pathing.Rails.AbstractRail
readonly Vector3d [] Rail
 
- Properties inherited from essentials.action.Pathing.Rails.AbstractRail
Vector3d Position [get]
 
Vector3d LookDirection [get]
 
double Time [get, set]
 
double TimeLength [get]
 
bool Done [get]
 
- Properties inherited from essentials.action.Pathing.IPathRail
double Time [get, set]
 
double TimeLength [get]
 
Vector3d Position [get]
 
Vector3d LookDirection [get]
 
bool Done [get]
 

Detailed Description

A rail that can be followed, were interpolation between two points is quadratic

Constructor & Destructor Documentation

◆ QuadraticRail() [1/3]

essentials.action.Pathing.Rails.QuadraticRail.QuadraticRail ( IEnumerable< Vector3d >  path)
15  :base(path)
16  { }

◆ QuadraticRail() [2/3]

essentials.action.Pathing.Rails.QuadraticRail.QuadraticRail ( Path  path,
Vector3d  offset 
)
19  :this(path.Select(x => x + offset))
20  { }

◆ QuadraticRail() [3/3]

essentials.action.Pathing.Rails.QuadraticRail.QuadraticRail ( Path  path)
23  :this(path, new Vector3d(0.5, 0.5, 0.5))
24  {}

Member Function Documentation

◆ GetPosition()

override Vector3d essentials.action.Pathing.Rails.QuadraticRail.GetPosition ( double  t)
protectedvirtual

Attribute: i0] + 2.0 * (1.0 - tf) * tf * this.Rail [i0 + 1] + tf * tf * this.Rail [i0 + 2

;

Attribute: 0

;

Implements essentials.action.Pathing.Rails.AbstractRail.

28  {
29  if (this.Rail.Length > 2)
30  {
31  int i0 = MExt.Clamp((int)t / 2 * 2, 0, this.Rail.Length - 3);
32  double tf = MExt.Fraction(t * 0.5);
33  return (1.0 - tf) * (1.0 - tf) * this.Rail [i0] + 2.0 * (1.0 - tf) * tf * this.Rail [i0 + 1] + tf * tf * this.Rail [i0 + 2];
34  }
35  return this.Rail[0];
36  }
static float Fraction(float v)
Gets the fractional part of the value
Definition: MathExtensions.cs:247
static float Clamp(float v, float min, float max)
Clamp the specified v, min and max.
Definition: MathExtensions.cs:331
Math extensions
Definition: MathExtensions.cs:7
readonly Vector3d [] Rail
Definition: AbstractRail.cs:14

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