Esempio n. 1
0
        public Chunk(int x, int y)
        {
            _x = x; _y = y;

            mi = new MeshInstance();
            AddChild(mi);
            cs  = new CollisionShape();
            ccs = new ConcavePolygonShape();
            cs.SetShape(ccs);
            AddChild(cs);
        }
Esempio n. 2
0
        private void Patch(MixedRealityExtensionApp app, ConcavePolygonShape concavePolygonShape)
        {
            var tempId = MeshId;

            app.AssetManager.OnSet(MeshId, asset =>
            {
                if (MeshId != tempId)
                {
                    return;
                }
                concavePolygonShape.Data = (Vector3[])(asset.Asset as Mesh).SurfaceGetArrays(0)[0];
            });
        }
Esempio n. 3
0
        public void createCollision()
        {
            StaticBody          staticBody = new StaticBody();
            ConcavePolygonShape shape      = new ConcavePolygonShape();
            var faces = Mesh.GetFaces();

            shape.Data = faces;
            CollisionShape collisionShape = new CollisionShape {
                Shape = shape
            };

            staticBody.AddChild(collisionShape);
            AddChild(staticBody);
        }