Tramway SDK
|
Point constrained to a Path. More...
#include <framework/path.h>
Public Member Functions | |
PathFollower (Path *path, vec3 initial_pos, PathType type) | |
Creates a new PathFollower for a path. More... | |
void | Advance (float) |
Advances the follower along the path. More... | |
void | Project (vec3) |
void | TurnLeft () |
void | TurnRight () |
void | TurnStraight () |
vec3 | GetPosition () |
vec3 | GetTangent () |
void | SetOrientation (vec3) |
Public Attributes | |
float | progress |
uint32_t | prev |
uint32_t | next |
PathType | type |
PathType | direction |
Path * | path |
Point constrained to a Path.
When constructed, the PathFollower will project the initial position on the path, i.e. find the nearest point on the path. After that, you can use PathFollower::Advance() to push it back and forth on the path. The position of the PathFollower can be used to position an object, so that it appears to be following the given path.
Creates a new PathFollower for a path.
void tram::PathFollower::Advance | ( | float | distance | ) |
Advances the follower along the path.
distance | Distance along the path, in meters. |
vec3 tram::PathFollower::GetPosition | ( | ) |
vec3 tram::PathFollower::GetTangent | ( | ) |
void tram::PathFollower::Project | ( | vec3 | projectable | ) |
void tram::PathFollower::SetOrientation | ( | vec3 | orientation | ) |
void tram::PathFollower::TurnLeft | ( | ) |
void tram::PathFollower::TurnRight | ( | ) |
void tram::PathFollower::TurnStraight | ( | ) |
PathType tram::PathFollower::direction |
uint32_t tram::PathFollower::next |
Path* tram::PathFollower::path |
uint32_t tram::PathFollower::prev |
float tram::PathFollower::progress |
PathType tram::PathFollower::type |