VHACD in BulletSharp

Post Reply
Posts: 3
Joined: Mon Jan 09, 2023 6:48 pm

VHACD in BulletSharp

Post 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?
Post Reply