コード例 #1
0
 /// Calculate and return the general spring-damper torque at the specified configuration.
 public virtual double this[double time,           //< current time
                            double angle,          //< relative angle of rotation
                            double vel,            //< relative angular speed
                            ChLinkRotSpringCB link //< back-pointer to associated link
 ]
 {
     get { return(0); }
 }
コード例 #2
0
 public override double this[double time,           //< current time
                             double angle,          //< relative angle of rotation
                             double vel,            //< relative angular speed
                             ChLinkRotSpringCB link //< back-pointer to associated link
 ]
 {
     get
     {
         double torque = -spring_coef * (angle - rest_angle) - damping_coef * vel;
         return(torque);
     }
 }
コード例 #3
0
 public ChLinkRotSpringCB(ChLinkRotSpringCB other)
 {
     m_torque     = other.m_torque;
     m_torque_fun = other.m_torque_fun;  //// do we need a deep copy?
 }