Ejemplo n.º 1
0
        public AccessoryDynamics(DocumentParser doc)
        {
            while (!doc.NextLineIsASection() && !doc.EOF())
            {
                string line = doc.ReadNextLine();

                switch (line)
                {
                    case "<lump_name>":
                        lump = doc.ReadNextLine();
                        break;

                    case "<mass>":
                        mass = doc.ReadFloat();
                        break;

                    case "<drivable_on>":
                        bDrivableOn = true;
                        break;

                    case "<solid>":
                        bSolid = true;
                        break;

                    case "<stop_sinking_into_ground>":
                        bStopSinkingIntoGround = true;
                        break;

                    case "<part_of_world>":
                        bPartOfWorld = true;
                        break;

                    case "<ignore_world>":
                        bIgnoreWorld = true;
                        break;

                    case "<inf_mass>":
                        bInfMass = true;
                        break;

                    case "<inf_mi>":
                        bInfMi = true;
                        break;

                    case "<buoyant>":
                        bBuouyant = true;
                        buoyancyCount = doc.ReadFloat();
                        buoyancyVector = doc.ReadVector3();
                        break;

                    case "<substance>":
                        substance = doc.ReadInt();
                        break;

                    case "<group>":
                        group = doc.ReadInt();
                        break;

                    case "<ignore_group>":
                        ignoreGroup = doc.ReadInt();
                        break;

                    case "<moments>":
                        moments = doc.ReadVector3();
                        break;

                    case "<buoyancy_relative_to_com>":
                        bBuoyancyRelativeToCOM = true;
                        break;

                    case "<centre_of_mass>":
                        centreOfMass = doc.ReadVector3();
                        break;

                    case "<sphere_rolling_resistance>":
                        sphereRollingResistance = doc.ReadFloat();
                        break;

                    case "<shape>":
                        shape = new AccessoryShape(doc);
                        break;

                    case "<breakable>":
                        breakable = new AccessoryBreak(doc);
                        break;

                    case "<world_joint>":
                        worldJoint = new AccessoryJoint(doc);
                        break;

                    case "<child_joint>":
                        childJoint = new AccessoryJoint(doc);
                        break;

                    default:
                        throw new NotImplementedException(string.Format("Unknown [DYNAMICS] setting: {0}", line));
                }
            }
        }
Ejemplo n.º 2
0
        public AccessoryDynamics(DocumentParser doc)
        {
            while (!doc.NextLineIsASection() && !doc.EOF())
            {
                string line = doc.ReadNextLine();

                switch (line)
                {
                case "<lump_name>":
                    Lump = doc.ReadNextLine();
                    break;

                case "<mass>":
                    Mass = doc.ReadFloat();
                    break;

                case "<drivable_on>":
                    DrivableOn = true;
                    break;

                case "<solid>":
                    Solid = true;
                    break;

                case "<stop_sinking_into_ground>":
                    StopSinkingIntoGround = true;
                    break;

                case "<part_of_world>":
                    PartOfWorld = true;
                    break;

                case "<ignore_world>":
                    IgnoreWorld = true;
                    break;

                case "<inf_mass>":
                    InfMass = true;
                    break;

                case "<inf_mi>":
                    InfMi = true;
                    break;

                case "<buoyant>":
                    Buoyant        = true;
                    BuoyancyCount  = doc.ReadFloat();
                    BuoyancyVector = doc.ReadVector3();
                    break;

                case "<substance>":
                    Substance = doc.ReadInt();
                    break;

                case "<group>":
                    Group = doc.ReadInt();
                    break;

                case "<ignore_group>":
                    IgnoreGroup = doc.ReadInt();
                    break;

                case "<moments>":
                    Moments = doc.ReadVector3();
                    break;

                case "<buoyancy_relative_to_com>":
                    BuoyancyRelativeToCOM = true;
                    break;

                case "<centre_of_mass>":
                    CentreOfMass = doc.ReadVector3();
                    break;

                case "<sphere_rolling_resistance>":
                    SphereRollingResistance = doc.ReadFloat();
                    break;

                case "<shape>":
                    Shape = new AccessoryShape(doc);
                    break;

                case "<breakable>":
                    Break = new AccessoryBreak(doc);
                    break;

                case "<world_joint>":
                    WorldJoint = new AccessoryJoint(doc);
                    break;

                case "<child_joint>":
                    ChildJoint = new AccessoryJoint(doc);
                    break;

                default:
                    throw new NotImplementedException(string.Format("Unknown [DYNAMICS] setting: {0}", line));
                }
            }
        }