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

Boxes on Physics Rigid Bodies Demo not rotating #19

Closed
joshua-hew opened this issue Nov 1, 2020 · 6 comments
Closed

Boxes on Physics Rigid Bodies Demo not rotating #19

joshua-hew opened this issue Nov 1, 2020 · 6 comments

Comments

@joshua-hew
Copy link

joshua-hew commented Nov 1, 2020

The Boxes on the Rigid Bodies Demo are not rotating. Oddly, the physics / the Matter.Bodies seems to be correct and when you stack one box on the ledge of another so that more than half of it is hanging off, it will fall and rotate, but the box's visuals do not match the "invisible" 2d rigid body.

I pulled this repo and ran on iPhone 11 pro - iOS 14.

@bberak
Copy link
Owner

bberak commented Nov 1, 2020

Thanks for the heads-up @CSugarPrince - I think others might be experiencing the same issue. This demo was initially written on a much older version of React and has not been updated since. I suspect that the Box renderer's are not updating due to a shallow prop comparison.. I'll try get this fixed soon - I might even update the renderers to use functional React components rather than classes - since that seems to be becoming the standard method of writing components.

@joshua-hew
Copy link
Author

Hey, thanks for the quick reply! Also I forked your repo and made a quick fix that uses Animated.View from react-native-reanimated to solve the issue.

Do you mind if I make a pull request so that you can take a look?

@bberak
Copy link
Owner

bberak commented Nov 6, 2020

Oh that would be great @CSugarPrince, please do!

Cheers!

@joshua-hew
Copy link
Author

Sorry for getting back to you so late. Just submitted pull request #20 for my fix. I tested on IPhone 11 pro simulator and on my physical device using expo. Didn't check to see if fix affected other parts of the handbook apart from the rigid bodies demo (though I don't think it should).

Anyways, take a look when you can and see if everything works for you!

@bberak
Copy link
Owner

bberak commented Nov 21, 2020

Awesome @CSugarPrince - I’ll check it out tomorrow and get it merged asap. Cheers!

@bberak
Copy link
Owner

bberak commented Nov 22, 2020

Addressed in PR #20 - much appreciated!

@bberak bberak closed this as completed Nov 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants