Beispiel #1
0
        public Mesh(Table table)
        {
            children = new List <Mesh>();

            //General
            name        = table["Name"].StrValue;
            model       = table["Model"].StrValue;
            meshType    = MeshTypeEnumExtensions.TypeFromString(table["SpecialObjectName"].StrValue);
            systemType  = table["SystemType"].StrValue;
            sectionName = table["SectionName"].StrValue;
            uiName      = table["UIName"].StrValue;


            //Interaction
            PickSphereRADIUS = table["PickSphereRADIUS"].DoubleValue;

            //Position
            parentName = table["ParentTo"].StrValue;
            position   = new Vec3(table["Position"]);
            rotation   = new Vec3(table["Rotation"]);
            //Collision


            //Render
            render    = new MeshRenderData(table);
            collision = new MeshCollisionData(table);
            //Light
            //light = new MeshLightData(table);

            //States
            states = new MeshStatesData(table);

            //Surfaces
            surfaces = new MeshSurfacesData(table);
        }
Beispiel #2
0
        public Table ToTable()
        {
            Table table = new Table();

            //General
            table["Name"].Value = name;
            if (model != "")
            {
                table["Model"].Value = model;
            }
            table["SpecialObjectName"].Value = MeshTypeEnumExtensions.StringFromType(meshType);
            table["SystemType"].Value        = systemType;
            table["SectionName"].Value       = sectionName;
            table["UIName"].Value            = uiName;

            //


            table["ParentTo"].Value = (parent == null)?"NONE":parent.name;
            table["Position"]       = position.ToTable();
            table["Rotation"]       = rotation.ToTable();

            //Interaction
            table["PickSphereRADIUS"].Value = PickSphereRADIUS;

            //Render
            render.AddToTable(table);
            //light.AddToTable(table);

            //States
            states.AddToTable(table);

            //Surfaces
            surfaces.AddToTable(table);

            return(table);
        }