public ChLink(ChLink other) : base(other) { Body1 = null; Body2 = null; react_force = other.react_force; react_torque = other.react_torque; }
/// Attach an arbitrary ChPhysicsItem (e.g. ChBody, ChParticles, ChLink, etc.) to the assembly. /// It will take care of adding it to the proper list of bodies, links, meshes, or generic /// physic item. (i.e. it calls AddBody(), AddLink(), AddMesh(), or AddOtherPhysicsItem()). /// Note, you cannot call Add() during an Update (i.e. items like particle generators that /// are already inserted in the assembly cannot call this) because not thread safe; instead, /// use AddBatch(). public void Add(ChPhysicsItem item) { //ChBody body = new ChBody(); System.Type body = typeof(ChBody); if (body.Equals(item)) { ChBody b = (ChBody)item; AddBody(b); return; } System.Type link = typeof(ChLink); if (link.Equals(item)) { ChLink l = (ChLink)item; AddLink(l); return; } AddOtherPhysicsItem(item); }
/// Attach a link to this assembly. public virtual void AddLink(ChLink link) { link.SetSystem(system); linklist.Add(link); }