Exemple #1
0
        public RenderObject GetRenderObject(Table.Table table, string id, Origin origin, bool asRightHanded)
        {
            var(preMatrix, _) = GetPreMatrix(table, origin, asRightHanded);
            switch (id)
            {
            case Wire:
                return(new RenderObject(
                           id,
                           GetBaseMesh().Transform(preMatrix),
                           new PbrMaterial(table.GetMaterial(_data.Material)),
                           _data.IsVisible
                           ));

            case Bracket:
                return(new RenderObject(
                           id,
                           GateBracketMesh.Clone().Transform(preMatrix),
                           new PbrMaterial(table.GetMaterial(_data.Material)),
                           _data.IsVisible && _data.ShowBracket
                           ));

            default:
                throw new ArgumentException("Unknown gate mesh \"" + id + "\".");
            }
        }
        public Mesh GetMesh(string id, Table.Table table, Origin origin, bool asRightHanded)
        {
            var(preMatrix, _) = GetPreMatrix(BaseHeight(table), origin, asRightHanded);
            switch (id)
            {
            case Wire:
                return(GetBaseMesh().Transform(preMatrix));

            case Bracket:
                return(GateBracketMesh.Clone().Transform(preMatrix));
            }
            throw new ArgumentException("Unknown gate \"" + id + "\".");
        }
Exemple #3
0
        public RenderObjectGroup GetRenderObjects(Table.Table table, Origin origin, bool asRightHanded)
        {
            var(preMatrix, _) = GetPreMatrix(table, origin, asRightHanded);
            var postMatrix = GetPostMatrix(table, origin);

            return(new RenderObjectGroup(_data.Name, "Gates", postMatrix, new RenderObject(
                                             "Wire",
                                             GetBaseMesh().Transform(preMatrix),
                                             new PbrMaterial(table.GetMaterial(_data.Material)),
                                             _data.IsVisible
                                             ),
                                         new RenderObject(
                                             "Bracket",
                                             GateBracketMesh.Clone().Transform(preMatrix),
                                             new PbrMaterial(table.GetMaterial(_data.Material)),
                                             _data.IsVisible && _data.ShowBracket
                                             )
                                         ));
        }