se2ez
se2ez::Box2DShape Class Reference

Container class that converts se2ez::Geometry into a Box2D geometry. More...

Public Member Functions

 Box2DShape (const std::string &name, const unsigned int index, const GeometryPtr &geometry, Box2DWorldPtr world, bool movable)
 Constructor. More...
 
 ~Box2DShape ()
 
void setPose (const Eigen::Isometry2d &pose)
 Sets the pose of this body. More...
 
Eigen::Isometry2d getPose () const
 Get the current pose of this body in the Box2D world. More...
 
const b2Transform & getTransform () const
 Get the current pose of this body in the Box2D world. More...
 
const std::vector< b2Fixture * > & getFixtures () const
 Get the list of fixtures attached to this body. More...
 

Public Attributes

const bool movable
 Is this a moving frame piece of geometry? More...
 
const std::string name
 Name of the frame this geometry is attached to. More...
 
const unsigned int index
 Index in frame this geometry is. More...
 

Private Member Functions

b2PolygonShape * createPolygon (const GeometryPtr &geometry)
 
void createShapes ()
 Convert the geometry of this body into a Box2D shape. More...
 

Private Attributes

const GeometryPtrgeometry_
 Original geometry. More...
 
std::vector< GeometryPtrgeometries_
 Geometry (created from decompositions). More...
 
b2BodyDef bodyDef_
 Box2D body definition to create body. More...
 
std::vector< b2FixtureDef > shapeDef_
 Box2d shape definitions to create fixtures. More...
 
std::vector< b2Shape * > shapes_
 Box2D geometries;. More...
 
b2Body * body_
 Box2D body. More...
 
std::vector< b2Fixture * > fixture_
 Box2D fixtures. More...
 
std::vector< std::pair< b2Vec2 *, unsigned int > > points_
 Polygon points. More...
 

Detailed Description

Container class that converts se2ez::Geometry into a Box2D geometry.

Definition at line 66 of file collision.cpp.

Constructor & Destructor Documentation

◆ Box2DShape()

se2ez::Box2DShape::Box2DShape ( const std::string name,
const unsigned int  index,
const GeometryPtr geometry,
Box2DWorldPtr  world,
bool  movable 
)
inline

Constructor.

Parameters
[in]nameName of frame this geometry is associated with.
[in]indexIndex within frames' geometry vector this geometry is associated with.
[in]geometryGeometry to convert.
[in]worldBox2D world.
[in]movableDoes this frame move?

Definition at line 76 of file collision.cpp.

◆ ~Box2DShape()

se2ez::Box2DShape::~Box2DShape ( )
inline

Definition at line 103 of file collision.cpp.

Member Function Documentation

◆ createPolygon()

b2PolygonShape* se2ez::Box2DShape::createPolygon ( const GeometryPtr geometry)
inlineprivate

Definition at line 153 of file collision.cpp.

◆ createShapes()

void se2ez::Box2DShape::createShapes ( )
inlineprivate

Convert the geometry of this body into a Box2D shape.

Definition at line 175 of file collision.cpp.

◆ getFixtures()

const std::vector<b2Fixture *>& se2ez::Box2DShape::getFixtures ( ) const
inline

Get the list of fixtures attached to this body.

Returns
The list of fixtures.

Definition at line 143 of file collision.cpp.

◆ getPose()

Eigen::Isometry2d se2ez::Box2DShape::getPose ( ) const
inline

Get the current pose of this body in the Box2D world.

Returns
The pose of the body.

Definition at line 125 of file collision.cpp.

◆ getTransform()

const b2Transform& se2ez::Box2DShape::getTransform ( ) const
inline

Get the current pose of this body in the Box2D world.

Returns
The pose of the body.

Definition at line 135 of file collision.cpp.

◆ setPose()

void se2ez::Box2DShape::setPose ( const Eigen::Isometry2d &  pose)
inline

Sets the pose of this body.

Parameters
[in]posePose of this body.

Definition at line 115 of file collision.cpp.

Member Data Documentation

◆ body_

b2Body* se2ez::Box2DShape::body_
private

Box2D body.

Definition at line 253 of file collision.cpp.

◆ bodyDef_

b2BodyDef se2ez::Box2DShape::bodyDef_
private

Box2D body definition to create body.

Definition at line 249 of file collision.cpp.

◆ fixture_

std::vector<b2Fixture *> se2ez::Box2DShape::fixture_
private

Box2D fixtures.

Definition at line 254 of file collision.cpp.

◆ geometries_

std::vector<GeometryPtr> se2ez::Box2DShape::geometries_
private

Geometry (created from decompositions).

Definition at line 247 of file collision.cpp.

◆ geometry_

const GeometryPtr& se2ez::Box2DShape::geometry_
private

Original geometry.

Definition at line 246 of file collision.cpp.

◆ index

const unsigned int se2ez::Box2DShape::index

Index in frame this geometry is.

Definition at line 150 of file collision.cpp.

◆ movable

const bool se2ez::Box2DShape::movable

Is this a moving frame piece of geometry?

Definition at line 148 of file collision.cpp.

◆ name

const std::string se2ez::Box2DShape::name

Name of the frame this geometry is attached to.

Definition at line 149 of file collision.cpp.

◆ points_

std::vector<std::pair<b2Vec2 *, unsigned int> > se2ez::Box2DShape::points_
private

Polygon points.

Definition at line 256 of file collision.cpp.

◆ shapeDef_

std::vector<b2FixtureDef> se2ez::Box2DShape::shapeDef_
private

Box2d shape definitions to create fixtures.

Definition at line 250 of file collision.cpp.

◆ shapes_

std::vector<b2Shape *> se2ez::Box2DShape::shapes_
private

Box2D geometries;.

Definition at line 251 of file collision.cpp.


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