I have recently switched my simulations from single-threaded to multi-threaded and for the most part it works really well. The one issue I have found with doing this was that I was having objects locked on the Z axis via "setLinearFactor(1,1,0)" and that is no longer being applied. I did a quick search for "getLinearFactor()" in the bullet repo and quickly found 4 lines that mention it in btSequentialImpulseConstraintSolver.cpp . Digging further I found that btParallelConstraintSolver doesn't use most/all of the methods in btSequentialImpulseConstraintSolver and doesn't contain the code "getLinearFactor()" anywhere. So based on what I can tell it's simply not factored in when multi-threading.
I'd create a patch file myself but just by looking at the code I've seen 3 places where the bodies' linear velocity is being assigned to and I don't know which is the most appropriate place for it (in btParallelConstraintSolver).
Rigid body Linear Factor not honored when Multi-threading.
-
- Posts: 171
- Joined: Sun Jan 17, 2010 4:47 am
-
- Posts: 171
- Joined: Sun Jan 17, 2010 4:47 am
Re: Rigid body Linear Factor not honored when Multi-threadin
I have since disabled the multi-threaded constraint solver since this issue has thus far gone un-addressed. I also saw an older post that mentioned btParallelConstraintSolver was still experimental. Though the post was old I haven't seen any newer posts or documentation stating otherwise. Is the btParallelConstraintSolver considered production ready? If so, can you give me any hints on where I need to insert the rigid objects linear factor into the code path so I may get that working?
-
- Posts: 463
- Joined: Fri Nov 30, 2012 4:50 am
Re: Rigid body Linear Factor not honored when Multi-threadin
I think multithreaded solver's been skipped over in preparation for bullet3, since that has reworked solvers including gpu one. As for linear factor, it shows up less than a dozen times in the code, in initSolverBody, setupContactConstraint, setFrictionConstraintImpulse, and solveGroupCacheFriendlyFinish. The locations seem to be some of the parts where you apply impulses or forces in contact and friction constraints, but not all the impulses seem to get that treatment. You'll need to look at the sequential impulse code to double check what you need.Mako_energy02 wrote:I have since disabled the multi-threaded constraint solver since this issue has thus far gone un-addressed. I also saw an older post that mentioned btParallelConstraintSolver was still experimental. Though the post was old I haven't seen any newer posts or documentation stating otherwise. Is the btParallelConstraintSolver considered production ready? If so, can you give me any hints on where I need to insert the rigid objects linear factor into the code path so I may get that working?