示例#1
0
        public void LoadModel(MDL0Node model)
        {
            model.Populate();
            model._renderAttribs._renderBones = false;
            model._renderAttribs._renderPolygons = true;
            model._renderAttribs._renderWireframe = false;
            model._renderAttribs._renderVertices = false;
            model.ApplyCHR(null, 0);
            model.ApplySRT(null, 0);

            if (UseExceptions) foreach (string texname in TexturesToDisable) {
                MDL0TextureNode tex = model.TextureGroup.FindChild(texname, false) as MDL0TextureNode;
                if (tex != null) {
                    tex.Enabled = false;
                }
            }

            modelPanel1.ClearAll();
            modelPanel1.AddTarget((IRenderedObject)model);

            if (UseExceptions && PolygonsToDisable.ContainsKey(_charString)) {
                foreach (int polygonNum in PolygonsToDisable[_charString]) {
                    MDL0ObjectNode poly = model.PolygonGroup.FindChild("polygon" + polygonNum, false) as MDL0ObjectNode;
                    if (poly != null) poly.IsRendering = false;
                }
            }

            Box box = model.GetBox();
            Vector3 min = box.Min, max = box.Max;
            if (ZoomOut) {
                min._x += 20;
                max._x -= 20;
            }
            modelPanel1.SetCamWithBox(min, max);
        }