Go to the documentation of this file.00001 #ifndef OPENTISSUE_COLLISION_CONTINUOUS_CONTINUOUS_MOTION_INTERPOLATION_H
00002 #define OPENTISSUE_COLLISION_CONTINUOUS_CONTINUOUS_MOTION_INTERPOLATION_H
00003
00004
00005
00006
00007
00008
00009
00010 #include <OpenTissue/configuration.h>
00011
00012 #include <OpenTissue/collision/continuous/continuous_conservative_advancement.h>
00013
00014 namespace OpenTissue
00015 {
00016 namespace collision
00017 {
00018 namespace continuous
00019 {
00020
00048 template<typename transform_type, typename object_type1, typename object_type2, typename motion_policy>
00049 inline bool motion_interpolation(
00050 transform_type const & A_from
00051 , transform_type const & A_to
00052 , object_type1 & A
00053 , typename transform_type::value_type const & r_max_a
00054 , transform_type const & B_from
00055 , transform_type const & B_to
00056 , object_type2 & B
00057 , typename transform_type::value_type const & r_max_b
00058 , typename transform_type::vector3_type & p_a
00059 , typename transform_type::vector3_type & p_b
00060 , typename transform_type::value_type & time_of_impact
00061 , size_t & iterations
00062 , typename transform_type::value_type const & epsilon
00063 , size_t const & max_iterations
00064 , motion_policy const & policy
00065 )
00066 {
00067 typedef typename transform_type::value_traits value_traits;
00068 typedef typename transform_type::vector3_type V;
00069
00070 V v_a;
00071 V omega_a;
00072 V v_b;
00073 V omega_b;
00074
00075 motion_policy::compute_velocities( A_from, A_to, value_traits::one(), v_a, omega_a );
00076 motion_policy::compute_velocities( B_from, B_to, value_traits::one(), v_b, omega_b );
00077
00078 return conservative_advancement(
00079 A_from , v_a , omega_a , A , r_max_a
00080 , B_from , v_b , omega_b , B , r_max_b
00081 , p_a
00082 , p_b
00083 , time_of_impact
00084 , iterations , epsilon, value_traits::one(), max_iterations, policy
00085 );
00086 }
00087
00088 }
00089 }
00090 }
00091
00092
00093 #endif