Zephos

Members
  • Content Count

    33
  • Joined

  • Last visited

About Zephos

  • Rank
    Advanced Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi all, So I am currently using an observer to detect the user picking a mesh and I use that to make the camera look at the mesh. Now, I also want to highlight the mesh when the user hovers over it, but it looks like the only way that is supported to do that is with actions. That lead me to wondering why there are two seemingly separate paradigms for this kind of thing. I found the explanation given here a bit vague: https://doc.babylonjs.com/features/events Mainly I just want to know how to compartmentalize the two systems so I can easily choose between them based on the circumstances. If possible, I would like to stick to just one paradigm to not muddle my code with various ways of doing the same thing. I think I should be able to implement the highlighting behavior with either one, as long as the POINTERMOVE event type has a pickResult (not sure if it does). Are there any obvious reasons to chose one method over the other? How should I be thinking about these features in relation to each other? Thanks
  2. I actually managed to repro it pretty quickly while at work. So here is the new PG: https://www.babylonjs-playground.com/#31M2AP#39 The issue seems to only happen with the layer masks in this format: 0x20000000, which according to this should be okay: https://doc.babylonjs.com/how_to/layermasks_and_multi-cam_textures Maybe I am not understanding something, or maybe something is broken. I have no clue.
  3. I will try to repro the issue tonight. But I don't think you want the gizmos to show for any layer mask if you have multiple cameras, because that would lead to multiple angles of view an some weird rendering. At the very least we need to be able to set the layer mask on the gizmo meshes I think, so adding that would still be good probably.
  4. So how do I get the fix? I installed babylon using npm. Do I just need to wait for the next release?
  5. Awesome. Are you the original creator of the gizmos? They are pretty cool so thanks! I am using them for a major part of my game's interaction.
  6. I guess the question now is whether this is the desired behavior or not. I bet it's an easy fix if not, as you can just use the global position of the camera in place of the values its using. Hopefully we can get Deltakosh or someone else who can change the source code to see this and take a look.
  7. Hmm... I don't notice any difference when I do jerk movements. As you move the camera back, the gizmo axis should stay the same size in the view though, but they are not. That is the issue I was talking about.
  8. Hi all, I have been having loads of fun with the new gizmos, but I discovered something very interesting. The position gizmo scales with distance from the camera, but that mechanism breaks when the camera has a parent it seems. I think it must be using the local position instead of the global position. Here is the PG: https://www.babylonjs-playground.com/#31M2AP#35 Just press any key to move the camera's parent and see how the gizmo fails to scale properly, and if you move it around it scale erratically. Also, if you start the camera with a different position vector it effects the scale too, to the point where a vector of 0,0,0 makes it disappear. Anyway, please let me know if this isn't a bug or if there is a work around. Thanks!
  9. I figured out the issue. Apparently the gizmo meshes have a layerMask = 1. Is there a way to set that to a different value?
  10. Hi all, I am having an issue where the axis are not showing up for a PositionGizmo when using a GizmoManager. Strangely, I can't reproduce the problem in a PG. I literally put the exact same code into my app and it stops working. Here is a PG of a simple gizmo setup that I want to do. I have added comments to mark the code I put in my app. https://www.babylonjs-playground.com/#31M2AP#34 The differences that I do have in my code is that I am using a skybox and two cameras with layer masks, so I have to add a layer mask to the sphere. The best results I have been able to achieve in my app (with other code, not what's in the pg) is to get the gizmo attached and be able to move them but the axis still never showed up. I have tried removing the layer mask to no effect. The next thing I will try is making the axis gizmos manually, and I will edit this when I have done that, but I wanted to get this up in case someone knows something that I don't. I have a suspicion the axis meshes are not playing nice for some reason with my scene. Any help is appreciated. Thanks.
  11. I would like to know the answers too! Posting so I can find out.
  12. Hi all, I am looking for away to optimize this scene: https://playground.babylonjs.com/#9G5I9U The playground is very similar to the project I am currently working except for the fact that I implemented my own controls for the camera by ICameraInput interface which would be difficult to replicate in a PG. I use two cameras so I can use a different fov based on the users choice without it distorting the skybox. The main problem I am observing is that when flying around, their can be a slight jitter or choppiness. It is worse in my local version but only slightly. All the cubes are clones of the same mesh as I need to be able to move them independently, etc. I am wondering if the skybox is too high res or something like that, but each side is 2048px. If there are any good ways to optimize this, I would sure appreciate some advice. Nothing I found in the docs seemed to help. Thanks.
  13. Hi all, EDIT: Issue solved. See bottom of post. I am trying to use assetManager and everything seems to be fine but the onSuccess callback is called and passed a task object that has no meshes in loadedMeshes. Here is the relevant code: export default class GameAssetManager{ constructor(gameManager, gamePackage){ this.initialized = false; this.gameManager = gameManager; this.assetScene = gameManager.gameDisplay.scene;//new BABYLON.Scene(gameManager.gameDisplay.engine); this.assetsManager = new BABYLON.AssetsManager(this.assetScene); this.gamePackage = gamePackage; this.baseMeshesForCloning = {}; this.gamePackage.fleets.forEach((fleet)=> {fleet.forEach((ship)=>{this.baseMeshesForCloning[ship.shipSpec.mesh.meshID] = ship.shipSpec.mesh; })}); } initialize(){ this.GetAllMeshesForCloning(); this.assetsManager.load(); } GetAllMeshesForCloning(){ for (const key of Object.keys(this.baseMeshesForCloning)) { let mesh = this.baseMeshesForCloning[key]; //load in mesh from specified root and filename. let task = this.assetsManager.addMeshTask("mesh_" + mesh.meshID, mesh.meshID, mesh.directory, mesh.filename ); task.onSuccess = function(task) { mesh["mesh"] = task.loadedMeshes[0]; } task.onError = function (task, message, exception) { console.log(message, exception); } var textTask = this.assetsManager.addTextFileTask("text task", "build/msg.txt"); textTask.onSuccess = function(task) { console.log(task.text); } } } ) The odd part is that in my network tab in dev tools the obj files are loaded successfully and the addTextFileTask works fine. The loadedMeshes array is just empty for some odd reason. The files I am loading are here: https://raw.githubusercontent.com/WriterZephos/files/master/Fighter.obj https://raw.githubusercontent.com/WriterZephos/files/master/Fighter.mtl Any help would be greatly appreciated. EDIT: I solved the issue! I didn't realize what the meshNames argument was... though it was just giving a name to the mesh or something, but it was actually looking for a mesh by that name! Wow I am such a noob at this. Thanks.
  14. Thanks John. You make an excellent point. Regarding your proposed alternative, does setEnabled apply to all of a mesh's clones or can the 'master' mesh be disabled while all of its clones are enabled? And what is the difference between enabled and isVisible? Lastly, can you clarify what SPS means? Thank you.