• 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()
  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)
  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 Oh by the way i have noticed an error in the SPS documentation, in the example code for picking a particle the variable is "meshFaceId" on a line and "faceId" on the line after So the question now is....What's the easiest way to prevent picking meshes behind a mesh (for example if there's an object behind a door)?
  4. As you can see in this playground 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. Oh it was that simple....thanks!
  6. Thanks, i guess that's the closest one can get to a "native" function
  7. Nothing, i'd just like to know if there's (or if it can be implemented) a "native" method to do that
  8. 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
  9. the playground you linked brings me to an example that i think has nothing to do with my issue: I think you meant to link this: 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: Even without using dispose at all i still have the same issue: Anyways i am not using jQuery, the $ in $dispose is just a variable name that starts with $
  10. 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)
  11. 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
  12. 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) 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. Is there something that can be done (other than using scene.pick, which seems to not be affected by this problem: )?
  13. 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 I would like the sphere to go "up" rather than towards the camera.
  14. 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
  15. 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 (this is an early alpha done while experimenting with babylon, i am heavily rewriting the code now) It uses So, while i was using an ArcRotateCamera that had the character as target everything went fine because the vector between the mesh and the camera is the same that defines the camera facing, so comparing the alpha value and the mesh rotation did the job . When i tested with a FreeCamera (comparing camera rotation and mesh rotation) i realized that it wouldn't work because i need to get the angle between the mesh facing vector and the camera-mesh vector since a FreeCamera, like the name suggests, is free and can go whenever it wants to go Checking this angle should be camera independant as long as i can get the vector between the camera and the mesh, isn't it? The attached image should clarify what i mean So, truth be told, i suck at vectorial math and i am kinda clueless on what i have to do for this to work and i will really appreciate your help