Empeld
Empeld plugin documentation.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events
essentials.action.Pathing.Rails.QuadraticRail Class Reference
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]
 

Constructor & Destructor Documentation

essentials.action.Pathing.Rails.QuadraticRail.QuadraticRail ( IEnumerable< Vector3d >  path)
12  :base(path)
13  { }
essentials.action.Pathing.Rails.QuadraticRail.QuadraticRail ( Path  path,
Vector3d  offset 
)
16  :this(path.Select(x => x + offset))
17  { }
essentials.action.Pathing.Rails.QuadraticRail.QuadraticRail ( Path  path)
20  :this(path, new Vector3d(0.5, 0.5, 0.5))
21  {}

Member Function Documentation

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.

25  {
26  if (this.Rail.Length > 2)
27  {
28  int i0 = MExt.Clamp((int)t / 2 * 2, 0, this.Rail.Length - 3);
29  double tf = MExt.Fraction(t * 0.5);
30  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];
31  }
32  return this.Rail[0];
33  }
static float Fraction(float v)
Gets the fractional part of the value
Definition: MathExtensions.cs:193
static float Clamp(float v, float min, float max)
Clamp the specified v, min and max.
Definition: MathExtensions.cs:277
Math extensions
Definition: MathExtensions.cs:7
readonly Vector3d[] Rail
Definition: AbstractRail.cs:11

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