summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--legacy/ephysics/src/lib/EPhysics.h35
-rw-r--r--legacy/ephysics/src/lib/ephysics_world.cpp24
2 files changed, 59 insertions, 0 deletions
diff --git a/legacy/ephysics/src/lib/EPhysics.h b/legacy/ephysics/src/lib/EPhysics.h
index be887740f1..53878c2374 100644
--- a/legacy/ephysics/src/lib/EPhysics.h
+++ b/legacy/ephysics/src/lib/EPhysics.h
@@ -566,6 +566,41 @@ EAPI void ephysics_world_event_callback_add(EPhysics_World *world, EPhysics_Call
566EAPI void *ephysics_world_event_callback_del(EPhysics_World *world, EPhysics_Callback_Type type, EPhysics_World_Event_Cb func); 566EAPI void *ephysics_world_event_callback_del(EPhysics_World *world, EPhysics_Callback_Type type, EPhysics_World_Event_Cb func);
567 567
568/** 568/**
569 * @brief
570 * Set linear slop to be used by world.
571 *
572 * Constraint solver can be configured using some advanced settings, like
573 * the solver slop factor.
574 *
575 * The default value is set to 0 with a small value results in a smoother
576 * stabilization for stacking bodies.
577 *
578 * Linear slop on sequencial impulse constraint solver is used as a factor
579 * for penetration. The penetration will the manifold distance + linear slop.
580 *
581 * @param world The physics world.
582 * @param linear_slop New linear slop value to be used by constraint solver
583 * of physics engine.
584 *
585 * @ingroup EPhysics_World
586 */
587EAPI void ephysics_world_linear_slop_set(EPhysics_World *world, double linear_slop);
588
589/**
590 * @brief
591 * Get linear slop used by world.
592 *
593 * @param world The physics world.
594 * @return Linear slop value used by constraint solver of physics engine or 0
595 * on failure.
596 *
597 * @see ephysics_world_linear_slop_set() for details.
598 *
599 * @ingroup EPhysics_World
600 */
601EAPI double ephysics_world_linear_slop_get(EPhysics_World *world);
602
603/**
569 * @} 604 * @}
570 */ 605 */
571 606
diff --git a/legacy/ephysics/src/lib/ephysics_world.cpp b/legacy/ephysics/src/lib/ephysics_world.cpp
index 0136a07e5d..7159eecbf3 100644
--- a/legacy/ephysics/src/lib/ephysics_world.cpp
+++ b/legacy/ephysics/src/lib/ephysics_world.cpp
@@ -642,6 +642,30 @@ ephysics_world_render_geometry_get(EPhysics_World *world, Evas_Coord *x, Evas_Co
642 if (h) *h = world->h; 642 if (h) *h = world->h;
643} 643}
644 644
645EAPI void
646ephysics_world_linear_slop_set(EPhysics_World *world, double linear_slop)
647{
648 if (!world)
649 {
650 ERR("Can't set linear slop, world is null.");
651 return;
652 }
653
654 world->dynamics_world->getSolverInfo().m_linearSlop = btScalar(linear_slop);
655}
656
657EAPI double
658ephysics_world_linear_slop_get(EPhysics_World *world)
659{
660 if (!world)
661 {
662 ERR("Can't get linear slop, world is null.");
663 return 0;
664 }
665
666 return world->dynamics_world->getSolverInfo().m_linearSlop;
667}
668
645#ifdef __cplusplus 669#ifdef __cplusplus
646} 670}
647#endif 671#endif