16 const std::string& prefix,
21 std::vector<PlaneDataT<T>> result;
22 for (
const auto& loc : locators) {
23 if (loc.name.find(prefix) == 0) {
38 const std::string& prefix,
41 const float& floorOffset,
44 const std::string& prefix,
47 const double& floorOffset,
52 const size_t constrIndex,
56 std::array<Eigen::Matrix<T, 1, 3>, 1>& dfdv)
const {
61 T val = v[0].dot(constr.
normal) - constr.
d;
62 if (halfPlane_ && val > T(0)) {
68 if (!halfPlane_ || val < T(0)) {
69 dfdv[0] = constr.
normal.transpose();
std::vector< PlaneDataT< T > > constraints_
The PlaneErrorFunction computes the point-on-plane error or point-in-half-plane error.
void evalFunction(size_t constrIndex, const JointStateT< T > &state, Vector< T, 1 > &f, std::array< Vector3< T >, 1 > &v, std::array< Eigen::Matrix< T, 1, 3 >, 1 > &dfdv) const final
Vector3< double > Vector3d
Eigen::Matrix< T, Dim, 1, Options > Vector
Column vector alias (an Nx1 Eigen matrix).
std::vector< PlaneDataT< T > > createFloorConstraints(const std::string &prefix, const LocatorList &locators, const Vector3< T > &floorNormal, const T &floorOffset, const float weight)
Create non-penetration half-plane constraints from locators with the input prefix.
Vector3< float > Vector3f
template std::vector< PlaneDataT< float > > createFloorConstraints< float >(const std::string &prefix, const LocatorList &locators, const Vector3f &floorNormal, const float &floorOffset, const float weight)
std::vector< Locator > LocatorList
A collection of locators attached to a skeleton.
template std::vector< PlaneDataT< double > > createFloorConstraints< double >(const std::string &prefix, const LocatorList &locators, const Vector3d &floorNormal, const double &floorOffset, const float weight)
Profiling macros that dispatch to one of three backends, selected at compile time:
#define MT_PROFILE_FUNCTION()
Represents the state of a joint with local and global transformations.
TransformT< T > transform
Global transformation in world space.
Point-on-plane or Point-in-half-plane constraint data.