16 const Eigen::Matrix2f global_R_human =
human.pose.linear();
17 const Eigen::Vector2f global_V_offset = global_R_human * params.offset;
20 pose.translation() += global_V_offset;
25 .shape = {.a = params.intimateRadius, .b = params.intimateRadius},
26 .penalty = intimatePenalty,
27 .weight = params.intimateWeight,
28 .homotopicRelevance =
true,
32 float velocityNorm =
human.linearVelocity.norm();
34 float movementStretch = 1 + velocityNorm * params.movementInfluence / 1000;
35 if (velocityNorm != 0)
38 float movementDirection =
39 std::atan2(
human.linearVelocity.y(),
human.linearVelocity.x()) - M_PI_2;
40 pose.linear() = Eigen::Rotation2Df(movementDirection).toRotationMatrix();
42 human.linearVelocity / velocityNorm * params.personalRadius * (movementStretch - 1);
47 .shape = {.a = params.personalRadius, .b = movementStretch * params.personalRadius},
48 .penalty = personalPenalty,
49 .weight = params.personalWeight,
50 .homotopicRelevance =
false,
53 return {intimate, personal};