Trax3 3.1.0
trax track library
Loading...
Searching...
No Matches
trax::Geom Struct Referenceabstract

A Geom is used for collision detection. It differs from a Shape in that it defines the most simple elements of a shape. A Shape is a collection of Geoms and itself a Geom. More...

#include <C:/Trend/Development/Trax3/Code/trax/rigid/Geom.h>

Inheritance diagram for trax::Geom:

Public Types

enum  Filters : unsigned int {
  none = 0 , fBogie = 0x00000001 , fChildBogie = 0x00000002 , fWheelset = 0x00000004 ,
  fCargo = 0x00000008 , fTerrain = 0x00000010 , fBogieSpace = 0x00000020 , fCrane = 0x00000040 ,
  fConstruction = 0x00000080 , fHook = 0x00000100 , fHookFixed = 0x00000200 , fCouplingNorth = 0x00000400 ,
  fCouplingSouth = 0x00000800 , fTriggerShape = 0x00001000 , fCabin = 0x00002000 , fBogieNoCabin = 0x00004000 ,
  fBuffer = 0x00008000 , fTrack = 0x00010000 , fMovableTrack = 0x00020000 , fAll = 0x2fffffff
}
 Filter flags that will serve in fast collision testing. More...

Public Member Functions

virtual const char * TypeName () const noexcept=0
virtual std::unique_ptr< GeomInstance () const noexcept=0
 Creates a new geom that will share shape data with the existing one.
virtual void SetName (const char *name) noexcept=0
 Sets the name of the Geom.
virtual const char * GetName () 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 spat::Box< LengthGetExtent () const noexcept=0
 Gets the minimum axis aligned box that includes the the Geom completely.
virtual void SetMaterial (const Material &material) noexcept=0
 Sets the material to be applied with the Geom.
virtual const MaterialGetMaterial () const noexcept=0
virtual GeomType GetGeomType () const noexcept=0
virtual void TypeFilter (Filters type) noexcept=0
 Specify a flag for the type of this Geom.
virtual Filters TypeFilter () const noexcept=0
virtual void CollisionFilter (unsigned int collideWith) noexcept=0
 Specify the collision bitfield.
virtual unsigned int CollisionFilter () const noexcept=0

Detailed Description

A Geom is used for collision detection. It differs from a Shape in that it defines the most simple elements of a shape. A Shape is a collection of Geoms and itself a Geom.

Member Enumeration Documentation

◆ Filters

enum trax::Geom::Filters : unsigned int

Filter flags that will serve in fast collision testing.

Each Geom carries a type flag and specifies with what other types a collision will be possible.

Member Function Documentation

◆ CollisionFilter() [1/2]

virtual unsigned int trax::Geom::CollisionFilter ( ) const
pure virtualnoexcept
Returns
the collision bitfield.

◆ CollisionFilter() [2/2]

virtual void trax::Geom::CollisionFilter ( unsigned int collideWith)
pure virtualnoexcept

Specify the collision bitfield.

This will typically be one bit set for each type to collide this geom with. Collisions between geoms with mismatching type and collision fields will be ignored if they collide but be aware that if one geom can not collide with another it still is possible that the other collides with the geom. I.e. the collision happens if:

/// (typeA & collionB) || (typeB & collisionA)
/// 

◆ GetGeomType()

virtual GeomType trax::Geom::GetGeomType ( ) const
pure virtualnoexcept
Returns
The type of the Geom.

◆ GetMaterial()

virtual const Material & trax::Geom::GetMaterial ( ) const
pure virtualnoexcept
Returns
The material active for the Geom.

◆ GetName()

virtual const char * trax::Geom::GetName ( ) const
pure virtualnoexcept
Returns
The name of the Body.

◆ Instance()

virtual std::unique_ptr< Geom > trax::Geom::Instance ( ) const
pure virtualnoexcept

Creates a new geom that will share shape data with the existing one.

It deponds from the geom wether instancing of data is applicable or not, but the method will give a geom in any case.

◆ SetFrame()

virtual void trax::Geom::SetFrame ( const spat::Frame< Length, One > & frame)
pure virtualnoexcept

Sets position and orientation (pose) relative to a Body's frame.

Parameters
frameFrame of reference.

◆ SetName()

virtual void trax::Geom::SetName ( const char * name)
pure virtualnoexcept

Sets the name of the Geom.

This is for debug purposes; the string is not copied, only the pointer is stored.

◆ TypeFilter() [1/2]

virtual Filters trax::Geom::TypeFilter ( ) const
pure virtualnoexcept
Returns
the type bitfield.

◆ TypeFilter() [2/2]

virtual void trax::Geom::TypeFilter ( Filters type)
pure virtualnoexcept

Specify a flag for the type of this Geom.

The type will be typically represented by one bit and will be used on collision detection.

◆ TypeName()

virtual const char * trax::Geom::TypeName ( ) const
pure virtualnoexcept
Returns
the name for the object type that implements this interface.

The documentation for this struct was generated from the following file:
  • C:/Trend/Development/Trax3/Code/trax/rigid/Geom.h