Ignition Physics

API Reference

5.1.0

Container for specifying Frame IDs. We do not want to use a generic integer type for this, because it may lead to bugs where a plain integer is mistaken for a FrameID. This also allows the compiler to always perform argument deduction successfully. More...

#include <FrameID.hh>

Public Member Functions

 FrameID (const FrameID &)=default
 
 FrameID (FrameID &&)=default
 
std::size_t ID () const
 The numerical value of this FrameID's ID number. More...
 
bool IsReferenceCounted () const
 This will return true if this Frame is being reference-counted, and false otherwise. More...
 
bool IsWorld () const
 Returns true if this is the world frame. More...
 
bool operator!= (const FrameID &_other) const
 
bool operator< (const FrameID &_other) const
 
bool operator<= (const FrameID &_other) const
 
FrameIDoperator= (const FrameID &)=default
 
FrameIDoperator= (FrameID &&)=default
 
bool operator== (const FrameID &_other) const
 
bool operator> (const FrameID &_other) const
 
bool operator>= (const FrameID &_other) const
 

Static Public Member Functions

static const FrameIDWorld ()
 Get a reference to the world Frame. More...
 

Detailed Description

Container for specifying Frame IDs. We do not want to use a generic integer type for this, because it may lead to bugs where a plain integer is mistaken for a FrameID. This also allows the compiler to always perform argument deduction successfully.

Physics engines may embed a std::shared_ptr which can be used for reference counting. That way, a FrameID will remain valid for as long as the user is referencing it. The member function IsReferenceCounted() can be used to check whether the physics engine is performing reference counting. The behavior of a frame which has been removed from simulation but not deleted is undefined.

Constructor & Destructor Documentation

◆ FrameID() [1/2]

FrameID ( const FrameID )
default

◆ FrameID() [2/2]

FrameID ( FrameID &&  )
default

Member Function Documentation

◆ ID()

std::size_t ID ( ) const

The numerical value of this FrameID's ID number.

◆ IsReferenceCounted()

bool IsReferenceCounted ( ) const

This will return true if this Frame is being reference-counted, and false otherwise.

FrameIDs that are not reference-counted may become invalid before the end of their lifetime.

FrameIDs that are reference-counted will remain valid throughout their lifetime, but if the frames that they correspond to are removed from the simulation, then the behavior of those frames will depend on the physics engine implementation. Physics engines are allowed to refuse to remove any frames which are actively being referenced.

Note that physics engines may choose to reference count some of the FrameIDs and not others, so this property must be accounted for per FrameID. For example, some engines may support reference-counting for Link frames but not Joint frames. Engine features can be used to ensure that your physics engine of choice will behave as desired.

◆ IsWorld()

bool IsWorld ( ) const

Returns true if this is the world frame.

◆ operator!=()

bool operator!= ( const FrameID _other) const

◆ operator<()

bool operator< ( const FrameID _other) const

◆ operator<=()

bool operator<= ( const FrameID _other) const

◆ operator=() [1/2]

FrameID& operator= ( const FrameID )
default

◆ operator=() [2/2]

FrameID& operator= ( FrameID &&  )
default

◆ operator==()

bool operator== ( const FrameID _other) const

◆ operator>()

bool operator> ( const FrameID _other) const

◆ operator>=()

bool operator>= ( const FrameID _other) const

◆ World()

static const FrameID& World ( )
static

Get a reference to the world Frame.


The documentation for this class was generated from the following file: