efficient collide detection improvements and questions

Official Python bindings with a focus on reinforcement learning and robotics.
sancelot88
Posts: 1
Joined: Wed Mar 01, 2023 7:54 am

efficient collide detection improvements and questions

Post by sancelot88 »

Hi,
I am working on an offline collision program. The meshes are rigid bodies of a complex machine moving (models are convex meshes converted from creo/proe cad systems).

I have positions of each mesh depending on the time. For optimisation reasons, I have positions only when something is moving at least 0.5mm. This implies non constant delta times.
eg , positions for t0=0ms , t1=4ms, t2=10ms,t3=50ms ......(this is not real , but to illustrate ....)

I started with a basic collide algorithm in which at each time frame I am computing and setting a new physics world with the whole scene to perform collisions.
It works, but I is not really efficient regarding performance.

I would like now migrate to a continuous detection collision mode, in which I will set positions (transformation matrix) of each mesh, without reconstructiong the whole physics world. Which orientations and modifications should be involved regarding my initial implementation ?


Here is basically the code I am using for each frame (with ammojs but does not sound being a pb).

Code: Select all

 this._broadphase = new this.ammoInjection.btDbvtBroadphase();
 this._collisionConfiguration = new this.ammoInjection.btDefaultCollisionConfiguration();
 this._dispatcher = new this.ammoInjection.btCollisionDispatcher(this._collisionConfiguration);

 this._physicsWorld = new this.ammoInjection.btCollisionWorld(
        this._dispatcher,
        this._broadphase,
        this._collisionConfiguration
      );
for each mesh:
    const shape = new this.ammoInjection.btConvexTriangleMeshShape(trimesh, true);
    const m = new this.ammoInjection.btCollisionObject();
    m.setCollisionShape(shape);
    this._physicsWorld.addCollisionObject(m, mesh.collisionGroup, mesh.collisionMask);


this._physicsWorld.performDiscreteCollisionDetection();

// collect manifolds 
...
User avatar
RKaji
Posts: 3
Joined: Wed Aug 04, 2021 8:48 am

Re: efficient collide detection improvements and questions

Post by RKaji »

This kind of PyBullet discussion really shows how much the community values sharing real debugging tips and real‑world performance insights. When you’re deep into testing physics simulations or running long builds, having reliable connectivity makes it much easier to follow replies and look up solutions without interruption. I even boosted my own mobile signal at home with a 5G unit from car signal booster for mobile phone and it noticeably reduced dropped pages and timeouts while browsing threads like this.