-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added get/setLCPSolver functions to ConstraintSolver #633
Conversation
See this StackOverflow post for justification: http://stackoverflow.com/a/8114913/111426
|
||
/// Get collision detector | ||
collision::CollisionDetector* getCollisionDetector() const; | ||
|
||
/// Set LCP solver | ||
void setLCPSolver(std::unique_ptr<LCPSolver> _lcpSolver); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passing const reference like std::shared_ptr<T>
case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That shouldn't be done for unique_ptr
because we want the ownership of the solver to be passed into the ConstraintSolver
. Passing by reference wouldn't allow that.
unique_ptr
is really weird when it comes to function arguments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, thanks for the clarification. Good to know!
Also, this pull request looks good to merge.
I'm not really sure whether this should be managed by There are no backwards compatibility concerns with |
I think Since
For the user's convenience. This way an
Instead of requiring the user to do confusing things with |
I am not a huge fan of that paradigm for two reasons. First, the function signature is inscrutable to people that are unfamiliar with template argument packs. Second, we have to define this type of overload for every function that accepts an I would prefer to provide a |
That sounds like a good alternative to me. |
|
Added get/setLCPSolver functions to ConstraintSolver
There is currently no way to use anything other than the default LCP solver in
ConstraintSolver
. This pull request adds functions that parallel theget/setCollisionDetector
for theLCPSolver
.