Jump to content


  • Content Count

  • Joined

  • Last visited

  1. Thanks, I solved by doing this: 1. add scene.constantlyUpdateMeshUnderPointer = true; 2. set the SPS as pickable (even without any action) 3. remove setParticles() from the render loop 4. Call refreshVisibleSize() after setParticles() http://www.babylonjs-playground.com/#HKEPK#5
  2. Wouldn't this affect performance even though they are not rendered? If i set an SPS as Pickable (without actions) and use scene.constantlyUpdateMeshUnderPointer = true; something weird happens: the mesh behind is picked only on certain points (like just slightly below the top edge of the square) http://www.babylonjs-playground.com/#HKEPK#4
  3. This is embarassing but... For performance reasons i have turned my scene into an SPS (which was composed of 900 cubes, now it runs smoothly!) , each with a pickable panel on top so that they use the same actionManager as the cubes used to have. I didn't realize it was possible to pick meshes behind unpickable meshes because in my previous scene the whole cube was pickable so i couldn't pick cubes behind it. Anyways, i see i don't just have to set the SPS as pickable but i have to set an action through scene.onPointerDown to prevent picking meshes behind http://www.babylonjs-playgrou
  4. As you can see in this playground http://www.babylonjs-playground.com/#HKEPK#1 If i put a mesh with an actionManager behind a particle generated using a Solid Particle System i can click on the meshes behind. (There's a sphere behind the panel and it's pickable, if you move the mouse on the panel you will trigger the spere's actions) Is this intended? Is there some way to prevent it? EDIT: I have realized it's not just SPS but any mesh will let you pick meshes behind, how do you prevent this?
  5. Thanks, i guess that's the closest one can get to a "native" function
  6. Nothing, i'd just like to know if there's (or if it can be implemented) a "native" method to do that
  7. I know the theory behind and i know i could just translate it over the right axis. My problem lies on the fact that i might have a function that should be "mesh agnostic" and does a translation over an axis. Say: function goUp(mesh) { mesh.position.y += 1; } if i pass to this function a mesh with a rotated parent (any kind of rotation) it won't move the mesh "up" Mind that this is just an example (and i don't have a more concrete one) so using another approach is not the solution here
  8. the playground you linked brings me to an example that i think has nothing to do with my issue: http://www.babylonjs-playground.com/#VNVOU#6 I think you meant to link this: http://www.babylonjs-playground.com/#26DEBS#5 But even in that playground it doesn't work (you forgot to add clickAction) Mouseover and Mouseout work fine, is the click that doesn't work: http://www.babylonjs-playground.com/#26DEBS#7 Even without using dispose at all i still have the same issue: http://www.babylonjs-playground.com/#26DEBS#6 Anyways i am not using jQuery, the $ in $dispose is just a
  9. I create a mesh A, rotate it by 90° on the X axis I create a mesh B and set A.parent = B i translate B on the y axis, but it doesn't move on the global y axis ("up"), it moves on the parent's rotated axis The additional mesh could work but i was wondering if there's a more "conventional" solution (like a special rotation function that uses world axis)
  10. Sadly, is not just that. I used it on 2 different browsers (chrome and mozilla) before writing this post, and even the babylon console window gives me the same problem. If it works try clicking on a different point of the ground in my example
  11. Hello I'm having an issue where i'm using an ActionManager with these actions: - On mouseover adds a decal - On mouseout removes a decal - On click does something else (console.log in the playground i linked below) http://www.babylonjs-playground.com/#26DEBS#3 While the decal is active it won't let me click on the mesh all the time. On the playground if you click on the mesh sometimes it works, sometimes it doesn't (if it works try to move to another point). I suppose that's because the Decal is a mesh itself so it won't let me click on the original mesh below.
  12. I've tried searching google on this but i can't seem to find a solution. What i want to achieve is that if i set a rotated mesh as parent then translating it through an axis would move it in the same direction as if it didn't have a rotated parent. For example in this playground http://www.babylonjs-playground.com/#26DEBS#0 I would like the sphere to go "up" rather than towards the camera.
  13. Hi again I finally managed to work on this and your answer was very enlightening. I didn't really need the green vector, that was just for visual. What i needed was the angle of the red vector on the X axis (i said Y earlier but i got it wrong) so what i did was cameraPos = camera.position.clone() cameraPos.y = mesh.position.y (as if they were at the same height) meshDirection = (cameraPos - mesh.position).normalize() angle = acos(dot(meshDirection, Vector3(1, 0, 0)) this (with some adjustments) gives you the same values of the ArcRotate's alpha but for any camera
  14. Hello again Let me say sorry in advance for my noobishness, my english and because i'm probably going to use the wrong terms to describe things... I finally got time to explain my situation. I am making a library that changes a plane's texture based on the difference between the camera rotation (alpha for ArcRotateCamera) and a mesh facing to make it look like it's a 3d-ish image even though it's a set of 2d sprites that "rotates" together with the camera http://mjzone.net/game/game.html (this is an early alpha done while experimenting with babylon, i am heavily rewriting the co
  • Create New...