-
Notifications
You must be signed in to change notification settings - Fork 52
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
[Bug] Prismatic Joint affected by Vector2.Normalize #47
Comments
We have discussed Vector2.Normalize before: So if you can make a case for it being a common enough use case to create a prismatic joint with localAxisA of 0, I would suggest the fix should go into that contructor rather than into Vector2.Normalize |
Description
When applying a Prismatic Joint, the localAxisA is normalized. This causes
{NaN, NaN}
when the joint isnew Vector2(0,0)
See
box2d-netstandard/src/box2dx/Box2D.NetStandard/Dynamics/Joints/Prismatic/PrismaticJoint.cs
Line 146 in b34d623
How To Reproduce
Create a new prismatic joint where the
localAxisA
isnew Vector2(0,0)
You can work around the issue by using Reflection to update the private values:
Expected Behavior
Something similar to:
https://github.com/erincatto/box2d/blob/c6cc3646d1701ab3c0750ef397d2d68fc6dbcff2/src/dynamics/b2_prismatic_joint.cpp#L88
The text was updated successfully, but these errors were encountered: