RaananW

Members
  • Content Count

    2,138
  • Joined

  • Last visited

  • Days Won

    52

Reputation Activity

  1. Like
    RaananW got a reaction from Dieterich in Shadow of invisible mesh   
    shadowGenerator.setTransparencyShadow(true);  seems to solve the problem.
    http://playground.babylonjs.com/#I2H3M#2
  2. Like
    RaananW got a reaction from webdva in importMesh and modify the model outside the callback   
    once you start understanding the way callbacks are executed, you don't really need global variables. 
    You could register the before render loop inside the callback.
    For example - you could create an external function that will be called after the callback was executed: http://www.babylonjs-playground.com/#1BUQD5
    You could also create a global variable and register the "beforeRender" after the callback was executed - http://www.babylonjs-playground.com/#1BUQD5#1 .
    So many ways of achieving it without inspecting constantly if mesh is not null.
  3. Like
    RaananW got a reaction from webdva in importMesh and modify the model outside the callback   
    Hi people,
    Javascript is async (and thank god for that!). If you load an object, it will take some time until it is rendered in the scene. you will only be able to change its position after the callback was executed. 
    changing the position before the object was loaded will not work (as you already noticed). you will have to work with callbacks, as this is how the language works  . you can still have a global reference to the object, and when it is not null do something with it. but then again, what's wrong with doing it after the callback was executed?
  4. Like
    RaananW got a reaction from webdva in [NewbieQuestion] My Box won't fall ( Gravity )   
    Hi! always nice to have fresh users on their quest for the next webgl game :-)
    There are two ways to use collisions and physics in babylon. It has a native collision system, that supports gravity on free cameras only. It also supports mesh-to-mesh collision when you wish to avoid meshes "merging" into one another. As Temechon said, the moveWithCollisions function of any mesh will move it in a specific direction until it collides with a different mesh. you can see a gravity simulation in this playground - http://playground.babylonjs.com/#NVWUF . What I am doing is simply applying the scene'S gravity constantly to the box on each frame. But this is not the way the collision detection system was meant to be used. It is actually more for the camera and less for meshes. To prevent from going through walls and such.
    To allow meshes physically colliding with one another using mass and friction and other fun things, you will need one of the two physics engines Babylon supports. Here is almost the same playground with Oimo physics turned on - http://playground.babylonjs.com/#NVWUF#1
    Try understanding what'S happening here. I think I will soon write an updated tutorial about the collisions system and physics
    On a side note - I am not sure why we can't add the gravity support to the meshes, let me have a look :-). Maybe 2.2 will include moving meshes with gravity as well.  
  5. Like
    RaananW got a reaction from Dieterich in Shadow of invisible mesh   
    shadowGenerator.setTransparencyShadow(true);  seems to solve the problem.
    http://playground.babylonjs.com/#I2H3M#2
  6. Like
    RaananW reacted to Anemol in [SOLVED]Physics and character animation   
    @RaananW :   Thanks!    Works fine.
     
  7. Like
    RaananW reacted to Sebavan in Ignore Gravity and Use Collisions only   
    @RaananW in case it would make a feature request ?
  8. Sad
    RaananW reacted to Deltakosh in [SOLVED]Physics and character animation   
    Trying to ping @RaananW again but I think he does not love us anymore
  9. Like
    RaananW got a reaction from DylanD in Html menu inside babylon.js   
    I think you are the best resource for playgrounds-that-should-be-listed-somewhere-but-aren't
  10. Like
    RaananW got a reaction from Deltakosh in How to properly remove physics joint   
    hi @blondegeek,
    A quick follow up - https://github.com/BabylonJS/Babylon.js/pull/5028
     
  11. Like
    RaananW got a reaction from Christopher Stock in [Fixe] Clone and Instance for mesh with physics   
    Right, physics is not being cloned. Haven't thought about it. Should be possible, I'll work on that.
  12. Like
    RaananW got a reaction from Sebavan in object.translate done in PhysicsImpostor.beforeStep and afterStep can't be skip even if there is no translate   
    Hi!
    If you are asking why it is needed - some objects are not centered, but physics engines don't support it. so, before sttep "centers them" for the physics engine to have the right data, and after step is putting back in place.
    To your question (if I understood correctly) - why is it still executed when the delta is 0,0,0? no reason, not needed, you can submit a PR and add me to review and skip this step if it's 0,0,0
     
  13. Like
    RaananW got a reaction from Wingnut in Rotation physicsImpostor physicsBody bug   
    it is integrated already, the demo you provided had the physics plugin redefined. see here - https://playground.babylonjs.com/#MARWS6#10
    about the debug mode - a fix will be merged soon.
  14. Like
    RaananW got a reaction from Wingnut in Rotation physicsImpostor physicsBody bug   
    Oimo is not that quick in accepting fixes (see - https://github.com/lo-th/Oimo.js/pull/70 from March). So, this is the best way to do it
    updatePosition with 0 delta means 0 ms passed, but - please update the body's position and rotation. It is not needed if the body has a mass, but a mass - 0 means the body is technically sleeping and doesn't have its position updated.
    What drinks do I get?
  15. Like
    RaananW got a reaction from Wingnut in Rotation physicsImpostor physicsBody bug   
    PR submitted - https://github.com/BabylonJS/Babylon.js/pull/4722
  16. Like
    RaananW got a reaction from Wingnut in Rotation physicsImpostor physicsBody bug   
    As wingnut said, it is an oimo issue. Since we moved to a build earlier than the one we used before, I had to change the way rotation is calculated, which seems to be wrong.
    I will work on that tomorrow and submit a PR.
  17. Like
    RaananW got a reaction from Wingnut in Rotation physicsImpostor physicsBody bug   
    As wingnut said, it is an oimo issue. Since we moved to a build earlier than the one we used before, I had to change the way rotation is calculated, which seems to be wrong.
    I will work on that tomorrow and submit a PR.
  18. Like
    RaananW reacted to Dong in waterMaterial   
    @aWeirdo @max123 @RaananW Thank you for your help , I eventually expanded the volume of the outer skybox, add the ground to the renderList,and increased the diffuseTexture's level of ground'material, while the black edges still look a bit serious , but I tactfully set alpha to water, which made him look not so bad.

  19. Like
    RaananW reacted to dbawel in Loaded OBJ file is dark   
    @abhivaidya
    As @RaananW advises, I almost always edit my .mtl files when importing textures with my .obj; as material attributes don't necessarily represent your exported mesh attributes in your 3D application. I often simply remove the .mtl file (also must edit and remove the .mtl reference in the .obj file) and let the importer set default materials on the mesh. Then assign what you like within the babylon.js framework.
    DB
  20. Like
    RaananW got a reaction from max123 in Uncaught ReferenceError: BABYLON is not defined   
    Babylon doesnt need the shim anymore, it has a proper amd definition. it will automatically populate the global namespace as a fallback, but requiring babylonjs (using this package name) will load it properly using requirejs
  21. Like
    RaananW reacted to max123 in waterMaterial   
    Had this problem. The solution is to play with scene.clearColor and/or scene.ambientColor. I think it's the former.
  22. Like
    RaananW got a reaction from NasimiAsl in Using typescript in playground   
    interesting discussion, a much simpler answer - 
    typescript requires compilation (or transpilation , if that word even exists). This will require further components or even server-side compiling. We think keeping things simpler would be great for everyone, hence - no typescript.
    Microsoft has nothing to do with that. Why would that even come up?...
  23. Like
    RaananW got a reaction from Raggar in [SOLVED] MeshImpostor not working with imported .gltf file   
    hi @vtange,
    seems like I found the problem and fixed it. I am still in the process of running tests, and your mesh really helped a lot in understanding what's going on. Your mesh has all of the "problems" I needed in order to find a working solution:
    1. parent with awesomely weird transformation (negative z scaling, Math.PI on y)
    2. Your mesh is not centered. At all  Wonderful!
    3. Your mesh is downscaled. 0.025 times to be exact.
    4. It is relatively complex! Which is good for testing.
    Here is the current working state :

    You will notice the collisions are working correctly. There are walls that are not seen due to back face culling, but you know the model better than me
    I will PR "soonish". I want to make sure everything is working, as this is a rather big change in the way I am calculating the initial physics bodies.
  24. Like
    RaananW got a reaction from Wingnut in Parametric PhysicsJoint? How to change length of SpringJoint with Slider.   
    @Wingnut provided a wonderful example, and a good explanation regarding the object that needs to be altered.
    The physics joint are synchronized with their corresponding physics objects from the physics engine, but such data as the axis, length, stiffness etc', are not synced. So, in this case, the best would be to do exactly what the playground does.
    It is of course possible to implement a getter and a setter for the legth value. you can create an issue for me if you want that.
  25. Like
    RaananW reacted to dbawel in Cannot call Dom object   
    @RaananW
    Thanks for being there when I needed help. This is why I love this forum and everyone on it.
    DB