Public Member Functions | |
void | Step (Settings &settings) override |
void | UpdateUI () override |
WreckingBall () | |
![]() | |
virtual void | BeginContact (b2Contact *contact) override |
Called when two fixtures begin to touch. More... | |
void | CompleteBombSpawn (const b2Vec2 &p) |
void | DrawTitle (const char *string) |
virtual void | EndContact (b2Contact *contact) override |
Called when two fixtures cease to touch. More... | |
virtual void | JointDestroyed (b2Joint *joint) |
virtual void | Keyboard (int key) |
virtual void | KeyboardUp (int key) |
void | LaunchBomb () |
void | LaunchBomb (const b2Vec2 &position, const b2Vec2 &velocity) |
virtual void | MouseDown (const b2Vec2 &p) |
virtual void | MouseMove (const b2Vec2 &p) |
virtual void | MouseUp (const b2Vec2 &p) |
virtual void | PostSolve (b2Contact *contact, const b2ContactImpulse *impulse) override |
virtual void | PreSolve (b2Contact *contact, const b2Manifold *oldManifold) override |
void | ShiftMouseDown (const b2Vec2 &p) |
void | ShiftOrigin (const b2Vec2 &newOrigin) |
void | SpawnBomb (const b2Vec2 &worldPt) |
Test () | |
virtual | ~Test () |
![]() | |
virtual | ~b2ContactListener () |
Static Public Member Functions | |
static Test * | Create () |
Public Attributes | |
b2Joint * | m_distanceJoint |
b2DistanceJointDef | m_distanceJointDef |
bool | m_stabilize |
Additional Inherited Members | |
![]() | |
b2Body * | m_bomb |
bool | m_bombSpawning |
b2Vec2 | m_bombSpawnPoint |
DestructionListener | m_destructionListener |
b2Body * | m_groundBody |
b2Profile | m_maxProfile |
b2MouseJoint * | m_mouseJoint |
b2Vec2 | m_mouseWorld |
int32 | m_pointCount |
ContactPoint | m_points [k_maxContactPoints] |
int32 | m_stepCount |
int32 | m_textIncrement |
int32 | m_textLine |
b2Profile | m_totalProfile |
b2World * | m_world |
b2AABB | m_worldAABB |
This test shows how a distance joint can be used to stabilize a chain of bodies with a heavy payload. Notice that the distance joint just prevents excessive stretching and has no other effect. By disabling the distance joint you can see that the Box2D solver has trouble supporting heavy bodies with light bodies. Try playing around with the densities, time step, and iterations to see how they affect stability. This test also shows how to use contact filtering. Filtering is configured so that the payload does not collide with the chain.
Definition at line 34 of file wrecking_ball.cpp.
|
inline |
Definition at line 37 of file wrecking_ball.cpp.
|
inlinestatic |
Definition at line 155 of file wrecking_ball.cpp.
Reimplemented from Test.
Definition at line 140 of file wrecking_ball.cpp.
|
inlineoverridevirtual |
Reimplemented from Test.
Definition at line 118 of file wrecking_ball.cpp.
b2Joint* WreckingBall::m_distanceJoint |
Definition at line 161 of file wrecking_ball.cpp.
b2DistanceJointDef WreckingBall::m_distanceJointDef |
Definition at line 160 of file wrecking_ball.cpp.
bool WreckingBall::m_stabilize |
Definition at line 162 of file wrecking_ball.cpp.