Search found 849 matches
- Fri Oct 30, 2015 4:06 pm
- Forum: General Bullet Physics Support and Feedback
- Topic: Best way to simulate a gyro sensor?
- Replies: 7
- Views: 8911
Re: Best way to simulate a gyro sensor?
Sounds like you don't need a real "physical gyroscope" but you need logic that can measure relative rotations. The good news is that this is much easier to do in Bullet than it is in the real world. Bullet has an API that can provide the world-frame rotation of a btRigidBody at any time. O...
- Fri Oct 30, 2015 1:13 pm
- Forum: General Bullet Physics Support and Feedback
- Topic: Best way to simulate a gyro sensor?
- Replies: 7
- Views: 8911
Re: Best way to simulate a gyro sensor?
Balanced gyroscopes are used to track the orientation of moving things (submarines and airplanes), or to stabilize things (fancy cameras). Unbalanced gyroscopes suffer precession in a non-inertial reference frame and are used to as novelty toy and physics demonstration. Tracking rotations and stabil...
- Tue Oct 27, 2015 1:22 pm
- Forum: General Bullet Physics Support and Feedback
- Topic: btTransform vs custom transform representation
- Replies: 6
- Views: 11654
Re: btTransform vs custom transform representation
No, btMotionState is a pure virtual base class. You must derive your own MotionState and override the setWorldTransform() and getWorldTransform( ) methods to do what you want. The only guarantee is that the Bullet simulation will call those methods at the appropriate times. In short, you must implem...
- Mon Oct 26, 2015 10:18 pm
- Forum: General Bullet Physics Support and Feedback
- Topic: btTransform vs custom transform representation
- Replies: 6
- Views: 11654
Re: btTransform vs custom transform representation
Bullet will call btMotionState::getWorldTransform() for two conditions: (1) When the btRigidBody is first created if the btMotionState was passed to the constructor. (2) Once every substep if the object is KINEMATIC. Note that for DYNAMIC objects Bullet calls btMotionState::setWorldTransform() once ...
- Mon Oct 26, 2015 5:04 pm
- Forum: General Bullet Physics Support and Feedback
- Topic: btTransform vs custom transform representation
- Replies: 6
- Views: 11654
Re: btTransform vs custom transform representation
I think all of your proposed solutions are fine. Wrapping btTransform with your own Transform class could be a partial step toward just adopting Bullet's math library everywhere if you eventually decide that is what you want to do. Abstracting the physics libraries out completely is nice if you thin...
- Sun Oct 18, 2015 3:06 pm
- Forum: General Bullet Physics Support and Feedback
- Topic: While porting this I found this...
- Replies: 19
- Views: 47986
Re: While porting this I found this...
I was curious to see how compiler optimization would affect your example code. I had to modify it a bit in order to prevent the compiler from optimizing your loops out entirely: #include <string.h> #include <stdio.h> #include <ctime> class Vector { public: float _a,_b,_c; inline Vector( float a, flo...
- Sun Oct 18, 2015 2:02 pm
- Forum: General Bullet Physics Support and Feedback
- Topic: While porting this I found this...
- Replies: 19
- Views: 47986
Re: While porting this I found this...
It is true that avoiding copies can help optimize code. For this reason the Havok physics engine doesn't even provide operator+() in its hkVector3 API. Instead it has hkVector3::add() and forces the developer to explicitly call constructors for temp variables when doing vector math -- constructors t...
- Fri Oct 16, 2015 3:49 pm
- Forum: General Bullet Physics Support and Feedback
- Topic: While porting this I found this...
- Replies: 19
- Views: 47986
Re: While porting this I found this...
FLT_MIN represents the smallest positive non-zero value that can be represented by 32-bit floats, so something on the order of 1e-37 whereas -FLT_MAX represents the most negative floating point value. Yes, sometimes it makes sense to use a custom EPSILON rather than SIMD_EPSILON . Meh, not using BT...
- Fri Oct 09, 2015 4:14 pm
- Forum: General Bullet Physics Support and Feedback
- Topic: Softbody cutting possible with Bullet ?
- Replies: 6
- Views: 8855
Re: Softbody cutting possible with Bullet ?
No, that real-time softbody cut simulation feature is not included in Bullet yet. Bullet could probably do the stretching response but the cutting would have to be new custom code.
- Tue Oct 06, 2015 3:55 pm
- Forum: General Bullet Physics Support and Feedback
- Topic: [Solved] Hinge with angular motor getting stuck.
- Replies: 6
- Views: 5526
Re: [Solved] Hinge with angular motor getting stuck.
BTW, completely disabling deactivation might not be what, depending on what exactly you're trying to do -- an object that never deactivates can constantly wake up other objects nearby and if the hinged object is ever expected to actually come to rest then deactivation is useful. If you allow the obj...
- Tue Oct 06, 2015 2:51 pm
- Forum: General Bullet Physics Support and Feedback
- Topic: Simulating coin stacking
- Replies: 5
- Views: 4692
Re: Simulating coin stacking
I pasted your modifications into the BasicExample.cpp file and saw the same poor behavior. I then experimented with different numbers and dimensions of the coins and learned that the simulation could succeed if I tried combinations of the following: (1) increase the thickness of the coins (2) reduce...
- Tue Oct 06, 2015 12:52 am
- Forum: General Bullet Physics Support and Feedback
- Topic: Simulating coin stacking
- Replies: 5
- Views: 4692
Re: Simulating coin stacking
My guess is that the coins are interpenetrating upon initialization, so Bullet is trying to use penetration resolution rather than enforcing contact points. I wonder what the dimensions of the coins are and what is their collision margin.
- Wed Sep 30, 2015 4:51 pm
- Forum: General Bullet Physics Support and Feedback
- Topic: Manual recovery from penetration problem
- Replies: 5
- Views: 6115
Re: Manual recovery from penetration problem
You could compute the AABB of all penetration vectors and then chose the corner that is furthest from the origin. Dunno if it works but is what I would try if I were doing the same thing. The AABB combined with the sum of all penetration vectors could provide an even fancier solution. I can imagine ...
- Mon Sep 28, 2015 4:31 am
- Forum: General Bullet Physics Support and Feedback
- Topic: Inconsistent/inaccurate AABB calculation for small shapes
- Replies: 2
- Views: 2797
Re: Inconsistent/inaccurate AABB calculation for small shape
I wonder if you're actually seeing the "collision margin" of the shapes. For more information about the margin I suggest you watch this youtube video.
- Mon Sep 28, 2015 4:25 am
- Forum: General Bullet Physics Support and Feedback
- Topic: Strange behaviour when setting collision shapes inertia
- Replies: 2
- Views: 2573
Re: Strange behaviour when setting collision shapes inertia
My guess would be that the "center of mass" of your shape is outside its bounding hull. In Bullet the center of mass of the btRigidBody in the world-frame is its position, and in the shape's frame it is the origin. This means that if you use a mesh with an offset such that the origin is no...