Search found 4173 matches

by Erwin Coumans
Fri Dec 21, 2018 3:05 am
Forum: PyBullet Support and Feedback
Topic: Rope for Unity
Replies: 2
Views: 544

Re: Rope for Unity

That code hasn't been exposed through the C-API yet. We may improve soft body support in PyBullet next year.
by Erwin Coumans
Fri Dec 21, 2018 1:34 am
Forum: General Bullet Physics Support and Feedback
Topic: Mass values.
Replies: 3
Views: 366

Re: Mass values.

Haven't seen this before. Can you create a simple repro case and file it in the issue tracker?
by Erwin Coumans
Fri Nov 30, 2018 6:03 pm
Forum: PyBullet Support and Feedback
Topic: generic 6DOF constraint in pyBullet
Replies: 2
Views: 499

Re: generic 6DOF constraint in pyBullet

PyBullet doesn't use constraints by default, it uses btMultiBody primarily. So joints are not represented by constraints internally. then create a constraint that encapsulates those DOFs without having to do collision detection/simulation Why? Can you explain more in detail what you try to do with P...
by Erwin Coumans
Mon Nov 26, 2018 4:56 am
Forum: General Bullet Physics Support and Feedback
Topic: Dynamically skipping collision response.
Replies: 2
Views: 306

Re: Dynamically skipping collision response.

One thing you can try it setting the cp.m_distance1 to a very large value (for exampe BT_LARGE_FLOAT), so it will be skipped by the solver.

The cp.m_appliedImpulse is a return value from the solver, also used in case of warmstarting, so I wouldn't modify that value.
by Erwin Coumans
Sat Nov 24, 2018 2:03 am
Forum: PyBullet Support and Feedback
Topic: Varying the center of mass of an object
Replies: 2
Views: 683

Re: Varying the center of mass of an object

What I've tried so far is to create a multiBody and offset the collisionFramePosition and visualFramePosition to emulate a com that is not at the center of the mesh. However, I'm not sure if that correctly alters the center of mass for simulation or if I just offset frame positions without physical...
by Erwin Coumans
Sat Nov 24, 2018 1:03 am
Forum: General Bullet Physics Support and Feedback
Topic: Generating Contact Constraints.
Replies: 6
Views: 687

Re: Generating Contact Constraints.

>> m_lateralFrictionInitialized does no longer exists. It was replaced by a flag. Try using this instead: contactPoint.m_contactPointFlags |= BT_CONTACT_FLAG_LATERAL_FRICTION_INITIALIZED Also, best to use the gContactProcessedCallback (not added callback, so no need for the CUSTOM MATERIAL flag): gC...
by Erwin Coumans
Fri Nov 23, 2018 11:58 pm
Forum: General Bullet Physics Support and Feedback
Topic: Different types of friction.
Replies: 7
Views: 723

Re: Different types of friction.

The contact added callback is only called if one (or two) of the objects have the btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK set.
(use body->setCollisionFlags() ( body->getCollisionFlags() | btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK))

Using only the contact processed callback should work.
by Erwin Coumans
Fri Nov 23, 2018 11:54 pm
Forum: General Bullet Physics Support and Feedback
Topic: Generating Contact Constraints.
Replies: 6
Views: 687

Re: Generating Contact Constraints.

The m_appliedImpulseLaterial1/2 are the applied impulses after the solver is done. You can set cp.m_combinedFriction (scalar) and m_lateralFrictionDir1/m_lateralFrictionDir2 (orthogonal directions, projected in the ground plane). There are also cp.m_contactMotion1, cp.m_frictionCFM etc. cp.m_contact...
by Erwin Coumans
Fri Nov 23, 2018 8:52 pm
Forum: General Bullet Physics Support and Feedback
Topic: Different types of friction.
Replies: 7
Views: 723

Re: Different types of friction.

Bullet computes 2 friction directions, orthogonal to the contact normal. You can override those directions in a contactAddedCallback. By default, Bullet aligns the first friction direction along the projected velocity vector. You can disable this by adding a solver mode 'SOLVER_DISABLE_VELOCITY_DEPE...
by Erwin Coumans
Fri Nov 23, 2018 8:17 pm
Forum: General Bullet Physics Support and Feedback
Topic: Generating Contact Constraints.
Replies: 6
Views: 687

Re: Generating Contact Constraints.

There are a multiple ways, to name a few: one way is to implement your own near callback. By default, Bullet uses void btCollisionDispatcher::defaultNearCallback. There is an API for this: btCollisionDispatcher::setNearCallback Right after the call "collisionPair.m_algorithm->processCollision(&obj0W...
by Erwin Coumans
Wed Nov 21, 2018 6:49 pm
Forum: General Bullet Physics Support and Feedback
Topic: Different types of friction.
Replies: 7
Views: 723

Re: Different types of friction.

Latest Bullet uses an implicit friction cone, clamping against lateral friction coefficient (setFriction). There is still the option to use pyramid friction cone approximation, like ODE. With setAnisotropicFriction you can have different friction coefficients along 2 orthogonal axis, which may help ...
by Erwin Coumans
Mon Nov 19, 2018 9:48 pm
Forum: General Bullet Physics Support and Feedback
Topic: Hinge2 damping
Replies: 5
Views: 519

Re: Hinge2 damping

We need to look into that. Would it be possible to re-create a small demo that shows the problem in the ExampleBrowser, and file a issue in the tracker? See https://github.com/bulletphysics/bullet3/issues (note that this tracker is mostly volunteering work, so it sometimes takes long time before it ...
by Erwin Coumans
Thu Nov 15, 2018 7:38 pm
Forum: General Bullet Physics Support and Feedback
Topic: printStats()
Replies: 9
Views: 798

Re: printStats()

Since many developers have their own, you can interface to your own task scheduler. There are however a few built-in task schedulers, pick one of those: addTaskScheduler(btGetSequentialTaskScheduler()); #if BT_THREADSAFE if (btITaskScheduler* ts = btCreateDefaultTaskScheduler()) { m_allocatedTaskSch...
by Erwin Coumans
Thu Nov 15, 2018 2:20 am
Forum: General Bullet Physics Support and Feedback
Topic: printStats()
Replies: 9
Views: 798

Re: printStats()

All defines, such as BT_ENABLE_THREADSAFE and BT_USE_DOUBLE_PRECISION etc should be added in both lib and app, and better be the same in both. Usually I just put the physics source code together with the app, to avoid any mismatch/out-of-date version etc. >> https://twitter.com/BramStolk/status/1051...
by Erwin Coumans
Thu Nov 15, 2018 12:29 am
Forum: General Bullet Physics Support and Feedback
Topic: Poor performance when ghost object overlaps many btBoxShapes [with video]
Replies: 5
Views: 666

Re: Poor performance when ghost object overlaps many btBoxShapes [with video]

>> 1. Is a ghost object even the right way to detect if enemies are near each unit? If not, what would work better? Another option is to use an broadphase aabbTest query first. This may be good enough, but you can perform a more accurate query if needed on the objects returned by the aabbTest (and t...