Elipsoid Collision Shape?

Is it possible to make an elipsoid collision shape in JBullet? Like an elongated sphere for example.

Native Bullet appears to have had this functionality even 10 years ago.

The trick was to scale a MultiSphereShape instead of a regular SphereShape. Looking at the docs there is no reference to this advanced sphere shape, as if someone forgot to port it over.

If you really need to do something using an elipsoid shape, you could take a look at CompuondCollisionShape (pasting together several shapes), HullCollisionShape (works like a Mesh, I think), or just scaling the SphereCollisionShape using .setScale(Vector3f).

A HullCollisionShape isn’t a good option here since I’ll likely have too many mesh to mesh collisions.

The docs on scaling:

You can change the scale of collisionshapes (whether it be, Simple or Mesh). You cannot change the scale of a CompoundCollisionShape however. A sphere collision shape, will change its radius based on the X component of the vector passed in. You must scale a collision shape before attaching it to the physicsSpace, or you must readd it to the physicsSpace each time the scale changes.

I wouldn’t be here if it were that easy :wink: [quote=“MisterCavespider, post:2, topic:36670”]
Yes, but how do you suggest I make an elipsoid out of spheres and cubes?

Are you sure HullCollisionShapes can’t collide either?

No I mean it would be too performance intensive. And I’m not in the hopeless-looking-for-a-workaround phase yet.

I think that if you want to use the shapes that jbullet already offers, you should use a CompuondCollisionShape, and SimplexCollisionShapes (lines, triangles, squares).

I think that you should stop suggesting random stuff if it’s not relevant to the problem at all.

Now looking at the JBullet wiki, it DOES have the btMultiSphereShape included. What I’m asking is why doesn’t jME have a class that links to it. Or maybe the JBullet page simply links to the Bullet wiki, hm.

Alright, after downloading and looking into JBullet itself I can confirm that the feature is missing.

I suppose that this changes the question to: What’s the progress on native Bullet support? I haven’t seen any posts about it in quite some time.

I recently read in the forum that the new jME 3.1 dropped jBullet in favor of native Bullet.
Don’t know the topic in depth though, just stumbled across someone confirming this.

1 Like

I assume it was overlooked when the native bullet implementation was first done. Most likely because it doesn’t seem to have to much use, except I guess in this case. Looking roughly at the doc for btMultiSphereShape, it could potentially be added to JME if we really wanted to.

I’ve been looking and fixing some bugs on JME’s native bullet implementation in my spare time, but that’s just me. Currently, I’ve reached a stand still however because I’m getting some weird native crashes since the switch to gradle 2.13.

Yes that’s correct. jBullet is based off a very old implementation of bullet and is written in Java. The native bullet implementation is based off the more recent versions of bullet but is written in C++ and using JNI.


Why are you unable to simply have an obj model that is an ellipsoid and create a collision from that?

An ellipsoid can be used for collision detection with simple math. It’s literally almost the very fastest form of collision detection possible, second only to a pure sphere.

A mesh can be used for collision detection with lots of complicated math that takes a long time to perform. This is pretty much the slowest type of collision detection possible.

So, I guess that’s why.

1 Like


Yes. Have read a book about the details behind game physics and agree to pspeed.