Search found 528 matches

by drleviathan
Wed Jun 19, 2019 5:41 pm
Forum: General Bullet Physics Support and Feedback
Topic: How to import stl file and make it a rigid body
Replies: 8
Views: 1334

Re: How to import stl file and make it a rigid body

Now that I look back at this issue I notice: it doesn't look like the OP was creating the motionState and then not using it. The motionState is a "bridge" object between the btRigidBody and the GameObject (rendered thing). One should at least supply the motionState to the btRigidBody constructor, an...
by drleviathan
Tue Jun 18, 2019 4:33 pm
Forum: General Bullet Physics Support and Feedback
Topic: Using Bullet for plain, accurate, convex intersection detection.
Replies: 5
Views: 278

Re: Using Bullet for plain, accurate, convex intersection detection.

I don't know how to do it exactly but merely mention it as a possibility. You'd have to identify the GJK parts, study its API, and figure out how to make it do what you want. Dunno how or if Bullet's GJK algorithm can be fine-tuned.
by drleviathan
Tue Jun 18, 2019 4:21 pm
Forum: General Bullet Physics Support and Feedback
Topic: Collision margin in BoxShapes.
Replies: 5
Views: 246

Re: Collision margin in BoxShapes.

How do you extract the worldTransform of the RigidBody ? Are you using something like DefaultMotionState::getWorldTransform() ? If so then the following issue may apply: Bullet's MotionState API will supply an extrapolated transform to the MotionState rather than the RigidBody 's true transform at t...
by drleviathan
Tue Jun 18, 2019 2:08 pm
Forum: General Bullet Physics Support and Feedback
Topic: Using Bullet for plain, accurate, convex intersection detection.
Replies: 5
Views: 278

Re: Using Bullet for plain, accurate, convex intersection detection.

One way to achieve your goal would be to use the GJK algorithm. Bullet has a GJK implementation but it is just one cog in the machine. You could extract that cog, figure out its API, and bend it to your will. Alternatively you could search for some other GJK implementation or even implement your own...
by drleviathan
Mon Jun 17, 2019 10:07 pm
Forum: General Bullet Physics Support and Feedback
Topic: Using torque to always push a rigidbody upright while on ground
Replies: 4
Views: 186

Re: Using torque to always push a rigidbody upright while on ground

If you have Quaternion or 3D math questions you can ask on this forum or on the live IRC channel on freenode. When it comes to how my example works I can offer this insight: Assume the displacement has an exponential decay time function of the form x(t) = X * exp(-t / tau) where tau is the timescale...
by drleviathan
Mon Jun 17, 2019 3:06 pm
Forum: General Bullet Physics Support and Feedback
Topic: btPersistentManifold::getNumContacts always returns zero
Replies: 1
Views: 157

Re: btPersistentManifold::getNumContacts always returns zero

I would like to help, however I don't have any good hypothesises. I looked at some working code that harvests contacts details from the contact manifolds and AFAICT your code should work. Perhaps you could supply enough source to actually build and reproduce your problem?
by drleviathan
Mon Jun 17, 2019 3:03 pm
Forum: General Bullet Physics Support and Feedback
Topic: Using Bullet for plain, accurate, convex intersection detection.
Replies: 5
Views: 278

Re: Using Bullet for plain, accurate, convex intersection detection.

More information please: Do you just need to know whether two shapes overlap or not? Or do you also need to know depth and direction of overlap? When they do touch do you need to know a useful contact manifold? This would be important for knowing how to transfer collision momentums. Do your calculat...
by drleviathan
Sun Jun 16, 2019 10:33 pm
Forum: General Bullet Physics Support and Feedback
Topic: Using torque to always push a rigidbody upright while on ground
Replies: 4
Views: 186

Re: Using torque to always push a rigidbody upright while on ground

Here is how I would do it: Rather than apply impulse I would implement a custom "action" (e.g. derive UprightCharacterAction from btActionInterface) which behaves like an "angular spring" and slams the velocity of the character toward an upright position. The main reason I don't like to operate in i...
by drleviathan
Sun Jun 16, 2019 8:56 pm
Forum: General Bullet Physics Support and Feedback
Topic: Collision margin in BoxShapes.
Replies: 5
Views: 246

Re: Collision margin in BoxShapes.

The shapeA-shapeB narrowphase collision algorithms are registered into a indexed array and called for the right parings. Box-box gets its own specific entry. Other pairings may fallback to more general purpose convexShape-convexShape algorithms, dunno for sure. I've chanced upon the relevant code du...
by drleviathan
Sun Jun 16, 2019 5:21 am
Forum: General Bullet Physics Support and Feedback
Topic: Collision margin in BoxShapes.
Replies: 5
Views: 246

Re: Collision margin in BoxShapes.

The box-box algorithm does not add the margin. For more info watch this youtube video.
by drleviathan
Thu Jun 13, 2019 7:17 pm
Forum: General Bullet Physics Support and Feedback
Topic: Inconsistent output from btGjkPairDetector::getClosestPoints
Replies: 5
Views: 246

Re: Inconsistent output from btGjkPairDetector::getClosestPoints

No, our build configs are not the same.

I think I'm using Bullet 2.87. I copied most of your StovePipeDlg.cpp code into another project I had already had cmake build configuration all setup. I'm building on linux with g++ 7.4.0.
by drleviathan
Thu Jun 13, 2019 3:43 pm
Forum: General Bullet Physics Support and Feedback
Topic: Collision shapes appear to have boxes around them
Replies: 4
Views: 193

Re: Collision shapes appear to have boxes around them

The enum values are powers of 2 and represent binary bits in a numerical value. Multiple modes can be enabled by setting more than one bit.

You were returning 3 = 1 + 2 which is both DBG_DrawWireframe and DBG_DrawAabb.
by drleviathan
Thu Jun 13, 2019 12:22 am
Forum: General Bullet Physics Support and Feedback
Topic: Inconsistent output from btGjkPairDetector::getClosestPoints
Replies: 5
Views: 246

Re: Inconsistent output from btGjkPairDetector::getClosestPoints

When I run it I get: d12 = -0.0800091 d21 = -0.0799984 These values seem close enough to me. The GJK algorithm is an iterative algorithm which must decide when to exit. Depending on its path through the Minkowski space it could take a longer or shorter path and end up with slightly different answers.
by drleviathan
Thu Jun 13, 2019 12:02 am
Forum: General Bullet Physics Support and Feedback
Topic: Collision shapes appear to have boxes around them
Replies: 4
Views: 193

Re: Collision shapes appear to have boxes around them

CollisionDebugDrawer::drawLine() takes a color argument which you appear to ignore. I would bet that if you actually use the color argument the bounding box will show up a different shade than the shapes. It probably represents the bounding box of the object in the broadphase, which I think can be ...
by drleviathan
Wed Jun 12, 2019 4:12 am
Forum: General Bullet Physics Support and Feedback
Topic: What are parameters worldAabbMin & worldAabbMax
Replies: 2
Views: 172

Re: What are parameters worldAabbMin & worldAabbMax

Yes, when using an axis-sweep broadphase you have to decide at construction time its bounds. The sweep algorithm usually quantizes the bounds of the elements inside, so it needs to know what are the world limits so it can set the quantization. This also means if you use Really Big world bounds then ...