Exemplo n.º 1
0
        public ChLink(ChLink other) : base(other)
        {
            Body1 = null;
            Body2 = null;

            react_force  = other.react_force;
            react_torque = other.react_torque;
        }
Exemplo n.º 2
0
        /// 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);
        }
Exemplo n.º 3
0
 /// Attach a link to this assembly.
 public virtual void AddLink(ChLink link)
 {
     link.SetSystem(system);
     linklist.Add(link);
 }