Ball mixer

Show what you made with Bullet Physics SDK: Games, Demos, Integrations with a graphics engine, modeler or any other application
Post Reply
d3x0r
Posts: 51
Joined: Tue Dec 11, 2012 9:59 pm

Ball mixer

Post by d3x0r »

I'm really surprised that applyCentralImpulse() isn't scaled by the time interval.

I've added a time scalar that I can apply to the time step... (I also apply the scale to all the magntitutes of the force vectors)

l.bullet.dynamicsWorld->stepSimulation( (now-l.last_tick)/(TIME_SCALE*1000.f), 100);
* edit*
I guess this should actually be...
l.bullet.dynamicsWorld->stepSimulation( (now-l.last_tick)/(TIME_SCALE*1000.f), 1000/* * (now-l.last_tick) + 500*/, 0.016/TIME_SCALE );

hmm no, I need to locate those continuous force sort of things instead of impulses; when I slow it down, the initial kick defies gravity, when I speed it up, gravity overwhelms all....

Okay no; force doesn't scale with time either. ApplyCentralForce.

*****


now and last_tick are normally in milliseconds. But what I'm noticing now is that the balls still go a long way into the ground and/or when they get corrected from the ground, they jump a very long way, then continue at a very slow pace. One would think that a large change in position would be matched with a large velocity.


---- description of what I've done, not really important? ---------------

I have a simulation that is basically a bunch of spheres in a cup shaped container. I added a cylinder at the bottom that rotates around the center of the cup, and stirs the spheres. I tried to make a cone shaped ground plane, but I couldn't get the visualization to work, and it was upside down, so instead I added an attractor that iterates for all objects, if they are on the bottom (dot(x) < 0.1), then I use applyCentralImpulse() in a direction of the center of the botttom of the cup. Then I have a repulsor (inverse attractor) with a 1/d^3 falloff on the bottom and apply to things that are (dot(origin)> 0.9) ( a narrow cone in the center ).

Which this all leads me to think, can those soft fluid particles be used to simulate these air flows rather than absolutes? Unfortunatly, if the attractor on the bottom isn't strong enough to cause the ball to move a significant distance into the respulsor cone, they all just end up getting shot upward mostly back toward their same side... the simulation is of a actual thing that has a high pressure air stream coming out of the center of the cup ( and it has a cone/pyramidal cone to draw the balls toward the air )... but really the air wouldn't affect the ball until the ball is more than it's radius into the stream so the outside can be affected, then additionally, this air stream will keep the ball confined because of the difference in air pressures...
d3x0r
Posts: 51
Joined: Tue Dec 11, 2012 9:59 pm

Re: Ball mixer

Post by d3x0r »

l.bullet.dynamicsWorld->stepSimulation( (now-l.last_tick)/(TIME_SCALE*1000.f), 1000/* * (now-l.last_tick) + 500*/, 0.016/TIME_SCALE );

....

But what I'm noticing now is that the balls still go a long way into the ground and/or when they get corrected from the ground, they jump a very long way, then continue at a very slow pace.
Changing the time scale this way stops the large position corrections.

But; how do I apply forces which scale with time?
Post Reply