brianzinn

Members
  • Content count

    445
  • Joined

  • Last visited

  • Days Won

    2

brianzinn last won the day on October 12 2017

brianzinn had the most liked content!

3 Followers

About brianzinn

  • Rank
    Advanced Member

Profile Information

  • Location
    Vancouver, BC

Recent Profile Visitors

1,175 profile views
  1. VR offline

    The experience when controller 3d model is not available (ie: offline or slow to load) does not seem to degrade gracefully and offer a workable controller (ie: forward ray with no model and working buttons). Maybe an option like "allowControllerInteractionWithoutModel" would be better, but it feels like this: https://github.com/BabylonJS/Babylon.js/blob/master/src/Gamepad/Controllers/babylon.windowsMotionController.ts#L109 should be: if (this.browserGamepad.axes) { if (this.browserGamepad.axes[2] != this.trackpad.x || this.browserGamepad.axes[3] != this.trackpad.y) { this.trackpad.x = this.browserGamepad["axes"][2]; this.trackpad.y = this.browserGamepad["axes"][3]; this.onTrackpadValuesChangedObservable.notifyObservers(this.trackpad); } // Only need to animate axes if there is a loaded mesh if (this._loadedMeshInfo) { for (let axis = 0; axis < this._mapping.axisMeshNames.length; axis++) { this.lerpAxisTransform(axis, this.browserGamepad.axes[axis]); } } } Likely something else is involved here, so need to investigate more to find the underlying cause for sure, but I was unable to demo my project offline! In the future I will set the MODEL_BASE_URL for all models and store locally. Has anybody else had trouble with VR controllers offline? A cursory look at the code seems to have fallbacks on everything...
  2. Lazy question about a lost PG

    i've tagged some of my PGs to make them easier to find... then fast to find in PG search. you have no metadata - searching by code takes me too long! https://doc.babylonjs.com/playground
  3. importScene of undefined from undefined version

    Did you check network tab in dev tools (ie: press F12 in chrome) for a 404? My guess is that it should be: BABYLON.SceneLoader.Load('', '/folder/design1.babylon', ....) or BABYLON.SceneLoader.Load('/folder/', 'design1.babylon', ....) JSON parse is a good sign you didn't get your model file, but instead perhaps a default/404 HTML page from your webserver. The other thing to take note of is that SceneLoader.Load(...) will create a new Scene object. https://github.com/BabylonJS/Babylon.js/blob/a86a04b640f8f25bb4a1ed86067ce735a404979b/src/Loading/babylon.sceneLoader.ts#L497 That scene object is different than the one passed into your method, so once you get the 404 fixed, you could update that if you wanted as your React component is probably creating unnecessarily a Scene object. Not sure if you got the code from here: https://github.com/brianzinn/react-babylonJS/blob/master/src/Scene.tsx#L60 If you did then you don't need to create that scene. I hadn't thought of this scenario, but would be a good parameter to add { createScene': boolean } to React component. Cheers. edit: oh, I see you got the code straight from the docs page (https://doc.babylonjs.com/resources/babylonjs_and_reactjs) anyway, that link points to the same line you could remove!
  4. Disposing a mesh

    It's not BJS specific, but JavaScript and is needed. As long as there is something in memory pointing at your object then it cannot be released from memory. If you are creating a lot of objects and not cleaning up then you will get a large memory footprint or memory leak. The Garbage Collector can't collect objects that have references - it can only collect "garbage" or unreachable objects. So, if your ball variable is a reference that leaves scope then it is also cleaned up, so you don't need to set to null. Good practice to set variables to null and avoid global references. edit: A disposed mesh it is removed from the scene, so I think you just need to make sure you don't have any references in your own code. BabylonJS takes care of references in framework for you: https://github.com/BabylonJS/Babylon.js/blob/7112a6542efc8aeb26c8b7b6568c61535716c01a/src/Mesh/babylon.abstractMesh.ts#L1424 NOTE: dispose() has two (for AbstractMesh) optional parameters: doNotRecurse?: boolean, disposeMaterialAndTextures: boolean = false So, you can be more specific when disposing with your intentions.
  5. Great! There is a sticky thread for marking solved. Cheers.
  6. well, it is alpha! it's just the typings file, so should only affect TypeScript people who need something in latest.
  7. I don't think there is a gear vr controller model, possible the generic one. I'm getting all the same errors as well. Can't put loaders back to alpha7, since STLFileLoader incorrectly implements ISceneLoaderPlugin. I'm trying to add support for daydream controller... not getting far! edit: if you copy these declarations into your typings it should build: https://github.com/BabylonJS/Babylon.js/blob/master/dist/babylon.glTF2Interface.d.ts Cheers. Think they are just not building the typings correctly in alpha8.
  8. Absolute positioning

    alright - glad you got it!! it's an optimization to evaluate world matrix once per frame. You can read more about it here on freezing your matrices: https://doc.babylonjs.com/how_to/optimizing_your_scene -> Reducing World Matrices Computation absolute position is always in relation to world co-ordinates, yes. If a mesh is not parented then it's position is already in world co-ordinates, otherwise in relation to parent mesh. It's a bit of a learning process, so glad you got that one also, there's a sticky thread for marking solved. cheers.
  9. Absolute positioning

    That's because the world matrix isn't updated, you can force by calling mesh.computeWorldMatrix(true); Your meshes position is not centered. I've set the circle to be the position and added mesh.showBoundingBox = true, so you can see: https://www.babylonjs-playground.com/#FY8S2X#3 I think you just need to adjust the positions accordingly.
  10. Absolute positioning

    I think you are calculating diagonals wrong, as your beams are not long enough for the angle you have. not to send you in the wrong direction, but here I calculated diagonals with purely Pythagorean (a^2 + b^2 = c^2). I don't want to throw you off target and hope this is not too unrelated, but it's just moving and rotating like you have done already. https://www.babylonjs-playground.com/#R555G1#0
  11. Absolute positioning

    Order matters with rotations/translations. You may be able to accomplish what you're after by moving and then rotating, because then the position will be in world space.
  12. I attached the material (line 42) and commented out the line where you disabled lighting: http://www.babylonjs-playground.com/#VKBJN#161 Seems to work... why do you want the lighting disabled? edit: Welcome to the forum!! good that you made a PG, it's really helpful for questions
  13. How to toggle scene?

    There's new examples using Asset Containers for scene assets. It was needed for ie: switching scenes in VR. Is that worth a look? https://github.com/BabylonJS/Babylon.js/pull/3494 and press "z" to cycle the scenes in this PG (from TrevorDev, I think): http://playground.babylonjs.com/#JA1ND3#48
  14. Speed zero

    Both methods take the same parameters. You can always verify by looking at the class documentation: https://doc.babylonjs.com/classes/3.1/physicsimpostor#setangularvelocity-velocity-rarr-void mesh.physicsImpostor.setLinearVelocity(BABYLON.Vector3.Zero()); mesh.physicsImpostor.setAngularVelocity(BABYLON.Vector3.Zero()); That should remove linear and rotational movement. If you don't have any joints you could try a forceUpdate(), but I have not found that necessary myself. Otherwise you can sleep() and wakeUp() the physics impostor, but then it loses physics properties. If that code doesn't work then can you reproduce in a PG?
  15. Tile Offset

    I don't think so with procedural texture as they are generated, although a texture is just a color map. NasimiAsl is the resident shader guru, if you really want to go the shader route check out this thread. With standard material and getting creative with UV mapping, perhaps you can get a good solution, too: https://doc.babylonjs.com/how_to/more_materials http://www.babylonjs-playground.com/#20OAV9#25