Xeonzinc Posted March 1, 2016 Share Posted March 1, 2016 Hi, I found this issue when cloning an imported mesh, but it seems to apply to everything: ISSUE: A mesh rotated without the 'Quaternion' system does not have the rotation copied during cloning. See the issue here: http://www.babylonjs-playground.com/#VMRND#1 (the rotate function converts the mesh to Quaternion, but setting rotation does not). I've had a look through the source but didn't manage to find a likely cause. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 1, 2016 Share Posted March 1, 2016 Woot..it was a bad dirty bug:) fixed now! Xeonzinc 1 Quote Link to comment Share on other sites More sharing options...
Xeonzinc Posted March 2, 2016 Author Share Posted March 2, 2016 Wow! Super speed bug fixing! The mesh seems to be as expected now I also have a similar issue when cloning a skeleton from the same source (base imported version works fine, but cloned versions are distorted) - I hoped the above might fix it, but no luck. Although I have no idea if that is a rotation problem (no method to make a test playground as bone matrices confuse me...) Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 2, 2016 Share Posted March 2, 2016 Regarding the clone for skeleton, if you check this code, you see that it seems to work : https://github.com/BabylonJS/Samples/blob/master/Demos/Bones/bones.js#L36 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted March 2, 2016 Share Posted March 2, 2016 http://www.babylonjs-playground.com/#18U5SO#3 Not sure that shows anything worthwhile, but... I have to get into everyone's business, because, that's what I do. I have never heard of cloning skeletons, but, it appears that playground is doing it. Ok, bye. Quote Link to comment Share on other sites More sharing options...
Xeonzinc Posted March 2, 2016 Author Share Posted March 2, 2016 Thanks guys, yes i was basing my test around those demos, very useful A bit more investigating makes it look like it's not the skeleton cloning, but potentially still the mesh cloning - Wingnut's code adjusted for my mesh has very strange results... http://babylonjs-playground.com/#18U5SO#6 Cloned meshes seems to be distorted when using the same skeleton.....Digging further - manual checking of the two mesh objects shows these differences: 1) _boneTransformMatrices is different between then (same array size, but different values) 2) _poseMatrix is different between then... 3) cloned mesh has a undefined _rotationQuaternion: where as base does not 4) base mesh has undefined _waitingActions: while clone does not Does any of this ring alarms? Or am I just highlighting expected differences between meshes Wingnut 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 2, 2016 Share Posted March 2, 2016 Fixed (It was a double bug!! thanks to your analyze, I found that _poseMatrix was not cloned!!) Really good job Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted March 3, 2016 Share Posted March 3, 2016 Good job to you, too, DK! Thanks for the fix. Fast, too. I dunno how you do it, but we all love it! Nice job on the discovery/analysis, X! Quote Link to comment Share on other sites More sharing options...
Xeonzinc Posted March 6, 2016 Author Share Posted March 6, 2016 I'm happy to help where I can, although I feel like I just pop up and highlight mysterious issues rather than offer actual solutions ... maybe I'll understand it all enough one day That said - your fix works great when using the the same skeleton, but breaks down for cloned skeletons (mesh 3 gets the same kind of distortions we were seeing before): http://babylonjs-playground.com/#18U5SO#14 Using my tried and test method of helping.... - Mesh 3 (with the cloned skeleton) doesn't appear to have a _bonesTranformMatrices - The cloned skeleton on mesh 3 has nothing in it's _meshesWithPoseMatrix (the other skeleton has the other two meshes as expected) - The cloned skeleton on mesh 3 has a very different _transformMatrices (which actually looks similar to the _bonesTransformMatrices on the other two meshes....) My attempt to make swap around a _transformMatrices with a _bonesTransformMatrices in the babylon source has resulted in a very different error, so I will leave it here... Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 7, 2016 Share Posted March 7, 2016 Your comparison makes the debug REALLY easier It is fixed now THanks a lot! Xeonzinc 1 Quote Link to comment Share on other sites More sharing options...
Xeonzinc Posted March 8, 2016 Author Share Posted March 8, 2016 No problem - I think this is still clone related, so I'll keep it in here: Chains of cloned mesh/skeletons seem to be linked, and starting animations propagates through somehow - see here: http://babylonjs-playground.com/#18U5SO#18 You can use the three beginAnimation lines to start either 1,2 or all 3 of the meshes going at once. All I've managed to figure out is that it's based on the order which the mesh clones are built. For some reason starting animations on rabbit2 also starts rabbit3, but starting rabbit3 does not start rabbit2. Potentially related to the fixes you made above...? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 8, 2016 Share Posted March 8, 2016 still bugs Working on it Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 8, 2016 Share Posted March 8, 2016 And this is fixed now! 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.