Empeld plugin documentation.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events
essentials.action.Pathing.Rails.LinearRail Class Reference
Inheritance diagram for essentials.action.Pathing.Rails.LinearRail:
essentials.action.Pathing.Rails.AbstractRail essentials.action.Pathing.IPathRail

Public Member Functions

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

Member Function Documentation

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

Attribute: idx] * (1.0 - f) + this.Rail[nextIdx

* f;

Implements essentials.action.Pathing.Rails.AbstractRail.

25  {
26  int idx = (int)t;
27  int nextIdx = Math.Min(idx+1, this.Rail.Length-1);
28  double f = MExt.Fraction(t);
29  return this.Rail[idx] * (1.0 - f) + this.Rail[nextIdx] * f;
30  }
static float Fraction(float v)
Gets the fractional part of the value
Definition: MathExtensions.cs:193
Math extensions
Definition: MathExtensions.cs:7
readonly Vector3d[] Rail
Definition: AbstractRail.cs:11

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