27 template<
typename GetForce,
typename GetSurface>
33 :
Element(
name), get_force_fn_(get_force_fn), get_surface_fn_(get_surface_fn), config_(config)
36 "Force element force callback must return an sva::ForceVecd");
38 "Force element surface callback must return an sva::PTransformd");
46 builder.
write(get_force_fn_());
47 builder.
write(get_surface_fn_());
49 config_.
write(builder);
53 GetForce get_force_fn_;
54 GetSurface get_surface_fn_;
58 template<
typename GetForce,
typename GetSurface,
typename SetForce>
66 GetForce get_force_fn,
67 SetForce set_force_fn,
68 GetSurface get_surface_fn)
69 :
ForceRO(
name, config, get_force_fn, get_surface_fn), set_force_fn_(set_force_fn)
82 SetForce set_force_fn_;
88 template<
typename GetForce,
typename GetSurface>
89 auto Force(
const std::string & name, GetForce get_force_fn, GetSurface get_surface_fn)
95 template<
typename GetForce,
typename GetSurface>
96 auto Force(
const std::string & name,
const ForceConfig & config, GetForce get_force_fn, GetSurface get_surface_fn)
102 template<
typename GetForce,
typename GetSurface,
typename SetForce>
103 auto Force(
const std::string & name, GetForce get_force_fn, SetForce set_force_fn, GetSurface get_surface_fn)
109 template<
typename GetForce,
typename GetSurface,
typename SetForce>
110 auto Force(
const std::string & name,
112 GetForce get_force_fn,
113 SetForce set_force_fn,
114 GetSurface get_surface_fn)