source: trunk/test/Physics/Src/EasyConstraint.cpp @ 1749

Last change on this file since 1749 was 1749, checked in by touky, 8 years ago

Reverted last CL

File size: 949 bytes
Line 
1#include "../Include/LolBtPhysicsIntegration.h"
2#include "../Include/LolPhysics.h"
3#include "../Include/EasyConstraint.h"
4
5namespace lol
6{
7
8namespace phys
9{
10
11#ifdef HAVE_PHYS_USE_BULLET
12
13//-------------------------------------------------------------------------
14//EASY_CONSTRAINT
15//--
16
17void EasyConstraint::AddToSimulation(class Simulation* current_simulation)
18{
19        btDiscreteDynamicsWorld* dynamics_world = current_simulation->GetWorld();
20        if (dynamics_world && m_typed_constraint)
21        {
22                dynamics_world->addConstraint(m_typed_constraint, m_disable_a2b_collision);
23                current_simulation->AddToConstraint(this);
24        }
25}
26
27void EasyConstraint::RemoveFromSimulation(class Simulation* current_simulation)
28{
29        btDiscreteDynamicsWorld* dynamics_world = current_simulation->GetWorld();
30        if (dynamics_world, m_typed_constraint)
31                dynamics_world->removeConstraint(m_typed_constraint);
32}
33
34#endif // HAVE_PHYS_USE_BULLET
35
36} /* namespace phys */
37
38} /* namespace lol */
Note: See TracBrowser for help on using the repository browser.