Page 1 of 1

VHACD in BulletSharp

Posted: Sun Jan 22, 2023 3:52 pm
by Realsphere

Im using BulletSharp in my app with VHACD, now when i start my app and use VHACD to generate my Convex Hulls, i get a offset and my objects start floating around.

i dont know why.

This is my code:

Code: Select all

CompoundShape cs = new CompoundShape();
            VHacdSharp.VHacd vhacd = new VHacdSharp.VHacd();
            var result = vhacd.ComputeAsync(go.renderer.Mesh.points.ToArray(), go.renderer.Mesh.tris.ToArray(), defaultvhacdparams).Result;

            foreach (VHacdSharp.ConvexHull hull in result.ConvexHulls)
                List<float> verts = new List<float>();
                foreach (var item in hull.Vertices)
                    verts.AddRange(new float[]
                ConvexHullShape chs = new ConvexHullShape(verts.ToArray());
                    ), chs);

            return cs;
What am i doing wrong?