Search found 849 matches

by drleviathan
Tue Nov 14, 2023 3:54 pm
Forum: General Bullet Physics Support and Feedback
Topic: Constraints between kinematic and dynamic rigid bodies
Replies: 8
Views: 76546

Re: Constraints between kinematic and dynamic rigid bodies

Oh hey, you're right! And btDiscreteDynamicsWorld::saveKinematicState() is called once per step rather than per substep. This means idea (1) would NOT solve your original problem, and also reintroduces the original mystery: Why would the first constraint relax so much? I understand you tried differe...
by drleviathan
Tue Nov 14, 2023 1:02 am
Forum: General Bullet Physics Support and Feedback
Topic: Constraints between kinematic and dynamic rigid bodies
Replies: 8
Views: 76546

Re: Constraints between kinematic and dynamic rigid bodies

So, shouldn't that swapped order be the default implementation actually ? Yes, I would think so, since it would fix the problem you were seeing while introducing minimal undesired behavior changes. However, I doubt Erwin would accept such a change if a PR was created. There is already a large backl...
by drleviathan
Mon Nov 13, 2023 4:37 pm
Forum: General Bullet Physics Support and Feedback
Topic: Constraints between kinematic and dynamic rigid bodies
Replies: 8
Views: 76546

Re: Constraints between kinematic and dynamic rigid bodies

...what are the consequences of adding/moving that btDiscreteDynamicsWorld::synchronizeKinematicMotionsStates() call prior to stepping the simulation... ? It isn't that we would be calling btDiscreteDynamicsWorld::synchronizeKinematicMotionsStates() before stepping the simulation. Rather, we would ...
by drleviathan
Sun Nov 12, 2023 7:43 pm
Forum: General Bullet Physics Support and Feedback
Topic: Using btIndexedMesh with btTriangleIndexVertexArray+btBvhTriangleMeshShape
Replies: 3
Views: 29716

Re: Using btIndexedMesh with btTriangleIndexVertexArray+btBvhTriangleMeshShape

The following code makes verts a copy of the data: auto verts = element->vertices(); and is equivalent to: std::vector<Vertex> verts = elements->vertices(); Note, the vertices() method is declared const (it does not modify the class instance's data members) which is why it returns a const reference ...
by drleviathan
Sun Nov 12, 2023 4:42 pm
Forum: General Bullet Physics Support and Feedback
Topic: AddConstraint: disableCollisionsBetweenLinkedBodies not working?
Replies: 2
Views: 26560

Re: AddConstraint: disableCollisionsBetweenLinkedBodies not working?

I made a quick audit of the logic that provides that feature --> by inspection it looked like it should work. I also checked the recent commit logs and didn't see any recent changes that would have affected that.
by drleviathan
Sun Nov 12, 2023 4:15 pm
Forum: General Bullet Physics Support and Feedback
Topic: Constraints between kinematic and dynamic rigid bodies
Replies: 8
Views: 76546

Re: Constraints between kinematic and dynamic rigid bodies

The problem is: for each substep constraints are solved prior to moving kinematic objects. If you examine the implementation of btDiscreteDynamicsWorld::stepSimulation() you'll see for each substep: btDiscreteDynamicsWorld::internalSingleStepSimulation() is called before btDiscreteDhnaicsWorld::sync...
by drleviathan
Tue Jun 13, 2023 7:12 pm
Forum: General Bullet Physics Support and Feedback
Topic: Issues simulating buoyancy with forces
Replies: 4
Views: 41884

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...
by drleviathan
Tue Jun 13, 2023 3:41 pm
Forum: General Bullet Physics Support and Feedback
Topic: Issues simulating buoyancy with forces
Replies: 4
Views: 41884

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....
by drleviathan
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: 31939

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...
by drleviathan
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: 54830

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,...
by drleviathan
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: 90975

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...
by drleviathan
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: 90975

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...
by drleviathan
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: 90975

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...
by drleviathan
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: 54830

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...
by drleviathan
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: 54830

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...