Render a debug ellipsoid for a mesh

Hey guys… how would i render (can please show snippets or a small playground) to render a debug ellipsoid for a mesh … or any simple object.

I really need to compare my toolkit character controller to a the basic contructs of a mesh and its ellipsoid should i moveWithCollisions.

Also… the ellipsoid X and Z … is that radius and the X is the half-extent height or what ???

If my character mesh (capsule) should be 2 meters tall with a radius of 0.5 … What would the ellipsoid be… 0.5 x 1 x 0.5 … ???

I just need to make sure im clear on this before i release my Native Collision System support for the toolkit

Yo @Deltakosh or @sebavan … I made a test playground using a cylinder to represent the ellipsoid shape:

Can please take a look and tweak the code to make a debug shape that is the true representation of the mesh ellipsoid

Ellipsoid is described here: Cameras, Mesh Collisions and Gravity - Babylon.js Documentation

This seems correct. ellipsoid is centered on position (+ellipsoidOffset) and x, y and z are the radiuses

So how do i render and ellipsoid and not a cylinder… Is that really a sphere with three seperate radius values for xyz or is the (or should there be) a MeshBuilder.CreateEllipsoid ???

So… Until we get MeshBuilder.CreateCapsule i have to use cylinders…

Can you please look over the CreateSphere for an ellipsoid… Since the mesh.ellipsoid values are all radius values for a sphere… Then this should be cool

                let debugCapsule:BABYLON.Mesh = null;
                if (typeof Ammo !== "undefined" && this._checkCollisions === false) {
                   debugCapsule = BABYLON.MeshBuilder.CreateCylinder(debugName, { subdivisions: this._capsuleSegments, height: capsuleSize.y, diameter: (capsuleSize.x * 2) }, this.scene);
                } else {
                    debugCapsule = BABYLON.MeshBuilder.CreateSphere(debugName, { segments: this._capsuleSegments, diameterX: (capsuleSize.x * 2), diameterY: (capsuleSize.y * 2), diameterZ: (capsuleSize.z * 2) }, this.scene);

And this is more what it should look like:

Right ???


As soon as PG&E flicks the power back on I will push the updates to get that going for you.

Wooo California fires…

I did not take this, but was taken by someone in a town right next to me at like 2:45 today…

Holly S… this pic is insane !!! It looks like hell in movies :frowning: Hope you are all safe.