Skip to content
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

Is FixedJoint CANUSE? #179

Closed
LLRukia opened this issue Nov 23, 2020 · 7 comments
Closed

Is FixedJoint CANUSE? #179

LLRukia opened this issue Nov 23, 2020 · 7 comments
Assignees
Labels

Comments

@LLRukia
Copy link

LLRukia commented Nov 23, 2020

I created a fixedjoint in my test program, and I give a speed (no matter linear or angular) to one of the rigid body of joint.
I can see it rotate totally irregular.

Then I review the code of SolveFixedJointSystem, I found a clerical error at line 457:
Vector3 w1 = mFixedJointComponents.mI2[i] * angularImpulseBody1;

I fixed it and try again, it behaves the same as before.

I am confused that does FixedJoint work well?

@DanielChappuis
Copy link
Owner

Hello. Thanks for your feedback.

I am not sure I understand your scenario. Can you please describe precisely what is your scenario, what behavior do you expect and what is happening ?

Then I review the code of SolveFixedJointSystem, I found a clerical error at line 457:
Vector3 w1 = mFixedJointComponents.mI2[i] * angularImpulseBody1;

Why do you think there is an error ? Can you please give some explanation ?

@DanielChappuis DanielChappuis self-assigned this Nov 23, 2020
@LLRukia
Copy link
Author

LLRukia commented Nov 24, 2020

1

when we apply the impulse to rigid body 1, why using inertia tensor of body 2(mI2)?
Is it because of the impulse applied to each body is equal, then I think when changing angular speed should use inertia tensor of the body which is applying impulse.

I notice that the same position correction code in BallandSocketJoint, which use mI1 at line 366:
const Vector3 w1 = mBallAndSocketJointComponents.mI1[i] * angularImpulseBody1;

If there are any mistake, plz advise me.

@LLRukia
Copy link
Author

LLRukia commented Nov 24, 2020

ball_and_socket_joint_constraint_unlock
I expect this behavior. This is a custom ball and socket joint rotation constraint. I think when the limit is violated, it behaves like a fixed joint.

@DanielChappuis
Copy link
Owner

Ok I see. Yes it's seems to be an error.

I have fixed this issue in the "issue_179" branch here. Could you try to pull this branch and see if it fixes the issue on your side ?

@LLRukia
Copy link
Author

LLRukia commented Nov 26, 2020

I found another error at FixedJointComponents.cpp, in function moveComponentToIndex:
new (mImpulseTranslation + destIndex) Vector3(mImpulseRotation[srcIndex]);
It should be new (mImpulseTranslation + destIndex) Vector3(mImpulseTranslation [srcIndex]);

@LLRukia
Copy link
Author

LLRukia commented Nov 26, 2020

And it seems to work well after we fix these 2 errors!

@LLRukia LLRukia closed this as completed Nov 26, 2020
@DanielChappuis
Copy link
Owner

Perfect. I have pushed both fixes on the master branch.

Thanks a lot for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants