source: trunk/test/physics/easyconstraint.cpp @ 2450

Last change on this file since 2450 was 2450, checked in by lolbot, 10 years ago

build: convert source files to lowercase.

File size: 1.1 KB
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->ObjectRegistration(true, 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    {
37        dynamics_world->removeConstraint(m_typed_constraint);
38        current_simulation->ObjectRegistration(false, this);
39    }
40}
41
42#endif // HAVE_PHYS_USE_BULLET
43
44} /* namespace phys */
45
46} /* namespace lol */
Note: See TracBrowser for help on using the repository browser.