Example #1
0
 public ConvexHullShape AddConvexHullShape()
 {
     IConvexHullShapeImp iConvexHullShapeImp = _dwi.AddConvexHullShape();
     var retval = new ConvexHullShape();
     retval.ConvexHullShapeImp = iConvexHullShapeImp;
     iConvexHullShapeImp.UserObject = retval;
     return retval;
 }
Example #2
0
 public ConvexHullShape AddConvexHullShape(float3[] points, bool optimized = true)
 {
     IConvexHullShapeImp iConvexHullShapeImp = _dwi.AddConvexHullShape(points, optimized);
     var retval = new ConvexHullShape();
     retval.ConvexHullShapeImp = iConvexHullShapeImp;
     iConvexHullShapeImp.UserObject = retval;
     return retval;
 }
        public void InitColliders()
        {
            MyBoxCollider = _world.AddBoxShape(2);
            MySphereCollider = _world.AddSphereShape(2);
            MyCylinderCollider = _world.AddCylinderShape(new float3(2, 4, 2));

            BoxMesh = MeshReader.LoadMesh(@"Assets/Cube.obj.model");
            TeaPotMesh = MeshReader.LoadMesh(@"Assets/Teapot.obj.model");
            PlatonicMesh = MeshReader.LoadMesh(@"Assets/Platonic.obj.model");
            float3[] verts = PlatonicMesh.Vertices;

            MyConvHull = _world.AddConvexHullShape(verts, true);

            float3[] vertsTeaPot = TeaPotMesh.Vertices;
            TeaPotHull = _world.AddConvexHullShape(vertsTeaPot, true);
            TeaPotHull.LocalScaling = new float3(0.05f, 0.05f,0.05f);
        }