public ClothQuadDefinition(MyObjectBuilder_ClothSquaresComponentDefinition.ClothSquare sq) { ResX = sq.ResX; ResY = sq.ResY; V00 = sq.V00; V01 = sq.V01; V10 = sq.V10; V11 = sq.V11; var pins = new List <ImmutablePointRef>(); if (sq.Pins != null) { foreach (var p in sq.Pins) { for (var xo = 0; xo < p.XCount; xo++) { for (var yo = 0; yo < p.YCount; yo++) { pins.Add(new ImmutablePointRef(p.X + xo, p.Y + yo)); } } } } Pins = pins.ToArray(); TensionStrength = sq.TensionStrength; ShearStrength = sq.ShearStrength; StructuralStrength = sq.StructuralStrength; Damping = sq.Damping; Mass = sq.Mass; }
public ClothSection(MyObjectBuilder_ClothSquaresComponentDefinition.ClothSquare sq) { Def = new ClothQuadDefinition(sq); Bindings = sq.Pins.Where(x => !string.IsNullOrWhiteSpace(x.Bone)).Select(x => new Binding(x)).ToArray(); }