Search found 843 matches
- Tue Jun 13, 2023 7:12 pm
- Forum: General Bullet Physics Support and Feedback
- Topic: Issues simulating buoyancy with forces
- Replies: 4
- Views: 1546
Re: Issues simulating buoyancy with forces
I believe the general treatment for drag approximations is more of an infinite series: drag_force = c0 * speed^0 + c1 * speed^1 + c2 * speed^2 + ... and the empirical exercise is to measure what are the proper values for the various coefficients: c0 , c1 , c2 , ... Your calculation of drag has c0 an...
- Tue Jun 13, 2023 3:41 pm
- Forum: General Bullet Physics Support and Feedback
- Topic: Issues simulating buoyancy with forces
- Replies: 4
- Views: 1546
Re: Issues simulating buoyancy with forces
You're using the AABB of the Box for the buoyancy intersection. The AABB of a Box is much larger than the Box itself. It is the bounding box around sphere that contains the Box no matter its orientation. In other words... when the Box tumbles arbitrarily it will always be inside its bounding sphere....
- Tue May 16, 2023 3:39 am
- Forum: General Bullet Physics Support and Feedback
- Topic: Quick question: Object moves different amount each frame despite constant velocity.
- Replies: 1
- Views: 2306
Re: Quick question: Object moves different amount each frame despite constant velocity.
Also curious is: the distance traveled along the x-axis does not agree with your speed and timestep: time = 0.05 sec rate = 250 m/sec distance = rate * time = 250 m/sec * 0.05 sec = 12.5m I wonder if you're bumping up against a maximum speed limit, especially since your total speed is so steady. May...
- Wed Mar 29, 2023 3:39 am
- Forum: General Bullet Physics Support and Feedback
- Topic: Setting the center of mass does nothing except translate the model
- Replies: 5
- Views: 3296
Re: Setting the center of mass does nothing except translate the model
Alas, physics simulations require approximation and abstraction in order to run in real-time on real-life hardware. The discrepancy between how you think it should work, and how it actually works, is a manifestation of that truth. The fact of the matter is: it is possible to get the effect you want,...
- Mon Mar 27, 2023 8:11 am
- Forum: General Bullet Physics Support and Feedback
- Topic: Getting and setting angular velocity in body space?
- Replies: 7
- Views: 18371
Re: Getting and setting angular velocity in body space?
Sorry about that. I updated the link to what I hope is a publicly shared google photo. Yes, I guess I misunderstood your problem. I still might not understand it but I'll take another swing (let me know if this is in the right direction). If the vehicle is being steered directly... and you're trying...
- Mon Mar 27, 2023 4:31 am
- Forum: General Bullet Physics Support and Feedback
- Topic: Getting and setting angular velocity in body space?
- Replies: 7
- Views: 18371
Re: Getting and setting angular velocity in body space?
Yes, I believe I made an error in my derivation. Let me try again from scratch... I tried again on paper and took a photo . Fig1 shows the leaning motorcycle. Fig2 shows the balance of forces which apply torque on the center of mass with focal point where the tire touches the road. Fig3 shows the ve...
- Sun Mar 26, 2023 6:39 am
- Forum: General Bullet Physics Support and Feedback
- Topic: Getting and setting angular velocity in body space?
- Replies: 7
- Views: 18371
Re: Getting and setting angular velocity in body space?
I have fixed a few bugs in your code, and added a bunch of comments: btRigidBody *car = common.brickCars[a]->body; btTransform worldTransform = car->getWorldTransform(); worldTransform.setOrigin(btVector3(0,0,0)); btVector3 up = btVector3(0,1,0); // When we set 'normal' to be 'up' we are assuming th...
- Fri Mar 24, 2023 3:03 pm
- Forum: General Bullet Physics Support and Feedback
- Topic: Setting the center of mass does nothing except translate the model
- Replies: 5
- Views: 3296
Re: Setting the center of mass does nothing except translate the model
Yes, the center of mass (COM) defines the local-frame origin which means: in order to shift the COM relative to the geometry you must shift the geometry instead. For this reason: btRigidBody::setCenterOfMassTransform() can only be understood to mean "set the COM transform in the world-frame&quo...
- Thu Mar 23, 2023 11:14 pm
- Forum: General Bullet Physics Support and Feedback
- Topic: Setting the center of mass does nothing except translate the model
- Replies: 5
- Views: 3296
Re: Setting the center of mass does nothing except translate the model
Yeah you don't want to use btRigidBody::setCenterOfMassTransform() . That sets the world_transform of the object's center of mass and doesn't change the center of mass in the object's local-frame. The center of mass in the object's local-frame is, by definition, the origin of the shape geometry. Con...
- Mon Mar 20, 2023 2:53 am
- Forum: General Bullet Physics Support and Feedback
- Topic: Getting and setting angular velocity in body space?
- Replies: 7
- Views: 18371
Re: Getting and setting angular velocity in body space?
For a rolling motorcycle the tilt of the vehicle is a balance between the torque from gravity and that of the centripetal force. In the case where the road is flat and the motorcycle has a forward speed and some tilt angle (from the vertical) then the torque balance relation looks like: (1) mass * s...
- Fri Mar 03, 2023 2:25 am
- Forum: General Bullet Physics Support and Feedback
- Topic: Kinematic objects colliding with dynamic objects very badly
- Replies: 2
- Views: 2265
Re: Kinematic objects colliding with dynamic objects very badly
What you want to do is to also set the velocities of the kinematic object correctly. Setting the velocities doesn't help move it to new transoforms, but it does help the collision system impart correct velocity on the dynamic object, allowing it to be knocked out of the way instead of getting into a...
- Mon Feb 27, 2023 4:03 pm
- Forum: General Bullet Physics Support and Feedback
- Topic: issue with softbody vs. custom concave shape
- Replies: 1
- Views: 2462
Re: issue with softbody vs. custom concave shape
Every system has its limits and you are adventuring outside those of the softbody collision system. Meanwhile, if you constantly invalidate the softbody cache (which was probably introduced to speed things up) then it would not be too surprising to suffer consequences of poor performance. Since you'...
- Tue Feb 21, 2023 5:47 pm
- Forum: General Bullet Physics Support and Feedback
- Topic: Reset/jump constraint to the initial position
- Replies: 3
- Views: 2305
Re: Reset/jump constraint to the initial position
Slamming the transform of the child object doesn't just work?
Code: Select all
child_body->setWordTransform(child_initial_transform);
- Mon Feb 20, 2023 5:07 am
- Forum: General Bullet Physics Support and Feedback
- Topic: Is it possible to create an ellipsoid shape in Bullet?
- Replies: 1
- Views: 2973
Re: Is it possible to create an ellipsoid shape in Bullet?
I've never personally used scaling on spheres however upon inspection of the code it looks like btSphereShape derives from btConvexInternalShape which has a m_localScaling data member. Try it and maybe it will work. Alternatively, you could use a btConvexHullShape . It is possible to set the collisi...
- Sun Feb 19, 2023 3:43 pm
- Forum: General Bullet Physics Support and Feedback
- Topic: Looking for help with settings and code to get my physics game correct
- Replies: 6
- Views: 3190
Re: Looking for help with settings and code to get my physics game correct
I should probably mention: one problem with slamming the linear velocity is it can override collision rebound effects and if the velocity blend is too strong it might lead to pushing the character through obstacle geometry (e.g. tunnel through a btBvhTriangleMeshShape terrain). To avoid this problem...