Search found 849 matches

by drleviathan
Mon Mar 28, 2022 4:53 am
Forum: General Bullet Physics Support and Feedback
Topic: How kinematic bodies work under the hood
Replies: 6
Views: 8923

Re: How kinematic bodies work under the hood

Bullet does not integrate kinematic objects forward. Instead it relies on custom external logic (e.g. stuff the game dev wrote) to supply their world transforms every substep. Typically this is done by supplying a MotionState that does the Right Thing inside its getWorldTransform() override. Usually...
by drleviathan
Tue Mar 15, 2022 1:34 pm
Forum: General Bullet Physics Support and Feedback
Topic: Is it safe to add rigidbody/collisionObject into the world during StepSimulation? [Single Thread Situation]
Replies: 3
Views: 6513

Re: Is it safe to add rigidbody/collisionObject into the world during StepSimulation? [Single Thread Situation]

I remembered something and figured I would mention it for the record: I had a situation where I wanted to be able to add/update/remove objects ASAP for a multi-threaded system where the operations could arrive from a different thread. The pending ops would be collated into three lists (add, update, ...
by drleviathan
Fri Mar 11, 2022 6:37 am
Forum: General Bullet Physics Support and Feedback
Topic: Is it safe to add rigidbody/collisionObject into the world during StepSimulation? [Single Thread Situation]
Replies: 3
Views: 6513

Re: Is it safe to add rigidbody/collisionObject into the world during StepSimulation? [Single Thread Situation]

The simple answer: no. A more complicated answer: the step consists of multiple substeps . It might be ok to add/remove a RigidBody/CollisionObject between substeps, however there is no default hook for calling your add/remove logic between substeps: you would have to add your own. Within the subste...
by drleviathan
Thu Mar 10, 2022 4:13 am
Forum: General Bullet Physics Support and Feedback
Topic: Can I update btRigidBody without adding/removing it from world?
Replies: 4
Views: 6448

Re: Can I update btRigidBody without adding/removing it from world?

For the inertia tensor, make sure to remove the object from the world before making the change, and re-insert it afterwards. Yes, changing the mass would also change the inertia tensor. It turns out the only way to change the mass is to make a call that also takes the local inertia diagonal. Bullet...
by drleviathan
Wed Mar 09, 2022 8:33 pm
Forum: General Bullet Physics Support and Feedback
Topic: Can I update btRigidBody without adding/removing it from world?
Replies: 4
Views: 6448

Re: Can I update btRigidBody without adding/removing it from world?

I read that for something as simple as changing the mass of the btRigidBody, it must be removed and re-added to the world. Not true: you can dynamically change the mass of a RigidBody without re-adding it to the world. However, if the body is inactive --> you probably want to activate it just in ca...
by drleviathan
Tue Mar 08, 2022 2:58 pm
Forum: General Bullet Physics Support and Feedback
Topic: Does different time step also makes different result?
Replies: 1
Views: 5331

Re: Does different time step also makes different result?

Yes, a different sub_step will produce different results. In particular, at longer sub_steps some object-object interactions could tunnel instead of collide. Even if you turn on continuous collision detection (CCD) the subtle differences introduced by different sub_steps will cause two otherwise ide...
by drleviathan
Wed Feb 23, 2022 2:26 pm
Forum: General Bullet Physics Support and Feedback
Topic: Unstable behavior on shapes like cylinder or box
Replies: 11
Views: 75009

Re: Unstable behavior on shapes like cylinder or box

Yes interesting. I downloaded your source code this morning and was looking around. I checked the commit logs and saw that you may have made some progress on the problem. I then diffed with history to browse the relevant changes. To tell the truth, I don't have any experience with rolling/spinning f...
by drleviathan
Wed Feb 23, 2022 1:48 pm
Forum: General Bullet Physics Support and Feedback
Topic: Rigidbody from btBvhTriangleMeshShape doesn't collide with Others
Replies: 1
Views: 5131

Re: Rigidbody from btBvhTriangleMeshShape doesn't collide with Others

I believe the btCompoundShape is designed to work with convex sub-shapes. Somewhere in the collision algorithm logic a shape->isConvex() check returns false and the result is a non-colliding body. Edit: In fact, btBvhTriangleMeshShape is not supported for dynamic or kinematic objects, only static . ...
by drleviathan
Tue Feb 22, 2022 5:50 pm
Forum: General Bullet Physics Support and Feedback
Topic: Unstable behavior on shapes like cylinder or box
Replies: 11
Views: 75009

Re: Unstable behavior on shapes like cylinder or box

Ok that debpMotionState looks fine: I don't see any misbehaving logic there.
by drleviathan
Tue Feb 22, 2022 4:55 pm
Forum: General Bullet Physics Support and Feedback
Topic: Unstable behavior on shapes like cylinder or box
Replies: 11
Views: 75009

Re: Unstable behavior on shapes like cylinder or box

The beer can... when it lands on the ground does it get deactivated? or does it remain active?

Are you using a custom MotionState in your game? If so, what does its getWorldTransform() and setWorldTransform() implementations look like?
by drleviathan
Tue Feb 22, 2022 1:42 am
Forum: General Bullet Physics Support and Feedback
Topic: Unstable behavior on shapes like cylinder or box
Replies: 11
Views: 75009

Re: Unstable behavior on shapes like cylinder or box

The box and cylinder shapes are not unstable. I've seen them work fine. I don't know what is wrong with your beer can. It behaves as if... the moment it hits the ground its world-frame inverse inertia tensor gets zero elements in the two axes perpendicular to the UP direction. That is: it is constra...
by drleviathan
Fri Feb 18, 2022 4:10 pm
Forum: General Bullet Physics Support and Feedback
Topic: Can I make btTriangleMeshShape from btHeightfieldTerrainShape?
Replies: 3
Views: 6583

Re: Can I make btTrangleMeshShape from btHeightfieldTerrainShape?

Why does the vertexBase of the getLockedVertexIndexBase function receive double pointers? The actual declaration for that API looks like this: void getLockedVertexIndexBase( unsigned char** vertexbase, int& numverts, PHY_ScalarType& type, int& stride, unsigned char** indexbase, int&...
by drleviathan
Thu Feb 17, 2022 5:19 am
Forum: General Bullet Physics Support and Feedback
Topic: Bullet skeletal animation
Replies: 4
Views: 8320

Re: Bullet skeletal animation

If you're animating a set of rigid shapes and want things to collide against them but don't need any collision feedback guiding the animation then that would be kinematic motion and you could do it the normal way: use custom MotionStates to communicate the body transforms to Bullet. That is, you wou...
by drleviathan
Wed Feb 16, 2022 4:10 pm
Forum: General Bullet Physics Support and Feedback
Topic: Bullet skeletal animation
Replies: 4
Views: 8320

Re: Bullet skeletal animation

This sounds much like a robot simulation project. Are you planning on using pyBullet or the C++ library? If pyBullet I suggest you move your question to the pyBullet forum . If C++ then you're in the right place. When it comes to how to proceed... it is a pretty broad question and since I haven't do...
by drleviathan
Wed Feb 16, 2022 3:54 pm
Forum: General Bullet Physics Support and Feedback
Topic: Obtaining multiple face normals from convexSweepTest? (to determine stepping vs sliding for kinematic controller)
Replies: 5
Views: 7293

Re: Obtaining multiple face normals from convexSweepTest? (to determine stepping vs sliding for kinematic controller)

More detail about trick (2) in case it helps anyone: I used the "zero inverse inertia tensor hack" to limit its rotation to only be about its "up" axis. It was linearly dynamic but I would slam its orientation according to user control (e.g. the orientation was effectively kinema...