5 #ifndef CNOID_BODY_CONSTRAINT_FORCE_SOLVER_H
6 #define CNOID_BODY_CONSTRAINT_FORCE_SOLVER_H
8 #include <cnoid/CollisionSeq>
9 #include "exportdecl.h"
15 class CollisionDetector;
16 class ContactMaterial;
28 void setBodyCollisionDetectionMode(
29 int bodyIndex,
bool isBodyToBodyCollisionEnabled,
bool isSelfCollisionDetectionEnabled);
33 void setFrictionCoefficientRange(
double minFriction,
double maxFriction);
34 double minFrictionCoefficient()
const;
35 double maxFrictionCoefficient()
const;
37 void setContactCullingDistance(
double thresh);
38 double contactCullingDistance()
const;
40 void setContactCullingDepth(
double depth);
41 double contactCullingDepth();
43 void setCoefficientOfRestitution(
double epsilon);
44 double coefficientOfRestitution()
const;
46 void setGaussSeidelErrorCriterion(
double e);
47 double gaussSeidelErrorCriterion();
49 void setGaussSeidelMaxNumIterations(
int n);
50 int gaussSeidelMaxNumIterations();
52 void setContactDepthCorrection(
double depth,
double velocityRatio);
53 double contactCorrectionDepth();
54 double contactCorrectionVelocityRatio();
56 void set2Dmode(
bool on);
58 [[deprecated(
"This function does nothing. Set Link::LinkContactState to Link::sensingMode from a controller.")]]
59 void enableConstraintForceOutput(
bool on);
61 void initialize(
void);
63 void clearExternalForces();
65 std::shared_ptr<CollisionLinkPairList> getCollisions();
68 typedef std::function<bool(
Link* link1,
Link* link2,
72 void registerCollisionHandler(
const std::string& name,
CollisionHandler handler);
73 bool unregisterCollisionHandler(
const std::string& name);