12#include "trax/Configuration.h"
13#include "CameraType.h"
14#include "trax/Identified.h"
15#include "trax/Units.h"
16#include "trax/collections/Collection.h"
18#include "spat/Frame.h"
39 static const Angle default_fovy;
40 static const One default_aspect;
41 static const Length default_nearPlane;
42 static const Length default_farPlane;
44 virtual void SetFromFofy(
Angle fovy = default_fovy,
One aspect = default_aspect,
Length zn = default_nearPlane,
Length zf = default_farPlane ) = 0;
46 virtual void SetFromDimensions(
Length width,
Length height,
Length zn = default_nearPlane,
Length zf = default_farPlane ) = 0;
50 virtual Length NearPlaneDistance()
const = 0;
52 virtual Length FarPlaneDistance()
const = 0;
54 virtual void Width(
Length width ) = 0;
56 virtual Length Width()
const = 0;
58 virtual void Height(
Length height ) = 0;
60 virtual Length Height()
const = 0;
80 virtual ~Frustum() =
default;
81 Frustum(
const Frustum& ) =
delete;
82 Frustum( Frustum&& ) =
delete;
83 Frustum& operator=(
const Frustum& ) =
delete;
84 Frustum& operator=( Frustum&& ) =
delete;
94 static dclspc std::unique_ptr<Camera>
Make(
CameraType type = CameraType::cam_basic )
noexcept;
98 virtual const char*
TypeName() const noexcept = 0;
151 using Camera::operator=;
155 virtual void AttachTo( std::shared_ptr<Module> pModule ) = 0;
162 virtual std::vector<GeomList*> OverlapQuery(
unsigned int filterflags )
const = 0;
164 virtual GeomList* OverlapQueryAny(
unsigned int filterflags )
const = 0;
210 virtual void ControllerTranslateX(
Velocity dx ) = 0;
212 virtual void ControllerTranslateY(
Velocity dy ) = 0;
214 virtual void ControllerTranslateZ(
Velocity dz ) = 0;
227 virtual void DampingTranslate(
Real damping ) = 0;
229 virtual Real DampingTranslate()
const = 0;
231 virtual void DampingRotate(
Real damping ) = 0;
233 virtual Real DampingRotate()
const = 0;
240 using Camera::operator=;
246 virtual void AttachTo( std::shared_ptr<Body> pBody ) = 0;
250 virtual std::shared_ptr<Body>
GetBody()
const = 0;
316 using Camera::operator=;
318 virtual const Location& GetLocation()
const = 0;
326 static dclspc std::unique_ptr<CameraCollection>
Make() noexcept;
329 virtual
void UserCameraType(
CameraType type ) = 0;
331 virtual
CameraType UserCameraType() const = 0;
333 virtual
void UserStartCameraID(
IDType id ) = 0;
335 virtual
IDType UserStartCameraID() const = 0;
A Location specifies a position on a track system by referencing a track and a TrackLocation on it.
Definition Location.h:110
Namespace of common utility classes and methods.
Definition Helpers.h:43
Value< Dimension< 0, 0, -1 > > AngularVelocity
Angular velocity.
Definition DimensionedValues.h:323
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
float Real
Underlying floating point type to be used with the dim library.
Definition DimensionedValues.h:190
Value< Dimension< 0, 0, 0 > > Angle
Angle in radians.
Definition DimensionedValues.h:320
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
CameraType
Type of the camera.
Definition CameraType.h:19
An interval describes the area between two numbers. It is understood to contain the near one and exlu...
Definition Interval.h:42
A Frame ("TNBFrame") describes a location in 3d space and an orientation using a right handed coordin...
Definition Frame.h:52
Implements a 3D - position in cartesian coordinates.
Definition Position.h:46
Implements a 3D - vector in cartesian coordinates.
Definition Vector.h:48
Interface for movable cameras.
Definition Camera.h:149
virtual std::shared_ptr< Module > GetModule() const =0
virtual void Reset()=0
Resets the position of the camera.
virtual void Stop()=0
Stops any animated inertial movement of the camera.
virtual void StepBack()=0
Reverts the last positional change done by Update().
virtual void SetVelocity(const spat::Vector< Velocity > &velocity)=0
Set the camera velocity directly.
virtual void MaximumLinearVelocity(Velocity maxVelocity)=0
Sets a maximum velocity that will not be exceeded.
virtual void RotationalVelocity(const spat::Vector< AngularVelocity > &rotvel)=0
Set the rotational velocity directly.
virtual void Update()=0
Updates the camera by the fixed time step.
virtual void AttachTo(std::shared_ptr< Module > pModule)=0
If attached to a module, the camera will stay on top of the terrain and will not penetrate geoms in t...
Interface for cameras that can get attached to a Body.
Definition Camera.h:238
virtual void Theta(Angle theta)=0
Signals that the user put the camera into a state that might signal to cut loose from the body.
virtual const common::Interval< Length > & RadiusLimits() const =0
Signals that the user put the camera into a state that might signal to cut loose from the body.
virtual void ThetaResetValue(Angle theta)=0
Signals that the user put the camera into a state that might signal to cut loose from the body.
virtual const common::Interval< Angle > & ThetaLimits() const =0
Signals that the user put the camera into a state that might signal to cut loose from the body.
virtual Angle Phi() const =0
Signals that the user put the camera into a state that might signal to cut loose from the body.
virtual bool BodyRealtiveRotations() const =0
virtual const spat::Frame< Length, One > & Center() const =0
Signals that the user put the camera into a state that might signal to cut loose from the body.
virtual const common::Interval< Angle > & PhiLimits() const =0
Signals that the user put the camera into a state that might signal to cut loose from the body.
virtual void PhiResetValue(Angle phi)=0
Signals that the user put the camera into a state that might signal to cut loose from the body.
virtual Length Radius() const =0
Signals that the user put the camera into a state that might signal to cut loose from the body.
virtual std::shared_ptr< Body > GetBody() const =0
virtual Length RadiusResetValue() const =0
Signals that the user put the camera into a state that might signal to cut loose from the body.
virtual void Phi(Angle phi)=0
Signals that the user put the camera into a state that might signal to cut loose from the body.
virtual void PhiLimits(const common::Interval< Angle > &limits)=0
Signals that the user put the camera into a state that might signal to cut loose from the body.
virtual Angle ThetaResetValue() const =0
Signals that the user put the camera into a state that might signal to cut loose from the body.
virtual void RadiusLimits(const common::Interval< Length > &limits)=0
Signals that the user put the camera into a state that might signal to cut loose from the body.
virtual bool GetLoose() const =0
Signals that the user put the camera into a state that might signal to cut loose from the body.
virtual void RadiusResetValue(Length radius)=0
Signals that the user put the camera into a state that might signal to cut loose from the body.
virtual void Center(const spat::Frame< Length, One > ¢er)=0
Signals that the user put the camera into a state that might signal to cut loose from the body.
virtual Angle Theta() const =0
Signals that the user put the camera into a state that might signal to cut loose from the body.
virtual Angle PhiResetValue() const =0
Signals that the user put the camera into a state that might signal to cut loose from the body.
virtual void ThetaLimits(const common::Interval< Angle > &limits)=0
Signals that the user put the camera into a state that might signal to cut loose from the body.
virtual void Radius(Length radius)=0
Signals that the user put the camera into a state that might signal to cut loose from the body.
A dynamic object in physical space.
Definition Body.h:44
Collection to store cameras.
Definition Camera.h:324
static dclspc std::unique_ptr< CameraCollection > Make() noexcept
Makes a CameraCollection object.
Base Camera interface.
Definition Camera.h:92
static dclspc std::unique_ptr< Camera > Make(CameraType type=CameraType::cam_basic) noexcept
Makes a Camera object.
virtual spat::Vector< Velocity > GetVelocity() const =0
Gets the current velocity.
virtual void EyePoint(const spat::Position< Length > &eyePoint)=0
Sets the camera to look at eyePoint.
virtual bool InFrustum(const spat::Position< Length > &position) const =0
virtual const char * TypeName() const noexcept=0
virtual CameraType GetType() const =0
virtual void SetFrame(const spat::Frame< Length, One > &frame)=0
Sets position and orientation (pose) in global coordinates.
Interface for Cameras movable along tracks.
Definition Camera.h:314
A Fleet holds Trains and (topmost) Bogies via their common interface RailRunner.
Definition Fleet.h:48
virtual One AspectRatio() const =0
virtual void Fovy(Angle fovy)=0
The Field Of View angle in radiants.
virtual Angle Fovy() const =0
virtual void AspectRatio(One aspect)=0
Type used for IDs in the trax library.
Definition IDType.h:43
A module is a chunck of railroad stuff that is all located in one rectangular volume.
Definition Module.h:60
A Train is a collection of TrainComponents that are coupled in a row.
Definition Train.h:43