Search found 699 matches

by drleviathan
Wed Jun 23, 2021 1:48 pm
Forum: General Bullet Physics Support and Feedback
Topic: On the problem of elastic collision of rigid bodies
Replies: 2
Views: 52

Re: On the problem of elastic collision of rigid bodies

(1) For pybullet questions you will get more replies if you post in the PyBullet Support and Feedback forum. This general forum is more focused on Bullet's C++ code. (2) For more elastic collisions use changeDynamics to set the restitution of all bouncy bodies to 1.0. You might also want to change ...
by drleviathan
Fri Jun 11, 2021 5:48 am
Forum: General Bullet Physics Support and Feedback
Topic: Gjk support function for arbitrary convex mesh
Replies: 4
Views: 212

Re: Gjk support function for arbitrary convex mesh

I was able to dig up the old code. It turns out: we did use it for something after all. I had forgotten. In any case, I've pulled the relevant files out into a separate github repository so it can become a stand-alone utility. It is incomplete because there is a missing class called Transform whose ...
by drleviathan
Thu Jun 10, 2021 2:31 pm
Forum: General Bullet Physics Support and Feedback
Topic: Gjk support function for arbitrary convex mesh
Replies: 4
Views: 212

Re: Gjk support function for arbitrary convex mesh

Yes, as I recall (and it has been a few years since I looked at it) it is brute force against the points. You could imagine writing spatial map lookup logic to optimize search in a large point cloud, however such a strategy would be slower in practice than brute force below some number of points N, ...
by drleviathan
Tue Jun 08, 2021 4:45 pm
Forum: General Bullet Physics Support and Feedback
Topic: Wake up object issue
Replies: 1
Views: 160

Re: Wake up object issue

A simple way to contrive a conveyor is to make the object kinematic, give it a non-zero velocity, and then make its MotionState.getWorldTransform() always return the unchanging position. Dynamic bodies that touch the conveyor will pick up the non-zero velocity at all contact points and will slide al...
by drleviathan
Sat May 15, 2021 3:41 pm
Forum: General Bullet Physics Support and Feedback
Topic: Manual collision response for kinematic objects
Replies: 3
Views: 1427

Re: Manual collision response for kinematic objects

Yeah... as I recall the btKinematicCharacterController has some bugs or shortcomings, but maybe it will work for your case and if not it could provide a good starting point or example. In particular it demonstrates how to sweep forward to find first touch. Some things to worry about, depending on th...
by drleviathan
Thu May 13, 2021 3:48 am
Forum: General Bullet Physics Support and Feedback
Topic: Manual collision response for kinematic objects
Replies: 3
Views: 1427

Re: Manual collision response for kinematic objects

The way to do this is to "sweep" the kinematic object from oldTransform to newTransform and to stop at first hit, else teleport to newTransform . This is how the btKinematicCharacterController works, as I recall, although it does a series of sweeps each frame so that it can walk up and dow...
by drleviathan
Tue Apr 27, 2021 8:52 pm
Forum: General Bullet Physics Support and Feedback
Topic: Issue moving objects that are constrained together.
Replies: 4
Views: 1336

Re: Issue moving objects that are constrained together.

Ah... it happens in the middle of the step? Maybe try teleporting things right before the next step. That is: set a bool variable teleportBeforeNextStep in the collision callback and outside the step: when teleportBeforeNextStep is true : do the teleport outside of the step itself and set teleportBe...
by drleviathan
Tue Apr 27, 2021 7:58 pm
Forum: General Bullet Physics Support and Feedback
Topic: Issue moving objects that are constrained together.
Replies: 4
Views: 1336

Re: Issue moving objects that are constrained together.

Here are some ideas: (1) Don't teleport the kinematic object in one step. Instead animate it from A to B quickly, but over several steps. This will give the constraint time to pull the dynamic object to its new location in a smoother way. (2) If you must teleport the kinematic object in one step, th...
by drleviathan
Tue Apr 27, 2021 2:09 pm
Forum: General Bullet Physics Support and Feedback
Topic: Character standing on a moving vehicle
Replies: 6
Views: 1693

Re: Character standing on a moving vehicle

This is really hard to do. By tweaking the friction and damping and adding special "am I standing on a vehicle?" logic to your character you might get satisfactory results with only one "world" if your vehicle moves slowly, however such a system will eventually fail as vehicle ve...
by drleviathan
Fri Apr 09, 2021 3:28 pm
Forum: General Bullet Physics Support and Feedback
Topic: Improving performances of transported objects [SOLVED]
Replies: 8
Views: 2173

Re: Improving performances of transported objects

Maybe use btGhostObject for your sensors instead of just btCollisionObject. If you need your sensors have a fancy shape instead of just a box then there is extra work involved.
by drleviathan
Fri Apr 09, 2021 3:34 am
Forum: General Bullet Physics Support and Feedback
Topic: Improving performances of transported objects [SOLVED]
Replies: 8
Views: 2173

Re: Improving performances of transported objects

To ensure sensor detection: make sure your kinematic objects are kept "active". This should always be true when using MotionStates to move them around because the MotionState.getWorldTransform() is only called on active kinematic objects. I believe kinematic-vs-static objects do not "...
by drleviathan
Fri Apr 02, 2021 3:35 pm
Forum: General Bullet Physics Support and Feedback
Topic: Improving performances of transported objects [SOLVED]
Replies: 8
Views: 2173

Re: Improving performances of transported objects

It occurs to me: I don't know if the CProfileManager stuff works in the multi-thread paradigm. So if you tried it... dunno if it would actually work. I've never played with the multi-threaded Bullet however I would expect single-threaded Bullet to be able to push several hundred dynamic objects, eve...
by drleviathan
Thu Apr 01, 2021 10:40 pm
Forum: General Bullet Physics Support and Feedback
Topic: Improving performances of transported objects [SOLVED]
Replies: 8
Views: 2173

Re: Improving performances of transported objects

If you want to first measure where the time is being spent inside the Bullet step before taking optimization measures you could use the CProfileManager utility in Bullet to get a nice printout of time spent in each context. Rather than outline its usage here I suggest you research previous threads a...
by drleviathan
Wed Mar 31, 2021 2:43 pm
Forum: General Bullet Physics Support and Feedback
Topic: Use of api(CreateFromTriMesh)
Replies: 3
Views: 1578

Re: Use of api(CreateFromTriMesh)

I looked at the code for btSoftBody . AFAICT the m_collisionDisabledObjects vector date member of that class is used when linking soft bodies together with "anchors". If you're not doing that then you would expect that vector container to be empty. The m_bodySolver is set internally, impli...
by drleviathan
Wed Mar 24, 2021 2:46 pm
Forum: General Bullet Physics Support and Feedback
Topic: Use of api(CreateFromTriMesh)
Replies: 3
Views: 1578

Re: Use of api(CreateFromTriMesh)

You should examine the implementation of btSoftBodyHelpers::CreateFromTriMesh() inside the CPP file to see how they are used. But I would guess: const btScalar* vertices is a pointer to a buffer of btScalar representing the float or double (depending on if btScaler is a float or double) values the v...