Hi,
i would like to achieve sphere in sphere collision system. Like a Motorcycle Sphere Cage Stunt.
But in fact, my goal is just to construct a ramp to launch some balls UP on an arc (so, i apply a force on X, and it should, following an arc, goes up on Y), and i will/could lock the balls on Z coordinate.
But, after trying a lot of different solutions (from tube obj to "two torus made from cylinders for a rail"), everytime, there is a problem in the physics simulation (rigging on an angle most, or sometime pass-through...) (i lauch balls with arbitrary force on X to verify)
I think the main problem is with convexe/concave shape ? Is this right ?
And, did someone already needed that kind of simulation, and how would you solve it ?
Could i use a tunnel, and how to emulate that (and, would this work) ?
If you have some pointers with if possible an example, that would be kind (i'm very new to bullet) !
sphere in sphere
-
- Posts: 5
- Joined: Mon Aug 22, 2011 8:03 pm
Re: sphere in sphere
Finally, looks like the better way to do it is using an extruded ARC (see attachment) but i'm still having grip/hook problems. Any solution to that problem ?
You do not have the required permissions to view the files attached to this post.
-
- Posts: 12
- Joined: Wed Aug 24, 2011 6:16 am
Re: sphere in sphere
Syl,
Does the exosphere need to dynamic or is it static? If it's static, I would load it as a model using btBvhTriangleMeshShape. You can have quite a few triangles and it should perform well. If it's dynamic, you'll need to use the heavyweight tests - GImpact, I believe.
Does the exosphere need to dynamic or is it static? If it's static, I would load it as a model using btBvhTriangleMeshShape. You can have quite a few triangles and it should perform well. If it's dynamic, you'll need to use the heavyweight tests - GImpact, I believe.
-
- Posts: 5
- Joined: Mon Aug 22, 2011 8:03 pm
Re: sphere in sphere
Hi Robert,
the goal is to launch the balls up to the area. I had the idea to use a sphere or a geosphere, because i thought it would be a good way to emulate the arc of a launch.
So yes, it's static, and i'm using btBvhTriangleMeshShape with the sample you provided in BT.
My problem is that the balls behave oddly, probably because of the angles? So I tried to complicate the 3D shape, but it still behaves oddly when I run the ball quickly. The problem is that the balls will be launched at a speed variable, so i must solve that. Well, i think i will simply cut that functionnality if this is not possible ! I will just launch balls from the upside of the area. At the very beginning i thinked that it was possible to make a sphere collide on the inside of another one...
the goal is to launch the balls up to the area. I had the idea to use a sphere or a geosphere, because i thought it would be a good way to emulate the arc of a launch.
So yes, it's static, and i'm using btBvhTriangleMeshShape with the sample you provided in BT.
My problem is that the balls behave oddly, probably because of the angles? So I tried to complicate the 3D shape, but it still behaves oddly when I run the ball quickly. The problem is that the balls will be launched at a speed variable, so i must solve that. Well, i think i will simply cut that functionnality if this is not possible ! I will just launch balls from the upside of the area. At the very beginning i thinked that it was possible to make a sphere collide on the inside of another one...
-
- Posts: 12
- Joined: Wed Aug 24, 2011 6:16 am
Re: sphere in sphere
I could be oversimplifying this in my head but it seems like the math isn't very hard - it's just the opposite of the normal sphere-sphere collision for one of the spheres (instead of constraining the center point distance to >= s1.radius + s2.radius you constrain it to <= s1.radius - s2.radius if s1 is the container and s2 is inside, so if you really wanted to, you could probably add the functionality to Bullet to do that specific shape and solution but the inside sphere will never be able to leave the outside one unless you slice it with a plane or something where it wont be constrained. I've never modified bullet so I don't know how feasible it is but I feel like a solution is there somewhere.
-
- Posts: 5
- Joined: Mon Aug 22, 2011 8:03 pm
Re: sphere in sphere
Yeah ! We have exactly the same opinion on that 
I will not do that ASAP, but i will think about debugging bullet physics to see what path it takes to do the math magic (i think it's very high level code). For now, i will concentrate myself on fancy things like modeling, and game logic.
I will also try to complicate MUCH launching pad to see if it can stop sending balls anywhere.
Thanks for your help.

I will not do that ASAP, but i will think about debugging bullet physics to see what path it takes to do the math magic (i think it's very high level code). For now, i will concentrate myself on fancy things like modeling, and game logic.
I will also try to complicate MUCH launching pad to see if it can stop sending balls anywhere.
Thanks for your help.
-
- Posts: 149
- Joined: Fri Jun 24, 2011 8:53 am
Re: sphere in sphere
I also thought inheriting from btSphereShape might have worked at first... but while it might work mathematically, I am scared of the implications it might have on (say) pre-emptive contact point generation, restitution and such. Those algorithms as far as I've understood work subtly on the starting point of having solid "in".rbgrn wrote:I could be oversimplifying this in my head but it seems like the math isn't very hard - it's just the opposite of the normal sphere-sphere collision for one of the spheres
So, I'd be interested in knowing if this turns out to work.