OpenPath class final

A path through points, measured by distance along it: where it is at s metres, which way it runs there, and which way is right.

A road is not a list of points. A racing game asks "where is the car eighty metres on" and "which way is the road pointing there", and a list of points answers neither without the arithmetic every such game wrote for itself: which segment, how far into it, and a heading that does not snap at every corner. Distances are cumulative lengths of the straight pieces between points; smooth the points first (a CatmullRom sampled finely) for a smooth road.

Right is the tangent crossed with up, so a path over flat ground has its right on the ground. Beyond either end the path goes straight on.

Constructors

OpenPath(List<Vector3> points, {Vector3? up})

Properties

hashCode → int
The hash code for this object.
no setterinherited
length → double
How long the path is, in metres.
no setter
points → List<Vector3>
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
up → Vector3
What right is taken against.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pointAt(double s, [Vector3? out]) → Vector3
Where the path is s metres along it, into out if given.
rightAt(double s, [Vector3? out]) → Vector3
Which way is right of the path at s, a unit vector on the plane square to up, into out if given.
tangentAt(double s, [Vector3? out]) → Vector3
Which way the path runs at s, a unit vector, into out if given.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited