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

Last change on this file since 1760 was 1760, checked in by sam, 8 years ago

build: fix a few compilation and build errors.

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