ChrisR Posted September 22, 2015 Share Posted September 22, 2015 So while i have been messing around with rotating objects, i came across a small bug in the babylonjs file. Under Mesh.rotate: If the space is in World space, and it has a parent, the code looks like: if (this.parent) { var invertParentWorldMatrix = this.parent.getWorldMatrix().clone(); invertParentWorldMatrix.invert(); axis = Vector3.TransformNormal(axis, invertParentWorldMatrix); }This causes the mesh to grow exponentially in size as its being rotated. Simple fix add axis.normalize() to the end: So if (this.parent) { var invertParentWorldMatrix = this.parent.getWorldMatrix().clone(); invertParentWorldMatrix.invert(); axis = Vector3.TransformNormal(axis, invertParentWorldMatrix); axis.normalize(); }I'm sure to whomever updates the babylon files this will make sence to normalize the axis before applying it to rotate. Or maybe you would prefer it in Math.RotationAxis to normalize the axis before use as a better precaution? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 22, 2015 Share Posted September 22, 2015 I like the Math.RotationAxis fix better Do you mind sending a PR to get credits for your fix? (and do not forget to update https://github.com/BabylonJS/Babylon.js/blob/master/dist/preview%20release/what's%20new.md) Quote Link to comment Share on other sites More sharing options...
ChrisR Posted September 22, 2015 Author Share Posted September 22, 2015 Yea, i mentioned before doing PR and Git related activities confuse me. However i have always wanted to learn. Maybe i will spend the next few hours getting aquatined. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 22, 2015 Share Posted September 22, 2015 No worry I would be please to do the fix for you and add your name as the developer (But I think it worth learning how to use git) ChrisR 1 Quote Link to comment Share on other sites More sharing options...
ChrisR Posted September 22, 2015 Author Share Posted September 22, 2015 Thanks and I will learn it Quote Link to comment Share on other sites More sharing options...
ChrisR Posted September 23, 2015 Author Share Posted September 23, 2015 Created a pull request. I believe i have things figured out now on git fenomas 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 23, 2015 Share Posted September 23, 2015 well done! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.