Search found 841 matches

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: 368

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: 693

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: 689

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: 689

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: 689

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: 693

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: 693

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

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

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

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

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);
by drleviathan
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: 369

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

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...
by drleviathan
Sun Feb 19, 2023 5:52 am
Forum: General Bullet Physics Support and Feedback
Topic: Looking for help with settings and code to get my physics game correct
Replies: 6
Views: 1006

Re: Looking for help with settings and code to get my physics game correct

After thinking about it some more I realized: if I just wanted a very simple rolling controller that pretty much always moved in the direction I wanted then I would blend toward a target linear velocity and then slam the angular velocity to always agree. In C++ it might look something like the code ...
by drleviathan
Mon Feb 06, 2023 3:56 pm
Forum: General Bullet Physics Support and Feedback
Topic: No performance difference between static and kinematic bodies?
Replies: 3
Views: 531

Re: No performance difference between static and kinematic bodies?

The broadphase keeps track of the AABBs and also overlapping AABB pairs between distinct objects that might need narrowphase collision check to compute the contact points (if any). Ignoring narrowphase costs... there is overhead in: (1) knowing all the AABBs and overlaps and (2) adding new AABBs to ...