예제 #1
0
 /// Return the resultant contact torque acting on the specified contactable object.
 public ChVector GetContactableTorque(ChContactable contactable)
 {
     /* Dictionary<IChContactable, ForceTorque>.Enumerator Iterator = contact_forces.find(contactable);
      * if (Iterator != contact_forces.end())
      * {
      *   return Iterator.second.torque;
      * }*/
     return(new ChVector(0));
 }
예제 #2
0
 /// Callback used to report contact points already added to the container.
 /// If it returns false, the contact scanning will be stopped.
 public abstract bool OnReportContact(
     ChVector pA,                     //< contact pA
     ChVector pB,                     //< contact pB
     ChMatrix33 <double> plane_coord, //< contact plane coordsystem (A column 'X' is contact normal)
     double distance,                 //< contact distance
     double eff_radius,               //< effective radius of curvature at contact
     ChVector react_forces,           //< react.forces (if already computed). In coordsystem 'plane_coord'
     ChVector react_torques,          //< react.torques, if rolling friction (if already computed).
     ChContactable contactobjA,       //< model A (note: some containers may not support it and could be nullptr)
     ChContactable contactobjB        //< model B (note: some containers may not support it and could be nullptr)
     );
예제 #3
0
        /// Return the resultant contact force acting on the specified contactable object.
        public ChVector GetContactableForce(ChContactable contactable)
        {
            //Dictionary<IChContactable, ForceTorque> it = new Dictionary<IChContactable, ForceTorque>();

            /*  foreach (KeyValuePair<IChContactable, ForceTorque> it in contact_forces)
             * {
             *    if(it.Key == contactable)
             *    {
             *        return it[1].force;
             *    }
             * }
             * Dictionary<IChContactable, ForceTorque> Iterator = contact_forces.Find(contactable);
             * if (Iterator != contact_forces.Last())
             * {
             *    return Iterator[1].force;
             * }*/
            return(new ChVector(0));
        }
예제 #4
0
 /// Sets the pointer to the contactable object.
 /// A derived class may override this, but should always invoke this base class implementation.
 public virtual void SetContactable(ChContactable mc)
 {
     mcontactable = mc;
 }