ogre icon indicating copy to clipboard operation
ogre copied to clipboard

OgreBullet needs some love

Open slapin opened this issue 6 months ago • 6 comments

  • ~~OgreBullet does not support btCompoundShape which is the only way to offset collision shapes and have multiple of them per RigidBody.~~

  • ~~Additionally all the CollisionShape utility functions are hidden which makes it hard to create shapes as needed from shapes and entities.~~

  • Also the full two-side kinematic body is not implemented because Bullet's kinematic btRigidBody is one side and does not handle collisions. I tried to use btKinematicCharacterController but was unable to make it run properly at all, so I consider the solution in Godot which is implemented roughly of useful parts from btKinematicCharacterController (de-penetration and sweep tests) w/o strange magic mumbo-jumbo. I think the following should be done:

  • [x] Add btCompoundShape support to OgreBullet.cpp https://github.com/OGRECave/ogre/pull/3363

  • [x] make shape creation functions available as API. https://github.com/OGRECave/ogre/pull/3363

  • [x] a API function is needed which would allow btRigidBody/btCollisionObject created outside to have Ogre listener attached for Ogre to handle the motion. https://github.com/OGRECave/ogre/pull/3364

  • [ ] implement ~~Godot's move_and_slide()~~ (changed direction and implemented as btActionInterface to run by physics directly ~~(approx. till June, 9)~~ done via btPairCachingGhostObject

    • [x] Build convex shape list from btCompoundShape hierarchy
    • [x] implement de-penetration part
    • July plan:
      • Kinematic motion:
        • [ ] Implement sweep motion tests to avoid too much de-penetration (even though performance is good but a bit more robustness and stability are welcome)
        • [ ] Add floor and wall tests (most important for feature completeness and ease of use)
      • Other physics:
        • [ ] Implement simple triggers. The setup of btGhostObjects is quite hard for many people so having more simple template setup for most usecases would be useful.

slapin avatar May 29 '25 15:05 slapin

as I did not need that functionality myself yet, I have no idea how a good API for this would look like. PRs with proposals are welcome.

paroj avatar May 30 '25 11:05 paroj

I have that planned over weekend, so there will be PR.

slapin avatar May 30 '25 16:05 slapin

Created one of 2 PRs.

slapin avatar May 31 '25 21:05 slapin

All PRs created. Then I go back to implementing move_and_slide...

slapin avatar May 31 '25 23:05 slapin

added "implement Godot's move_and_slide()" it would be easier for me to track.

slapin avatar Jun 01 '25 18:06 slapin

achievement made btPairCachingGhostShape work and still sane. Muhahahahagh!!!111

slapin avatar Jun 06 '25 19:06 slapin