31#include "trax/Configuration.h"
32#include "trax/Units.h"
35#include "spat/Frame.h"
37#include "spat/Position2D.h"
53 virtual const char*
TypeName() const noexcept = 0;
70 virtual
void SetName( const
char* name ) noexcept = 0;
74 virtual const
char*
GetName() const noexcept = 0;
113 fChildBogie = 0x00000002,
114 fWheelset = 0x00000004,
116 fTerrain = 0x00000010,
117 fBogieSpace = 0x00000020,
119 fConstruction = 0x00000080,
122 fHookFixed = 0x00000200,
123 fCouplingNorth = 0x00000400,
124 fCouplingSouth = 0x00000800,
126 fTriggerShape = 0x00001000,
128 fBogieNoCabin = 0x00004000,
129 fBuffer = 0x00008000,
131 fMovableTrack = 0x00020000,
166 virtual ~
Geom() = default;
174 dclspc
unsigned int CollisionFilterFor(
Geom::
Filters filter ) noexcept;
176 constexpr
bool IsTrigger(
unsigned int filter ) noexcept{
177 return (filter & (Geom::fHook | Geom::fHookFixed | Geom::fCouplingNorth | Geom::fCouplingSouth)) ?
true :
false;
203 virtual void Radius(
Length radius ) = 0;
205 virtual Length Radius()
const = 0;
207 virtual void SetLength(
Length length ) = 0;
209 virtual Length GetLength()
const = 0;
242 virtual void Radius(
Length radius ) = 0;
244 virtual Length Radius()
const = 0;
261 virtual bool Create(
const short* pSamples,
const bool* pbHoles,
int nRows,
int nCols,
Real vertScale,
Real horzScale ) = 0;
268 virtual bool CreateEEPStyle(
const short* pSamples,
const bool* pbHoles,
int nRows,
int nCols,
Real vertScale,
Real horzScale ) = 0;
285 virtual bool Create(
const std::vector<
spat::Position<Length>>& points,
const std::vector<int>& indices ) = 0;
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
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
GeomType
Type of a geom.
Definition GeomType.h:33
Axis aligned box.
Definition Box.h:41
A Frame ("TNBFrame") describes a location in 3d space and an orientation using a right handed coordin...
Definition Frame.h:52
Implements a 2D - position in cartesian coordinates.
Definition Position2D.h:45
Implements a 3D - position in cartesian coordinates.
Definition Position.h:46
Implements a 3D - vector in cartesian coordinates.
Definition Vector.h:48
A Capsule is a Cylinder with round caps.
Definition Geom.h:220
virtual Length Radius() const =0
Gets the radius aof the cylinder part and the caps.
virtual void Radius(Length radius)=0
Sets the radius aof the cylinder part and the caps.
virtual Length GetLength() const =0
Gets the length of the capsule without the caps.
virtual void SetLength(Length length)=0
Sets the length of the capsule without the caps.
Rectangular cuboid shape.
Definition Geom.h:182
virtual const spat::Vector< Length > & Diagonal() const =0
Get the edge lengthes of the cuboid.
virtual void Diagonal(const spat::Vector< Length > &diagonal)=0
Set the edge lengthes of the cuboid shape.
virtual void SetFromBox(const spat::Box< Length > &box)=0
Set the dimensions and the frame of the cuboid to represent an axis aligned box.
Cylinder shaped Geom.
Definition Geom.h:201
virtual bool Create(const short *pSamples, const bool *pbHoles, int nRows, int nCols, Real vertScale, Real horzScale)=0
Creates a heightfield from data.
virtual bool CreateEEPStyle(const short *pSamples, const bool *pbHoles, int nRows, int nCols, Real vertScale, Real horzScale)=0
creates a heightfield from data in the EEP style.
A Geom is used for collision detection. It differs from a Shape in that it defines the most simple el...
Definition Geom.h:50
virtual GeomType GetGeomType() const noexcept=0
virtual void SetFrame(const spat::Frame< Length, One > &frame) noexcept=0
Sets position and orientation (pose) relative to a Body's frame.
virtual void GetFrame(spat::Frame< Length, One > &frame) const noexcept=0
Gets the pose relative to a Body's frame.
virtual void SetName(const char *name) noexcept=0
Sets the name of the Geom.
virtual void TypeFilter(Filters type) noexcept=0
Specify a flag for the type of this Geom.
virtual spat::Box< Length > GetExtent() const noexcept=0
Gets the minimum axis aligned box that includes the the Geom completely.
virtual const char * GetName() const noexcept=0
virtual const Material & GetMaterial() const noexcept=0
virtual Filters TypeFilter() const noexcept=0
virtual void CollisionFilter(unsigned int collideWith) noexcept=0
Specify the collision bitfield.
virtual void SetMaterial(const Material &material) noexcept=0
Sets the material to be applied with the Geom.
virtual const char * TypeName() const noexcept=0
virtual std::unique_ptr< Geom > Instance() const noexcept=0
Creates a new geom that will share shape data with the existing one.
Filters
Filter flags that will serve in fast collision testing.
Definition Geom.h:110
A sphere shaped Geom.
Definition Geom.h:240