You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

преди 12 години
преди 12 години
преди 12 години
12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #if defined HAVE_CONFIG_H
  2. # include "config.h"
  3. #endif
  4. #include "lolbtphysicsintegration.h"
  5. #include "lolphysics.h"
  6. #include "easyconstraint.h"
  7. namespace lol
  8. {
  9. namespace phys
  10. {
  11. #ifdef HAVE_PHYS_USE_BULLET
  12. //-------------------------------------------------------------------------
  13. //EASY_CONSTRAINT
  14. //--
  15. void EasyConstraint::AddToSimulation(class Simulation* current_simulation)
  16. {
  17. btDiscreteDynamicsWorld* dynamics_world = current_simulation->GetWorld();
  18. if (dynamics_world && m_typed_constraint)
  19. {
  20. dynamics_world->addConstraint(m_typed_constraint, m_disable_a2b_collision);
  21. current_simulation->ObjectRegistration(true, this);
  22. }
  23. }
  24. void EasyConstraint::RemoveFromSimulation(class Simulation* current_simulation)
  25. {
  26. btDiscreteDynamicsWorld* dynamics_world = current_simulation->GetWorld();
  27. if (dynamics_world && m_typed_constraint)
  28. {
  29. dynamics_world->removeConstraint(m_typed_constraint);
  30. current_simulation->ObjectRegistration(false, this);
  31. }
  32. }
  33. #endif // HAVE_PHYS_USE_BULLET
  34. } /* namespace phys */
  35. } /* namespace lol */