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); }
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]; }); }
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); }