![]() |
Box2D Joint Toy
Game Physics with a 2D Physics Engine
|
A line object. More...
#include <LineObject.h>


Public Member Functions | |
| CLineObject (b2Body *, b2Vec2, bool, b2Body *, b2Vec2, bool) | |
| Constructor. | |
| void | Draw () |
| Draw line. | |
Additional Inherited Members | |
Static Protected Attributes inherited from CCommon | |
| static b2World * | m_pPhysicsWorld = nullptr |
| Pointer to Box2D Physics World. | |
| static CBox2DRenderer * | m_pRenderer = nullptr |
| Pointer to the renderer. | |
| static CLevel * | m_pLevel = nullptr |
| Pointer to current level. | |
| static eLevel | m_eCurLevel = eLevel::Windmill |
| Current level. | |
| static eDrawMode | m_eDrawMode = eDrawMode::Sprites |
| Draw mode. | |
A line object differs from an ordinary object in that it is associated with two bodies in Physics World instead of just one. The line goes from an anchor on one body to an anchor on another body. AN anchor is just a vector offset from the center of the body in Physics World. The anchors may or may not rotate with their associated bodies.
| CLineObject::CLineObject | ( | b2Body * | b0, |
| b2Vec2 | d0, | ||
| bool | r0, | ||
| b2Body * | b1, | ||
| b2Vec2 | d1, | ||
| bool | r1 ) |
Constructor.
| b0 | Pointer to body 0. |
| d0 | Anchor point for body 0. |
| r0 | True if body 0 rotates. |
| b1 | Pointer to body 1. |
| d1 | Anchor point for body 1. |
| r1 | True if body 1 rotates. |
| void CLineObject::Draw | ( | ) |
Draw in Render World. This line goes from anchor 0 on body 0 to anchor 1 on body 1 in Physics World.

