00001 #ifndef OPENTISSUE_DYNAMICS_MBD_UTIL_MBD_COMPUTE_RELATIVE_CONTACT_VELOCITY_H 00002 #define OPENTISSUE_DYNAMICS_MBD_UTIL_MBD_COMPUTE_RELATIVE_CONTACT_VELOCITY_H 00003 // 00004 // OpenTissue, A toolbox for physical based simulation and animation. 00005 // Copyright (C) 2007 Department of Computer Science, University of Copenhagen 00006 // 00007 #include <OpenTissue/configuration.h> 00008 00009 namespace OpenTissue 00010 { 00011 00012 namespace mbd 00013 { 00025 template<typename vector3_type> 00026 vector3_type compute_relative_contact_velocity( 00027 vector3_type const & v_a 00028 , vector3_type const & w_a 00029 , vector3_type const & r_a 00030 , vector3_type const & v_b 00031 , vector3_type const & w_b 00032 , vector3_type const & r_b 00033 ) 00034 { 00035 vector3_type u_a = cross(w_a , r_a) + v_a; 00036 vector3_type u_b = cross(w_b , r_b) + v_b; 00037 return (u_b - u_a); 00038 } 00039 00040 } //End of namespace mbd 00041 00042 } //End of namespace OpenTissue 00043 00044 #endif // OPENTISSUE_DYNAMICS_MBD_UTIL_MBD_COMPUTE_RELATIVE_CONTACT_VELOCITY_H