public static Bone CopyOf(Bone bone) { return(new Bone { //OYM:这是什么骚操作 Name = bone.Name, NameEn = bone.NameEn, Position = bone.Position, ParentIndex = bone.ParentIndex, TransformLevel = bone.TransformLevel, Rotatable = bone.Rotatable, Movable = bone.Movable, Visible = bone.Visible, Controllable = bone.Controllable, HasIk = bone.HasIk, AppendRotate = bone.AppendRotate, AppendTranslate = bone.AppendTranslate, RotAxisFixed = bone.RotAxisFixed, UseLocalAxis = bone.UseLocalAxis, PostPhysics = bone.PostPhysics, ReceiveTransform = bone.ReceiveTransform, ChildBoneVal = ChildBone.CopyOf(bone.ChildBoneVal), AppendBoneVal = AppendBone.CopyOf(bone.AppendBoneVal), RotAxis = bone.RotAxis, LocalAxisVal = LocalAxis.CopyOf(bone.LocalAxisVal), ExportKey = bone.ExportKey, IkInfoVal = IkInfo.CopyOf(bone.IkInfoVal), }); }
public static LocalAxis CopyOf(LocalAxis localAxis) { return(new LocalAxis { AxisX = localAxis.AxisX, AxisY = localAxis.AxisY, AxisZ = localAxis.AxisZ }); }
public GsaNode Duplicate() { if (this.Node == null) { return(null); } GsaNode dup = new GsaNode { Node = new Node { AxisProperty = Node.AxisProperty, DamperProperty = Node.DamperProperty, MassProperty = Node.MassProperty, Name = Node.Name, Restraint = new NodalRestraint { X = Node.Restraint.X, Y = Node.Restraint.Y, Z = Node.Restraint.Z, XX = Node.Restraint.XX, YY = Node.Restraint.YY, ZZ = Node.Restraint.ZZ, }, SpringProperty = Node.SpringProperty, } }; if ((System.Drawing.Color)Node.Colour != System.Drawing.Color.FromArgb(0, 0, 0)) // workaround to handle that System.Drawing.Color is non-nullable type { dup.Node.Colour = Node.Colour; } dup.Point = new Point3d { X = Node.Position.X, Y = Node.Position.Y, Z = Node.Position.Z, }; if (m_id != 0) { dup.ID = m_id; } if (m_spring != null) { dup.Spring = m_spring.Duplicate(); } if (m_plane != null) { dup.LocalAxis = LocalAxis.Clone(); } return(dup); }
public override string ToString() { if (Node == null) { return("Null Node"); } string idd = " " + ID.ToString() + " "; if (ID == 0) { idd = " "; } string nodeTxt = "Gsa Node" + idd + "(" + Point.ToString() + ") " + System.Environment.NewLine; string localTxt = ""; if (LocalAxis != Plane.WorldXY) { localTxt = System.Environment.NewLine + "Local axis (" + LocalAxis.ToString() + ") "; } string sptTxt = "X: " + (Node.Restraint.X ? "Fix" : "Free") + ", Y: " + (Node.Restraint.Y ? "Fix" : "Free") + ", Z: " + (Node.Restraint.Z ? "Fix" : "Free") + ", XX: " + (Node.Restraint.XX ? "Fix" : "Free") + ", YY: " + (Node.Restraint.YY ? "Fix" : "Free") + ", ZZ: " + (Node.Restraint.ZZ ? "Fix" : "Free"); if (!Node.Restraint.X & !Node.Restraint.Y & !Node.Restraint.Z & !Node.Restraint.XX & !Node.Restraint.YY & !Node.Restraint.ZZ) { sptTxt = "Free"; } if (Node.Restraint.X & Node.Restraint.Y & Node.Restraint.Z & !Node.Restraint.XX & !Node.Restraint.YY & !Node.Restraint.ZZ) { sptTxt = "Pinned"; } if (Node.Restraint.X & Node.Restraint.Y & Node.Restraint.Z & Node.Restraint.XX & Node.Restraint.YY & Node.Restraint.ZZ) { sptTxt = "Fixed"; } return(nodeTxt + "Restraint: " + sptTxt + localTxt); }
public GsaNode Duplicate() { GsaNode dup = new GsaNode { Node = Node //add clone or duplicate if available }; Point3dList pt = new Point3dList(Point); Point3dList duppt = pt.Duplicate(); dup.Point = duppt[0]; if (m_id != 0) { dup.ID = m_id; } if (m_spring != null) { dup.Spring = m_spring.Duplicate(); } dup.m_plane = LocalAxis.Clone(); return(dup); }
public Bone() //OYM:骨骼类的构造方法 { ChildBoneVal = new ChildBone(); //OYM:初始化 AppendBoneVal = new AppendBone(); //OYM:初始化 LocalAxisVal = new LocalAxis(); //OYM:初始化 }
public Bone() { ChildBoneVal = new ChildBone(); AppendBoneVal = new AppendBone(); LocalAxisVal = new LocalAxis(); }