313#include "trax/Units.h"
314#include "trax/Identified.h"
315#include "trax/Location.h"
325 struct RailRunnerUserData;
360 virtual std::shared_ptr<RailRunner>
This() const noexcept = 0;
389 virtual
void Rail( const
Location& location,
bool bMoveTo = true ) = 0;
646 virtual
void UserData( RailRunnerUserData* pData ) noexcept = 0;
650 virtual RailRunnerUserData*
UserData() const noexcept = 0;
659 default:
return RailRunner::EndType::none;
A Location specifies a position on a track system by referencing a track and a TrackLocation on it.
Definition Location.h:110
Value< Dimension< 1, 0, -1 > > Velocity
Velocity.
Definition DimensionedValues.h:331
Value< Dimension< 0, 0, 0 > > One
Dimensionless value.
Definition DimensionedValues.h:319
Value< Dimension< 1, 0, 0 > > Length
Length.
Definition DimensionedValues.h:324
Value< Dimension< 1, 1, -2 > > Force
Force.
Definition DimensionedValues.h:333
Value< Dimension< 2, 1, -3 > > Power
Power.
Definition DimensionedValues.h:339
The namespace provides classes and methods for spatial computations.
Definition Box.h:32
Namespace of all the trax track libraries classes and methods.
Definition Collection.h:17
dclspc RailRunner::EndType ToRailRunnerEndType(const std::string &endtype)
Makes a end type value from a string.
A Frame ("TNBFrame") describes a location in 3d space and an orientation using a right handed coordin...
Definition Frame.h:52
A jack a plug can get connected with.
Definition Jack.h:83
Interface for train and rolling stock that can be railed on a track and might provide brakes and powe...
Definition RailRunner.h:345
virtual Velocity MaximumVelocity() const noexcept=0
virtual std::shared_ptr< RailRunner > This() const noexcept=0
Gets a shared pointer to this.
virtual Power CurrentPowerOutput() const noexcept=0
virtual void DeactivateCoupling(EndType end)=0
Deactivates the coupling at the respective end of the RailRunner.
virtual bool IsValid() const noexcept=0
virtual void ResetToGlobalAnchor(const spat::Frame< Length, One > &anchorPose)=0
Sets the position of the RailRunner so that its global anchor alignes to the given global pose.
virtual Location GetLocation() const noexcept=0
Gets the track location were the RailRunner is railed.
virtual void SetVelocity(Velocity velocity)=0
Sets the velocity of this RailRunner along the track.
EndType
Types of the RailRunner's end's.
Definition RailRunner.h:351
@ any
Denotes the north or south end of a Railrunner.
Definition RailRunner.h:355
@ south
Denotes the back end of a RailRunner.
Definition RailRunner.h:354
@ north
Denotes the front end of a RailRunner.
Definition RailRunner.h:353
@ all
Denotes both ends of a RailRunner.
Definition RailRunner.h:356
virtual Jack & JackOnCouple(EndType end)=0
Gets a Jack that pulses its Plug if one (or any) of the RailRunner's outmost couplings get coupled.
virtual void DeRail() noexcept=0
Take the RailRunner from the track.
virtual Velocity GetVelocity() const =0
virtual spat::Frame< Length, One > GetGlobalAnchor() const =0
Gets the global anchor of the RailRunner.
virtual Power MaximumPowerOutput() const noexcept=0
virtual void Brake(One byfactor)=0
Sets the fraction of the maximum braking to apply in order to reach a zero velocity.
virtual Force MaxBrake() const noexcept=0
Gets the maximal available braking. This value is determined by the properties of the Wheelsets attac...
virtual Jack & JackOnUnCouple(EndType end)=0
Gets a Jack that pulses its Plug if one (or any) of the RailRunner's outmost couplings get uncoupled ...
virtual bool Uncouple(EndType end=EndType::all, bool btriggerPulses=true) noexcept=0
Uncouples the RailRunner at the specified end.
virtual Jack & JackOnCouplingDeactivated(EndType end)=0
Gets a Jack that pulses its Plug if one (or any) of the RailRunner's outmost couplings get deactivate...
virtual bool IsRailed() const noexcept=0
Is the RailRunner on a track?
virtual Length GetCouplingHeight(EndType end) const noexcept=0
Gets the height of the coupling over the track.
virtual EndType TargetDirection() const noexcept=0
Gets the principle direction of movement according to the sign of the target velocity.
virtual Jack & JackOnCouplingActivated(EndType end)=0
Gets a Jack that pulses its Plug if one (or any) of the RailRunner's outmost couplings get activated.
virtual void BrakeAbsolute(Force brake)=0
Sets the brake as absolute force value. If the value exceeds MaxBrake() it gets clipped.
virtual Force MaxThrust() const noexcept=0
virtual bool IsActivated(EndType end) const noexcept=0
virtual void ActivateCoupling(EndType end)=0
Activates the coupling at the respective end of the RailRunner.
virtual void UserData(RailRunnerUserData *pData) noexcept=0
Sets a pointer to user provided data.
virtual void Thrust(One byfactor)=0
Sets the fraction of the maximum thrust to apply in order to reach the target velocity specified by T...
virtual bool IsCoupled(EndType end=EndType::any) const noexcept=0
Is the coupling coupled?
virtual const char * TypeName() const noexcept=0
virtual void ThrustAbsolute(Force thrust)=0
Sets the thrust as absolute force values. If the value exceeds MaxThrust() it get clipped.
virtual void Rail(const Location &location, bool bMoveTo=true)=0
Attaches this RailRunner onto the specified track location.
virtual void TargetVelocity(Velocity velocity)=0
Sets the target velocity to aim for by using the supplied Thrust() and Brake() settings.