Example #1
0
 public BoxShape AddBoxShape(float3 boxHalfExtents)
 {
     IBoxShapeImp iBoxShapeImp = _dwi.AddBoxShape(boxHalfExtents);
     var retval = new BoxShape();
     retval.BoxShapeImp = iBoxShapeImp;
     iBoxShapeImp.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);
        }