Jump to content

fateriddle

Members
  • Content Count

    63
  • Joined

  • Last visited

Everything posted by fateriddle

  1. I tried @babylonjs/core 4.0.0 import { Scene, Engine, FreeCamera, Vector3, HemisphericLight, Mesh, } from '@babylonjs/core' ... It doesn't seem to do proper tree shaking as the build bundle still includes everything(tried webpack-bundle-analyzer), and the size is still 2.11m.
  2. Thank you, that's fantastic! Unfortunately I kinda need to reduce bundle size right now for a game to display in a week. Could you help with the question?
  3. So I followed https://doc.babylonjs.com/how_to/how_to_start and https://doc.babylonjs.com/how_to/workloads question 1. Basically I clone the project, cd into Gulp folder, then run 'npm install' & 'gulp --max-old-space-size=8192' I don't understand why because I haven't even try to customize yet. question2: Then I figured may be the file is built, just tests failed. So I changed currentConfig from "all" to "minimal", and run 'gulp --max-old-space-size=8192' again to build the supposedly minimal bundle similar error pops: ➜ Gulp git:(master) ✗ gulp --max-ol
  4. I got this error (see attach). Basically I clone the project, cd into Gulp folder, then run 'npm install' & 'gulp --max-old-space-size=8192' Everything seems fine, till the very end, I got this error. Haven't change anything, not trying to customize yet.
  5. 1. Since you can load meshes using ImportMeshAsync to return a promise, I wonder if it is possible to do the same for sound? I'm trying to do Promise.all([ loadAsset1, loadAsset2, loadSound, loadMusic ]).then( ... ) 2. Also It seems 360 photo dome and video also needs loading time, can you turn them into promise too?
  6. Is there any plan to extract a light weight core of babylon.js for mobile? Currently, I downloaded the babylon.js file from mdn and size is around 2.1 M. That's way too big for me to run some simple game on smart phone. Can we extract a lighter version that only contains the core functionalities? And maybe then add everything else back onto the core using plugins / npm packages? I build a game to play on phone, and share it (qr code) internally in our company, the performance is not impressive to say the least, and we are considering switching to something lighter right now.
  7. I didn't read the source, but the api documentation doesn't mention hasObserver at all, so I assumed it was a typo and reported it.
  8. https://doc.babylonjs.com/how_to/observables "hasObserver" should be "hasObservers"
  9. Using on phone, if need to leave chrome app then go back, what should I do to keep memory low? Like I don't think I can dispose everything one second, then when user comes back to web browser app, then I immediately create and import everything on the fly. What should I normally do?
  10. I have an idea of creating a transparent outside / hidden inside box on the right side of the wall, but is it possible?
  11. This is the PG, ball moving through a wall, I want to hide whatever part of the ball that's on the right side of the wall, so it feels like the ball is absorbed into the wall. Is this possible? https://www.babylonjs-playground.com/ts.html#JP05DS#1
  12. Wanna trigger animation when camera move to a certain spot, how? I wanna watch the position of camera every frame, once it gets to a certain point, an animation will trigger.
  13. This is a straight forward question, how do I get the transformNode under root mesh? The asset has a root mesh with id '__root__', putting it in sandbox, I see a transformNode 'node-0' under it, with 3 subMeshes under that transformNode 'node-0'. So I want to get that transformNode, how? ImportMesh will return all meshes, and I can get access to the root with const obj = newMeshes[0] How do I find that transformNode then?
  14. Thanks, I didn't notice the difference. Btw, the assets are all using a transformNode as the parent of all meshes (and it makes sense), if I createIntance of that node, it seems nothing will be copied. If I use .clone that node, things will be fine. But I have performance concern using clone instead of createInstance, should I be worried?
  15. I'm coding using babylonjs + reactjs. And I suspect there's memory leak somewhere in the code as stuff gets laggy over time. So what's the 101 list that I should check? I've imported a few assets, then created instance of them, also I'm creating new mesh as bullet everytime user click shoot button. In componentWillUnmount, I dispose every asset, and that's all I did. Is there something missing?
  16. Hey, thanks, scaling seems to work, but isVisible is not working on root. I'm trying to createInstance of it and set the original one invisible. btw, is .clone() simply creating a new mesh rather than creating an instance? So for performance wise, we should use createInstance() right? But then, createInstance won't copy children as explained here So the use case of createInstance is very limited? Because for any assets that consist of more than one child, you can't use createInstance?
  17. So some assets I downloaded has a structure of __root__ ----> node-0, I can find that single child with id node-0, and perform rotation/scaling/isVisible to control the whole object. But some assets like in https://www.babylonjs-playground.com/#JUKXQD#52, has mutiple children meshes, then I don't know how to scale the whole thing, or make it invisible. Please help, many thanks!
  18. Thanks. 1. Could you explain a bit why trying to change 'rotation.y' will result in such weird manner? 2. And when do I have to use rotationQuaternion to do the job? I see use case of 'rotation.y' here in this PG, and it works fine https://www.babylonjs-playground.com/#2L26P1#8
  19. I import a mesh of animation girl, and trying to rotate her then move her in sequence. But the animation goes wild as girl rotate like 10 circles before she stays at the final key. Any reason for that and how do I fix? https://www.babylonjs-playground.com/#WGZLGJ#367 btw, I always wanna ask, how do you animate a mesh's scaling? Do you have to make 3 animations for scaling.x, scaling.y, scaling.z?
  20. https://www.babylonjs-playground.com/#14KRGG#23 It is the waterSphpere example, except I comment out line 23: // var helper = scene.createDefaultEnvironment(); Then the outer sphere become transparent... I don't want to use createDefaultEnvironment in a real project, but how do I mimic what it provides to make this example works as intended?
  21. How do I convert float32Array data into Babylon.js Matrix? I read real device camera data in float32Array format, how do I convert it into babylonjs Matrix?
  22. I'm pretty confused right now. 1. Is camera.cameraDirection a vector of where camera is pointing? 2. Then setTarget/getTarget is doing the same thing? to point the camera to the direction of the target? 3. And to rotate a camera is also trying to point a camera to some direction, no? So what is the difference? btw, I'm trying to add customized input to camera.inputs to control which direction it is pointing for a shooter game.
×
×
  • Create New...