Dad72 Posted March 23, 2016 Share Posted March 23, 2016 The physics is not cloning and/or instantiate on the mesh. http://www.babylonjs-playground.com/#1GDJ17#2 Christopher Stock 1 Quote Link to comment Share on other sites More sharing options...
RaananW Posted March 23, 2016 Share Posted March 23, 2016 Right, physics is not being cloned. Haven't thought about it. Should be possible, I'll work on that. Christopher Stock and Dad72 2 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 23, 2016 Author Share Posted March 23, 2016 Thanks Raanan. Quote Link to comment Share on other sites More sharing options...
RaananW Posted March 23, 2016 Share Posted March 23, 2016 PR submitted. https://github.com/BabylonJS/Babylon.js/pull/1063 Dad72 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 23, 2016 Author Share Posted March 23, 2016 There is an error with removeImpostor' of undefined http://www.babylonjs-playground.com/#1GDJ17#3 Quote Link to comment Share on other sites More sharing options...
RaananW Posted March 24, 2016 Share Posted March 24, 2016 Will look into that. Quote Link to comment Share on other sites More sharing options...
RaananW Posted March 24, 2016 Share Posted March 24, 2016 Physics is not enabled on this scene. The physics engine is missing and therefore fails. Turn on the log in the debug console and you'll see the error. But i found a different bug with the mesh's deep copy which I didn't take into account. Fixing. I tested it a bit differently (I don't reference the impostor in the mesh anymore, so DeepCopy didn't catch it). But I found a different problem - the clone of the mesh was not updated for some reason (missing the physics clone). Need to check what happened there. Anyhow, fixing all of the bugs right now. Last edit - the clone command moved to the mesh constructor, but the references were not altered correctly. PRed a fix, will be ready this evening. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 24, 2016 Author Share Posted March 24, 2016 okey. Have you seen this error too. I activate the phisics that I forget I have this error now. You have it may be fixe for the next ? Cannot read property 'rotationQuaternion' of undefined Thank you Raanan Quote Link to comment Share on other sites More sharing options...
RaananW Posted March 24, 2016 Share Posted March 24, 2016 Fixed already, should be soon updated in the playground Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 24, 2016 Share Posted March 24, 2016 Published Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 24, 2016 Author Share Posted March 24, 2016 Yes, I have not the error. but the physics is not clone with the object. http://www.babylonjs-playground.com/#1GDJ17#4 Quote Link to comment Share on other sites More sharing options...
RaananW Posted March 24, 2016 Share Posted March 24, 2016 ok! debugged. found the problem. commited the change. Crossing fingers Quote Link to comment Share on other sites More sharing options...
RaananW Posted March 24, 2016 Share Posted March 24, 2016 Ok! cloning works, but a new problem appeared. The meshes will always collide on the first frame of creation, as they essentially have the same position. I have a solution already, I just want to see how to integrate it correctly. I'll keep you posted here. here is a working version, notice line 35, which is the temporary solution - http://www.babylonjs-playground.com/#1GDJ17#5 Quote Link to comment Share on other sites More sharing options...
RaananW Posted March 24, 2016 Share Posted March 24, 2016 Ok, further debugging - this seems to be a cannon-specific problem. I know what the problem is, but I need to think of the best solution. for now, if you clone, use oimo - http://www.babylonjs-playground.com/#1GDJ17#7 , this will work correctly. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 24, 2016 Author Share Posted March 24, 2016 I like the solution beforeStep(). I hope you will come to find the solution for Cannon. Thank you Rannan for the hard work you do on the physics engine. with Oimo, it looks like the sphere penetrates into the soil Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 24, 2016 Author Share Posted March 24, 2016 I can not access a beforeStep. It may not yet be up to date on the deposit? Quote Link to comment Share on other sites More sharing options...
RaananW Posted March 25, 2016 Share Posted March 25, 2016 beforeStep should exist on each impostor, the physics engine requires it. Do you want to show an example where it's not working? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 25, 2016 Author Share Posted March 25, 2016 Yes, watching on my model, there is no impostor on the model to clone. Yet the basic model I clone, there is an impostor created. I do not understand why. I use a model created with ImportMesh and not a primitive, which may be the problem with the model created with ImortMesh. But this is a hypothesis. I try on a scene with ImortMesh playground and there is a problem that I do not understand when I clone the object. Looks like it hit the one and the other, despite their distance. by against the clone has a impostor, so I do not know why my clone model without impostor ? http://www.babylonjs-playground.com/#1GDJ17#10 I also found a problem with MeshImpostor (But I guess we'll see after that or something else.) : http://www.babylonjs-playground.com/#1GDJ17#9 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 25, 2016 Author Share Posted March 25, 2016 I made my tests listed in trying to understand, but I do not understand. My basic purpose has an impostor as shown here: Now if I clone this object, the impostor is not created as shown here: for the code I use is this: var name = global.objetSelected.name; console.log(global.objetSelected); // impostor exist global.objectsFreeze[name] = global.objetSelected.clone(name); console.log(global.objectsFreeze[name]); // impostor null global.objectsFreeze[name].physicsImpostor.beforeStep();//property 'beforeStep' of null I use the latest version of Babylon to day and I emptied all my covers to be sure it does not come from there. If you need my model, I can send it to you by PM. Thank you Raanan for your time. [EDIT] oops, looking at the deposit, your last pull request has been added, but minimize file (Babylon.min.js) was not built. I guess this is why cloning does not work for me. but why it works on the playground? Quote Link to comment Share on other sites More sharing options...
RaananW Posted March 25, 2016 Share Posted March 25, 2016 My guess is that the playground is being deployed from a different source and not from github. If you can build yourself, it'll work for sure. I'll anyhow update the build files later today. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 25, 2016 Author Share Posted March 25, 2016 I'll wait for the build. Do you look for this problem with MeshImpostor ? The objects pass through the ground. http://www.babylonjs-playground.com/#1GDJ17#9 Quote Link to comment Share on other sites More sharing options...
RaananW Posted March 25, 2016 Share Posted March 25, 2016 Mesh impostor only collides against sphere abd plane impostors. Not against box impostor. So it'll fall through. Not a bug, this is cannon's limitation. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 25, 2016 Author Share Posted March 25, 2016 ah, ok. It's a shame this limitation. Thank you Raanan Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 25, 2016 Author Share Posted March 25, 2016 Yes, it's fixed Raanan. cloning is carried out with the physics with the use of beforStep() 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.